For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
HomeGuidesAPI Reference
HomeGuidesAPI Reference
  • Foundations
    • Introduction
    • Request Headers
    • User-Agent Header
    • Authentication
    • Errors
    • Data Requirements
  • Online API
      • POSTCreate Checkout
      • Express Checkout Payload (Create Checkout)
      • GETGet Checkout
    • Immediate Payment Flow
    • Deferred Payment Flow
  • Upgrading to the Clearpay Express Checkout
    • Express Checkout Overview
    • How to Integrate
    • Security
LogoLogo
Online APICheckouts

Express Checkout Payload (Create Checkout)

Was this page helpful?
Previous

Get Checkout

Next
Built with
Supported Countries

Express Checkout is currently available in the following countries:

🇬🇧 UK
🇺🇸 United States
🇦🇺 Australia
🇳🇿 New Zealand
🇨🇦 Canada

When creating an Express Checkout order, there are two key differences – you must specify the mode as express and set a single popupOriginUrl instead of redirectConfirmUrl and redirectCancelUrl. Unlike standard checkout, only amount, merchant, and mode are required for the Create Checkout API call:

The Data Payload Properties:

AttributeTypeDescription
amountMoney (required)Total amount to be charged to the consumer. This can be dynamically updated during the checkout by setting mode to express
modeString (default standard)Set to express for an express-flow checkout. This allows the amount to adjust based on events during the checkout, such as shipping costs and sales tax based on a selected address
merchantMerchant
(required)
You must provide a new URL, popupOriginUrl, to receive Javascript callbacks from Clearpay (e.g. onComplete, onShippingAddressChange, etc). Include the scheme, hostname and port. Port is optional.
items, discounts, shipping, merchantReference(optional)Optional fields as per the API reference docs.
1curl --request POST \
2 --url https://global-api.afterpay.com/v2/checkouts/ \
3 --header 'accept: application/json' \
4 --header 'content-type: application/json' \
5 --data '{"amount":{"amount":"100.00", “currency”: “GBP”}, “mode”: “express”, "merchant": {"popupOriginUrl": "https://example.com/cart"}}'

The amount provided in this call should be the order amount before shipping and taxes

The shippingOptions to be applied if a merchant wishes to support shipping to addresses outside of the Afterpay/Clearpay region the customer belongs to.

AttributeTypeDescription
shippingCountrystringDefault shipping country in ISO 3166-1 country code.
Limited to 2 characters
supportedShippingCountriesstringAn array of supported shipping address countries (in ISO 3166-1 alpha-2 country code format)