The checkouts endpoint is responsible for creating a new checkout and returning the associated checkout token
Authentication
AuthorizationBasic
Basic authentication of the form Basic <base64(username:password)>.
Headers
User-AgentstringRequired
AcceptstringOptionalDefaults to application/json
Request
amountobjectRequired
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|
consumerobjectRequired
The consumer data model is used for gathering essential user information. It captures details such as the individual's first name, represented by `givenNames`, and their last name, captured under `surname`. In addition, it stores the user's contact number under `phoneNumber` and their email address under `email`. These fields collectively provide indispensable contact and identification details for a user.
merchantReferencestringOptional
billingobjectOptional
This data model is used for storing an individual's contact information. Mandatory fields such as **name**, **line1**, **area1**, **region**, **postcode**, and **countryCode** help in capturing vital information about a user's location.
The `line2` and `area2` fields provide additional space for extended addresses, while `phoneNumber` can be used to store the user's contact number.
<Warning title="Important Note">
The `area1`, `area2` and `region` properties feature localized terminology based on country. Refer to the property descriptions for insights on each country's specific usage
</Warning>
shippingobjectOptional
This data model is used for storing an individual's contact information. Mandatory fields such as **name**, **line1**, **area1**, **region**, **postcode**, and **countryCode** help in capturing vital information about a user's location.
The `line2` and `area2` fields provide additional space for extended addresses, while `phoneNumber` can be used to store the user's contact number.
<Warning title="Important Note">
The `area1`, `area2` and `region` properties feature localized terminology based on country. Refer to the property descriptions for insights on each country's specific usage
</Warning>
merchantobjectOptional
itemslist of objectsOptional
courierobjectOptional
Essential information for tracking a shipment. The `shippedAt` key represents the date and time when the item was shipped. This value follows the ISO 8601 standard format for date and time representations.
The `name` field indicates the courier service employed to handle the shipment (e.g. FEDEX, UPS). For orders that are picked up in-store (also known as Buy-Online-Pickup-Instore), please use "INSTORE_PICKUP" as the `name` field value.
The `tracking` key represents a unique tracking number provided by the courier service to monitor the shipment's progress. It's a valuable tool for customers and businesses to track and trace their packages.
The `priority` field tracks the shipping speed or service level associated with the delivery.
taxAmountobjectOptional
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|
shippingAmountobjectOptional
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|
discountslist of objectsOptional
agreementslist of objectsOptional
List of agreements
customobjectOptional
Additional data depending on the goods and services you provide to customers.
modeenumOptionalDefaults to standard
Must be set to express to enable express checkout.
Allowed values:
descriptionstringOptionalDeprecated
Response
Create Checkout Response
tokenstring
expiresstring
redirectCheckoutUrlstring
Errors
400
Bad Request Error
422
Unprocessable Entity Error
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
The consumer data model is used for gathering essential user information. It captures details such as the individual’s first name, represented by givenNames, and their last name, captured under surname. In addition, it stores the user’s contact number under phoneNumber and their email address under email. These fields collectively provide indispensable contact and identification details for a user.
This data model is used for storing an individual’s contact information. Mandatory fields such as name, line1, area1, region, postcode, and countryCode help in capturing vital information about a user’s location.
The line2 and area2 fields provide additional space for extended addresses, while phoneNumber can be used to store the user’s contact number.
Important Note
The area1, area2 and region properties feature localized terminology based on country. Refer to the property descriptions for insights on each country’s specific usage
This data model is used for storing an individual’s contact information. Mandatory fields such as name, line1, area1, region, postcode, and countryCode help in capturing vital information about a user’s location.
The line2 and area2 fields provide additional space for extended addresses, while phoneNumber can be used to store the user’s contact number.
Important Note
The area1, area2 and region properties feature localized terminology based on country. Refer to the property descriptions for insights on each country’s specific usage
Essential information for tracking a shipment. The shippedAt key represents the date and time when the item was shipped. This value follows the ISO 8601 standard format for date and time representations.
The name field indicates the courier service employed to handle the shipment (e.g. FEDEX, UPS). For orders that are picked up in-store (also known as Buy-Online-Pickup-Instore), please use “INSTORE_PICKUP” as the name field value.
The tracking key represents a unique tracking number provided by the courier service to monitor the shipment’s progress. It’s a valuable tool for customers and businesses to track and trace their packages.
The priority field tracks the shipping speed or service level associated with the delivery.
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
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