Express Checkout requires the addition of an amount field to verify that the final amount matches the order total including the shipping and taxes.

As seen in the example below, you may capture payment immediately if you are using the Integrated Shipping flow and do not want to allow the total to be updated on a review page.


curl --request POST \
  --url https://api.us.afterpay.com/v2/payments/capture \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"token": "YOUR_TOKEN", "amount":{"amount":"100.00", “currency”: “USD”}}'

In addition to the required amount field, you will also need to provide some extra properties to the payload if you are using the Afterpay Checkout Widget to enable dynamic updates to the order total on a review page (e.g. selecting shipping options, increasing item quantities, applying promo codes):

  • isCheckoutAdjusted: the state to indicate if changes have been made since the initial order creation
  • items: the list of order items if it has changed
  • shipping: the shipping address if it has changed
  • paymentScheduleChecksum: the latest paymentScheduleChecksum retrieved from your widget’s onChange call

If the final amount does not match the calculated amount (including shipping and taxes) or the paymentScheduleChecksum does not match the payment schedule displayed to the consumer, the request will be rejected.

The Data Payload Properties:

Attribute

Type

Description

token

String (required)

The token returned in the Create Checkout request.

amount

Money (required)

Amount to be checked against the amount including shipping and taxes. If the amounts do not match, the request will be rejected.

merchantReference

String

Order ID or reference this order corresponds to.

isCheckoutAdjusted

Boolean

Whether there have been changes to the order since the initial order creation.

paymentScheduleChecksum

String

A unique value representing the payment schedule that must be provided when there has been changes since the initial order creation.

items

Array

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

shipping

Shipping

The shipping address for this order to be provided if it has changed since the initial order creation.


📘

For Cross Border Trade orders, the shipping costs and taxes must be captured in the same currency in which the checkout is initiated.

Example:
For a US merchant displaying a $100 USD order in AUD for an Australian consumer on your site – When initiating Afterpay checkout, If you initiate checkout by sending us the order amount in USD (i.e. $100 USD), then at capture the final order amount must also be in USD. Likewise, if you initiate checkout by sending us the order amount in AUD post currency conversion on your side (i.e. $150 AUD), ensure that the capture amount is sent in AUD. In other words, ensure that the currency is consistent throughout the entire checkout flow.