Creates a new checkout session
Create a new checkout session to accept one-time payments or start subscriptions. Returns a checkout URL to redirect customers.
Authorizations
API key for authentication. You can find your API key in the Creem dashboard under Settings > API Keys.
Body
Create checkout request payload
The ID of the product associated with the checkout session.
"prod_1234567890"
Identify and track each checkout request.
The number of units for the order.
1
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.
1500
Prefill the checkout session with a discount code.
"SUMMER2024"
Customer data for checkout session. This will prefill the customer info on the checkout page.
Collect additional information from your customer using custom fields. Up to 3 fields are supported.
DEPRECATED: Use custom_fields instead. Collect additional information from your customer using custom fields. Up to 3 fields are supported.
The URL to which the user will be redirected after the checkout process is completed.
Metadata for the checkout in the form of key-value pairs
{
"userId": "user_123",
"visitCount": 42,
"lastVisit": "2023-04-01"
}
Response
Successfully created a checkout session
Unique identifier for the object.
String representing the environment.
test, prod, sandbox String representing the object's type. Objects of the same type share the same value.
Status of the checkout.
pending, processing, completed, expired "completed"
The product associated with the checkout session.
Identify and track each checkout request.
The number of units for the of the product.
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.
1500
The order associated with the checkout session.
The subscription associated with the checkout session.
The customer associated with the checkout session.
Additional information collected from your customer during the checkout process.
The URL to which the customer will be redirected to complete the payment.
The URL to which the user will be redirected after the checkout process is completed.
"https://example.com/return"
License keys issued for the order.
DEPRECATED: Use license_keys instead. Features issued for the order.
Metadata for the checkout in the form of key-value pairs
{
"userId": "user_123",
"visitCount": 42,
"lastVisit": "2023-04-01"
}
The discount applied to the checkout, if any.