API Reference · Checkout Sessions

Expire a checkout session

Transitions an OPEN session to EXPIRED immediately.

POST/v1/checkout/sessions/:id/expire

Useful for invalidating a session after your customer abandons the flow in your own UI, before the 24-hour auto-expire fires. Returns 409 if the session is already COMPLETE or EXPIRED.

Path parameters

idstringRequired

Session id (`cs_…`).

Errors

404
resource_missing

No session exists with that id.

409
session_not_open

Session is already COMPLETE or EXPIRED.