Skip to main content
POST
Creates a new checkout session.

Authorizations

x-api-key
string
header
required

API key for authentication. You can find your API key in the Creem dashboard under Settings > API Keys.

Body

application/json

Create checkout request payload

product_id
string
required

The ID of the product associated with the checkout session.

Example:

"prod_1234567890"

request_id
string

Identify and track each checkout request.

units
number

The number of units for the order.

Example:

1

custom_price
integer

Override the unit price of the product for this checkout session, in cents (e.g. 1500 = $15.00). The product currency is used, and the amount is per unit: with units: 3 and custom_price: 1500 the customer pays 4500. Must be between 100 (one whole unit of the currency) and 99999999. Only supported for one-time payment products. Use this for dynamic pricing models such as pay-what-you-want, donations, or amounts calculated by your application.

Example:

1500

discount_code
string

Prefill the checkout session with a discount code.

Example:

"SUMMER2024"

customer
object

Customer data for checkout session. This will prefill the customer info on the checkout page.

custom_fields
object[]

Collect additional information from your customer using custom fields. Up to 3 fields are supported.

custom_field
object[]
deprecated

DEPRECATED: Use custom_fields instead. Collect additional information from your customer using custom fields. Up to 3 fields are supported.

success_url
string

The URL to which the user will be redirected after the checkout process is completed.

metadata
object

Metadata for the checkout in the form of key-value pairs

Example:

Response

Successfully created a checkout session

id
string
required

Unique identifier for the object.

mode
enum<string>
required

String representing the environment.

Available options:
test,
prod,
sandbox
object
string
required

String representing the object's type. Objects of the same type share the same value.

status
enum<string>
required

Status of the checkout.

Available options:
pending,
processing,
completed,
expired
Example:

"completed"

product
required

The product associated with the checkout session.

request_id
string

Identify and track each checkout request.

units
number
default:1

The number of units for the of the product.

custom_price
integer

The per-unit price override (in cents, product currency) this checkout was created with. Only present when the checkout was created with a custom_price. One-time payment products only.

Example:

1500

order
object

The order associated with the checkout session.

subscription

The subscription associated with the checkout session.

customer

The customer associated with the checkout session.

custom_fields
object[]

Additional information collected from your customer during the checkout process.

checkout_url
string

The URL to which the customer will be redirected to complete the payment.

success_url
string | null

The URL to which the user will be redirected after the checkout process is completed.

Example:

"https://example.com/return"

license_keys
object[]

License keys issued for the order.

feature
object[]
deprecated

DEPRECATED: Use license_keys instead. Features issued for the order.

metadata
object

Metadata for the checkout in the form of key-value pairs

Example:
discount
object

The discount applied to the checkout, if any.