> This page is for version v2 (default).
> For other versions, use one of these documentation indexes:
> - v2 (default): https://developers.clearpay.co.uk/v-2/llms.txt
> - v1: https://developers.clearpay.co.uk/v-1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.clearpay.co.uk/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.clearpay.co.uk/_mcp/server.

# Get Checkout

GET https://global-api-sandbox.afterpay.com/v2/checkouts/{token}

This endpoint retrieves an incomplete individual checkout by token.

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).

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.

## 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**  Not Found           | `not_found`     | No checkout token was provided.                                       |
| **412**  Precondition Failed | `invalid_token` | The checkout token is invalid, expired, completed, or does not exist. |

Reference: https://developers.clearpay.co.uk/api-reference/get-checkout

## Authentication

- `Authorization` header (basic auth, required) — Basic authentication of the form `Basic <base64(username:password)>`.

## Request

### Path parameters

- `token` (string, required) — The token of the checkout to be retrieved.

### Headers

- `Accept` (string, optional, default: application/json)

## Response

### 200

Get Checkout Response

- `token` (string, required) — Checkout token to be used to complete payment.
- `expires` (string, required) — The UTC timestamp of when the checkout token will expire, in ISO 8601 format.
- `redirectCheckoutUrl` (string, required) — 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.
- `amount` (V2CheckoutsTokenGetResponsesContentApplicationJsonSchemaAmount, optional) — Total amount to be charged to consumer.
- `consumer` (V2CheckoutsTokenGetResponsesContentApplicationJsonSchemaConsumer, optional) — The consumer requesting the order.
- `billing` (V2CheckoutsTokenGetResponsesContentApplicationJsonSchemaBilling, optional) — Billing address.
- `shipping` (V2CheckoutsTokenGetResponsesContentApplicationJsonSchemaShipping, optional) — Shipping address.
- `courier` (V2CheckoutsTokenGetResponsesContentApplicationJsonSchemaCourier, optional) — Shipping courier details.
- `description` (string, optional) — A description of the order.
- `merchant` (V2CheckoutsTokenGetResponsesContentApplicationJsonSchemaMerchant, optional) — Merchant configuration details.
- `mode` (enum, optional) — Must be set to `express` to enable express checkout.
  - Allowed values: `express`, `standard`
- `merchantReference` (string, optional) — The merchant's id/reference that this order corresponds to.
- `items` (list of V2CheckoutsTokenGetResponsesContentApplicationJsonSchemaItemsItems, optional) — An array of order items.
- `discounts` (list of V2CheckoutsTokenGetResponsesContentApplicationJsonSchemaDiscountsItems, optional) — An array of discounts.
- `shippingAmount` (V2CheckoutsTokenGetResponsesContentApplicationJsonSchemaShippingAmount, optional) — The shipping amount.
- `taxAmount` (V2CheckoutsTokenGetResponsesContentApplicationJsonSchemaTaxAmount, optional) — The included tax amount after applying all discounts.
- `shippingOptions` (V2CheckoutsTokenGetResponsesContentApplicationJsonSchemaShippingOptions, optional) — Shipping option details.

## Errors

### 404 Not Found Error

Not Found - No checkout token was provided

- `errorCode` (string, optional)
- `errorId` (string, optional)
- `message` (string, optional)
- `httpStatusCode` (integer, optional)

### 412 Precondition Failed Error

Precondition Failed - The checkout token is invalid, expired, completed, or does not exist

- `errorCode` (string, optional)
- `errorId` (string, optional)
- `message` (string, optional)
- `httpStatusCode` (integer, optional)

## Types

### V2CheckoutsTokenGetResponsesContentApplicationJsonSchemaAmount

Total amount to be charged to consumer.

- `amount` (string, required) — The amount as a string representation of a decimal number, rounded to 2 decimal places.
- `currency` (string, required) — The currency in ISO 4217 format.

### V2CheckoutsTokenGetResponsesContentApplicationJsonSchemaConsumer

The consumer requesting the order.

- `phoneNumber` (string, optional) — The consumer's phone number. Limited to 32 characters.
- `givenNames` (string, optional) — The consumer's first name and any middle names. Limited to 128 characters.
- `surname` (string, optional) — The consumer's last name. Limited to 128 characters.
- `email` (string, optional) — The consumer's email address. Limited to 128 characters.

### V2CheckoutsTokenGetResponsesContentApplicationJsonSchemaBilling

Billing address.

- `name` (string, optional) — Full name of contact. Limited to 255 characters.
- `line1` (string, optional) — First line of the address. Limited to 128 characters.
- `line2` (string, optional) — Second line of the address. Limited to 128 characters.
- `area1` (string, optional) — UK postal town or EU Suburb or Town. Limited to 128 characters.
- `area2` (string, optional) — UK village or local area, EU Province. Limited to 128 characters.
- `region` (string, optional) — UK county, EU region. Limited to 128 characters.
- `postcode` (string, optional) — Postal code. Limited to 128 characters.
- `countryCode` (string, optional) — The two-character ISO 3166-1 country code.
- `phoneNumber` (string, optional) — The phone number, in E.123 format. Limited to 32 characters.

### V2CheckoutsTokenGetResponsesContentApplicationJsonSchemaShipping

Shipping address.

- `name` (string, optional) — Full name of contact. Limited to 255 characters.
- `line1` (string, optional) — First line of the address. Limited to 128 characters.
- `line2` (string, optional) — Second line of the address. Limited to 128 characters.
- `area1` (string, optional) — UK postal town or EU Suburb or Town. Limited to 128 characters.
- `area2` (string, optional) — UK village or local area, EU Province. Limited to 128 characters.
- `region` (string, optional) — UK county, EU region. Limited to 128 characters.
- `postcode` (string, optional) — Postal code. Limited to 128 characters.
- `countryCode` (string, optional) — The two-character ISO 3166-1 country code.
- `phoneNumber` (string, optional) — The phone number, in E.123 format. Limited to 32 characters.

### V2CheckoutsTokenGetResponsesContentApplicationJsonSchemaCourier

Shipping courier details.

- `shippedAt` (string, optional) — The time at which the order was shipped, in ISO 8601 format.
- `name` (string, optional) — The name of the courier. Limited to 128 characters.
- `tracking` (string, optional) — The tracking number provided by the courier. Limited to 128 characters.
- `priority` (string, optional) — The shipping priority. If provided, must be either "STANDARD" or "EXPRESS".

### V2CheckoutsTokenGetResponsesContentApplicationJsonSchemaMerchant

Merchant configuration details.

- `redirectConfirmUrl` (string, optional) — The consumer is redirected to this URL on confirmation.
- `redirectCancelUrl` (string, optional) — The consumer to redirected to this URL if the payment process is cancelled.
- `popupOriginUrl` (string, optional) — The URL location from which Clearpay is initiated (required for express checkout). Optional for standard checkout when a `redirectConfirmURL` is provided.
- `name` (string, optional) — The merchant name displayed in the Clearpay checkout flow, confirmation & refund emails, and the consumer portal

### V2CheckoutsTokenGetResponsesContentApplicationJsonSchemaItemsItems

- `name` (string, optional) — Product name. Limited to 255 characters.
- `sku` (string, optional) — Product SKU. Limited to 128 characters.
- `quantity` (integer, optional) — The quantity of the item, stored as a signed 32-bit integer.
- `pageUrl` (string, optional) — The canonical URL for the item's Product Detail Page. Limited to 2048 characters.
- `imageUrl` (string, optional) — A URL for a web-optimised photo of the item, suitable for use directly as the `src` attribute of an `img` tag. Limited to 2048 characters.
- `price` (V2CheckoutsTokenGetResponsesContentApplicationJsonSchemaItemsItemsPrice, optional) — The unit price of the individual item. Must be a positive value.
- `categories` (string, optional) — An array of arrays to accommodate multiple categories that apply to the item. Each array represents a hierarchical path to a category, with the left-most category being the top-level parent category.
- `estimatedShipmentDate` (string, optional) — The estimated date when the order will be shipped, in `YYYY-MM` or `YYYY-MM-DD` format.

### V2CheckoutsTokenGetResponsesContentApplicationJsonSchemaDiscountsItems

- `displayName` (string, optional) — A display name for the discount. Limited to 128 characters.
- `amount` (V2CheckoutsTokenGetResponsesContentApplicationJsonSchemaDiscountsItemsAmount, optional) — The discount amount.

### V2CheckoutsTokenGetResponsesContentApplicationJsonSchemaShippingAmount

The shipping amount.

- `amount` (string, required) — The amount as a string representation of a decimal number, rounded to 2 decimal places.
- `currency` (string, required) — The currency in ISO 4217 format.

### V2CheckoutsTokenGetResponsesContentApplicationJsonSchemaTaxAmount

The included tax amount after applying all discounts.

- `amount` (string, required) — The amount as a string representation of a decimal number, rounded to 2 decimal places.
- `currency` (string, required) — The currency in ISO 4217 format.

### V2CheckoutsTokenGetResponsesContentApplicationJsonSchemaShippingOptions

Shipping option details.

- `shippingCountry` (string, optional) — Default shipping country in ISO 3166-1 country code. Limited to 2 characters
- `supportedShippingCountries` (string, optional) — An array of supported shipping address countries (in ISO 3166-1 alpha-2 country code format)

### V2CheckoutsTokenGetResponsesContentApplicationJsonSchemaItemsItemsPrice

The unit price of the individual item. Must be a positive value.

- `amount` (string, required) — The amount as a string representation of a decimal number, rounded to 2 decimal places.
- `currency` (string, required) — The currency in ISO 4217 format.

### V2CheckoutsTokenGetResponsesContentApplicationJsonSchemaDiscountsItemsAmount

The discount amount.

- `amount` (string, required) — The amount as a string representation of a decimal number, rounded to 2 decimal places.
- `currency` (string, required) — The currency in ISO 4217 format.

## Examples

**Response**

```json
{
  "token": "002.ejh49ovam0acussgg4c6slpqqtn1ntqt3m4efqdh4qe0u8qk",
  "expires": "2023-08-29T00:57:25.754Z",
  "redirectCheckoutUrl": "https://portal.eu-sandbox.afterpay.com/uk/checkout/?token=002.ejh49ovam0acussgg4c6slpqqtn1ntqt3m4efqdh4qe0u8qk",
  "amount": {
    "amount": "100.00",
    "currency": "GBP"
  },
  "consumer": {
    "givenNames": "Joe",
    "surname": "Consumer",
    "email": "test@example.com"
  },
  "billing": {
    "name": "Joe Consumer",
    "line1": "123 Fake Street",
    "area1": "",
    "region": "",
    "postcode": "AA99 9AA",
    "countryCode": "GB"
  },
  "shipping": {
    "name": "Joe Consumer",
    "line1": "123 Fake Street",
    "area1": "",
    "region": "",
    "postcode": "AA99 9AA",
    "countryCode": "GB"
  },
  "merchant": {
    "redirectConfirmUrl": "https://example.com/checkout/confirm",
    "redirectCancelUrl": "https://example.com/checkout/cancel",
    "popupOriginUrl": "https://example.com/cart"
  },
  "mode": "standard",
  "merchantReference": "merchant-order-123",
  "items": [
    {
      "name": "Sample Product",
      "quantity": 1,
      "price": {
        "amount": "100.00",
        "currency": "GBP"
      }
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://global-api-sandbox.afterpay.com/v2/checkouts/token"

headers = {
    "User-Agent": "User-Agent"
}

response = requests.get(url, headers=headers, auth=("<username>", "<password>"))

print(response.json())
```

```javascript
const url = 'https://global-api-sandbox.afterpay.com/v2/checkouts/token';
const credentials = btoa("<username>:<password>");

const options = {
  method: 'GET',
  headers: {'User-Agent': 'User-Agent', Authorization: `Basic ${credentials}`}
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://global-api-sandbox.afterpay.com/v2/checkouts/token"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("User-Agent", "User-Agent")
	req.SetBasicAuth("<username>", "<password>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://global-api-sandbox.afterpay.com/v2/checkouts/token")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["User-Agent"] = 'User-Agent'
request.basic_auth("<username>", "<password>")

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://global-api-sandbox.afterpay.com/v2/checkouts/token")
  .header("User-Agent", "User-Agent")
  .basicAuth("<username>", "<password>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://global-api-sandbox.afterpay.com/v2/checkouts/token', [
  'headers' => [
    'User-Agent' => 'User-Agent',
  ],
    'auth' => ['<username>', '<password>'],
]);

echo $response->getBody();
```

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://global-api-sandbox.afterpay.com/v2/checkouts/token");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.GET);
request.AddHeader("User-Agent", "User-Agent");

IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<username>:<password>".utf8).base64EncodedString()

let headers = [
  "User-Agent": "User-Agent",
  "Authorization": "Basic \(credentials)"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://global-api-sandbox.afterpay.com/v2/checkouts/token")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```