Record Affiliate Refund or Chargeback
growsurf_refund_transactionRecords refunds, partial refunds, and chargebacks for a prior affiliate transaction and adjusts the referrer's commission in GrowSurf without sending a refund through the payment provider.
Instructions
Record a refund, partial refund, or chargeback for a previously recorded affiliate transaction in GrowSurf and reverse or adjust the referrer's commission. This records the amendment without sending a refund through the payment provider. Requires the same transaction identifier as the original sale. Omitted amountRefunded means a full refund. Already-paid commissions are not clawed back and are recorded for tax only. Targets campaignId if supplied, 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 | Yes | Target program id for this call: the `id` returned by `growsurf_list_campaigns`, not the program name or a share URL. Defaults to GROWSURF_CAMPAIGN_ID when omitted. Program IDs also identify newly created programs 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 | Refund status. Send `canceled` with the original `refundId` to cancel that refund. | |
| amendmentType | No | Defaults to `REFUND`, which covers full refunds, partial refunds, and refund cancellations. `CHARGEBACK` is always a full reversal. | |
| participantId | No | ||
| transactionId | No | ||
| amountRefunded | No | Total refunded so far, in the currency's minor unit. Omit for a full refund. For a partial refund send the running total, not the amount of this one refund. Required when `refundStatus` is `canceled`: send the total that stays refunded after the cancellation (`0` when none remain). | |
| 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. |