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

Get Checkout

GET
https://global-api-sandbox.afterpay.com/v2/checkouts/:token
GET
/v2/checkouts/:token
$curl https://global-api-sandbox.afterpay.com/v2/checkouts/token \
> -H "User-Agent: User-Agent" \
> -u "<username>:<password>"
1{
2 "token": "002.ejh49ovam0acussgg4c6slpqqtn1ntqt3m4efqdh4qe0u8qk",
3 "expires": "2023-08-29T00:57:25.754Z",
4 "redirectCheckoutUrl": "https://portal.eu-sandbox.afterpay.com/uk/checkout/?token=002.ejh49ovam0acussgg4c6slpqqtn1ntqt3m4efqdh4qe0u8qk",
5 "amount": {
6 "amount": "100.00",
7 "currency": "GBP"
8 },
9 "consumer": {
10 "givenNames": "Joe",
11 "surname": "Consumer",
12 "email": "test@example.com"
13 },
14 "billing": {
15 "name": "Joe Consumer",
16 "line1": "123 Fake Street",
17 "area1": "",
18 "region": "",
19 "postcode": "AA99 9AA",
20 "countryCode": "GB"
21 },
22 "shipping": {
23 "name": "Joe Consumer",
24 "line1": "123 Fake Street",
25 "area1": "",
26 "region": "",
27 "postcode": "AA99 9AA",
28 "countryCode": "GB"
29 },
30 "merchant": {
31 "redirectConfirmUrl": "https://example.com/checkout/confirm",
32 "redirectCancelUrl": "https://example.com/checkout/cancel",
33 "popupOriginUrl": "https://example.com/cart"
34 },
35 "mode": "standard",
36 "merchantReference": "merchant-order-123",
37 "items": [
38 {
39 "name": "Sample Product",
40 "quantity": 1,
41 "price": {
42 "amount": "100.00",
43 "currency": "GBP"
44 }
45 }
46 ]
47}
This endpoint retrieves an incomplete individual checkout by token. <Note title="Note"> Checkout details are only retained in this temporary format for up to 60 minutes. If a checkout token expires or has an order created against it, it can no longer be retrieved from this endpoint. To retrieve a [Payment](/payment-object) record (Clearpay Order) along with its associated checkout details, see [Get Payment By Token](/api-reference/online-api/order-management/get-payment-by-token). </Note> <Note title="Note"> Fields that were not included in the original [Create Checkout](/api-reference/online-api/checkouts/create-checkout) request may not be included in any corresponding Get Checkout response. </Note> ## Connection Timeouts | Timeout | Time (Seconds) | | :------ | :------------- | | Open | 10 | | Read | 20 | ## Errors In addition to the [GET Errors](/get-errors) applicable to all GET endpoints, the following errors are specific to Get Checkout: | HTTP Status Code | errorCode | Description | | :-- | :-- | :-- | | **404** <br />Not Found | `not_found` | No checkout token was provided. | | **412** <br />Precondition Failed | `invalid_token` | The checkout token is invalid, expired, completed, or does not exist. |
Was this page helpful?
Previous

Immediate Payment Flow

Next
Built with

This endpoint retrieves an incomplete individual checkout by token.

Note

Checkout details are only retained in this temporary format for up to 60 minutes. If a checkout token expires or has an order created against it, it can no longer be retrieved from this endpoint.

To retrieve a Payment record (Clearpay Order) along with its associated checkout details, see Get Payment By Token.

Note

Fields that were not included in the original Create Checkout request may not be included in any corresponding Get Checkout response.

Connection Timeouts

TimeoutTime (Seconds)
Open10
Read20

Errors

In addition to the GET Errors applicable to all GET endpoints, the following errors are specific to Get Checkout:

HTTP Status CodeerrorCodeDescription
404
Not Found
not_foundNo checkout token was provided.
412
Precondition Failed
invalid_tokenThe checkout token is invalid, expired, completed, or does not exist.

Authentication

AuthorizationBasic

Basic authentication of the form Basic <base64(username:password)>.

Path parameters

tokenstringRequired
The token of the checkout to be retrieved.

Headers

User-AgentstringRequired
AcceptstringOptionalDefaults to application/json

Response

Get Checkout Response
tokenstring
Checkout token to be used to complete payment.
expiresstring
The UTC timestamp of when the checkout token will expire, in ISO 8601 format.
redirectCheckoutUrlstring
A URL that can be used to redirect the consumer to the Clearpay screenflow directly from the merchant backend. This can be used as an alternative to implementing the JavaScript afterpay.js.
amountobject
Total amount to be charged to consumer.
consumerobject
The consumer requesting the order.
billingobject
Billing address.
shippingobject
Shipping address.
courierobject
Shipping courier details.
descriptionstring
A description of the order.
merchantobject
Merchant configuration details.
modeenum

Must be set to express to enable express checkout.

Allowed values:
merchantReferencestring

The merchant’s id/reference that this order corresponds to.

itemslist of objects
An array of order items.
discountslist of objects
An array of discounts.
shippingAmountobject
The shipping amount.
taxAmountobject
The included tax amount after applying all discounts.
shippingOptionsobject
Shipping option details.

Errors

404
Not Found Error
412
Precondition Failed Error