Void

This endpoint voids the remaining `openToCapture` amount of the payment auth, and refunds the consumer. <Info> Partial voids can be performed by specifying an amount in the request body. </Info> This operation is idempotent based on the `requestId` (if provided), which allows for the safe retry of multiple requests, guaranteeing the payment operation is only performed once. **Connection Timeouts** | Timeout | Time (Seconds) | |---------|----------------| | Open | 10 | | Read | 70 |

Authentication

AuthorizationBasic

Basic authentication of the form Basic <base64(username:password)>.

Path parameters

orderIdstringRequired

The unique ID of the Afterpay Order, returned as the id property of the Auth response.

Headers

User-AgentstringRequired
AcceptstringOptionalDefaults to application/json

Request

amountobjectOptional
The amount to void. Must be less than or equal to the open to capture amount.
requestIdstringOptional
A unique request ID, required for safe retries. It is recommended that the merchant generate a UUID for each unique void.
reasonstringOptional

Can be passed in void requests to conditionally modify wording of the corresponding consumer refund email. This can be set to 1 of 3 values, cancelledItems, amountAdjustment or null

Response

If successful, returns an updated copy of the Payment object. - A new Payment Event object will be appended to the events array, with a type of "VOIDED". - A new Refund object will be prepended to the refunds array. - If the openToCapture amount is reduced to zero as a result of this Void request, the paymentState will be updated as follows: - from "AUTH_APPROVED" to "VOIDED", or - from "PARTIALLY_CAPTURED" to "CAPTURED".
idstringOptional
The unique, permanent, Afterpay generated Order ID.
tokenstringOptional
The token obtained from the checkout call
statusenumOptional
represents the status of the order
createdstringOptional
The UTC timestamp of when the payment was completed.
originalAmountobjectOptional
Total amount charged to the customer for the order.
openToCaptureAmountobjectOptional
Remaining amount that can be captured. Will always be zero for Immediate Payment Flow orders.
paymentStateenumOptionalRead-only
is the current state for capturing payments
merchantReferencestringOptional

is the merchant’s order id/reference that the payment corresponds to.

refundslist of objectsOptional

An array of refunds. Note: in response to a Capture Full Payment call, this array will always be empty, since refunds cannot occur until payment is captured.

orderDetailsobjectOptional
The details of the order bound to the payment.
eventslist of objectsOptional
One or more payment events that have occurred against the order.
agreementslist of objectsOptional

List of billing agreements created if any (field omitted if empty)

Errors

404
Not Found Error
422
Unprocessable Entity Error