Create checkout session
Creates a checkout session with a 6-hour TTL. Returns a checkout_url that you can redirect customers to, or use the session ID to build a custom checkout experience. Supports both catalog products (by product_id) and dynamic line items (by name + amount).
Path Parameters
Store ID (shp_ prefix)
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "https://example.com/stores/string/checkouts" \ -H "Content-Type: application/json" \ -d '{ "items": [ { "product_id": "string", "quantity": 1 } ] }'{ "ok": true, "data": { "id": "string", "title": "string", "description": "string", "checkout_url": "http://example.com", "pay_redirect_url": "http://example.com", "merchant": { "id": "string", "name": "string", "handle": "string", "slug": "string", "logo": "string", "favicon": "string", "accentColor": "string", "primaryColor": "string", "statementDescriptor": "string", "supportEmail": "string" }, "amount": 0, "discount_amount": 0, "tax_amount": 0, "total_amount": 0, "coupon": { "code": "string", "discount_amount": 0 }, "items": [ { "name": "string", "amount": 0, "quantity": 0, "image": "string" } ], "display": {}, "metadata": { "property1": "string", "property2": "string" }, "return_url": "string", "cancel_url": "string", "expires_at": 0 }}