Skip to content

Checkout sessions

A checkout session is one buyer's chance to pay one order. Flint either hosts the payment page, and you send the buyer to the session's url, or your storefront renders checkout itself and calls Flint with the session's checkout credential. Every session is backed by an order: the session collects payment, and the order holds what was sold, its total, and its payment state.

Use a session when a buyer pays now, in one sitting. A payment link is a reusable URL that starts a new session for each buyer, and an invoice collects a balance over time. Payment links vs checkout sessions vs invoices compares the three, and the Checkout sessions guide walks through a hosted checkout from creation to payment.

Delivery address country requirements come from the session's pinned delivery methods, including their eligibility and rate-table conditions. Read input_requirements[].constraint.supported_countries on the checkout session or delivery quote, and intersect across choice groups. Automatic tax adds the order's tax.supported_countries limit, currently ["US"]. Non-US automatic tax locations are not supported. Unrestricted delivery excludes CU, IR, KP, and SY; Crimea, Donetsk, and Luhansk are excluded when address data identifies them.

What a session collects#

type is fixed at creation. You create three types with POST /v1/checkout-sessions, and Flint creates the other two through other routes.

  • order: send order_id for an open order you built. The session uses the order's customer, tax, and lines, so set those on the order; customer_id and tax aren't accepted with this type. A return resolution's replacement order is also collected as order.
  • quick_pay: send quick_pay_item with a name and amount_money, and Flint creates a one-line order.
  • subscription_plan: send subscription_plan_id for an active plan. Flint creates the signup order and, once the buyer pays, the subscription.
  • invoice: created with type: invoice to collect the invoice's order. Its deadline comes from the invoice, not expires_in_seconds.
  • payment_link: started by POST /v1/payment-links/{payment_link_id}/resolve, which creates an order from the link for each buyer.
  • shop: started by POST /v1/shops/{shop_id}/resolve. The session carries shop_id. Filter GET /v1/checkout-sessions by that ID to list a shop's sessions.

Sessions started from payment links also have client_reference: the opaque buyer or cart reference carried by the URL or resolve request, or null when none was sent. It is immutable and readable only by merchant credentials, including checkout-session webhooks. Create and PATCH do not accept it. Unlike merchant-owned external_reference_id, it is buyer-editable before resolve and is not proof of identity. Resolve's prefill.email fills in an editable email without setting customer_id or customer_prefill.

They also return custom_field_answers, the buyer's answers to the link's custom fields, the same as on the session's order. It is read-only, readable only by merchant credentials, and empty for other sessions. See Orders.

A partner app token can send platform_fee on an order or quick_pay session to charge a platform fee on the payment it collects. The session's platform_fee shows the fee requested, readable only by merchant credentials, and each payment the session creates carries its own. To price a subscription signup and every renewal after it, send platform_fee_rule instead, on an order, quick_pay, or subscription_plan session. Live rules also require the app's owner to accept a Flint Platform Agreement version that covers rules. See Platform fees.

For quick_pay and subscription_plan, tax.enabled and tax.calculation set the tax of the order Flint creates. tax.calculation is {"mode": "automatic"} or {"mode": "external", "components_source": "callback"}, which asks your tax calculation callback once the buyer gives an address or picks delivery. External tax needs components_source: callback; without it the request returns 400 INVALID_REQUEST with detail code REQUIRED. Leave it out to follow tax.default_calculation, where a provided default means automatic. The session's tax returns what you set. See Tax at checkout.

Payment needs the buyer's email, which comes from the buyer's entry or their wallet, and Flint saves it on the customer.

For a subscription plan checkout, subscription_terms.line_items accepts partial quantity overrides such as [{"subscription_plan_line_item_id":"spli_1kmn0aExample","quantity":7}] on create and PATCH. Each ID must be distinct and belong to the plan. Omitted lines keep their quantities. Merchant credentials may set any line to 1 through 9,999. Checkout credentials may set only the line with allow_quantity_adjustment: true, within its frozen min_quantity and max_quantity (defaults 1 and 9,999). Read the IDs and policy in the session's subscription_terms.line_items. Changing line quantities reprices the signup order and its recurring terms together.

In a headless checkout that sells a subscription, pass the session's customer_account_url as Apple Pay's recurringPaymentRequest.managementURL, so the wallet sheet says where the buyer manages the subscription.

Prefill delivery details#

Send prefill.shipping_recipient_name on POST /v1/checkout-sessions. shipping_recipient_name: who receives the delivery. Send it with shipping_address so the buyer has nothing to type.

It is optional and accepted with or without prefill.shipping_address. Flint trims surrounding whitespace and keeps 1 to 200 characters. A blank or longer name returns 400 INVALID_REQUEST with detail INVALID_VALUE and param: prefill.shipping_recipient_name. Both your API key and the session's checkout credential read the stored value under prefill. The buyer can edit it, and it never changes the customer record. Pickup-only sessions and sessions without delivery accept it and don't use it.

JSON
{
  "type": "quick_pay",
  "quick_pay_item": {"name": "Coffee", "amount_money": {"amount": 1800, "currency": "USD"}},
  "prefill": {
    "shipping_recipient_name": "Alex Morgan",
    "shipping_address": {"line1": "123 Market Street", "city": "San Francisco", "state": "CA", "postal_code": "94103", "country": "US"}
  }
}

Payment-link resolve still accepts only prefill.email.

Apply promotions at creation#

For quick_pay and subscription_plan, send discounts with 1 to 10 entries, each containing promotion with either promotion_id or promotion_code. Flint prices them after the order's lines, subscription terms, customer, and tax inputs, and saves the order and session together. If a promotion can't be redeemed, neither record is created. With type: "order", apply discounts through POST /v1/orders/{order_id}/discounts instead.

Account promotion settings apply to these entries. Session promotion_config controls buyer actions, so you can set promotion_config.codes_enabled: false alongside a pre-applied offer to prevent buyers from adding codes. A code-type promotion still requires account codes to be enabled, including when selected by ID.

Flint ranks the entries as promotions already on the order. A ranking loss returns 201 with a promotion_declined warning in meta.warnings; an unredeemable promotion returns 409 PROMOTION_DECLINED. Read applied entries on order.discounts, or order.deferred_promotions for a trial, by expanding order on a session read or reading the order directly. By-ID entries have promotion_code: null; the buyer can't remove them. Eligible promotions survive buyer changes to subscription terms, address, and codes.

See Apply a promotion when you create a checkout session for an example.

Hosted or headless#

surface is also fixed at creation, and defaults to hosted.

surface: hosted

Hosted

Flint renders the payment page. Create and launch responses include url and omit checkout_auth_token. Send the buyer to url, and set where they land afterward with redirects (success_url, cancel_url, expired_url). Only a merchant credential reads url.

surface: headless

Headless

Your storefront renders checkout. Your backend keeps checkout_auth_token and relays the buyer's calls with it. Send page_origin to show a gift card challenge and payment_return_url for redirect payments such as Affirm. There's no url, and redirects isn't accepted.

Build your own checkout covers a headless integration end to end.

Who can call what#

A session answers to two credentials:

  • Your API key reaches every session. Use it to create, list, read, and close sessions, to update metadata and external_reference_id in any status, and to pay the order for the buyer, for example over the phone.
  • The checkout credential (ckat_), returned as checkout_auth_token by headless create and launch routes, reaches only its own session and that session's order. It does what the buyer does: saves buyer_contact and timezone, chooses delivery, applies codes and gift cards, requests and confirms verification codes, and pays the order. It can also confirm and cancel its own session's payment intents. After 3D Secure, confirm the action's payment intent without payment_source to continue the holding attempt. It can't close the session.

A read with the checkout credential leaves out url, metadata, external_reference_id, and closed_reason_message, and adds what the buyer's page needs, such as payment_collection, customer_prefill, the save-card fields, and merchant_support. The API reference marks each field a credential doesn't receive. What the checkout credential can do lists every call it can make.

The checkout credential requests a six-digit code with POST /v1/checkout-sessions/{checkout_session_id}/customer-verifications and confirms it on the confirm route. purpose says what the code unlocks: save_payment_method, use_saved_payment_methods, confirm_saved_payment_method, or gift_card_purchase, which lets a buyer with no customer record buy a gift card. Confirming an email returns a new checkout credential, and only that credential acts for the customer it confirms. See Confirm the buyer's email.

Texted customer verifications include code_route in create, read, and list responses: store for a number saved at this business, or flint_wallet for the buyer's enrolled wallet number in Flint's hosted checkout. The field is omitted for email and describes the original request, not current access to saved details. Its vocabulary is extensible; use generic code instructions for unrecognized values.

Listing saved cards without customer_id requires saved-card authority from the merchant's customer binding or a confirmed email or phone code. Without that authority, GET /v1/payment-methods returns 409 ACTION_NOT_ALLOWED, reason verification_required, and no param. Its top-level remediation.next_actions includes create_checkout_session_customer_verification with /v1/checkout-sessions/{checkout_session_id}/customer-verifications. Use purpose: use_saved_payment_methods with the supported email or phone flow, confirm the code, then list with the checkout credential returned by confirmation. A code may not be offered; the buyer can continue with a fresh card. An explicit customer outside the credential's authority stays concealed as 404 RESOURCE_NOT_FOUND. Linking the order to a customer alone grants no saved-card authority.

An ended checkout refuses operations outside its allowed reads with 409 ACTION_NOT_ALLOWED, reason terminal_status, its current_status, and the message "The checkout session has ended." Read the checkout to decide whether to start another session.

Status#

A session starts open and ends exactly once. terminal_reason says why it ended.

status on checkout session
Final values do not change again
  • open
    The buyer can pay.
  • paidFinal
    A payment through the session collected the full amount due: payment_succeeded.
  • partially_paidFinal
    A payment through the session settled part of the amount due: payment_partially_succeeded. Create a new session for the order to collect the rest.
  • expiredFinal
    The deadline in expires_at passed first: expired.
  • closedFinal
    You closed it: closed_by_merchant.
  • invalidatedFinal
    Something outside the session ended it. terminal_reason says what.

An invalidated session's terminal_reason is one of these:

  • superseded: a replacement session took its place, and superseding_checkout_session_id names it.
  • order_paid_elsewhere: a payment outside the session cleared the order's balance.
  • order_mutated: an order edit closed the order or left nothing to pay.
  • invoice_paid_elsewhere, invoice_voided, invoice_uncollectible, or invoice_balance_changed: the invoice was paid another way, voided, marked uncollectible, or its amount due changed.

A session lasts 24 hours unless you send expires_in_seconds, from 60 to 86,400, or the merchant set a different default; see Expiration. A session that reaches expires_at during a payment, for example on a 3D Secure screen, stays open with is_in_recovery: true until that one attempt finishes; see Finish a payment after expiry. Closing takes an optional reason_message, kept as closed_reason_message, which the buyer never sees.

After the session ends, its checkout credential can still read it, so the buyer's page can show the outcome. After a paid, partially_paid, or invalidated session, it can also read the order and its payments, and after a paid or partially_paid one it can send the receipt. Any other call returns 409 ACTION_NOT_ALLOWED with details[0].reason terminal_status. Your API key keeps full access; see After a session ends.

Flint sends a webhook when a session starts and when it ends. Fulfill from order.paid, which fires once the order is paid in full however it was paid. Check the order's dispute_status first (access rules).

Rules across a session#

One open session per order#

An order has at most one open session. Creating another returns 409 ALREADY_EXISTS with param: order_id and the open session in details[0].current_resource, which keeps working. To replace it on purpose, send its ID as replace_checkout_session_id with type: "order": the old session becomes invalidated with superseded. If a different session is now open, the request returns 409 VERSION_CONFLICT with that session in details[0].current_resource. Naming a closed or expired session when none is open creates the new session normally. See One open session per order.

A hosted session collects the order with one payment method. Creating one for an order with more than one unpaid payment intent returns 409 RESOURCE_IN_USE with those payment intents in details[0].blocking_resources; cancel the extra ones or use a headless session.

What can change after creation#

How checkout looks and behaves is set on POST /v1/checkout-sessions and stays fixed: theme, tip, buyer_fields, prefill, payments, promotion_config, legal, custom_text, tax, delivery_method_ids, redirects, expires_in_seconds, page_origin, and payment_return_url. Of these, only page_origin and the return destination can change, through the invoice and return-resolution launch routes; to change anything else, replace the session. These fields change after creation:

FieldWho changes it, and when
metadata, external_reference_idYour API key, with PATCH, in any status.
buyer_contact, timezoneThe checkout credential, with PATCH, while the session is open.
subscription_termsEither credential, with PATCH, while a subscription_plan session is open and no payment is running. A billing interval or quantity change reprices the signup order. gift_recipient is accepted only when subscription_terms.gifts_enabled is true, and leaves the price and delivery choice as they are. See Gifts at checkout.
page_origin and the return destinationThe invoice and return-resolution launch routes, when they reuse an open session. return_url applies only until a payment starts. See Collect an invoice or a return balance.

Changing the order during checkout#

Editing the order with your API key keeps a session open with the same ID, URL, and checkout credential, and Flint re-prices the order in place. The edit ends the session with order_mutated only when it closes the order or leaves nothing to pay; sessions for an invoice, a return, or a subscription plan can also end that way when their order changes. Because the total can move, a payment while the session is open sends the outstanding_money the buyer approved as expected_outstanding_money, and can send the order's version as expected_version, on POST /v1/orders/{order_id}/pay. A mismatch returns 409 VERSION_CONFLICT without charging. See Changing the order during checkout and Paying the order with your API key.

Versions#

Every session has a version, starting at 1, that goes up with each committed change to the session itself:

  • an update to metadata, external_reference_id, buyer_contact, or subscription_terms
  • a launch route replacing page_origin or the return destination
  • closing, expiry, invalidation, or a payment ending the session
  • Flint clearing the saved buyer_contact after the session ends

Saving the buyer's timezone doesn't change it. Order edits change the order's version, and expanded payment intents carry their own.

Send the version you read as expected_version to apply a change only to that version. Two calls accept it:

PATCH /v1/checkout-sessions/{checkout_session_id} accepts expected_version from your API key, a partner credential, or the session's checkout credential, for the fields that credential can update.

POST /v1/checkout-sessions/{checkout_session_id}/close accepts expected_version from your API key or partner credential. The session's checkout credential cannot close it.

A stale value returns 409 VERSION_CONFLICT with the current version in details[0].current_version, and nothing changes. A buyer's page sends the version it loaded and moves forward only with versions its own saves return. On a conflict, keep what the buyer typed, read the session again, and resend with the new version and a new Idempotency-Key. Paying uses the order's version, not the session's.

GET /v1/checkout-sessions/{checkout_session_id} and GET /v1/checkout-sessions accept expand to include related records beside their IDs, or null when the session has no such ID. Each path needs checkouts.checkout_sessions.read plus the scope of the record it adds; without it, the request returns 403 INSUFFICIENT_SCOPE with param: expand.

expandAlso needs
ordercommerce.orders.read
invoicecommerce.invoices.read
payment_linkcheckouts.payment_links.read
customercustomers.read
payment_intentspayments.payment_intents.read. Single-session read only.

An expanded order includes the contact the order recorded as buyer_contact, including on guest orders; see Expanded order summaries.

This lists paid headless sessions for one invoice, with each session's order:

cURL
curl -G https://api.withflintpay.com/v1/checkout-sessions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "invoice_id=inv_01J00000000000000000000000" \
  --data-urlencode "surface=headless" \
  --data-urlencode "status=paid" \
  --data-urlencode "expand=order"

status, type, and surface take several values as repeated keys or a comma-separated list. Expand related records covers how Flint expands a page and keeps page tokens valid.

Checkout sessionsCreate a hosted session, send the buyer to it, and confirm the payment.Build your own checkoutRun a headless session from your storefront: delivery, saved cards, gift cards, and branding.Payment links vs checkout sessions vs invoicesChoose how to collect a payment.

The Checkout session object#

A session in which a buyer completes an order's payment.

Returned by GET /v1/checkout-sessions/{checkout_session_id} and carried by the endpoints below.

Attributes

active_payment_attemptobject

The payment attempt now collecting this checkout's order, the same attempt as the order's active_payment_attempt. Read it to recover after losing a pay response, and resume it only when is_resumable is true. Omitted when no attempt is active. Pending actions that open a URL are left out; the pay response carries them.

buyer_contactobject

Contact the buyer entered in checkout before paying, saved with the session's checkout credential. Separate from merchant-supplied prefill and customer_prefill from the customer record. Omitted until the buyer saves or clears a field. When a checkout session payment omits buyer_contact.email or buyer_contact.phone, Flint uses these values. Flint clears the contact 30 days after the session ends, and when a customer linked to the session is deleted.

buyer_fieldsobject

What checkout asks the buyer for. Each field you leave out uses your checkout settings.

can_apply_promotion_codebooleanRequired

Whether to offer promotion-code entry now. True only while the session is open, is not in recovery, and merchant promotion policy allows codes. An explicit promotion_config.codes_enabled wins; null offers entry only when this merchant has an active code promotion whose schedule includes now, in the session's environment. Recomputed on each read. This hint does not change code admission: checkout lifecycle, promotion_config, and merchant policy still apply.

can_save_payment_methodboolean

Whether checkout offers the buyer the option to save the card they type for faster checkout at this merchant. When true, PayOrder accepts save_payment_method: true for one newly collected card. False when the merchant turned checkout.saved_payment_details off, customer accounts are merchant hosted, card is not an available payment option, the checkout collects an invoice, a subscription, or a return, or the checkout acts for no customer and Flint cannot email the buyer a verification code. Returned only to the checkout credential; never in webhook payloads.

Not returned with a bearer token

can_save_payment_method_with_phoneboolean

Whether the buyer can save the card they type by giving a US or Canadian mobile phone number with the payment, in save_payment_method_phone on POST /v1/orders/{order_id}/pay, and confirming it with a texted code after paying. True while Flint can send texts and either save_payment_method_requires_verification is true, so the number replaces confirming an email before paying, or the checkout acts for the customer whose email the buyer confirmed with this credential, so the number joins that customer's saved details once the buyer confirms it. Returned only to the checkout credential; never in webhook payloads.

Not returned with a bearer token

checkout_session_idstringRequired

Unique identifier for this checkout session, prefixed `cs_`.

client_referencestring or null

The reference the payment link URL or resolve request carried, such as your user ID. `null` when none was sent or checkout did not start from a payment link. Returned only to merchant credentials; omitted for buyer credentials. Set by the buyer's browser, so treat it as a claim, not proof of identity. Always present with merchant credentials.

Not returned with a checkout credential, a customer session, or an invoice access token

closed_reason_messagestring

The note supplied when the checkout session was closed.

Not returned with a checkout credential, a customer session, or an invoice access token

created_atstringRequired

RFC3339 timestamp.

custom_field_answersarray of one of

The buyer's answers to the payment link's custom fields, the same as the `custom_field_answers` of the session's order. Read-only. Empty when the session didn't start from a payment link, the buyer answered no custom fields, or the order was created before Flint recorded answers here. Returned only to merchant credentials; omitted for buyer credentials. Always present with merchant credentials.

Not returned with a checkout credential, a customer session, or an invoice access token

custom_textobject

The custom text this session shows in checkout.

customerobject or null

Present only when `expand` includes `customer`; `null` when expanded and there is no related customer.

Not returned with a checkout credential, a customer session, or an invoice access token

customer_account_urlstring

The store's customer account, where the buyer can see this purchase and manage a subscription it starts. A stable link that opens the account wherever the merchant's `customer_account` settings put it; the buyer signs in there if needed. Pass it as Apple Pay's `managementURL` for a subscription. Omitted from webhooks, and when the account can't be resolved.

customer_idstring

The customer of the session's order. Omitted when the order has none. A checkout credential issued for this session acts for this customer. Add expand=customer to include the customer.

customer_prefillobject

Contact and default addresses of the customer the checkout acts for, with the recipient name on its default shipping address: the customer the merchant created the session for, or the customer whose email the buyer confirmed in it. Present on GET and PATCH responses while the session is open and acts for a customer. Separate from merchant-supplied prefill and buyer_contact saved by the buyer. Returned only to the checkout credential; never in webhook payloads.

Not returned with a bearer token

deliveryobject

Current delivery choices for Flint-owned pricing. External pricing reports requires_explicit_quote; reading this field does not request a delivery quote. Omitted when the session is not open, has no order, or Flint cannot read its delivery.

delivery_method_idsarray of stringRequired

Immutable delivery method assignment captured when the checkout was created.

delivery_selection_requiredbooleanRequired

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

expires_atstring

RFC3339 timestamp.

expires_in_secondsinteger

The lifetime the session got. expires_at is its deadline. Omitted for invoice sessions, which take their deadline from the invoice.

external_reference_idstring

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

Not returned with a checkout credential, a customer session, or an invoice access token

gift_card_challengeobject

Where the buyer completes a gift card challenge for this checkout. Returned on single-session reads, session create and update responses, checkout launch results, and customer verification confirmation results while the session is open and can show the challenge. Omitted from lists, webhooks, expanded resources, and delivery selection results.

inventory_reservation_idsarray of string

Immutable cart hold IDs authorized by the merchant at session creation. Omitted when empty and from checkout-credential responses. Buyer and merchant delivery requests that omit IDs use eligible bound holds; explicit merchant IDs replace the binding for that request. First adopter wins when sessions share a hold. Invalidated or otherwise ended sessions cannot adopt stock, and replacements never inherit the binding. Unused cart units retain their own release and expiration lifecycle.

Not returned with a checkout credential, a customer session, or an invoice access token

invoiceobject or null

Present only when `expand` includes `invoice`; `null` when expanded and there is no related invoice.

Not returned with a checkout credential, a customer session, or an invoice access token

invoice_idstring

ID of the invoice a session of type `invoice` collects payment for. Absent for other types.

is_in_recoverybooleanRequired

Whether the checkout is in its payment recovery window after its deadline. The checkout credential can recover only an attempt it started. Merchant reads can also report a merchant-started attempt.

legalobject

The terms and policy links this session shows the buyer, and whether the buyer must accept the terms.

merchant_iconobject

The merchant's square icon, shown in browser tabs and compact headers. Returned by `GET /v1/checkout-sessions/{checkout_session_id}` when the merchant has one; other responses and webhooks omit it.

merchant_idstringRequired

ID of the merchant this resource belongs to.

merchant_logoobject

The merchant's logo. Returned by `GET /v1/checkout-sessions/{checkout_session_id}` when the merchant has one; other responses and webhooks omit it.

merchant_namestring

The merchant's business name, which hosted checkout shows when `theme.title` is unset. Reads `Merchant` when the merchant has not set a business name. Returned by `GET /v1/checkout-sessions/{checkout_session_id}`; other responses and webhooks omit it.

merchant_supportobject

How the buyer can reach the merchant for help: the support email, phone, and URL the merchant set. Present on GET and PATCH responses when the merchant set at least one of them. Show it where your checkout tells the buyer to contact the merchant, such as an expired or closed checkout, or your receipt. Returned only to the checkout credential; never in webhook payloads.

Not returned with a bearer token

metadatamap of string

Stored caller-owned key-value data. See `MetadataInput` for key, value, and size rules.

Not returned with a checkout credential, a customer session, or an invoice access token

orderobject or null

Present only when `expand` includes `order`; `null` when expanded and there is no related order.

Not returned with a checkout credential, a customer session, or an invoice access token

order_idstring

ID of the order the session collects payment for, fixed at creation. Absent when the session has no order.

page_originstring

Origin of the page that renders this headless checkout. Omitted when not set.

pay_to_new_address_requires_verificationboolean

Whether at least one saved card this checkout lists would be refused for the current delivery destination because the paying credential last confirmed a code more than 15 minutes ago. Request a code with purpose pay_to_new_address, without email or channel, and confirm it with this credential before paying. A Flint wallet card can still pay to an address in that wallet while this is true for a store saved card. Pickup and orders that ship nothing never require this verification. Returned only to the checkout credential. Returned only to the checkout credential; never in webhook payloads.

Not returned with a bearer token

payment_collectionobject

Guidance for collecting a payment source. Checkout-credential reads include it only while the session is open. Returned only to the checkout credential; never in webhook payloads.

Not returned with a bearer token

payment_intent_idsarray of string

IDs of the payment intents for the session's order. Absent when the order has none.

payment_intentsarray of object

Present only when `expand` includes `payment_intents`: summaries of the payment intents in `payment_intent_ids`.

Not returned with a checkout credential, a customer session, or an invoice access token

payment_linkobject or null

Present only when `expand` includes `payment_link`; `null` when expanded and there is no related payment link.

Not returned with a checkout credential, a customer session, or an invoice access token

payment_link_idstring

ID of the payment link the session was started from. Absent when it was not started from a payment link.

payment_link_imageobject

The current image of the payment link that opened this session. Returned by `GET /v1/checkout-sessions/{checkout_session_id}` when that link has an image; other responses and webhooks omit it.

payment_method_saveobject

The card the buyer saved pending with this checkout's payment, and whether they confirmed it. Present on GET and PATCH responses after a payment that paid the order in full, or that was approved for the merchant to capture later, and saved a card this way. Without a number, confirmation requires an emailed code. A checkout whose payment is approved stays open until the capture. Returned only to the checkout credential; never in webhook payloads.

Not returned with a bearer token

payment_return_urlstring

Headless sessions only. Absolute HTTPS URL on your site where Flint sends the buyer after a redirect payment such as Affirm, whatever the outcome; read the session there to show the result. Required when the session offers affirm. It can't contain credentials, a query string, or a fragment. Query strings are deliberately excluded so credentials and provider state cannot cross Flint's payment relay. Put merchant identifiers in the URL path, such as https://shop.example/return/sub_123. Test mode also accepts http loopback URLs. Up to 2,048 characters.

paymentsobject

Configured payment options for merchant credentials; currently available payment options for the checkout credential.

platform_feeobject

The platform fee the partner app requested when it created the session with an install token. Each payment intent the session creates carries its own platform_fee, lowered to fit that payment. Absent when the session has none.

Not returned with a checkout credential, a customer session, or an invoice access token

platform_fee_ruleobject

The platform fee rule that the session was created with.

Not returned with a checkout credential

prefillobject

Contact details and addresses to fill in for the buyer, who can change them. For a customer with saved addresses, Flint fills in any address you leave out, and reads include it. With quick_pay or subscription_plan and automatic tax on, a prefilled address sets the order's tax location. Not changed by what the buyer types; for that, read buyer_contact. customer_prefill is what the checkout credential reads from the customer record.

problemsarray of objectRequired

Named conditions that affect checkout completion. Follow each problem's remediation action instead of reconstructing delivery lifecycle rules in the client. payment_in_progress means another payment for the order must finish before this checkout can complete. When Flint cannot read the checkout's delivery, the read still succeeds and reports delivery_unreadable; its remediation says whether reading the session again can succeed, and its next action's reason_code names the error.

promotion_configobject

Whether automatic promotions apply to this session and whether the buyer can enter promotion codes.

recovery_expires_atstring or null

When the restricted payment-attempt recovery window ends. `null` when the session has no recovery window.

recovery_payment_attempt_idstring

The payment attempt in the recovery window. Only merchant reads report a merchant-started attempt.

redirectsobject

Where hosted checkout sends the buyer. Not allowed when surface is headless; use payment_return_url.

refundsarray of object

All buyer-visible refunds on this session’s order, including refunds made by the store. Uses the same buyer projection as /v1/me/refunds. Included on GET single-session reads as an array, with [] when there are none, and omitted from other responses and webhooks. A failed refund with failure_reason refund_abandoned could not be completed: tell the buyer to contact the store to get their money back.

save_payment_method_requires_verificationboolean

Whether saving a new card or using saved cards needs the buyer to confirm their email with a code. A new card can be saved pending with the payment and confirmed on the receipt; using saved cards still needs the code before paying. True when can_save_payment_method is true and the checkout acts for no customer for this credential: the merchant created it without one, and either the buyer has not confirmed an email with this credential, or the customer whose email they confirmed has since changed that email or been deleted. A credential other than the one a confirmation returned, such as the hosted checkout link opened on another device, reads true. Send the code with POST /v1/checkout-sessions/{checkout_session_id}/customer-verifications. False while the checkout acts for a customer, and whenever can_save_payment_method is false. Returned only to the checkout credential; never in webhook payloads.

Not returned with a bearer token

save_payment_method_typesarray of enum

What save_payment_method keeps, present when can_save_payment_method is true: card, a card the buyer types into checkout. Show the save option with that payment method only. A pay request that sends save_payment_method: true with Apple Pay, Google Pay, a bank account, or Affirm, through a confirmation token created with setup_future_usage none, still pays, and its payment attempt's payment_method_save reports not_saved. The values can grow. Returned only to the checkout credential; never in webhook payloads.

Not returned with a bearer token

  • card
setup_collectionobject

Guidance for collecting a payment method to save. Checkout-credential reads include it only while the session is open. Returned only to the checkout credential; never in webhook payloads.

Not returned with a bearer token

shop_idstring

ID of the shop that started checkout.

show_flint_markboolean

Whether Flint's hosted pages show the Powered by Flint mark for this merchant. `false` when the merchant's agreement with Flint removes it. Returned by `GET /v1/checkout-sessions/{checkout_session_id}`; other responses and webhooks omit it.

statusenumRequired

Where the session is in its lifecycle. Only an `open` session accepts payment. `terminal_reason` says why a session that is not open ended.

  • open
  • paid
  • partially_paid
  • expired
  • closed
  • invalidated
subscription_plan_idstring

ID of the subscription plan a session of type `subscription_plan` signs the buyer up for. Absent for other types.

subscription_termsobject

Renewal terms a subscription checkout commits the buyer to. Frozen when the session's order was created, so later plan changes do not alter them. Absent when the checkout starts no subscription.

superseding_checkout_session_idstring

ID of the session that replaced this one. Present when `terminal_reason` is `superseded`.

supported_actionsarray of enum

Lifecycle actions Flint accepts now, computed from stored checkout state without checking the caller's permissions. Contains close while open; empty after payment, closure, or expiry. Always present with merchant credentials.

Not returned with a checkout credential, a customer session, or an invoice access token

  • close
surfaceenumRequired

How the session is presented to the buyer. A hosted session has a `url` on Flint's checkout page; a headless one is rendered on your own page.

  • hosted
  • headless
taxobject

The session's tax settings. Omitted when the session sets none.

terminal_reasonenum

Why the session ended. The checkout credential can still read its own closed or expired session; every other call is refused because the session is not open. order_paid_elsewhere applies only to invalidated sessions when payment succeeds or partially succeeds outside the session. order_mutated applies when an edit closes or completes its order, or ends an invoice, return-resolution, or subscription-plan session. Other merchant edits keep hosted and headless sessions open. A session already past expires_at ends with expired before the edit is applied.

  • payment_succeeded
  • payment_partially_succeeded
  • expired
  • closed_by_merchant
  • order_mutated
  • superseded
  • order_paid_elsewhere
  • invoice_paid_elsewhere
  • invoice_voided
  • invoice_uncollectible
  • invoice_balance_changed
themeobject

The theme checkout renders with: your branding settings, with the session's `title`, `primary_color`, and `accent_color` over them. A session sets only those three; the other fields come from branding settings. Omitted when neither sets a value.

tipobject

The tip options this session offers the buyer.

typeenumRequired

What the session collects payment for, fixed at creation.

  • order
  • quick_pay
  • subscription_plan
  • invoice
  • payment_link
  • shop
updated_atstringRequired

RFC3339 timestamp.

urlstring

Hosted checkout URL that carries a one-time launch credential. Send the buyer here to pay. Present only for hosted sessions read with a merchant credential that can manage checkout sessions. Launch results include it for hosted sessions: create, payment-link resolve, and invoice and return-resolution checkout. Omitted for headless sessions.

Not returned with a checkout credential

versionintegerRequired

Persisted version of this resource's owned state. Expanded resources and external observations can change independently.

JSON
{
  "buyer_fields": {
    "require_email": true
  },
  "can_apply_promotion_code": false,
  "checkout_session_id": "cs_01KEZF7C00NH3PCFF00TEWN03B",
  "client_reference": null,
  "created_at": "2026-03-17T14:30:00Z",
  "custom_field_answers": [],
  "customer_account_url": "https://links.withflintpay.com/account/v1.eyJtZXJjaGFudF9pZCI6Im1lcl8xMjMifQ.example",
  "delivery_method_ids": [],
  "delivery_selection_required": false,
  "gift_card_challenge": {
    "url": "https://checkout.withflintpay.com/gift-card-challenge/opaque-frame-token"
  },
  "is_in_recovery": false,
  "merchant_id": "mer_01KEZF7C00MPP0T9S0KH5BB4CC",
  "metadata": {
    "campaign": "spring_launch"
  },
  "order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
  "payments": {
    "enabled_payment_options": [
      "card",
      "apple_pay",
      "google_pay"
    ],
    "payment_note": "Thank you for your purchase."
  },
  "prefill": {},
  "problems": [],
  "promotion_config": {
    "codes_enabled": true
  },
  "redirects": {
    "cancel_url": "https://example.com/canceled",
    "success_url": "https://example.com/success"
  },
  "refunds": [
    {
      "amount_money": {
        "amount": 2500,
        "currency": "USD"
      },
      "created_at": "2026-11-13T12:00:00Z",
      "credit_adjustment_money": {
        "amount": 0,
        "currency": "USD"
      },
      "failure_reason": "refund_abandoned",
      "order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
      "payment_intent_id": "pi_01KEZF7C0050JFFB0HNCWWV1G3",
      "pending_reason": null,
      "processed_by": "flint",
      "reason": "payment_returned",
      "refund_id": "ref_01KEZF7C00H2GAMWD73WZ7K81W",
      "refunded_tip_money": {
        "amount": 0,
        "currency": "USD"
      },
      "status": "failed",
      "updated_at": "2026-11-13T12:00:00Z",
      "version": 1
    }
  ],
  "status": "open",
  "supported_actions": [
    "close"
  ],
  "surface": "hosted",
  "theme": {
    "primary_color": "#0f766e",
    "title": "Spring Gala Checkout"
  },
  "type": "quick_pay",
  "updated_at": "2026-03-17T14:30:00Z",
  "url": "https://checkout.withflintpay.com/checkout/cs_01KEZF7C00NH3PCFF00TEWN03B#checkout_token=cklt_v1.example",
  "version": 1
}

List checkout sessions#

GET/v1/checkout-sessions

Requires scope checkouts.checkout_sessions.read or checkouts.checkout_sessions.write

Rate limit: read

Returns a paginated list of checkout sessions for the authenticated merchant. Default order: created_at descending, then checkout_session_id descending.

Query parameters

page_sizeinteger

Maximum number of results to return, from 1 to 100. Defaults to 20.

page_tokenstring

Opaque, signed next_page_token from the previous response, bound to the list and caller. Omit on the first request. You may change `page_size` between pages. Reuse it with the same endpoint, filters, sort, and request context. Do not parse or construct tokens. An altered, invalid, expired, or mismatched token returns a validation error.

statusarray of enum

Filter by the status each session has when read. A session past expires_at lists as expired even before its stored status is updated, unless payment work keeps it open, in which case it lists as open. A page can hold fewer sessions than page_size. Values are trimmed and deduplicated in first-seen order; empty or unknown entries are rejected. Values within this filter are ORed; separate filters are ANDed.

  • open
  • paid
  • partially_paid
  • expired
  • closed
  • invalidated
order_idstring

Filter by Flint order ID.

shop_idstring

Filter by Flint shop ID.

payment_link_idstring

Filter by Flint payment link ID.

customer_idstring

Filter by Flint customer ID.

subscription_plan_idstring

Exact match on the Flint subscription plan ID.

invoice_idstring

Exact match on the Flint invoice ID.

surfacearray of enum

Filter by checkout surface. Sessions created before surfaces existed are hosted. Values are trimmed and deduplicated in first-seen order; empty or unknown entries are rejected. Values within this filter are ORed; separate filters are ANDed.

  • hosted
  • headless
typearray of enum

Filter by checkout session type. Values are trimmed and deduplicated in first-seen order; empty or unknown entries are rejected. Values within this filter are ORed; separate filters are ANDed.

  • order
  • quick_pay
  • subscription_plan
  • invoice
  • payment_link
  • shop
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. Text fields match any part of the value, and %, _ and \ are ordinary characters, not wildcards. IDs match from the start and need the type prefix, such as cs_01.

sort_byenum

Field to sort by. Defaults to created_at; ties are broken by checkout_session_id.

  • created_at
  • updated_at
sort_directionenum

Sort direction. Defaults to desc.

  • asc
  • desc
created_afterstring

Inclusive lower bound on created_at.

created_beforestring

Exclusive upper bound on created_at.

updated_afterstring

Inclusive lower bound on updated_at.

updated_beforestring

Exclusive upper bound on updated_at.

expires_afterstring

Inclusive lower bound on expires_at.

expires_beforestring

Exclusive upper bound on expires_at.

expandarray of enum

Include related objects in the response. Supported expansions: customer, invoice, order, payment_link. Include the requested related resources using scoped batch reads for this page. Each relationship requires its existing target read scopes. Expansion changes the representation without changing pagination tokens. Limits: at most 10 unique expand paths per request.

  • customer
  • invoice
  • order
  • payment_link

Response · 200

A page of checkout sessions.

dataarray of objectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

next_page_tokenstring

Opaque token to send as `page_token` to retrieve the next page. Omitted when there is no next page.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl https://api.withflintpay.com/v1/checkout-sessions \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

A page of checkout sessions.

JSON
{
  "data": [
    {
      "buyer_fields": {
        "require_email": true
      },
      "can_apply_promotion_code": false,
      "checkout_session_id": "cs_01KEZF7C00NH3PCFF00TEWN03B",
      "client_reference": null,
      "created_at": "2026-03-17T14:30:00Z",
      "custom_field_answers": [],
      "customer_account_url": "https://links.withflintpay.com/account/v1.eyJtZXJjaGFudF9pZCI6Im1lcl8xMjMifQ.example",
      "delivery_method_ids": [],
      "delivery_selection_required": false,
      "gift_card_challenge": {
        "url": "https://checkout.withflintpay.com/gift-card-challenge/opaque-frame-token"
      },
      "is_in_recovery": false,
      "merchant_id": "mer_01KEZF7C00MPP0T9S0KH5BB4CC",
      "metadata": {
        "campaign": "spring_launch"
      },
      "order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
      "payments": {
        "enabled_payment_options": [
          "card",
          "apple_pay",
          "google_pay"
        ],
        "payment_note": "Thank you for your purchase."
      },
      "prefill": {},
      "problems": [],
      "promotion_config": {
        "codes_enabled": true
      },
      "redirects": {
        "cancel_url": "https://example.com/canceled",
        "success_url": "https://example.com/success"
      },
      "status": "open",
      "supported_actions": [
        "close"
      ],
      "surface": "hosted",
      "theme": {
        "primary_color": "#0f766e",
        "title": "Spring Gala Checkout"
      },
      "type": "quick_pay",
      "updated_at": "2026-03-17T14:30:00Z",
      "url": "https://checkout.withflintpay.com/checkout/cs_01KEZF7C00NH3PCFF00TEWN03B#checkout_token=cklt_v1.example",
      "version": 1
    }
  ],
  "meta": {
    "api_version": "2026-09-07"
  },
  "request_id": "req_01KWM6K9DDQXWQ9SX35C75Y4FH"
}

Create checkout session#

POST/v1/checkout-sessionsIdempotent

Requires scope checkouts.checkout_sessions.write or commerce.invoices.write or commerce.returns.resolutions.write

Rate limit: payment

Creates a hosted or headless checkout session for an order, quick-pay charge, subscription plan signup, a return resolution's buyer balance, or what is due now on an invoice. Subscription signup requires a buyer email before payment. 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. Scopes depend on type: order, quick_pay and subscription_plan need checkouts.checkout_sessions.write, return_resolution needs commerce.returns.resolutions.write, and invoice needs commerce.invoices.write. A credential without the type's scope gets 403 INSUFFICIENT_SCOPE. A return_resolution or invoice session reuses the open session with the same surface and returns 200; a different surface replaces an idle session and is refused while a payment is in progress. Read the resolution or invoice with its own GET.

Request body

Send exactly one of these

The `order` variant of `CreateCheckoutSessionRequest`.

buyer_fieldsobject

What checkout asks the buyer for. Each field you leave out uses your checkout settings.

custom_textobject

Custom text for this session's checkout: an order summary message and a shipping address label.

delivery_method_idsarray of string

Immutable delivery method assignment for this checkout, 1 to 25 unique IDs. Omit it to use settings.checkout.default_delivery_method_ids when the order has items to deliver; otherwise no methods are assigned. Empty arrays and null are rejected.

expires_in_secondsinteger

Seconds the session stays open, from 60 to 86,400. Omit it to use settings.checkout.default_expires_in_seconds, or 24 hours.

external_reference_idstring

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

inventory_reservation_idsarray of string

Merchant-created cart holds this session may adopt during delivery selection. Only with type: order and a merchant credential. At most 100 unique IDs; exceeding the cap returns INVALID_REQUEST with param inventory_reservation_ids. Immutable after creation. Buyer quotes credit still-eligible bound holds and buyer selections adopt matching units without supplying IDs. Merchant delivery requests that omit IDs also use this binding; explicit IDs, including an empty array, replace it for that request. First adopter wins when sessions share a hold. Unused units remain held until released or expired. Unknown or ineligible IDs at creation return 404. Invalidated or otherwise ended sessions cannot use the binding, and replacement sessions never inherit it.

legalobject

The terms and policy links this session shows the buyer, and whether the buyer must accept the terms.

metadatamap of string

Caller-owned metadata. Values can't be empty strings. Keys starting with flint_ are reserved for Flint, are not returned, and cannot be written through the public API.

order_idstringRequired

The order to collect. It must be open and not collected by an invoice or a return resolution.

page_originstring

Origin of the page where you render this headless checkout, such as https://shop.example.com. Only this origin can show the checkout's gift card challenge and receive its result. It does not let the browser call the Flint API. Accepted only when surface is headless. Use HTTPS and a lowercase DNS hostname. Do not include a path, query, fragment, or default port. In test mode, localhost, names ending in .localhost, and 127.0.0.1 also work over HTTP or HTTPS.

payment_return_urlstring

Headless sessions only. Absolute HTTPS URL on your site where Flint sends the buyer after a redirect payment such as Affirm, whatever the outcome; read the session there to show the result. Required when the session offers affirm. It can't contain credentials, a query string, or a fragment. Query strings are deliberately excluded so credentials and provider state cannot cross Flint's payment relay. Put merchant identifiers in the URL path, such as https://shop.example/return/sub_123. Test mode also accepts http loopback URLs. Up to 2,048 characters.

paymentsobject

Payment settings for this session: the payment options it offers and a note shown with them. Omit `enabled_payment_options` to use the merchant's `settings.checkout.enabled_payment_options`. Not allowed when `type` is `return_resolution` or `invoice`.

platform_feeobject

A platform fee your partner app charges on the payment the session collects, checked once against the order total when the session is created. Each payment the session creates carries its own fee, lowered to the cap for its amount. Only a partner app install token can send it; from any other credential it is INVALID_REQUEST with NOT_ALLOWED on platform_fee. A subscription_plan checkout session, or an order whose payment starts or renews a subscription, refuses it with INVALID_REQUEST and NOT_ALLOWED on platform_fee, because Flint's billing creates the renewals. Set platform_fee_rule on the subscription or its checkout session. amount_money.amount must be at least 1 minor unit; otherwise INVALID_REQUEST with INVALID_VALUE on platform_fee.amount_money.amount. Omit platform_fee to charge no fee. The fee must be in the payment's currency, at most the platform fee cap the merchant approved for this amount, and below the amount; otherwise INVALID_REQUEST with INVALID_VALUE on platform_fee.amount_money, with maximum_money when the cap or the amount bounds it. Without an approved cap in this currency it is ACTION_NOT_ALLOWED with reason platform_fee_consent_required. In live mode the partner app's platform_fees capability must be active; otherwise ACTION_NOT_ALLOWED with capability platform_fees and the reason the app's platform status gives. Test mode never checks the capability. Flint lowers the fee, or cancels it, when the cap or Flint's own fees leave less at confirm or capture, so the payment never fails because of it. Part of the request fingerprint. See [Platform fees](/docs/guides/platform-fees).

platform_fee_ruleobject

The platform fee rule for payments the session creates. Only a partner app install token can set or remove a platform fee rule.

prefillobject

Contact details and addresses to fill in for the buyer, who can change them. For a customer with saved addresses, Flint fills in any address you leave out, and reads include it. With quick_pay or subscription_plan and automatic tax on, a prefilled address sets the order's tax location. Not changed by what the buyer types; for that, read buyer_contact. customer_prefill is what the checkout credential reads from the customer record.

promotion_configobject

Whether automatic promotions apply to this session and whether the buyer can enter promotion codes.

redirectsobject

Where hosted checkout sends the buyer. Not allowed when surface is headless; use payment_return_url.

replace_checkout_session_idstring

Expected checkout session for an atomic replacement. Allowed only with type: order. The named session must belong to the same merchant, environment, and order. Active payment work fails with `OPERATION_IN_PROGRESS`.

surfaceenum

Defaults to hosted when omitted. Use headless for a merchant-owned presentation.

  • hosted
  • headless
themeobject

The title and colors for this session's checkout. Fields you omit come from your branding settings.

tipobject

Tip options for this session. Fields you omit follow your tipping settings.

typeenumRequired

What the checkout collects payment for. order: an order you created; send order_id. quick_pay: one named amount; send quick_pay_item, and Flint creates the order. subscription_plan: a signup for an active plan; send subscription_plan_id, and Flint creates the order and, once the buyer pays, the subscription. return_resolution: the buyer's balance on a return resolution; send return_resolution_id. invoice: what is due now on an open invoice; send invoice_id. The order, quick_pay and subscription_plan types need checkouts.checkout_sessions.write; return_resolution needs commerce.returns.resolutions.write; invoice needs commerce.invoices.write.

  • order

Response · 201

The created checkout session and surface-appropriate access details.

dataobjectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

Response · 200

Only for type return_resolution or invoice: the existing open checkout session was returned. Nothing was created.

Same attributes as 201.

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 '{
    "buyer_fields": {
      "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_url": "https://example.com/canceled",
      "success_url": "https://example.com/success"
    },
    "theme": {
      "primary_color": "#0f766e",
      "title": "Spring Gala Checkout"
    },
    "type": "quick_pay"
  }'

Get checkout session#

GET/v1/checkout-sessions/{checkout_session_id}

Requires scope checkouts.checkout_sessions.read or checkouts.checkout_sessions.write

Rate limit: read

Returns a single checkout session by ID.

Path parameters

checkout_session_idstringRequired

Flint checkout session ID. Must be a valid ID with prefix cs_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Query parameters

expandarray of enum

Include related objects in the response. 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. To-many expansions are capped at 20 related objects per path. Checkout session credentials cannot use expand on this route.

  • customer
  • invoice
  • order
  • payment_intents
  • payment_link

Response · 200

The requested checkout session.

dataobjectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl https://api.withflintpay.com/v1/checkout-sessions/cs_01KEZF7C004JRWFW43H037MQRN \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

The requested checkout session.

JSON
{
  "data": {
    "buyer_fields": {
      "require_email": true
    },
    "can_apply_promotion_code": false,
    "checkout_session_id": "cs_01KEZF7C00NH3PCFF00TEWN03B",
    "client_reference": null,
    "created_at": "2026-03-17T14:30:00Z",
    "custom_field_answers": [],
    "customer_account_url": "https://links.withflintpay.com/account/v1.eyJtZXJjaGFudF9pZCI6Im1lcl8xMjMifQ.example",
    "delivery_method_ids": [],
    "delivery_selection_required": false,
    "gift_card_challenge": {
      "url": "https://checkout.withflintpay.com/gift-card-challenge/opaque-frame-token"
    },
    "is_in_recovery": false,
    "merchant_id": "mer_01KEZF7C00MPP0T9S0KH5BB4CC",
    "metadata": {
      "campaign": "spring_launch"
    },
    "order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
    "payments": {
      "enabled_payment_options": [
        "card",
        "apple_pay",
        "google_pay"
      ],
      "payment_note": "Thank you for your purchase."
    },
    "prefill": {},
    "problems": [],
    "promotion_config": {
      "codes_enabled": true
    },
    "redirects": {
      "cancel_url": "https://example.com/canceled",
      "success_url": "https://example.com/success"
    },
    "refunds": [
      {
        "amount_money": {
          "amount": 2500,
          "currency": "USD"
        },
        "created_at": "2026-11-13T12:00:00Z",
        "credit_adjustment_money": {
          "amount": 0,
          "currency": "USD"
        },
        "failure_reason": "refund_abandoned",
        "order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
        "payment_intent_id": "pi_01KEZF7C0050JFFB0HNCWWV1G3",
        "pending_reason": null,
        "processed_by": "flint",
        "reason": "payment_returned",
        "refund_id": "ref_01KEZF7C00H2GAMWD73WZ7K81W",
        "refunded_tip_money": {
          "amount": 0,
          "currency": "USD"
        },
        "status": "failed",
        "updated_at": "2026-11-13T12:00:00Z",
        "version": 1
      }
    ],
    "status": "open",
    "supported_actions": [
      "close"
    ],
    "surface": "hosted",
    "theme": {
      "primary_color": "#0f766e",
      "title": "Spring Gala Checkout"
    },
    "type": "quick_pay",
    "updated_at": "2026-03-17T14:30:00Z",
    "url": "https://checkout.withflintpay.com/checkout/cs_01KEZF7C00NH3PCFF00TEWN03B#checkout_token=cklt_v1.example",
    "version": 1
  },
  "meta": {
    "api_version": "2026-09-07"
  },
  "request_id": "req_01KWM6K9DDQXWQ9SX35C75Y4FH"
}

Update checkout session#

PATCH/v1/checkout-sessions/{checkout_session_id}Idempotent

Requires scope checkouts.checkout_sessions.write

Rate limit: payment

Updates the mutable fields of a checkout session. A merchant credential can update metadata and external_reference_id, including after the session ends. Send external_reference_id as null to clear it, or metadata as null to clear all metadata. On a session with a subscription_plan_id, either credential can send subscription_terms with the buyer's billing interval and quantity while the session is open and no payment is in progress; a change reprices the signup order and releases the delivery selection. The session's own checkout credential can also send buyer_contact and timezone while the session is open. The buyer_contact field saves the email and phone the buyer entered; send a contact field as null to clear it. The timezone field records the buyer's IANA time zone, which Flint uses for times in the emails it sends the buyer. Saving the same values again changes nothing.

Path parameters

checkout_session_idstringRequired

Flint checkout session ID. Must be a valid ID with prefix cs_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Request body

buyer_contactobject

Checkout session credentials only. Saves the contact the buyer entered while the session is open. A patch object: omitted fields are unchanged, and null clears a field. A merchant credential that sends buyer_contact fails with `INVALID_REQUEST` and a `NOT_ALLOWED` detail on `buyer_contact`.

Not accepted with a bearer token

expected_versioninteger

Optional expected version of this resource. A stale value returns 409 VERSION_CONFLICT with the current version. Retrieve the resource and rebuild the request before retrying.

external_reference_idstring or null

Caller-owned identifier for this resource in an external system. Omit to leave unchanged; send null to clear.

Not accepted with a checkout credential

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 caller-owned metadata. An empty object makes no change. Values can't be empty strings. Keys starting with flint_ are reserved for Flint, are not returned, and cannot be written through the public API.

Not accepted with a checkout credential

subscription_termsobject

Subscription plan sessions only. The billing interval and line quantities the buyer chose from the frozen subscription_terms, and the gift recipient when subscription_terms.gifts_enabled is true. Send billing_interval and billing_interval_count together. Accepted from your API key or the checkout credential.

timezonestring

Checkout credentials only. A valid IANA timezone, such as America/Toronto, used for Flint-sent receipts. Omission keeps the previous observation; null is invalid.

Not accepted with a bearer token

Response · 200

The updated checkout session.

Same response as Get checkout session.

curl -X PATCH https://api.withflintpay.com/v1/checkout-sessions/cs_01KEZF7C004JRWFW43H037MQRN \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "buyer_contact": {
      "email": "ada@example.com",
      "phone": "+14155551234"
    }
  }'

Close checkout session#

POST/v1/checkout-sessions/{checkout_session_id}/closeIdempotent

Requires scope checkouts.checkout_sessions.write

Rate limit: payment

Closes an open checkout session before it naturally expires.

Path parameters

checkout_session_idstringRequired

Flint checkout session ID. Must be a valid ID with prefix cs_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Request body

expected_versioninteger

Optional expected version of this resource. A stale value returns 409 VERSION_CONFLICT with the current version. Retrieve the resource and rebuild the request before retrying.

reason_messagestring

Your note explaining why you are closing the checkout session. It is not shown to the buyer.

Response · 200

The closed checkout session.

Same response as Get checkout session.

curl -X POST https://api.withflintpay.com/v1/checkout-sessions/cs_01KEZF7C004JRWFW43H037MQRN/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_message": "Merchant closed stale session"
  }'

List checkout verification code requests#

GET/v1/checkout-sessions/{checkout_session_id}/customer-verifications

Requires a checkout credential

Rate limit: read

Only the session's own checkout credential can read its verification code requests. Only requests whose code hasn't expired are readable until expires_at; an expired, unknown, malformed, deleted, or other session's request returns 404 RESOURCE_NOT_FOUND. Emails are masked on every read. A request reads the same whether or not a code was sent, confirmed, or replaced. Reads send nothing and change no code or attempt counters. Returns requests newest first by created_at descending, then checkout_session_customer_verification_id descending. Default order: created_at descending, then checkout_session_customer_verification_id descending.

Path parameters

checkout_session_idstringRequired

Flint checkout session ID. Must be a valid ID with prefix cs_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Query parameters

page_sizeinteger

Maximum number of results to return, from 1 to 100. Defaults to 20.

page_tokenstring

Opaque, signed next_page_token from the previous response, bound to the list and caller. Omit on the first request. You may change `page_size` between pages. Reuse it with the same endpoint, filters, sort, and request context. Do not parse or construct tokens. An altered, invalid, expired, or mismatched token returns a validation error.

Response · 200

The live code request or page of requests, with masked emails.

dataarray of objectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

next_page_tokenstring

Opaque token to send as `page_token` to retrieve the next page. Omitted when there is no next page.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl https://api.withflintpay.com/v1/checkout-sessions/cs_01KEZF7C004JRWFW43H037MQRN/customer-verifications \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_CHECKOUT_AUTH_TOKEN"

The live code request or page of requests, with masked emails.

JSON
{
  "data": [
    {
      "channel": "email",
      "checkout_session_customer_verification_id": "cscv_01K6ZQ4TE3M8Q2N7W5V1R9X0YB",
      "checkout_session_id": "cs_01KEZF7C00NH3PCFF00TEWN03B",
      "created_at": "2026-03-17T14:30:00Z",
      "email": "a•••@example.com",
      "expires_at": "2026-03-17T14:45:00Z",
      "purpose": "use_saved_payment_methods",
      "supported_actions": [
        "confirm"
      ]
    }
  ],
  "meta": {
    "api_version": "2026-09-07"
  },
  "next_page_token": "example",
  "request_id": "req_01KWM6RTJCWG082MGAWE2CRJYC"
}

Send a checkout verification code#

POST/v1/checkout-sessions/{checkout_session_id}/customer-verificationsIdempotent

Requires a checkout credential

Rate limit: sensitive_write

Sends a six-digit code to prove the buyer controls an email address or mobile phone number, so this checkout can save a card, use saved details, or confirm a saved card. Only the session's own checkout credential can call it. A retry with the same idempotency key returns the same code request without sending another email or text. See the [headless checkout guide](https://developers.withflintpay.com/docs/guides/headless-checkout) for limits, sandbox codes, SMS copy, and what each answer reveals. To link guest purchases, use POST /v1/customer-verifications.

Path parameters

checkout_session_idstringRequired

Flint checkout session ID. Must be a valid ID with prefix cs_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Request body

Send exactly one of these

The buyer confirms their email before funding a gift card purchase. Flint emails a code without saving a payment method.

channelenum

How Flint delivers the code.

  • email
emailstringRequired

Email the buyer typed, with no surrounding spaces. Customers are matched by email without regard to case. The local part before @ must be at most 64 octets (UTF-8 bytes).

purposeenumRequired

What the buyer is confirming their email or number for.

  • gift_card_purchase

Response · 200

The code request. A request with channel email reads the same whether or not Flint sent a code.

dataobjectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl -X POST https://api.withflintpay.com/v1/checkout-sessions/cs_01KEZF7C004JRWFW43H037MQRN/customer-verifications \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_CHECKOUT_AUTH_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "email": "ada@example.com",
    "purpose": "use_saved_payment_methods"
  }'

Get a checkout verification code request#

GET/v1/checkout-sessions/{checkout_session_id}/customer-verifications/{checkout_session_customer_verification_id}

Requires a checkout credential

Rate limit: read

Only the session's own checkout credential can read its verification code requests. Only requests whose code hasn't expired are readable until expires_at; an expired, unknown, malformed, deleted, or other session's request returns 404 RESOURCE_NOT_FOUND. Emails are masked on every read. A request reads the same whether or not a code was sent, confirmed, or replaced. Reads send nothing and change no code or attempt counters.

Path parameters

checkout_session_idstringRequired

Flint checkout session ID. Must be a valid ID with prefix cs_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

checkout_session_customer_verification_idstringRequired

Flint checkout verification code request ID. Must be a valid ID with prefix cscv_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Response · 200

The live code request or page of requests, with masked emails.

Same response as Send a checkout verification code.

curl https://api.withflintpay.com/v1/checkout-sessions/cs_01KEZF7C004JRWFW43H037MQRN/customer-verifications/cscv_01KEZF7C00XW14W2FCVD5PH3Z9 \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_CHECKOUT_AUTH_TOKEN"

The live code request or page of requests, with masked emails.

JSON
{
  "data": {
    "channel": "email",
    "checkout_session_customer_verification_id": "cscv_01K6ZQ4TE3M8Q2N7W5V1R9X0YB",
    "checkout_session_id": "cs_01KEZF7C00NH3PCFF00TEWN03B",
    "created_at": "2026-03-17T14:30:00Z",
    "email": "a•••@example.com",
    "expires_at": "2026-03-17T14:45:00Z",
    "purpose": "use_saved_payment_methods",
    "supported_actions": [
      "confirm"
    ]
  },
  "meta": {
    "api_version": "2026-09-07"
  },
  "request_id": "req_01KWM6RTJCWG082MGAWE2CRJYC"
}

Confirm a checkout verification code#

POST/v1/checkout-sessions/{checkout_session_id}/customer-verifications/{checkout_session_customer_verification_id}/confirmIdempotent

Requires a checkout credential

Rate limit: sensitive_write

Checks the code the buyer typed. A right code makes the checkout act for the customer with that email, and creates the customer, with a customer.created event, when none exists. The checkout can then save the buyer's card with save_payment_method on POST /v1/orders/{order_id}/pay, and list and pay with that customer's saved cards. The order's customer does not change until the payment succeeds. Only the checkout_auth_token in the response acts for that customer. Send it as the Bearer credential from then on. Every other credential for the session, including earlier checkout_auth_token values and hosted checkout links, keeps working for the checkout and acts for no customer, so it lists no saved cards and pays with none. A buyer who opens the link on another device confirms an email there to use them, and from then on only that device's new credential acts for a customer. If the response is lost after the code was accepted, the credential you sent still works. Send the same code again with it while the code is valid, which counts as another try and returns a new credential for the same customer, or request a new code. A wrong, expired, or replaced code fails with `INVALID_REQUEST` and an `INVALID_VALUE` detail on `code`, and so does a used code once the checkout was confirmed again, any code after its 5th try, any code for an email past its limit on wrong tries, or a code whose email's customer changed its email or was deleted after the code was sent. If the checkout stops offering saved payment details before the code is confirmed, such as when the merchant turns them off, the request fails with `ACTION_NOT_ALLOWED` and reason `not_offered`. A credential that already acts for a customer fails with `ACTION_NOT_ALLOWED` and reason `already_applied`, and confirming never replaces a customer the merchant named. Once the customer whose email the buyer confirmed changes that email or is deleted, the checkout acts for no customer, and the buyer can confirm the customer's new email or another one. A checkout opened from a checkout reminder link acts for no customer the buyer confirmed earlier, so its buyer confirms an email again. A texted code for saved details binds the checkout the same way, but the new credential opens only the cards saved with that number: it lists and pays with no card saved by email, and reads no customer details. A texted code checks once, so after a lost answer request a new code. A code for purpose pay_to_new_address keeps the credential and its proof, omits checkout_auth_token, and refreshes the last confirmed code for 15 minutes. A code for purpose confirm_saved_payment_method keeps the session's credential, so the response omits checkout_auth_token and carries payment_method_save on the checkout session. A texted code saves the card with the number when the number already opens the customer's saved details or the customer has none yet; otherwise payment_method_save.email_confirmation_required turns true, and an emailed code finishes the save. An emailed code alone saves the card by email. After success, a retry with the same idempotency key and code returns the stored answer and credential to any credential of the session. After failure, a retry checks the code again and counts as another try.

Path parameters

checkout_session_idstringRequired

Flint checkout session ID. Must be a valid ID with prefix cs_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

checkout_session_customer_verification_idstringRequired

The checkout_session_customer_verification_id the code request returned. Must be a valid ID with prefix cscv_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Request body

codestringRequired

The six-digit code from the email or the text.

remember_buyerboolean

Remember this buyer after a right code. Defaults to false. Accepted without issuing a token until the required notice email is configured.

remembered_buyer_tokenstring

Token this device already holds, if any. A right code for the same email resets its unconfirmed steps; a different email ends it. With remember_buyer, Flint returns a replacement token.

Response · 200

The checkout as the new credential reads it, and that credential, which acts for the buyer's customer; or, for purpose confirm_saved_payment_method, the paid checkout with its payment_method_save.

dataobjectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl -X POST https://api.withflintpay.com/v1/checkout-sessions/cs_01KEZF7C004JRWFW43H037MQRN/customer-verifications/cscv_01KEZF7C00XW14W2FCVD5PH3Z9/confirm \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_CHECKOUT_AUTH_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "code": "482913"
  }'

Was this helpful?