Skip to main content
POST
/
v1
/
checkout
/
sessions
/
{id}
/
cancel
Cancel Auth Checkout Session
curl --request POST \
  --url https://api.withflex.com/v1/checkout/sessions/{id}/cancel \
  --header 'Authorization: Bearer <token>'
{
  "checkout_session": {
    "allow_promotion_codes": false,
    "amount_total": 0,
    "amount_subtotal": 0,
    "amount_received": 0,
    "amount_refunded": 0,
    "amount_disputed": 0,
    "cancel_url": "https://example.com",
    "captures": [],
    "disputes": [],
    "capture_method": "automatic",
    "checkout_session_id": "obj_01EXAMPLE00000000000000000",
    "client_reference_id": "string",
    "created_at": 0,
    "customer": "string",
    "defaults": {
      "customer_id": "obj_01EXAMPLE00000000000000000",
      "email": "john.doe@example.com",
      "first_name": "John",
      "last_name": "Doe",
      "phone": "+15555555555"
    },
    "expires_at": 0,
    "invoice": "obj_01EXAMPLE00000000000000000",
    "hsa_fsa_eligible": false,
    "letter_of_medical_necessity_required": false,
    "metadata": {},
    "mode": "payment",
    "origin": "shopify",
    "payment_intent": "string",
    "payment_intents": [],
    "redirect_url": "https://example.com",
    "refunds": [],
    "setup_intent": "string",
    "shipping_options": {
      "shipping_rate_id": "obj_01EXAMPLE00000000000000000",
      "shipping_amount": 0,
      "display_name": "Example"
    },
    "shipping_address_collection": false,
    "shipping_details": {
      "shipping_address_id": "obj_01EXAMPLE00000000000000000",
      "line1": "123 Main St",
      "line2": "Suite 100",
      "city": "San Francisco",
      "state": "CA",
      "postal_code": "94107",
      "country": "US"
    },
    "split_cart": "string",
    "status": "open",
    "success_url": "https://example.com",
    "fees": [
      {}
    ],
    "custom_text": {},
    "subscription": "string",
    "subscription_data": {
      "cancel_at": "2024-01-01T00:00:00Z",
      "cancel_at_period_end": false,
      "trial_period_days": 0
    },
    "tax_rate": {
      "amount": 0
    },
    "tax_calculation_mode": "exclusive",
    "test_mode": false,
    "total_details": {
      "amount_discount": 0,
      "amount_tax": 0,
      "amount_shipping": 0,
      "amount_iias": 0,
      "amount_vision": 0,
      "amount_prescription": 0,
      "amount_service": 0,
      "amount_fee": 0
    },
    "visit_type": "cbtSleep",
    "setup_future_use": "on_session",
    "payment_method_options": {},
    "next_action": {},
    "partner": "string",
    "platform_fees": {}
  }
}

Authorizations

Authorization
string
header
required

Use a Bearer token to access this API.

Path Parameters

id
string
required
Example:

"obj_01EXAMPLE00000000000000000"

Query Parameters

expand
string
default:""

Comma-separated list of related objects to expand in the response.

Example:

""

Response

Success

checkout_session
object
required
Example:
{
  "allow_promotion_codes": false,
  "amount_total": 0,
  "amount_subtotal": 0,
  "amount_received": 0,
  "amount_refunded": 0,
  "amount_disputed": 0,
  "cancel_url": "https://example.com",
  "captures": ["string"],
  "disputes": ["string"],
  "capture_method": "automatic",
  "checkout_session_id": "obj_01EXAMPLE00000000000000000",
  "client_reference_id": "string",
  "created_at": 0,
  "customer": "string",
  "defaults": {
    "customer_id": "obj_01EXAMPLE00000000000000000",
    "email": "john.doe@example.com",
    "first_name": "John",
    "last_name": "Doe",
    "phone": "+15555555555"
  },
  "expires_at": 0,
  "invoice": "obj_01EXAMPLE00000000000000000",
  "hsa_fsa_eligible": false,
  "letter_of_medical_necessity_required": false,
  "metadata": {},
  "mode": "payment",
  "origin": "shopify",
  "payment_intent": "string",
  "payment_intents": ["string"],
  "redirect_url": "https://example.com",
  "refunds": ["string"],
  "setup_intent": "string",
  "shipping_options": {
    "shipping_rate_id": "obj_01EXAMPLE00000000000000000",
    "shipping_amount": 0,
    "display_name": "Example"
  },
  "shipping_address_collection": false,
  "shipping_details": {
    "shipping_address_id": "obj_01EXAMPLE00000000000000000",
    "line1": "123 Main St",
    "line2": "Suite 100",
    "city": "San Francisco",
    "state": "CA",
    "postal_code": "94107",
    "country": "US"
  },
  "split_cart": "string",
  "status": "open",
  "success_url": "https://example.com",
  "fees": [
    {
      "fee_id": "ffee_1234567890",
      "amount": 0,
      "name": "Example",
      "description": "string",
      "fee_type": "lmn_consultation",
      "applied": true
    }
  ],
  "custom_text": {
    "after_submit": { "message": "string" },
    "shipping_address": { "message": "string" },
    "submit": { "message": "string" },
    "terms_of_service_acceptance": { "message": "string" },
    "payment": { "message": "string" }
  },
  "subscription": "string",
  "subscription_data": {
    "cancel_at": "2024-01-01T00:00:00Z",
    "trial_end": "string",
    "cancel_at_period_end": false,
    "trial_period_days": 0
  },
  "tax_rate": { "amount": 0 },
  "tax_calculation_mode": "exclusive",
  "test_mode": false,
  "total_details": {
    "amount_discount": 0,
    "amount_tax": 0,
    "amount_shipping": 0,
    "amount_iias": 0,
    "amount_vision": 0,
    "amount_prescription": 0,
    "amount_service": 0,
    "amount_fee": 0,
    "breakdown": { "discounts": [] }
  },
  "visit_type": "cbtSleep",
  "setup_future_use": "on_session",
  "payment_method_options": { "card": {} },
  "next_action": {
    "type": "collect_letter_of_medical_necessity",
    "collect_letter_of_medical_necessity": {}
  },
  "partner": "string",
  "platform_fees": {
    "letter_fee": { "amount": 0, "type": "string" }
  }
}