Skip to main content
POST
Create a new checkout session

Body

application/json
product_id
string
required

UUID of the product to purchase.

variant_id
string

Optional UUID of the specific product variant.

customer_email
string

Pre-fill the buyer email address on the checkout form.

discount_code
string
affiliate_code
string
splits
object[]
success_url
string

URL to redirect the buyer to after a successful payment. Supports dynamic placeholders: {CHECKOUT_SESSION_ID} (or {CHECKOUT_ID}), {ORDER_ID}, {SUBSCRIPTION_ID}, and {PAYMENT_INTENT_ID}.

cancel_url
string
ui_mode
string
return_url
string

Fallback redirect URL (alias for success_url / cancel_url). Supports {CHECKOUT_SESSION_ID}, {ORDER_ID}, {SUBSCRIPTION_ID}, and {PAYMENT_INTENT_ID}.

metadata
object

Optional key-value metadata object. If custom_data is omitted, metadata is automatically used as custom_data.

custom_data
object

Arbitrary JSON object to attach to the checkout session (e.g., {"user_id": "usr_123"}). Persisted onto the resulting Order and Subscription (custom_data) and echoed back verbatim at data.custom_data in checkout.created, order.created, order.paid, and all subscription.* webhooks.

seat_quantity
integer

Pre-filled seat quantity

options
object
custom_checkout_id
string

UUID of the custom checkout design

lock_email
boolean
default:false

When true (and customer_email is provided), locks the email input on the checkout page so the buyer cannot modify it.

Response

Checkout session created

data
object