This endpoint performs a full or partial refund.

Log in to see full request history

📘

Note

The refund operation is idempotent if a unique requestId and merchantReference are provided.

📘

Note

If using the Deferred Payment Flow, please be aware that only captured funds can be refunded.

Do not create refunds after 120 days from the date of purchase.

Successful Response (201)

Returns a Refund object in response. All request parameters will be echoed in the response. In addition, the response includes the following:

AttributeTypeDescription
refundIdstringThe unique, permanent, Afterpay-generated Refund ID.
refundedAtstringThe UTC timestamp of when the refund was completed, in ISO 8601 format.

Connection Timeouts

TimeoutTime (Seconds)
Open10
Read70

Errors

In addition to the PUT/POST Errors applicable to all POST endpoints, the following errors are specific to Create Refund:

HTTP Status CodeerrorCodeDescription
412
Precondition Failed
precondition_failedThe orderId is invalid, does not exist, or is not eligible for a refund. For example, the order was declined.
422
Unprocessable Entity
invalid_objectThe refundMerchantReference exceeded 128 characters.
422
Unprocessable Entity
invalid_amountThe amount requested exceeded the amount available.
422
Unprocessable Entity
invalid_objectThe currency of the refund does not match the currency of the order (and the Merchant account).
422
Unprocessable Entity
refund_timelimit_exceededThe refund exceeds the time limit of 120 days
Path Params
string
required

The unique Afterpay Order ID to apply the refund to.

Body Params
string

A unique request ID, required for safe retries. It is recommended that the merchant generate a UUID for each unique refund.

amount
object
required

The refund amount. The refund amount can not exceed the payment total.

string

The merchant’s internal refund id/reference. This must be included along with the requestId to utilise idempotency.

string

A unique reference for the individual refund event. If provided, the value will appear in the daily settlement file as "Payment Event ID". Limited to 128 characters.

Headers
string
required
Defaults to application/json
string
required
Defaults to Readme.io API Simulator
string
Defaults to application/json
Language
Credentials
:
Click Try It! to start a request and see the response here!