Skip to navigation

Void

This endpoint voids the remaining openToCapture amount of the payment auth, and refunds the customer.

Note

To make a partial void, specify an amount in the request body.

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 made once.

Connection Timeouts

TimeoutTime (Seconds)
Open10
Read70

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

This endpoint expects an object.
amountobjectOptional
The amount to void. Must be less than or equal to the open to capture amount. Omit it to void the whole remaining balance.
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 customer 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 is appended to the events array, with a type of “VOIDED”.
  • A new Refund object is prepended to the refunds array, which also holds voids and reversals. To get the amount refunded, sum the refunds array and subtract the “VOIDED” and “REVERSED” amounts in the events array.
  • If the openToCapture amount is reduced to zero as a result of this Void request, the paymentState is 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
Allowed values:
createdstringOptional
The UTC timestamp of when the order was created.
originalAmountobjectOptional
Object containing amount and currency
openToCaptureAmountobjectOptional
Object containing amount and currency
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, voids, and reversals. Note: in response to a Capture Full Payment call, this array will always be empty, since refunds cannot occur until payment is captured.

orderDetailsobjectOptional
This comprehensive schema is designed to store an entire transaction's detail, covering crucial aspects like consumer information, billing and shipping details, courier particulars, item list, discounts, tax, and shipping amount.
eventslist of objectsOptional

Errors

404
Not Found Error
409
Conflict Error
422
Unprocessable Entity Error