Cancel a checkout
Stops the buyer from paying. If a payment already cleared before the cancel call lands, it still completes: cancelling doesn’t reach into the card processor or on-chain state after the fact. Only works while the checkout is open (400 otherwise).
open (400 otherwise).A 409 has a code:session_already_paid: the buyer paid before the cancel. The payment is booked and you receivecheckout.session.completed.payment_in_progress: a payment is still processing. Try again in a few minutes.
409 with no code means the checkout was modified concurrently.Authorizations
Your secret key, from app.agentaos.ai -> Settings -> Developers -> API Keys. The key's prefix is both its identity and its environment: sk_test_... (sandbox, free, no verification) or sk_live_... (real money, requires business verification). A missing or invalid key returns 401.
Path Parameters
The public session_id (not the internal id UUID).
Response
The checkout was cancelled.