Auth

This endpoint requests a payment auth, which determines the order approval status. If approved, the auth has an expiration date and time, which is returned in the events list for the "AUTH_APPROVED" payment event. Authorization expires after 13 days. 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. The consumer's payment plan will begin at the time of auth approval. **Note:** Authorization expires after 13 days and then the transaction is automatically voided. Voided transactions are frozen and cannot be reopened or changed in any way. In this case your only option is to use the v2/checkouts endpoint to create a new order. **Connection Timeouts** | Timeout | Time (Seconds) | |---------|----------------| | Open | 10 | | Read | 70 |

Authentication

AuthorizationBasic

Basic authentication of the form Basic <username:password>.

Headers

User-AgentstringRequired
AcceptstringOptionalDefaults to application/json

Request

This endpoint expects an object.
tokenstringRequired
requestidstringOptionalformat: "uuid"
A unique request ID, required for idempotent retries. It is recommended that the merchant generate a UUID for each unique request.
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

Required for express checkout only. Amount to be checked against the value in the create checkout request. If the amounts do not match, then the request is rejected and an error specific to this scenario is returned.

isCheckoutAdjustedbooleanOptional

Express checkout only. The isCheckoutAdjusted field can be used to allow the order amount to be changed after the checkout flow.

paymentScheduleChecksumstringOptional

Express checkout only. A unique value representing the payment schedule that must be provided when there has been changes since the initial order creation (retrieved from checkout widget).

itemslist of anyOptional

Express checkout only. An array of order items that have been updated to be provided if it has changed since the initial order creation.

shippingobjectOptional

Express checkout only. The shipping address if it has changed since the initial order creation.

enrichmentsobjectOptional
Additional enrichment data for the payment.

Response

If the payment is approved by Afterpay, a Payment object is returned with a status of APPROVED and a paymentState of AUTH_APPROVED.

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
is the UTC timestamp of when the payment was completed.
originalAmountobject or null
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|
openToCaptureAmountobject or null
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|
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
orderDetailsobject or null
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 objects or null
agreementslist of objects or null

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

Errors