Refund
Refund a settled transaction in full or in part. Supports multiple partial refunds up to the settled total.
Refunds return money to the cardholder (or accountholder, for ACH) from a previously settled transaction. If the transaction has not yet settled, use Void instead — voids are cheaper and leave no entry on the customer's statement.
Path parameters
| Parameter | Description |
|---|---|
transactionId | ID of the original settled transaction. |
Body
| Field | Type | Description |
|---|---|---|
amount | integer | Refund amount in cents. Omit for a full refund. Required for partial refunds. |
surcharge | integer | Amount of any surcharge to refund, in cents. Defaults to the proportional share. |
Example
fetch("https://sandbox.fluidpay.com/api/transaction/txn_abc123/refund", {
method: "POST",
headers: {
"Authorization": "YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
amount: 500
})
})
Full refund
{}
Omit the body (or send an empty object) to refund the entire settled amount, including any surcharge that was collected.
Partial refunds
You can issue multiple partial refunds against the same transaction. The sum of all partial refunds cannot exceed the settled total. Once the total has been refunded in full, further refund attempts return an error.
Refunding surcharges
When a transaction included a surcharge (collected under your fee program), refunds default to a proportional share of the surcharge. If you're refunding $50 of a $100 transaction that had a $4 surcharge, the default refund returns $52 (the $50 base plus $2 of surcharge).
You can override this by passing an explicit surcharge value. This is useful when the dispute was specifically about the product (refund the base only) or specifically about the fee (refund only the surcharge).
Refund responses use the same response_code ranges as sales. A refund can come back with a 300-series gateway error — retry in that case. True refund declines from the issuer are rare but possible; check response_code and msg.
ACH refunds
ACH refunds follow the same rules as card refunds, with one caveat: because ACH settlement itself can take a day or two and returns can arrive up to 60 days later, you may refund an ACH transaction that later gets returned by the originating bank. When that happens, the refund stands but the original transaction is reversed — you've paid the customer twice. Use webhooks to watch for ACH returns and reconcile.