Skip to main content
POST
Cancel a checkout
Cancelling stops a payment that is not yet complete, then closes the checkout. It only works while the checkout is open (400 otherwise).A 409 has a code:
  • session_already_paid: the buyer paid before the cancel. The payment is booked and you receive checkout.session.completed.
  • payment_in_progress: a payment is still processing. Try again in a few minutes.
A 409 with no code means the checkout was modified concurrently.
Webhook: none. An unpaid checkout has no payment to report. See Which action fires which event.

Authorizations

x-api-key
string
header
required

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

sessionId
string
required

The public session_id (not the internal id UUID).

Response

The checkout was cancelled.

success
boolean
required