---
title: "Cancel checkout session"
method: POST
path: "/checkout/sessions/{id}/cancel"
tags: ["Checkout"]
---

# Cancel checkout session

`POST /checkout/sessions/{id}/cancel`

## Path parameters

- `id` string, required

## Response `200`

OK

- CheckoutSessionResponse
  - `action` 'create_subscription' | 'modify_subscription' | 'wallet_topup' | 'add_addon' | 'pay_invoice'
  - `cancel_url` string
  - `cancelled_at` string, date-time
  - `checkout_invoice_id` string
  - `checkout_payment_id` string
  - `checkout_status` 'initiated' | 'pending' | 'completed' | 'failed' | 'expired'
  - `completed_at` string, date-time
  - `created_at` string, date-time
  - `customer_id` string
  - `entity_creation_result` EntityCreationResult
    - `entity_id` string
    - `status` 'created' | 'superseded' | 'failed_already_exists'
  - `expires_at` string, date-time
  - `failure_reason` string
  - `failure_url` string
  - `id` string
  - `idempotency_key` string
  - `metadata` TypesMetadata
  - `next_poll_after_ms` integer — NextPollAfterMs is how long a client should wait before reading again. Zero means stop — either the session is terminal, or this response did not come from a polling read.
  - `payment` CheckoutPaymentBlock
    - `gateway` string
    - `id` string
    - `status` 'INITIATED' | 'PENDING' | 'PROCESSING' | 'SUCCEEDED' | 'OVERPAID' | 'FAILED' | 'REFUNDED' | 'PARTIALLY_REFUNDED' | 'VOIDED'
  - `payment_action` TypesPaymentAction
    - `type` 'checkout_url' | 'payment_link'
    - `url` string
  - `payment_provider` 'razorpay' | 'chargebee'
  - `stale` boolean — Stale reports that this response is stored state that was not checked against the payment provider on this request — the read was debounced, or the gateway did not answer. A UI should say "still checking" rather than presenting a stale answer as fact.
  - `success_url` string
  - `terminal` boolean — Terminal reports whether the session has finished. Clients poll until this is true rather than hardcoding the status set, which would go stale if a status is ever added.
  - `updated_at` string, date-time

## Other responses

- `400` — Bad Request
- `404` — Not Found
- `500` — Internal Server Error

## Changes

- **2026-09-21** `15dcbc3c880b` — 1 info
  - added the optional property `entity_creation_result` to the response with the `200` status
- **2026-09-21** `56ac1e6adeb7` — 1 warning
  - removed the optional property `entity_creation_result` from the response with the `200` status
- **2026-09-21** `0aa0bf7c01e1` — 1 info
  - added the optional property `entity_creation_result` to the response with the `200` status
- **2026-09-14** `b1cf963a4fcb` — 1 info
  - endpoint added
- **2026-09-14** `9df16a2f0f84` — 1 breaking
  - api path removed without deprecation

[Full history](https://skmtc.dev/flexprice/apis/flexprice-api/changes/checkout/sessions/:id/cancel/post.md)

---

[API](https://skmtc.dev/flexprice/apis/flexprice-api.md) · [All operations](https://skmtc.dev/flexprice/apis/flexprice-api/llms.txt) · [OpenAPI document](https://skmtc.dev/flexprice/apis/flexprice-api/revisions/19bac1b92501?raw)
