Create Checkout

This endpoint creates a checkout used to start the Clearpay payment process. Clearpay uses the information in the order request to assist with the customer’s pre-approval process.

<Note title="Note">

The popupOriginUrl is optional if using the redirectConfirmURL and is found under the merchant object. However, this method is used by most new merchants. You can see how the method is used for Express Checkout and read more about the Popup method under our Standard Checkout page. </Note>

<Note title="Note"> It is not possible to update the checkout information (including `amount`) after the token is generated.

If the consumer's cart changes on the merchant side after a token is generated, please discard this token. Use the current checkout information to generate a new checkout token. Use the new token to send the consumer through the Clearpay screenflow before attempting to call Auth or Capture Full Payment. </Note>

Connection Timeouts

TimeoutTime (Seconds)
Open10
Read20

Errors

In addition to the PUT/POST Errors applicable to all POST endpoints, the following errors are specific to Create Checkout:

HTTP Status CodeerrorCodeDescription
400 <br />Bad Requestinvalid_requestInvalid request format or missing required fields.
422 <br />Unprocessable Entityinvalid_objectOne or more required fields were missing or invalid.
422 <br />Unprocessable Entityunsupported_payment_typeThe amount is outside of the merchant's payment limits, as returned by Get Configuration.
422 <br />Unprocessable Entityunsupported_currencyOne or more Money objects may have contained a currency that differs from the merchant's account currency.
post/v2/checkouts

Request

  • Base URL: https://global-api-sandbox.afterpay.com
  • URL: https://global-api-sandbox.afterpay.com/v2/checkouts
  • Auth: HTTP basic

Headers

User-Agentstring required
Acceptstring

Request body

purchaseCountrystring required

The Merchant's store front country. The two-character ISO 3166-1 country code. Required for EU Countries.

descriptionstring

Deprecated: A description of the order.

merchantReferencestring required

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

Response

Create Checkout Response

tokenstring required

The checkout token used to redirect consumers to the Clearpay checkout flow.

expiresstring required

The expiration date and time for the checkout token in ISO 8601 format.

redirectCheckoutUrlstring required

The URL to redirect consumers to complete the Clearpay checkout process.

Changes

No recorded changes to this operation across all 1 revision of this API.