Skip to Content

Cancel Checkout

POST/checkouts/:checkoutId/cancel

Description

Cancels a pending checkout. If a payment was associated (direct or two_step) with a checkout session, the payment cascades to cancelled and a payment.cancelled webhook is fired.

⚠️

Cancellation is blocked once on-chain funds are observed — the customer’s deposit must settle or expire through the normal flow before the checkout can be released.

Headers

HeaderDescriptionRequired
AuthorizationBearer token with your API keyyes

Path Parameters

NameTypeDescriptionRequired
checkoutIdstringThe unique identifier of the checkout to cancel.yes

Example Request

const response = await fetch(
  'https://checkout.exodus.com/checkouts/chk_1234567890abcdef/cancel',
  {
    method: 'POST',
    headers: {
      Authorization: 'Bearer sk_live_xxxxxxxxxxxxxxxx',
    },
  }
);

Response

SUCCESSFUL CANCELLATION
{
  "id": "chk_1234567890abcdef",
  "object": "checkout",
  "amount": 5000,
  "currency": "USD",
  "description": "Premium Plan - Monthly",
  "status": "cancelled",
  "checkout_url": "https://checkout.exodus.com/pay/chk_1234567890abcdef",
  "success_url": "https://yoursite.com/success",
  "cancel_url": "https://yoursite.com/cancel",
  "customer_email": "[email protected]",
  "metadata": {
    "order_id": "12345"
  },
  "expires_at": "2024-01-16T12:00:00Z",
  "created_at": "2024-01-15T12:00:00Z",
  "cancelled_at": "2024-01-15T13:00:00Z"
}

Error Responses

NOT FOUND
{
  "error": {
    "type": "not_found",
    "message": "Checkout not found"
  }
}
NOT CANCELLABLE (409)
{
  "error": {
    "code": "checkout_not_cancellable",
    "message": "Checkout cannot be cancelled — it is already completed, expired, or cancelled"
  }
}
FUNDS IN FLIGHT (409)
{
  "error": {
    "code": "checkout_has_funds_in_flight",
    "message": "Customer funds are on-chain. Wait for settlement or expiry before cancelling."
  }
}

Start building

XO

Request Demo

Schedule a call with our team

Select a product
Arrow right

Start building
Grateful

Contact Us

We're here to help