Refunds a successful checkout transaction, in full or in part, to the instrument the buyer paid with.
Use it for one-time checkouts and for subscription billing cycles. Get the transaction ID from succeededTransactionId on
the checkout. For a billing cycle, read the cycle's checkoutId from List Subscription Payments, then read that checkout
with Get Checkout, or use Refund Subscription Payment, which finds the transaction for you.
Permission: Merchant Approver.
Rules
- The transaction must be
SUCCEEDEDand belong to the checkout in the path. - Only one refund can be in progress per checkout. Wait until the previous refund is
COMPLETEDorFAILEDbefore you send another. - The total refunded can never exceed the original charge.
- Some checkouts accept only a refund of the full charge, and some cannot be refunded through the API.
- Send
idempotencyKeyso you can retry safely: a repeat returns the refund the first request created. Without a key, if the request timed out, call List Checkout Refunds before you retry.
What happens: the refund is created in PENDING and processed asynchronously. It moves to PROCESSING,
then COMPLETED or FAILED (see errorReason). Each change sends the refund-status-changed webhook event
(/reference/refund-status-changed). The checkout gets hasRefunds: true. A refund of a checkout created for a
subscription is typed SUBSCRIPTION, carries the subscriptionId and, for a billing cycle, the subscriptionPaymentId,
and the cycle gets hasRefunds: true. Refunding a cycle does not cancel the subscription.
Errors
400 VALIDATION_ERROR:details.amountcarries one ofINVALID_TRANSACTION_STATUS(the transaction did not succeed),
CANNOT_REFUND_MORE_THAN_ORIGINAL_AMOUNT(constraints.remainingAmountis what is left, in minor units),
CANNOT_PARTIALLY_REFUND(send the full amount) orREFUND_NOT_SUPPORTED(this checkout cannot be refunded through the API).404 NOT_FOUND: the checkout or the transaction does not exist, or the transaction belongs to another checkout.409 VALIDATION_ERROR: a refund is already in progress for this checkout; the amount rounds to zero in the currency;
the total would exceed the charge; this checkout cannot be refunded with this operation; or theidempotencyKey
was already used with a different amount or transaction.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
