Capture Payment

This endpoint captures a full or partial payment that has been authorized. Any amounts successfully captured will be settled from Afterpay to the merchant's nominated bank account on the following day. Records of all payments captured against an order are returned in the events list as events of type, "CAPTURED". **Note:** Authorization expires after 13 days and then the transaction is automatically voided. Voided transactions are frozen and cannot be captured, reopened or changed in any way. In this case your only option is to use the v2/checkouts endpoint to create a new order. This operation is idempotent based on the `requestId` (if provided), which allows the safe retry of multiple requests. This safe retry guarantees the payment operation only occurs once. **Connection Timeouts** | Timeout | Time (Seconds) | |---------|----------------| | Open | 10 | | Read | 70 |

Authentication

AuthorizationBasic

Basic authentication of the form Basic <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

requestIdstringOptionalformat: "uuid"
A unique request ID, required for idempotent retries.
merchantReferencestringOptional

The reference/ order id that this payment corresponds to in the merchant’s system.

Note: Providing a new value will update any value previously set in the Create Checkout request.

amountobjectOptional
Object containing amount and currency. Where a Money object is included in an API request, it will be validated according to the specification above. Invalid Money objects will trigger a **422 Unprocessable Entity response**. The following is a list of common examples: |Example| errorCode| message| |---|---|---| |`amount` is omitted or null |invalid_object |{Money object}.amount Amount field required| |`amount` has more than 2 decimal places | invalid_object amount| must be a valid ISO 4217 format value| |`amount` includes a thousands separator comma, for example: "1,000" |invalid_amount |Amount must be a valid ISO 4217 format value| |`amount` is not a decimal number, for example: "FREE", "$2" or an empty string |invalid_object| {Money object}.amount Amount field must be a valid ISO 4217 format value| |`currency` is omitted or null |invalid_object| {Money object}.currency Currency field required| |`currency` is not a valid currency code, not all uppercase or an empty string |invalid_object| {Money object}.currency Currency not supported for this merchant| |`currency` is supported by Afterpay, but not valid for the Merchant account |unsupported_currency |An error occurred|
paymentEventMerchantReferencestringOptional<=128 characters
A unique reference for the individual payment capture event. If provided, the value will appear in the daily settlement file as "Payment Event ID"

Response

If successful, returns an updated copy of the Payment object, with the newly captured payment appended to the events array as a Payment Event object with a type of “CAPTURED”.

idstring or null
The unique, permanent, Afterpay generated Order ID.
tokenstring or null
The token obtained from the checkout call
statusenum or null
represents the status of the order
Allowed values:
createdstring or null
The UTC timestamp of when the payment was completed.
originalAmountobject or null
Total amount charged to the customer for the order.
openToCaptureAmountobject or null
Remaining amount that can be captured. Will always be zero for Immediate Payment Flow orders.
paymentStateenum or null
is the current state for capturing payments
merchantReferencestring or null

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

refundslist of objects or null

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.

orderDetailsobject or null
The details of the order bound to the payment.
eventslist of objects or null
One or more payment events that have occurred against the order.
agreementslist of objects or null

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

Errors