/v1/checkout_sessions
/v1/checkout_sessions[checkout_api] create checkout session + line_items
Security: gated; the registry declares no role list for this surface.
Header Parameters
Client-supplied idempotency key. Required on every registry-idempotent door.
1 <= lengthRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/checkout_sessions" \ -H "Idempotency-Key: string" \ -H "Content-Type: application/json" \ -d '{ "currency": "string", "amount": 0, "amount_subtotal": 0, "amount_total": 0, "line_items": [ { "quantity": 1, "amount_subtotal": 0, "price_data": { "currency": "string", "unit_amount": 0, "product_data": { "name": "string" } } } ] }'{ "id": "string", "object": "checkout.session", "mode": "test", "ui_mode": "hosted", "status": "string", "payment_status": "string", "currency": "string", "amount": 0, "amount_subtotal": 0, "amount_discount": 0, "amount_shipping": 0, "amount_tax": 0, "amount_total": 0, "success_url": "string", "cancel_url": "string", "return_url": "string", "notify_url": "string", "description": "string", "customer_email": "string", "locale": "string", "metadata": { "property1": "string", "property2": "string" }, "expires_at": 0, "created_at": 0, "line_items": { "object": "list", "data": [ { "product_name": "string", "description": "string", "images": [ "string" ], "tax_behavior": "inclusive", "quantity": 0, "unit_price": 0, "currency": "string", "amount_subtotal": 0, "amount_discount": 0, "amount_tax": 0, "amount_total": 0 } ] }}{ "request_id": "string", "error": { "type": "invalid_request", "message": "string", "param": "string", "errors": [ { "param": "string", "code": "string", "message": "string", "allowed": [ "string" ] } ], "next_step": { "type": "string", "path": "string", "method": "string" }, "code": "invalid_param" }}{ "request_id": "string", "error": { "type": "invalid_request", "message": "string", "param": "string", "errors": [ { "param": "string", "code": "string", "message": "string", "allowed": [ "string" ] } ], "next_step": { "type": "string", "path": "string", "method": "string" }, "code": "invalid_api_key" }}{ "request_id": "string", "error": { "type": "invalid_request", "message": "string", "param": "string", "errors": [ { "param": "string", "code": "string", "message": "string", "allowed": [ "string" ] } ], "next_step": { "type": "string", "path": "string", "method": "string" }, "code": "invalid_amount" }}{ "request_id": "string", "error": { "type": "invalid_request", "message": "string", "param": "string", "errors": [ { "param": "string", "code": "string", "message": "string", "allowed": [ "string" ] } ], "next_step": { "type": "string", "path": "string", "method": "string" }, "code": "origin_not_allowed" }}{ "request_id": "string", "error": { "type": "invalid_request", "message": "string", "param": "string", "errors": [ { "param": "string", "code": "string", "message": "string", "allowed": [ "string" ] } ], "next_step": { "type": "string", "path": "string", "method": "string" }, "code": "idempotency_conflict" }}