Cancel checkout session before payment processing

Cancel a checkout session before payment processing starts or contract is created.

Common use cases:

  • Customer abandonment: Track when customers decide not to proceed with purchase
  • Duplicate removal: Cancel sessions when creating new ones with different terms
  • Expiration handling: Clean up sessions that have reached their expiry time
  • Fraud prevention: Cancel sessions flagged by risk management systems

Behavior & restrictions:

  • Only 'open' sessions can be cancelled
  • Sessions with payment_status 'pending' or 'paid' cannot be cancelled
  • Provide optional cancellation context using standardized reason types:
    • customer_requested: When customer explicitly cancels
    • payment_failed: When payment attempt unsuccessful
    • expired: When session reaches expiration time
    • duplicate: When another session supersedes this one
    • fraudulent: When fraud risk detected
    • other: For any other reason (requires explanation)

Related endpoints:

  • POST /checkout_session: Creates a session that may later be cancelled
  • GET /checkout_session/{id}: Check session status before cancelling
  • PUT /checkout_session/{id}: Alternative to cancellation when modifications needed

Errors include not-open sessions, disallowed payment status, and invalid status transitions.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
uuid
required
Body Params
enum

Standard categorization of the cancellation reason

length ≤ 500

Detailed explanation for why the checkout session is being cancelled. This will be stored for audit purposes.

External reference ID related to this cancellation (e.g., support ticket number)

Responses

Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json