This endpoint performs a full or partial refund.

📘

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:

Attribute

Type

Description

refundId

string

The unique, permanent, Afterpay-generated Refund ID.

refundedAt

string

The UTC timestamp of when the refund was completed, in ISO 8601 format.

Connection Timeouts

Timeout

Time (Seconds)

Open

10

Read

70

Errors

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

HTTP Status Code

errorCode

Description

412
Precondition Failed

precondition_failed

The orderId is invalid, does not exist, or is not eligible for a refund. For example, the order was declined.

422
Unprocessable Entity

invalid_object

The refundMerchantReference exceeded 128 characters.

422
Unprocessable Entity

invalid_amount

The amount requested exceeded the amount available.

422
Unprocessable Entity

invalid_object

The currency of the refund does not match the currency of the order (and the Merchant account).

422
Unprocessable Entity

refund_timelimit_exceeded

The refund exceeds the time limit of 120 days

Language
Authentication
Basic
base64
:
URL
Response
Click Try It! to start a request and see the response here!