Cancel an affiliate sale
Cancels a website, iOS or Android sale you reported to Growi, the same way a Shopify refund cancels a Shopify sale: the sale is cancelled, its full amount and commission count as refunded, and it stops counting toward creator payouts. Full cancel only. Safe to retry.
POST
Cancel an affiliate sale
Cancels a sale you reported to Growi from your website or your iOS or Android app. Call it from your backend when an order is refunded: a website order you refunded, an App Store refund or a Google Play voided purchase.
It works the same way a Shopify refund cancels a Shopify sale: the sale is marked cancelled, its full amount and commission count as refunded, and it stops counting toward the brand’s revenue, the creator’s commission and creator payouts. The creator sees it as cancelled.
Request body
Behavior
- Call it from your server. The API key must never reach a browser or an app.
- Website, iOS and Android only. Shopify sales are cancelled automatically when the order is refunded in Shopify, so
shopifyis rejected here. - Full cancel only. The whole sale is cancelled and the creator’s full commission on it is removed. Partial refunds are not supported: if only part of an order is refunded, decide whether to cancel the sale or leave it.
- Safe to retry. Cancelling a sale that is already cancelled changes nothing and returns
200withresult: "already_cancelled". - Already paid sales. A sale whose commission was already paid is cancelled the same way, as with a Shopify refund. Growi does not take money back from creators. To protect yourself, ask Growi to set a payout delay on the campaign that covers most of your refund window.
- Only your own sales. Orders are matched to your organization and to the platform you send. An order id from another organization, from another platform or from your Shopify store returns
404. - Rate limits. Counts toward your normal API budget, including the 2-second spacing. On
429, waitRetry-Afterseconds and send again.
When to call it
Website orders
When you refund an order on your website, send the sameorder_id you used for that sale with conversion_platform: "website".
Apple: App Store Server Notifications
- In App Store Connect, set your App Store Server Notifications URL (version 2) to an endpoint on your server.
- When a notification arrives with
notificationType=REFUND, verify and decodesignedPayload, then decodedata.signedTransactionInfo. - Send the same id you sent as
order_idinpayment_completedfor that purchase. If you senttransactionId, send the refunded transaction’stransactionId. If you sentoriginalTransactionId, send that. Growi keeps one sale perorder_id, so if you used one id for a whole subscription, any refund on it cancels that one sale.
REFUND_REVERSED (Apple undid a refund) is not handled by this endpoint. Contact Growi support if it happens.
Google Play: voided purchases
Poll the Voided Purchases API (purchases.voidedpurchases.list) from your server, for example once a day. It lists refunded, charged back and revoked purchases. For each one, send its orderId (the same GPA. order id you sent as order_id in payment_completed).
Response
Response example
commission is the original commission on the sale. The creator is no longer owed it once the sale is cancelled.
Errors
Authorizations
Body
application/json
Response
The sale is cancelled (by this request, or already before it)