The Afterpay API supports idempotency that allows the safe retry of requests, guaranteeing the operation is only performed once.
For example, if a Create Refund request fails with a network error, the request can be retried with the same
merchantReference. This is especially important for partial refunds to ensure retry attempts are not processed as separate refunds.
Afterpay recommends that merchants generate UUIDs for use as request IDs. The resources that include a
requestId may send back the same response for requests made with the same
requestId for up to 24 hours.
When performing an idempotent retry of an API request, an HTTP 409 response may be encountered. This generally indicates that the original request was received, but is still processing. Please try again in a few moments, and repeat with the same
requestIduntil something other than a 409 response is received.