Create Checkout

Create a new checkout session.

Headers

AuthorizationstringRequired

Bearer authentication of the form Bearer <token>, where token is your auth token.

Idempotency-KeystringOptional
Idempotency key to prevent duplicate checkout creation

Request

This endpoint expects an object.
amountintegerRequired
The final amount you would like to charge the customer, in cents. Including all the discounts and applicable taxes.
currencystringRequired

The 3-letter currency code in ISO 4217 format. Currently we only support ZAR.

cancelUrlstringOptional
The URL to redirect customers to when the checkout is cancelled.
successUrlstringOptional
The URL to optionally redirect customers to when the checkout completes successfully.
failureUrlstringOptional
The URL to optionally redirect customers to when the checkout does not complete successfully.
metadatamap from strings to anyOptional
Used to record additional details about the checkout, often used to reconcile data with an external system.
totalDiscountintegerOptional
The total discount, in cents, is used for display only. It must already be included in the amount to collect.
totalTaxAmountintegerOptional
The total tax, in cents, is used for display only. It must already be included in the amount to collect.
subtotalAmountintegerOptional
The subtotal, in cents, is used for display only and represents the total value collected including taxes and excluding discounts.
lineItemslist of objectsOptional
The line items are used for display only and provide additional details for the items purchased during checkout.

Response

This endpoint returns an object.
idstring
Unique identifier for the checkout session.
statusenum
Current status of the checkout.
Allowed values:
amountinteger
Amount to be charged in cents.
currencystring
Currency code for the transaction.
redirectUrlstring
URL to redirect the customer to complete payment.
paymentIdstring or null
The ID of a successful payment.
successUrlstring or null
The URL to redirect customers to when the checkout completes successfully.
cancelUrlstring or null
The URL to redirect customers to when the checkout is cancelled.
failureUrlstring or null
The URL to redirect customers to when the checkout does not complete successfully.
metadatamap from strings to any or null
Used to record additional details about the checkout, often used to reconcile data with an external system.
merchantIdstring
The ID of the merchant that created the checkout.
totalDiscountinteger or null
The total discount, in cents, is used for display only. It must already be included in the amount to collect.
totalTaxAmountinteger or null
The total tax, in cents, is used for display only. It must already be included in the amount to collect.
subtotalAmountinteger or null
The subtotal, in cents, is used for display only and represents the total value collected including taxes and excluding discounts.
lineItemslist of objects or null
The line items are used for display only and provide additional details for the items purchased during checkout.
externalIdstring or null
An optional ID that can be used to reconcile data with an external system.
processingModeenum
The mode in which the checkout is processed.
Allowed values:

Errors