Checkout sessions

Checkout sessions create Flint-hosted payment pages for a single buyer. Each session is backed by an order: pass order_id to collect payment for an order you already created, quick_pay_item to have Flint create a simple one-time order for you, or plan_id to run hosted subscription signup from a subscription plan. The create response returns a tokenized buyer-facing url you redirect or link the buyer to.

Sessions are single-use. Generic sessions are short-lived (24 hours by default); invoice-owned sessions last for the life of the invoice's payment link. A session is open until the buyer completes payment, a mixed terminal attempt settles only part of the balance, you close it, it expires, or its source invalidates it. Terminal statuses are paid, partially_paid, closed, expired, and invalidated; terminal_reason explains the exact transition, including payment_succeeded and payment_partially_succeeded. Flint allows only one active session per order at a time. Creating another session for the same order returns CHECKOUT_SESSION_ALREADY_EXISTS unless you explicitly compare and replace the current session with replace_checkout_session_id. Configuration (theme, tipping, customer collection requirements, redirects, legal links, and expiration) is fixed at creation, and only metadata is mutable afterward.

Start with the Checkout sessions guide. Not sure whether you need a checkout session, a payment link, or an invoice? See Payment links vs checkout sessions vs invoices.

The Checkout session object#

Every field on a checkout session, as returned by retrieve and carried by the endpoints below.

Attributes
active_payment_attemptobject
checkout_session_idstringrequired
closed_reasonstring

Internal reason supplied when the checkout session was closed. This is not shown to the buyer.

created_atstring

RFC3339 timestamp.

custom_textobject
customerobject or null
customer_collectionobject
delivery_method_idsarray of stringrequired

Immutable delivery method assignment captured when the checkout was created.

delivery_pinned_dependenciesarray of object

Merchant-only immutable configuration lineage used to evaluate delivery quotes.

delivery_selection_requiredbooleanrequired

Whether the order has at least one remaining quote-resolved fulfillment choice that must be selected before payment.

expirationobject
expires_atstring

RFC3339 timestamp.

external_reference_idstring

Caller-owned identifier for this resource in an external system.

fulfillmentone of

Current fulfillment choices for Flint-owned pricing. Checkout credentials receive the fields available to buyers; merchant credentials also receive configuration lineage and diagnostics. External pricing reports requires_explicit_quote; reading this field does not request a delivery quote.

invoiceobject or null
invoice_idstring
legalobject
merchant_idstring
metadatamap of string
orderobject or null
order_idstring
originenum
virtual_terminalpayment_linkcheckoutapisubscription
payment_collectionobject
payment_intent_idstring
payment_intent_idsarray of string
payment_intentsarray of object
payment_linkobject or null
payment_link_idstring
paymentsobject
plan_idstring
problemsarray of objectrequired

Named conditions that affect checkout completion. Follow each problem's remediation action instead of reconstructing delivery lifecycle rules in the client.

promotion_configobject
recovery_expires_atstring or null

RFC3339 deadline for the restricted payment-attempt recovery window.

recovery_modebooleanrequired

Whether this terminal session credential is temporarily restricted to recovering its owning payment attempt.

recovery_payment_attempt_idstring

Payment attempt that this checkout credential may recover while recovery_mode is true.

redirectsobject
setup_collectionobject
statusenumrequired
openpaidpartially_paidexpiredclosedinvalidated
superseding_checkout_session_idstring
surfaceenumrequired
hostedembedded
taxobject
terminal_reasonenum
payment_succeededpayment_partially_succeededexpiredapiorder_mutatedsupersededinvoice_paid_elsewhereinvoice_voidedinvoice_uncollectible
themeobject
tipobject
updated_atstring

RFC3339 timestamp.

urlstring
JSON
{
  "checkout_session_id": "cs_123",
  "created_at": "2026-03-17T14:30:00Z",
  "customer_collection": {
    "require_email": true
  },
  "delivery_method_ids": null,
  "delivery_selection_required": false,
  "merchant_id": "mer_123",
  "metadata": {
    "campaign": "spring_launch"
  },
  "order_id": "ord_123",
  "origin": "api",
  "payments": {
    "enabled_payment_options": [
      "card",
      "apple_pay",
      "google_pay"
    ],
    "payment_note": "Thank you for your purchase."
  },
  "problems": [],
  "promotion_config": {
    "codes_enabled": true
  },
  "recovery_mode": false,
  "redirects": {
    "cancel_redirect_url": "https://example.com/canceled",
    "success_redirect_url": "https://example.com/success"
  },
  "status": "open",
  "surface": "hosted",
  "theme": {
    "primary_color": "#0f766e",
    "title": "Spring Gala Checkout"
  },
  "updated_at": "2026-03-17T14:30:00Z",
  "url": "https://checkout.withflintpay.com/checkout/cs_123#checkout_token=tok_123"
}

List checkout sessions#

GET/v1/checkout-sessionsRequires scope: checkouts.checkout_sessions.read or checkouts.checkout_sessions.write

Returns a paginated list of checkout sessions for the authenticated merchant.

Query parameters
page_sizeinteger

Page size, default 20, max 100.

page_tokenstring

Cursor returned by the previous list response.

statusenum

Filter by checkout session status.

openpaidpartially_paidexpiredclosedinvalidated
order_idstring

Filter by Flint order ID.

payment_link_idstring

Filter by Flint payment link ID.

customer_idstring

Filter by Flint customer ID.

originenum

Filter by checkout session origin.

virtual_terminalpayment_linkcheckoutapisubscription
external_reference_idstring

Exact-match filter on the caller-owned external reference ID.

querystring

Search across checkout session ID, external reference ID, metadata, and payment notes.

sort_byenum

Sort field.

created_atupdated_at
sort_directionenum

Sort direction.

ascdesc
created_afterstring

RFC3339 lower bound for created_at.

created_beforestring

RFC3339 upper bound for created_at.

updated_afterstring

RFC3339 lower bound for updated_at.

updated_beforestring

RFC3339 upper bound for updated_at.

expires_afterstring

RFC3339 lower bound for expires_at.

expires_beforestring

RFC3339 upper bound for expires_at.

Response · 200
dataarray of objectrequired
metaobject
next_page_tokenstring
request_idstring

Error codes

AUTH_REQUIREDINSUFFICIENT_SCOPEINVALID_API_KEYINVALID_REQUESTRATE_LIMIT_EXCEEDED
Bash
curl https://api.withflintpay.com/v1/checkout-sessions \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"
JSON
{
  "data": [
    {
      "checkout_session_id": "cs_123",
      "created_at": "2026-03-17T14:30:00Z",
      "customer_collection": {
        "require_email": true
      },
      "delivery_method_ids": null,
      "delivery_selection_required": false,
      "merchant_id": "mer_123",
      "metadata": {
        "campaign": "spring_launch"
      },
      "order_id": "ord_123",
      "origin": "api",
      "payments": {
        "enabled_payment_options": [
          "card",
          "apple_pay",
          "google_pay"
        ],
        "payment_note": "Thank you for your purchase."
      },
      "problems": [],
      "promotion_config": {
        "codes_enabled": true
      },
      "recovery_mode": false,
      "redirects": {
        "cancel_redirect_url": "https://example.com/canceled",
        "success_redirect_url": "https://example.com/success"
      },
      "status": "open",
      "surface": "hosted",
      "theme": {
        "primary_color": "#0f766e",
        "title": "Spring Gala Checkout"
      },
      "updated_at": "2026-03-17T14:30:00Z",
      "url": "https://checkout.withflintpay.com/checkout/cs_123#checkout_token=tok_123"
    }
  ],
  "next_page_token": "Zm9yd2FyZC1vbmx5LW9wYXF1ZS1jdXJzb3I",
  "request_id": "bce56cba-0827-44aa-bb56-4f200ba15ee6"
}

Create checkout session#

POST/v1/checkout-sessionsIdempotentRequires scope: checkouts.checkout_sessions.write

Creates a hosted or embedded checkout session for an order, quick-pay charge, or subscription plan signup. Creation never implicitly replaces an open order session. To replace one, send order_id with replace_checkout_session_id set to the expected current session; the compare-and-swap replacement and collection-lock transfer commit atomically.

Request body
order_idobject
quick_pay_itemobject
plan_idobject
payment_intent_idobject
Response · 201
dataobjectrequired

Checkout-session access returned for hosted or embedded checkout creation.

metaobject
request_idstring

Error codes

AUTH_REQUIREDEMBEDDED_PAYMENT_RETURN_URL_REQUIREDINSUFFICIENT_SCOPEINVALID_API_KEYINVALID_REQUESTRATE_LIMIT_EXCEEDEDREQUEST_TIMEOUTSERVICE_UNAVAILABLE
Bash
curl -X POST https://api.withflintpay.com/v1/checkout-sessions \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "customer_collection": {
      "require_email": true
    },
    "metadata": {
      "campaign": "spring_launch"
    },
    "payments": {
      "enabled_payment_options": [
        "card",
        "apple_pay",
        "google_pay"
      ],
      "payment_note": "Thank you for your purchase."
    },
    "promotion_config": {
      "codes_enabled": true
    },
    "quick_pay_item": {
      "amount_money": {
        "amount": 2500,
        "currency": "USD"
      },
      "name": "Service Fee"
    },
    "redirects": {
      "cancel_redirect_url": "https://example.com/canceled",
      "success_redirect_url": "https://example.com/success"
    },
    "theme": {
      "primary_color": "#0f766e",
      "title": "Spring Gala Checkout"
    }
  }'

Get checkout session#

GET/v1/checkout-sessions/{checkout_session_id}Requires scope: checkouts.checkout_sessions.read or checkouts.checkout_sessions.write

Returns a single checkout session by ID.

Path parameters
checkout_session_idstringrequired

Flint checkout session ID.

Query parameters
expandarray of enum

Supported expansions: customer, invoice, order, payment_intents, payment_link. Expansion requires checkouts.checkout_sessions.read plus the read scope for each expanded resource. Limits: at most 10 unique expand paths per request; path depth at most 2. To-many expansions are capped at 20 related objects per path. Repeat expand, for example expand=customer&expand=invoice, or pass one comma-separated value.

customerinvoiceorderpayment_intentspayment_link
Response · 200
dataobjectrequired
metaobject
request_idstring

Error codes

AUTH_REQUIREDDANGLING_EXPANSION_REFERENCEEXPANSION_DEPENDENCY_UNAVAILABLEEXPANSION_RESOLUTION_FAILEDINSUFFICIENT_SCOPEINTERNAL_ERRORINVALID_API_KEYINVALID_REQUESTRATE_LIMIT_EXCEEDEDRESOURCE_NOT_FOUNDSERVICE_UNAVAILABLE
Bash
curl https://api.withflintpay.com/v1/checkout-sessions/cs_123 \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"
JSON
{
  "data": {
    "checkout_session_id": "cs_123",
    "created_at": "2026-03-17T14:30:00Z",
    "customer_collection": {
      "require_email": true
    },
    "delivery_method_ids": null,
    "delivery_selection_required": false,
    "merchant_id": "mer_123",
    "metadata": {
      "campaign": "spring_launch"
    },
    "order_id": "ord_123",
    "origin": "api",
    "payments": {
      "enabled_payment_options": [
        "card",
        "apple_pay",
        "google_pay"
      ],
      "payment_note": "Thank you for your purchase."
    },
    "problems": [],
    "promotion_config": {
      "codes_enabled": true
    },
    "recovery_mode": false,
    "redirects": {
      "cancel_redirect_url": "https://example.com/canceled",
      "success_redirect_url": "https://example.com/success"
    },
    "status": "open",
    "surface": "hosted",
    "theme": {
      "primary_color": "#0f766e",
      "title": "Spring Gala Checkout"
    },
    "updated_at": "2026-03-17T14:30:00Z",
    "url": "https://checkout.withflintpay.com/checkout/cs_123#checkout_token=tok_123"
  },
  "request_id": "bce56cba-0827-44aa-bb56-4f200ba15ee6"
}

Update checkout session#

PATCH/v1/checkout-sessions/{checkout_session_id}IdempotentRequires scope: checkouts.checkout_sessions.write

Updates mutable checkout session fields. Currently only metadata is mutable.

Path parameters
checkout_session_idstringrequired

Flint checkout session ID.

Request body
external_reference_idstring

Caller-owned identifier for this resource in an external system.

metadatamap of string or null

Caller-owned metadata. Omit this field to leave metadata unchanged. Send an object to merge by key, set a key to null to remove it, or set metadata to null to clear all metadata. An empty object makes no change. Empty strings are stored. Keys starting with flint_ are reserved and cannot be written through the public API.

Response · 200
dataobjectrequired
metaobject
request_idstring

Error codes

AUTH_REQUIREDINSUFFICIENT_SCOPEINVALID_API_KEYINVALID_REQUESTRATE_LIMIT_EXCEEDEDREQUEST_TIMEOUTRESOURCE_LIMIT_EXCEEDEDRESOURCE_NOT_FOUNDSERVICE_UNAVAILABLE
Bash
curl -X PATCH https://api.withflintpay.com/v1/checkout-sessions/cs_123 \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "metadata": {
      "campaign": "spring_launch",
      "channel": "email"
    }
  }'

Close checkout session#

POST/v1/checkout-sessions/{checkout_session_id}/closeIdempotentRequires scope: checkouts.checkout_sessions.write

Closes an open checkout session before it naturally expires.

Path parameters
checkout_session_idstringrequired

Flint checkout session ID.

Request body
reasonstring

Internal reason for closing the checkout session. This is not shown to the buyer.

Response · 200
dataobjectrequired
metaobject
request_idstring

Error codes

AUTH_REQUIREDINSUFFICIENT_SCOPEINVALID_API_KEYINVALID_REQUESTRATE_LIMIT_EXCEEDEDREQUEST_TIMEOUTRESOURCE_NOT_FOUNDSERVICE_UNAVAILABLE
Bash
curl -X POST https://api.withflintpay.com/v1/checkout-sessions/cs_123/close \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "reason": "Merchant closed stale session"
  }'

Query checkout pickup availability#

POST/v1/checkout-sessions/{checkout_session_id}/query-pickup-availabilityRequires scope: commerce.delivery.read or commerce.delivery.write

Computes a bounded, non-holding pickup-location projection from current checkout authority and one inventory snapshot. Merchant-authenticated requests include configured Location diagnostics; checkout credentials receive only buyer-safe results.

Path parameters
checkout_session_idstringrequired

Flint checkout session ID.

Request body
buyer_locationone of
expected_delivery_selection_idstring
maximum_distanceobject
Response · 200
dataobjectrequired
metaobject
request_idstring

Error codes

AUTH_REQUIREDDELIVERY_CALCULATION_EXPIREDDELIVERY_CALLER_RATES_UNAVAILABLE_TO_BUYERDELIVERY_COMMERCE_TREATMENT_UNSUPPORTEDDELIVERY_DESTINATION_INVALIDDELIVERY_ELIGIBILITY_CONTEXT_CHANGEDDELIVERY_FIELD_NOT_SUPPORTEDDELIVERY_FIELD_REQUIREDDELIVERY_GROUPING_UNSUPPORTEDDELIVERY_MERCHANT_INPUT_REQUIREDDELIVERY_METHOD_SERVICE_UNAVAILABLEDELIVERY_PICKUP_AVAILABILITY_CHANGEDDELIVERY_PICKUP_AVAILABILITY_INVALIDDELIVERY_PICKUP_AVAILABILITY_UNAVAILABLEDELIVERY_PICKUP_LOCATION_UNAVAILABLEDELIVERY_QUOTE_BASIS_INVALIDDELIVERY_QUOTE_EXPIREDDELIVERY_QUOTE_INCOMPLETEDELIVERY_QUOTE_INPUT_CHANGEDDELIVERY_QUOTE_INVALIDDELIVERY_QUOTE_REVOKEDDELIVERY_QUOTE_STALEDELIVERY_QUOTE_UNAVAILABLEDELIVERY_REQUEST_INVALIDDELIVERY_SERVICE_UNAVAILABLEDELIVERY_WINDOW_EXPIREDDELIVERY_WINDOW_INVALIDINSUFFICIENT_SCOPEINVALID_REQUESTRATE_LIMIT_EXCEEDEDRESOURCE_NOT_FOUNDSERVICE_UNAVAILABLE
Bash
curl -X POST https://api.withflintpay.com/v1/checkout-sessions/cs_123/query-pickup-availability \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "buyer_location": {
      "type": "address"
    },
    "expected_delivery_selection_id": "",
    "maximum_distance": {
      "unit": "meters",
      "value": 0
    }
  }'
Rate this doc