Cancel Checkout Session
Checkout Session
Cancel Checkout Session
Cancels a checkout session.
POST
Cancel 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 or view orders in the Publisher Dashboard.
How cancellation works
- A player visits your web store and selects an offer to purchase.
- Your web store calls the Create Checkout Session endpoint to create a checkout session.
- The player is redirected to Appcharge Checkout.
- 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.
- After the player exits, call the Cancel Checkout Session endpoint to cancel the session.
- 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.
Headers
Authorization header in the format: Bearer ${checkoutSessionToken}.
The checkout session token is retrieved from the Create Checkout Session API and serves as the checkout session ID.
Example:
"Bearer ba5af26a21ec497cb1551821c630d9f9"
Response
Result.
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, or view the list of orders in the Publisher Dashboard.
