Create Checkout [Express Checkout]

This endpoint creates a checkout that is used to initiate the Clearpay payment process. Clearpay uses the information in the order request to assist with the consumer’s pre-approval process. ## Successful Response (201) Returns a token, expiry date/time and checkout URL if successful. | Attribute | Type | Description | | :-------------------- | :----- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `token` | string | Checkout token to be used to complete payment. | | `expires` | string | The UTC timestamp of when the checkout token will expire, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. | | `redirectCheckoutUrl` | string | 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. | ## Connection Timeouts | Timeout | Time (Seconds) | | :------ | :------------- | | Open | 10 | | Read | 20 | ## Errors In addition to the [PUT/POST Errors](/put-post-errors) applicable to all POST endpoints, the following errors are specific to Create Checkout: | HTTP Status Code | errorCode | Description | | :-- | :-- | :-- | | 422 <br />Unprocessable Entity | `invalid_object` | One or more required fields were missing or invalid. | | 422 <br />Unprocessable Entity | `unsupported_payment_type` | The amount is outside of the merchant's payment limits, as returned by [Get Configuration](/api-reference/online-api/configuration/get-configuration). | | 422 <br />Unprocessable Entity | `unsupported_currency` | One or more [Money](/money-object) objects may have contained a currency that differs from the merchant's account currency. |

Authentication

AuthorizationBasic

Basic authentication of the form Basic <username:password>.

Headers

User-AgentstringRequired
AcceptstringOptionalDefaults to application/json

Request

This endpoint expects an object.
amountobjectRequired
Total amount for order to be charged to consumer.
modestringRequiredDefaults to express

This must be set to express to enable express checkout. It will default to standard otherwise.

merchantobjectRequired

Response

200
tokenstring or null
expiresstring or null
redirectCheckoutUrlstring or null

Errors