Skip to main content
POST
Checkout Sessions
A checkout session prices one tool call, takes payment, and runs the tool. Create it, update it if the input changes, then complete or cancel it within 30 minutes. Completing it returns a request_id you poll for results.
Paid endpoints accept optional memo (≤ 1000 chars) and decisionContext (object) body fields, stored on the receipt. See Audit Trail.

Session lifecycle

A new session is ready_for_payment. completed and canceled are terminal: no update, complete or cancel after either. Sessions expire after 30 minutes; an expired session cannot be completed or updated.

Create session

Response (201)


Retrieve session

A completed session includes an order:

Update session

Send buyer, line_items, or both, while status is ready_for_payment. Changing item.id to another product updates the price.

Complete session

Charges a Stripe SharedPaymentToken and starts the tool. Poll GET /v1/requests/{request_id} with the returned request_id.

Response (200)

Errors

Check order.status even on HTTP 200: if payment succeeds but the tool fails, the response has status: "completed" and order.status: "failed", with error_code and a generic error. Errors carry a machine-readable code and a generic message. Branch on code:
A missing session returns 404 with type: "not_found" and no code.

Cancel session

Allowed while status is ready_for_payment or not_ready_for_payment.