Skip to main content
POST
Create a client session

Authorizations

X-API-KEY
string
header
required

Body

application/json
orderId
string

Your reference for the payment.

currencyCode
string

The 3-letter currency code in ISO 4217 format. e.g. use USD for US dollars.

amount
integer<int64>

The amount you would like to charge the customer, in minor units. e.g. for $7, use 700.

Some currencies, such as Japanese Yen, do not have minor units. In this case you should use the value as it is, without any formatting. For example for ¥100, use 100.

If the amount is provided on this level, it would override any amount calculated from the provided line items, shipping and other amounts.

Required range: x >= 0
order
Order Details · object

More information associated with the order.

customerId
string

A unique identifier for your customer. Create a client session token with a customerId to enable the client-side SDK to retrieve and manage your customer's saved payment methods. A client session token also enables saving payment methods against this customer id.

customer
Customer Details · object

More information associated with the customer.

metadata
Payment Metadata · object

Additional data to be used throughout the payment lifecycle.

A dictionary of key-value pairs where the values can only be strings or integers.

e.g. {"productId": 1001, "merchantId": "a13bsd62s"}

The size of metadata must not exceed 300 KB (307,200 bytes) when serialized as JSON. Larger payloads are rejected with a PaymentMetadataSizeExceeded error.

paymentMethod
Payment Method Options · object

Enable certain options associated with the payment method.

Response

Successful Response

clientToken
string
required

Client token used to initialize the SDK on all platforms. Its length is not fixed. Treat it as an opaque string and do not rely on a maximum length when storing it.

clientTokenExpirationDate
string<date-time>
required

Expiration date & time of the client token (UTC with no timezoneinfo).

orderId
string

Your reference for the payment.

currencyCode
string

The 3-letter currency code in ISO 4217 format. e.g. use USD for US dollars.

amount
integer<int64>

The amount you would like to charge the customer, in minor units. e.g. for $7, use 700.

Some currencies, such as Japanese Yen, do not have minor units. In this case you should use the value as it is, without any formatting. For example for ¥100, use 100.

If the amount is provided on this level, it would override any amount calculated from the provided line items, shipping and other amounts.

Required range: x >= 0
order
Order Details · object

More information associated with the order.

customerId
string

A unique identifier for your customer.

customer
Customer Details · object

More information associated with the customer.

metadata
Payment Metadata · object

Additional data to be used throughout the payment lifecycle.

paymentMethod
Payment Method Options · object

Enable certain options associated with the payment methods.

warnings
ClientSessionWarningsAPIResponse · object[]

Warning messages to indicate missing information that are required for payment methods, checkout modules and other features; or when third-party services are unavailable.