growsurf_refund_transaction
Record a refund, partial refund, or chargeback to reverse or adjust an affiliate commission on a previously recorded transaction.
Instructions
Record an amendment (refund, partial refund, or chargeback) against a previously recorded affiliate transaction; reverses or adjusts the referrer's commission. The inverse of growsurf_record_sale. Identify the original transaction with the same identifier you sent when recording it (omit amountRefunded for a full refund). Already-paid commissions are not clawed back (recorded for tax only). Targets campaignId if you pass it, otherwise GROWSURF_CAMPAIGN_ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | No | ||
| orderId | No | ||
| chargeId | No | ||
| currency | No | ||
| refundId | No | Stable per-refund identifier. Required when canceling a refund or changing the refunded total after a cancellation. Reuse the original refund's identifier for its cancellation. An amendment without enough refund identity returns `409` without applying the cancellation. Newly observed higher cumulative refunds and incomplete coverage are retained for reconciliation. | |
| testMode | No | Original payment mode: `true` for test or `false` for live. Requires `paymentProvider`. | |
| invoiceId | No | ||
| paymentId | No | ||
| campaignId | No | Target program (campaign) id for this call. Defaults to GROWSURF_CAMPAIGN_ID when omitted. Pass the `id` returned by growsurf_create_campaign to configure or operate a program you just created, without restarting the server. | |
| externalId | No | ||
| description | No | ||
| refundAmount | No | Positive amount for this individual refund, no greater than the sale amount, in the sale currency's minor unit. Send it with `refundId` on each original refund to support cancellations and out-of-order amendments. The amount for a given `refundId` cannot change. A cancellation can omit it when the original amount is already recorded. Incomplete refund history returns `409` without applying the cancellation. Newly observed higher cumulative refunds and incomplete coverage are retained for reconciliation. | |
| refundStatus | No | ||
| amendmentType | No | ||
| participantId | No | ||
| transactionId | No | ||
| amountRefunded | No | ||
| paymentIntentId | No | ||
| paymentProvider | No | Connected provider for the original payment. Requires its `transactionId` and `testMode`. This amends GrowSurf records without sending a refund through the provider. | |
| participantEmail | No | ||
| refundHistoryComplete | No | Set true only after reconciling and recording every original refundId and refundAmount, including refunds later canceled. This confirmation resolves previously incomplete history. Omit during ordinary delivery. Replaying an old confirmation cannot resolve a later gap; confirm a newly reconciled refund or complete provider list. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deleted | No | Pending commissions deleted by the amendment. | |
| matched | No | Commissions found for the provided identifiers. | |
| message | No | Human-readable result message. | |
| success | No | `true` when the amendment was processed; `false` when no matching transaction was found. | |
| adjusted | No | Commissions partially adjusted. | |
| notFound | No | Present and `true` when no commission matched the provided identifiers. | |
| reversed | No | Commissions reversed (set to zero amount). | |
| amendmentType | No | Amendment type that was processed. | |
| matchingCommissionIds | No | Commission ids that matched the submitted identifiers. |