Create Refund
This endpoint performs a full or partial refund. The refund operation is idempotent if a unique requestId and merchantReference are provided. Reusing a pair returns the original refund object, including its original refundId, instead of issuing a second one — so give every refund a fresh pair, including each partial refund on the same order.
If using the Deferred Payment Flow, please be aware that only captured funds can be refunded. Don’t create refunds after 120 days from the date of purchase.
Connection Timeouts
Authentication
Basic authentication of the form Basic <base64(username:password)>.
Path parameters
Headers
Request
Object containing amount and currency.
Where a Money object is included in an API request, it will be validated according to the specification above. Invalid Money objects will trigger a 422 Unprocessable Entity response. The following is a list of common examples:
Unique ID required for safe retries. Max length 64 (varchar).
The merchant’s internal refund id/reference. This must be included along with the requestId to utilise idempotency. Max length 85 (varchar).
A unique reference for the individual refund event. Max length 128 (varchar).
Response
Returns a Refund object in response. All request parameters will be echoed in the response. In addition, the response includes the following:
Object containing amount and currency.
Where a Money object is included in an API request, it will be validated according to the specification above. Invalid Money objects will trigger a 422 Unprocessable Entity response. The following is a list of common examples:
The merchant’s internal refund id/reference. This must be included along with the requestId to utilise idempotency. Max length 85 (varchar).
The unique, permanent, Afterpay-generated Refund ID.
A unique reference for the individual refund event. Max length 128 (varchar).
Unique ID required for safe retries. Max length 64 (varchar).