> ## Documentation Index
> Fetch the complete documentation index at: https://docs.appcharge.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel Checkout Session

> Cancels a checkout session.

Cancel a checkout session to prevent additional payments from using the same checkout URL.

Canceling a checkout session doesn't affect the associated order. To monitor the order status, use [order events](../../events/introduction#order-events) or [view orders](/../../guides/publisher-dashboard/view-orders) in the Publisher Dashboard.

## How cancellation works

1. A player visits your web store and selects an offer to purchase.
2. Your web store calls the [Create Checkout Session](./create-checkout-session) endpoint to create a checkout session.
3. The player is redirected to Appcharge Checkout.
4. The player exits checkout without completing the purchase. For example, the player clicks the **X** button in checkout, navigates away from the checkout page, or closes the browser tab.
5. After the player exits, call the Cancel Checkout Session endpoint to cancel the session.
6. Appcharge notifies your web store with `{"isOrderCancelled": true}`.

## Response behavior

`{"isOrderCancelled": true}` means the session reference is no longer active. This response is also returned when the authorization header is invalid or missing.

To confirm that the checkout session was canceled, try to complete a payment using the same checkout URL:

* A canceled session returns an error.
* An active session doesn't return an error. Check that you're sending the correct authorization header.


## OpenAPI

````yaml openapi-cancel-checkout-session.json POST /checkout/v3/cancel
openapi: 3.0.3
info:
  title: Cancel Checkout Session API
  description: Cancels a checkout session
  version: 1.0.0
servers:
  - url: https://api.appcharge.com
security: []
paths:
  /checkout/v3/cancel:
    post:
      summary: Cancel Checkout Session
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            example: Bearer ba5af26a21ec497cb1551821c630d9f9
          description: >-
            Authorization header in the format: `Bearer
            ${checkoutSessionToken}`. 

             The checkout session token is retrieved from the [Create Checkout Session API](/../../api-reference/checkout/checkout-session/create-checkout-session) and serves as the checkout session ID.
      responses:
        '200':
          description: Result.
          content:
            application/json:
              schema:
                type: object
                properties:
                  isOrderCancelled:
                    type: boolean
                    description: >-
                      Whether the checkout session is no longer available, and
                      can't accept further payments. **Note:** This property
                      only reflects the cancellation of the session, not the
                      order. To track order status, listen for [Order
                      Events](../../events/introduction#order-events), or [view
                      the list of
                      orders](/../../guides/publisher-dashboard/view-orders) in
                      the Publisher Dashboard.
        '400':
          description: Bad request.
        '401':
          description: Unauthorized - invalid or missing token.
        '500':
          description: Internal server error.

````