Lock product version, pricing, and currency for checkout
Create a checkout session that locks product version, pricing, and currency. This is the first step in the checkout flow for both one-time and subscription products.The typical flow is:
Merchant creates a checkout session (server-side)
Returns checkoutUrl to the frontend
Buyer clicks the link and lands on the hosted checkout page
Buyer fills in billing details, previews tax, and completes the order
When a checkout session is created, the following values are locked and cannot change during the session lifetime:productVersionId, productName, priceInfo, storeName, billingPeriod, withTrial, theme, buyerEmail, billingDetail
Billing detail validation failed (e.g. missing state for US)
401
Unauthorized
Invalid API Key signature or Store Slug
403
Store not active
The store is not in active status
403
Store not production enabled
Store cannot process live payments
403
Product not in store
The product does not belong to the specified store
404
Store not found
No store matches the given storeId or slug
404
Product not found
No product matches the given productId
The default session TTL is 45 minutes (2700 seconds). When using API Key auth, you can customize this with expiresInSeconds. Sessions lock the product version and pricing at creation time, so price changes will not affect existing sessions.