Orders
Orders are the central commerce resource in Flint. Every sale flows through an order: it holds line items, discounts, charges, tax, a requested tip, and the full pricing and settlement state for the transaction. Other resources attach to orders rather than replacing them: payments, refunds, invoices, checkout sessions, and subscriptions all read from and write back to an order.
Create an order whenever Flint should keep the record of what was sold. Collect it through a checkout session, an invoice, or your own payment form with POST /v1/orders/{order_id}/pay, and read the outcome from the order. Why Flint is orders-first walks through one order from creation to payment, and explains when a standalone payment intent fits better.
invoice_id identifies the invoice associated with the order and is null when there is none. It is also returned on /v1/me/orders rows. A Quick Pay invoice creates its order with origin: invoice; invoicing an existing order preserves its origin. Use has_invoice=true or has_invoice=false on GET /v1/orders and GET /v1/me/orders to filter by whether this link is set, including voided invoices.
A checkout started from a shop cart creates an order with origin: "shop" and the shop's shop_id. Use shop_id on GET /v1/orders to list orders from that shop.
New orders start at version 1 and advance on changes. Existing orders continue from their current version. Versions are concurrency tokens, not Unix timestamps: pass the latest returned version as expected_version, or expected_order_version on child creates. Never derive it from updated_at. The order’s updated_at records wall-clock time, so several changes can share a timestamp.
Create and pay a delivered order#
Send delivery with POST /v1/orders to quote the exact method and create its selection, shipping charge, and inventory hold with the order. Then pay with POST /v1/orders/{order_id}/pay. Merchant keys and partner tokens need both commerce.orders.write and commerce.delivery.write; buyer and checkout credentials cannot set this field.
<!-- docs-test {"request":{"method":"POST","path":"/v1/orders"},"skip":"Delivery quoting needs catalog stock and delivery-method fixtures; outside payment-request coverage."} -->
{
"line_items": [{"type": "variant", "variant_id": "var_01ARZ3NDEKTSV4RRFFQ69G5FAV", "quantity": 1}],
"delivery": {
"type": "shipment",
"delivery_method_id": "dmet_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"destination": {
"type": "address",
"address": {"line1": "120 Kent Avenue", "city": "Brooklyn", "state": "NY", "postal_code": "11249", "country": "US"}
},
"recipient": {"name": "Ada", "email": "ada@example.com"},
"expected_amount_money": {"amount": 500, "currency": "USD"}
}
}
type supports shipment and local_delivery. The method must serve the order in one delivery choice group; Flint refuses an unavailable method instead of picking another. To use a saved address, send destination: {"type": "customer_address", "customer_address_id": "caddr_..."} for an address belonging to the order's customer.
expected_amount_money is optional and compares the final delivery amount, including delivery discounts and tax. A mismatch returns 409 DELIVERY_REQUOTE_REQUIRED with the current amount in details[].current_money, without changing the order or its holds. inventory_reservation_ids accepts up to 100 distinct merchant cart reservations. Flint credits them while quoting and atomically adopts matching held item and location units into the selection hold. Unused and committed units stay on their source reservation; remaining demand uses available stock. Foreign or ineligible IDs return not found.
To replace delivery, PATCH the order with the full delivery object and its current version as expected_version. Omit delivery to keep it, or send null to clear a provisional direct-order selection, its charge, and hold. Send delivery changes separately from delivery_destination, handover, and shipping charge calculations. Open, unpaid orders owned only by a draft invoice are allowed, including Quick Pay orders. Issued invoices, checkout ownership, subscription ownership, payment locks, and committed selections prevent this change.
Read governing_delivery_selection_id for the selection and delivery_destination for its resolved address. delivery reports that selection's method, type, and recipient. Retry a lost response with the same Idempotency-Key and unchanged body to recover the committed result without repeating hold adoption.
Payment state on list rows#
GET /v1/orders and GET /v1/me/orders include active_payment_attempt when an attempt is active. It carries the same payment status and amount as a single-order read, including a bank debit still processing after its collection window ends. It is omitted when no attempt is active or its payment details are temporarily unavailable. Buyer list responses use the same field visibility as buyer single-order responses.
Use the attempt's status to distinguish a payment that is processing or requires_capture from an order awaiting a new payment. payment_status continues to describe settled payments; an unsettled payment does not make the order paid. Read the individual order before offering payment actions. List responses do not include payment collection guidance or pending client actions.
POST /v1/orders/{order_id}/pay can return 200 with a processing attempt while Flint finishes recording the payment. Keep that attempt ID and show the buyer that the payment is processing. Poll GET /v1/orders/{order_id} or wait for the order's payment webhook to learn the outcome. If you retry the pay request, send the same body and Idempotency-Key: a response that stopped waiting for completion does not freeze the attempt's result, and the retry returns the settled result once available. Do not start another payment while the attempt is processing.
Prepaid delivery orders#
A prepaid delivery order reports prepayment_order_id for the order that paid, subscription_delivery_number from 2 to the period's delivery count, and subscription_cycle for the cycle that paid. The first two fields are null on other orders. Delivery merchandise has a 100% discount with discount_source: prepaid_delivery, and shipping is waived. Fulfill these paid orders as usual; they make no new charge. See Prepaid deliveries.
Read an order's state#
status says whether the order still accepts changes and new payments. An order is open while you build and collect it, and closed once collection completes or it stops. Refunds, fulfillment, disputes, returns, and edits to metadata and notes continue on a closed order.
The other status fields move independently, so read the one that answers your question:
| Field | Answers | Values |
|---|---|---|
payment_status | How much of the total was collected? | unpaid, partially_paid, paid |
refund_status | How much collected money went back? | none, partially_refunded, refunded |
fulfillment_status | How far has fulfillment gone across all quantities? | See Order fulfillment status |
inventory_exception_status | Did stock fail after payment? Absent when nothing went wrong. | paid_inventory_failed, resolved |
dispute_status | Is a payment on the order disputed? Merchant reads only; buyer reads omit it. | none, an open state, or a closed one such as lost. See Read dispute state on an order |
A fully refunded order reads paid and refunded. An order becomes paid when collection completes and closes with closed_reason: paid. Reversing a recorded invoice payment reopens the order when it leaves an outstanding order balance. The order then reads unpaid or partially_paid, depending on what remains collected, and Flint sends an order webhook with the new balance.
Why an order closed#
closed_reason and closed_at are set when the order closes and are absent while it is open. For paid, closed_at is when collection completed. If the order reopens and the buyer pays again, Flint records the new completion time. More reasons can be added, so handle one you don't recognize like other.
closed_reason on orderpaidCollection completed: a card payment, a recorded offline payment, gift cards or return credit covering the balance, or a zero-balance order completed withPOST /v1/orders/{order_id}/pay.closed_by_merchantYou closed the order. Your note, if you sent one, is inclosed_reason_message, which buyers never see and which is absent on every order Flint closed itself.checkout_expiredAn unpaid payment link or shop checkout expired.invoice_voidedIts Quick Pay invoice was voided while the order was open with no collected payment and no fulfillment.written_offThe order's invoice was marked uncollectible.payment_statusreflects only what was paid,unpaidorpartially_paid, because the written-off balance never arrived. Checkclosed_reasonto tell it from an order still collecting.supersededFlint canceled an unpaid subscription renewal order, for example to replace it with a newer attempt.return_resolution_canceledThe return resolution that created this replacement order was canceled.otherA reason your API version doesn't name.
Money on an order#
Tax rows in tax.tax_breakdowns include required order_id beside any order_line_item_id or order_charge_id. Flat order tax rows also name the order. Buyer projections carry only the buyer's own order ID.
Delivery quote line items, pickup availability quantities, and delivery selection choices include required order_id. Checkout credentials receive only the order belonging to their own session.
pricing_amounts is the order price, including the original settled tip after a refund. settlement_amounts tracks what was paid, refunded, written off, and is still outstanding. Before any payment, settlement_amounts.outstanding_money equals pricing_amounts.total_money.
{
"pricing_amounts": {
"subtotal_money": {"amount": 4800, "currency": "USD"},
"discount_money": {"amount": 500, "currency": "USD"},
"charge_money": {"amount": 595, "currency": "USD"},
"additive_tax_money": {"amount": 372, "currency": "USD"},
"inclusive_tax_money": {"amount": 0, "currency": "USD"},
"tax_money": {"amount": 372, "currency": "USD"},
"requested_tip_money": {"amount": 0, "currency": "USD"},
"total_money": {"amount": 5267, "currency": "USD"}
}
}
- Subtotal
pricing_amounts.subtotal_moneyTwo mugs at $24.00$48.00 - Discount
pricing_amounts.discount_money−$5.00 - Charges
pricing_amounts.charge_moneyShipping$5.95 - Tax
pricing_amounts.additive_tax_money$3.72 - Requested tip
pricing_amounts.requested_tip_money$0.00 - Total
pricing_amounts.total_money$52.67
Tax already inside tax-inclusive prices is reported in inclusive_tax_money and isn't added again. Shipping and other fees are order charges, and a free-shipping discount lowers charge_money rather than adding to discount_money.
Read settlement_amounts.outstanding_money for the amount still owed. Refunds return money already collected and don't add to it. removed_money is the value order edits took off the order, which it no longer owes. paid_money counts processor payments, recorded offline payments, gift card value, and return credit. To show how an order was paid, read gift_card_settlements for each gift card redemption, with its masked last characters and tip share, and return_credit_settlements for value applied from returned items, such as an exchange's replacement order, with the Return and resolution it came from.
settlement_amounts.disputed_money is the principal of open disputes, and dispute_lost_money the principal of lost ones. Disputes never reopen outstanding_money; a lost dispute reduces net_collected_money. This signed amount is paid_money - refunded_money - dispute_lost_money and can be negative when refunds plus lost disputes exceed payments. It excludes processing and dispute fees.
Build the order#
Each line item has a type:
type | You send | Flint resolves |
|---|---|---|
variant | variant_id and quantity | Name, price, tax, and delivery settings from the catalog |
bundle | bundle_id and quantity | The bundle's price and components |
custom | name, unit_price_money, quantity, and fulfillment | Nothing: the line is what you send |
A custom line needs fulfillment; send {"requirement": "none"} for services, digital goods, and items handed over at the point of sale. Only a custom line accepts unit_weight and unit_dimensions for delivery pricing, because catalog lines use the variant's. Lines return the weight and dimensions recorded when they were created, and omit them when unknown and on bundle lines. Adding inventory_demands to a custom line makes it consume tracked stock.
The rest of the order has its own routes and guides:
- Discounts. Apply one with
POST /v1/orders/{order_id}/discounts, remove several at once, including signup promotions listed indeferred_promotions, with.../discounts/remove, and call.../discounts/repriceafter an eligibility input changes. See Promotions. - Tips and fees. Set
requested_tipon create or withPATCH /v1/orders/{order_id}, and add fees as charges. See Tips and charges. - Tax.
tax.price_modeisinclusivewhen the order's prices include tax andadditivewhen tax is added. Automatic tax applies it to every line item and charge; with external tax, each line item and charge states its own mode intax.calculation.price_mode. See Sales tax and External tax calculations. - Inventory. An order with a tracked variant needs an
inventory_routing_source, a fixed Location, an allocation policy, or an immutable policy revision, before it can hold stock. Sendtypeand its required ID:location_idforfixed_location,inventory_allocation_policy_idforpolicy, orinventory_allocation_policy_revision_idforpolicy_revision. IDs from other branches are rejected. See Inventory. To sell past available stock or ahead of a release date, see Backordered and pre-ordered lines.
Variant quantity pricing#
Catalog variant lines select a net unit_price_money from the variant's base price and quantity_price_breaks. Each line uses its own quantity; separate lines for the same variant are not combined. The largest minimum_quantity at or below the line quantity applies.
The line's catalog_pricing reports source: "variant" or "price_list", the selected price_list_id (or null for variant pricing), and the applied minimum_quantity, or null for the base price. With a customer, Flint chooses the active direct price list if it prices the variant, then an active list for the customer's segment, then the variant. Each line uses its own quantity; quantities on separate lines are not combined. This object is absent on custom lines, bundle lines, and older lines without recorded pricing facts, and it is never shown to buyers. You cannot supply catalog_pricing or a unit price for a catalog line.
Each line keeps the schedule from when it was added. Changing its quantity on an open order selects from that schedule, even after the variant's prices change. Older lines without a saved schedule keep their stored unit price. After the order has received a payment, a quantity change that would select a different unit price returns 409 ACTION_NOT_ALLOWED with reason payment_collected and param: quantity. A quantity change on a fully paid order or on a line with settled units is refused with the same code and reason, whether or not the price would change. Subscription renewal orders keep their locked unit prices.
Promotions discount the selected net price plus modifiers. For example, ten units priced at $8 each have an $80 base subtotal before a percentage discount. Quantity pricing does not count toward max_promotions_per_order.
Subscribe and save lines#
To sell a catalog variant on a subscription, send subscription on its line with the subscription_offer_id, billing_interval, and billing_interval_count of an active subscription offer. Lines with the same cadence start one subscription. Switch a line before payment with PATCH /v1/orders/{order_id}/line-items/{order_line_item_id}, sending subscription, or null for a one-time purchase, with the order's version as expected_version. After payment, each subscribed line reports the subscription_id it started.
Gift card purchase lines#
To sell a gift card, add a line for a variant of a gift_card product. Send gift_card_purchase.face_value_money to choose an amount within the variant's custom amount bounds, or omit it for the reference denomination, and add an optional recipient for email delivery. Don't send unit_price_money: Flint prices the line from the offer and returns gift_card_purchase with the frozen configuration, reference price, face value, and consideration per card. quantity counts cards with the same terms, and later catalog price changes don't reprice the line. Gift card purchases aren't taxed, take no ordinary discounts, and need no shipping or inventory.
Until funding starts, change the face value or recipient with PATCH /v1/orders/{order_id}/line-items/{order_line_item_id}, sending gift_card_face_value_money, gift_card_recipient, or both, with expected_version. Flint reprices a face value change as the new face value times the offer's price divided by its reference face value, then recalculates the order. Sending the current face value changes nothing and keeps version. A recipient change keeps the face value and price and leaves an open checkout running. Neither can change while a payment attempt is unresolved or once the order has received any payment, and a funded line returns 409 ACTION_NOT_ALLOWED with reason field_locked. After a failed or canceled attempt that collected nothing, you can edit them again.
Paying needs a customer_id on the order, or a checkout buyer who verified their identity, and a purchase over the buyer's funding limits is refused before collection starts. Each card activates when its full consideration is captured and settled; a partly paid unit stays unissued. line_items[].purchased_gift_cards lists the issued cards by ID, unit_ordinal, and last characters. Order reads never include codes. Refunds and funding losses covers refunds, manual payment reversals, and replacement cards.
Payment-link references#
client_reference is the buyer or cart reference sent when a payment link started checkout. It is copied at resolve, including onto a subscription signup's first order, and never changes. It is null when none was sent or the order did not come from a payment link. Merchant reads and order webhooks, including order.paid, carry it; buyer credentials cannot read its value. Create and PATCH do not accept it. Treat it as a buyer-controlled claim, not proof of identity. Use external_reference_id for your merchant-owned identifier for the order.
custom_field_answers holds the buyer's answers to a payment link's custom fields, recorded when checkout started. Each answer keeps the field's payment_link_custom_field_id, key, label, and custom_field_type from that moment, so later changes to the link don't change it. value is a string for text, textarea, and dropdown, and true or false for checkbox, where false means the buyer left an optional box unchecked. Answers come in the order the link showed the fields, and optional fields left blank are left out. The list is empty when the order didn't come from a payment link or the buyer answered no fields. Orders created before Flint recorded answers here return an empty list and keep their answers in metadata as custom_field_<key>. Merchant reads and order webhooks carry it; buyer credentials can't read it. Create and PATCH do not accept it, and metadata updates don't change it. Deleting the customer removes the answers.
Each line created from a payment link line item carries that item's key as payment_link_line_item_key, in reads and order webhooks, and buyer reads include it. Flint sets it when checkout starts and it never changes; metadata updates don't affect it. It is null on lines that didn't come from a link line item: lines added to the order later, lines from orders that didn't come from a payment link, and lines from a subscription plan on a subscription signup link. Create and PATCH do not accept it.
Change an open order#
catalog_price_behavior defaults to keep: attaching a customer preserves the existing prices. Send catalog_price_behavior: "reprice" with an explicit, non-null customer_id to refresh every catalog variant line on an open, unpaid order. This also allows reassignment to another customer. Flint resolves the new customer's direct list, then segment list, then variant pricing, and freezes the selected schedules again. Custom lines and bundles keep their prices; subscription-owned and return-owned orders cannot be repriced this way. A customer cannot be removed with customer_id: null. If any catalog line's variant is no longer for sale, the reprice is refused with 409; remove that line, then reprice.
Checkout does not reprice after customer verification. Supply the customer when creating the order. Close an active checkout session before changing the order's customer or explicitly repricing it.
Every order carries a version. Send the value you last read as expected_version, and a write fails with 409 VERSION_CONFLICT, with the current value in details[0].current_version, if the order changed since. Order updates, close, pay, gift card selection, discounts, and line item and charge updates and deletes accept expected_version. Line item and charge creates (POST /v1/orders/{order_id}/line-items and POST /v1/orders/{order_id}/charges) accept expected_order_version instead. DELETE routes take it as a query parameter. Line items have no version of their own: send the order's.
PATCH /v1/orders/{order_id} changes the order's own fields in one request, including customer_id, notes, metadata, tax, delivery_destination, handover, requested_tip, and inventory_routing_source. Send null to clear buyer_note, internal_note, external_reference_id, delivery_destination, handover, or requested_tip. null on any other field returns 400 INVALID_REQUEST.
A request that changes only metadata, notes, or external_reference_id works on any order, including closed and paid orders and orders with an invoice. It changes no amounts and leaves an open checkout session running. A request that also changes another field follows that field's rules for the whole request.
metadata merges by key: a null value removes a key, and metadata: null removes all of your keys. Keys starting with flint_ are reserved for Flint and can't be written or deleted, and no response returns them. The 50-key limit counts only your keys.
Order changes share these 409 refusals:
| Code | Meaning and what to do |
|---|---|
VERSION_CONFLICT | The order changed after the read your expected_version came from. Read the order again and rebuild the change. |
ACTION_NOT_ALLOWED | The order can't take this change. details[0].reason is terminal_status for a closed order, or payment_collected for an order that is still open but already paid, with the order's status in current_status. Starting or capturing a payment on such an order returns the same code with param: order_id, and already_applied instead of payment_collected. |
PAYMENT_ATTEMPT_ACTIVE | A payment attempt on the order hasn't finished, including an authorization waiting for capture. Resolve it with an action from details[0].supported_actions, then change the order. |
OPERATION_IN_PROGRESS | Payment work on the order is still running. Retry the same request with the same Idempotency-Key, after Retry-After when present. |
RESOURCE_IN_USE | The order has an invoice, even a draft, so its financial fields are fixed. Changes to only metadata, notes, or external_reference_id still work. |
Flint checks a saved-payment token against the request before it checks the order's state, so a token it can't use is reported first.
Errors has the retry guidance for each code. To take unshipped items off a paid order, see Edit a paid order.
Delivery destination#
delivery_destination is where the order ships or is delivered. In checkout, the buyer's delivery selection writes it. governing_delivery_selection_id names the selection that governs the order: the checkout's provisional selection before payment, and the selection a payment committed after. Read it with GET /v1/delivery-selections/{delivery_selection_id}. It appears on every order response, list, expanded order, buyer read, and order.* webhook. While it is set, change the destination through the delivery selection, not the order. It is null when no selection governs the order, including on the response that creates the order.
While the order is open and unpaid, governing_delivery_selection_id follows the checkout's current selection, including a pickup choice that sets no delivery_destination. It becomes null when that selection expires or stops matching the order, such as after a cart change. Once the order is paid or closed, or its destination is frozen, it keeps the selection recorded with the order.
Flint takes no card or other online payment for an order with items to ship, deliver, or pick up until it has a delivery selection or a handover, and refuses with 409 ACTION_NOT_ALLOWED, reason configuration_required. Set delivery_destination yourself only for an order you collect outside Flint, such as an invoice paid with a recorded offline payment, and set it before you create the invoice. While the order is open and unpaid, each update replaces the whole destination, and null clears it, for example before you remove the order's last item to deliver.
Sell for carry-out with a handover#
For a counter sale where the buyer leaves with the goods, set handover instead of a delivery destination:
"handover": {"location_id": "loc_01KEZF7C00CMHRRYA3MV996JB2"}
Every item that would otherwise need a delivery choice (shipping, pickup, or local delivery) is handed to the buyer at that location when the order is paid. Paying needs no delivery quote or selection, online, in person, or with a gift card. Digital and service lines keep their own fulfillments, and lines with no fulfillment requirement are unchanged.
- Location. It must be active and have a complete address:
line1,city,postal_code, andcountry, plusstatefor a US address. Otherwise you get409 ACTION_NOT_ALLOWEDwith reasonconfiguration_requiredathandover.location_id. - Stock. Tracked items take stock from the handover location, and they can't be backordered. The location must have
inventory_allocation_enabled: true. Setting the flag needscommerce.inventory.allocation.writeas well asmerchants.locations.write; see Inventory. Leaveinventory_routing_sourceout and the order routes from that location. A routing source that takes stock anywhere else returns400 INVALID_REQUEST, detailNOT_ALLOWED, athandover.location_id. - Tax. Automatic tax treats the sale as made at the handover location, as for pickup, so you don't need the buyer's address.
- Changing it. Set
handoveron create or withPATCH /v1/orders/{order_id}, and sendnullto clear it.- It can't change after a payment. A paid order is closed, so you get
409 ACTION_NOT_ALLOWEDwith reasonterminal_status; an open order with part of its total paid returns reasonpayment_collected. - It can't change while a checkout session or delivery selection controls the order's delivery:
409 ACTION_NOT_ALLOWED, reasonfield_locked. An order an invoice collects returns409 RESOURCE_IN_USE, as for its other fields. - Return replacement and subscription orders can't carry a handover.
- An order can't have both
handoveranddelivery_destination:400 INVALID_REQUEST, detailNOT_ALLOWED, athandover.
- It can't change after a payment. A paid order is closed, so you get
- At payment. When the order is paid, Flint creates one fulfillment with
type: handoverat the location, covering those items, and completes it right away.completed_atis the order'spaid_at. You receivefulfillment.createdandfulfillment.completed, and the buyer gets no fulfillment email. Returns work as for any completed fulfillment.
Any payment, including a recorded offline payment, freezes the destination and sets its frozen_at. For a paid subscription signup or renewal, you can still correct the destination before shipment by sending it with expected_version, as long as the committed delivery methods remain eligible and shipping and tax stay the same. To fix a delivery problem on any other paid order, change fulfillment.recipient on the fulfillment; the order keeps what the buyer committed to.
Automatic tax destination coverage#
tax.supported_countries is a read-only, sorted array of destination country codes where automatic tax can calculate every taxable line on the order. It is present only when tax is enabled in automatic mode. Current coverage is the United States (US) for every category, and Canada, the 27 EU member states, the UK (GB), Australia (AU), and New Zealand (NZ) for digital_goods, software, and saas. Read the tax connection's coverage for category scope. Physical goods, services, professional_services, and taxable charges are unsupported outside the US. Intersect it with delivery input constraint.supported_countries for a shipping address picker, and use it alone for a tax address picker. The field is absent when tax is off or external.
Checkout requires merchant-supplied external tax to match the selected delivery address. To update the quote for a new destination, send the recalculated components and the full address in tax.location with address_type set to tax_address. See Supply external tax components.
Tax exemption#
tax.exemption chooses whether an exemption applies to the order. Its type is customer, the default, which applies the customer's tax_exempt flag or else one of their exemption records; order, a one-off declaration with reason and coverage and optional certificate_number, description, and evidence_reference, where description is required when reason is other and limited to 500 characters, as on a customer exemption record; or none, which taxes the order regardless. Subscription renewals always use customer. Once the order's tax commits, which a collected payment, an issued invoice, or a confirmed return replacement does, changing it returns 409 ACTION_NOT_ALLOWED with reason payment_collected.
The response's tax.exemption is the exemption that applied, not the selection you sent: source (customer, order, or none), customer_tax_exemption_id, reason, coverage, certificate_number, start_date, end_date, and, in merchant reads only, evidence_reference. It is recalculated with the order's tax and freezes when tax commits. Flint keeps your selection, but responses don't return it: an order declaration that doesn't cover the order's destination stays on the order, and responses show source: none until it applies. To change the selection, send the whole tax.exemption again. An exemption that expires, is archived, or changes before a payment attempt's first confirmation or authorization makes the payment return 409 ACTION_NOT_ALLOWED with reason configuration_required. On an ordinary unpaid order, Flint then recalculates the order's tax. A confirmed return replacement keeps its frozen prices. If Flint already accepted an unconfirmed payment attempt, the refusal leaves it open: cancel any open attempt with POST /v1/orders/{order_id}/payment-attempts/{order_payment_attempt_id}/cancel, cancel its unpaid resolution, create a new one, and confirm the new one. Sales tax covers which exemption applies and what happens at expiry.
External tax calculations#
A line item or charge carries its own tax.calculation, with price_mode and components, only while the order uses external tax, and responses include it only then. To switch an existing order to external tax, or to rerate one, send tax.line_item_calculations and tax.charge_calculations in the same PATCH /v1/orders/{order_id}. These lists exist only on that route. Each entry names an order_line_item_id or order_charge_id and gives its calculation. Listed calculations replace the old ones and unlisted ones stay, but every component with an amount needs one, including non-taxable components; otherwise the update fails, names every component still missing a calculation, and leaves the order unchanged. Switch an existing order to external tax has an example.
Send tax.calculation.components_source: "callback" with mode external to have the environment's selected tax calculation callback supply every calculation instead. Flint calls it whenever the order's tax would change and before a payment when the last evaluation is more than 24 hours old. Responses then return tax.components_source callback, tax.callback_evaluation with the tax_calculation_evaluation_id and evaluated_at of the answer in use, and each line item's and charge's tax.calculation as the callback returned it. tax.components_source is provided on other external-tax orders and absent when tax is automatic or off; tax.callback_evaluation is absent until the callback answers and while tax.status is requires_location or incomplete. A callback order refuses components, tax.line_item_calculations, tax.charge_calculations, and tax.delivery_charge_calculation with 400 INVALID_REQUEST and detail code NOT_ALLOWED. Switching to callback drops your calculations and calls the callback in the same request; switching back to provided needs every calculation in that request. When the order needs an evaluation and no active callback is selected, the request returns 409 ACTION_NOT_ALLOWED with reason configuration_required and resource_type tax_calculation_callback. A failed callback returns 502 EXTERNAL_SERVICE_ERROR with reason tax_callback_failed, and the order is unchanged.
tax.delivery_charge_calculation is a price_mode and components template for delivery charges that checkout generates, with percentage components only and mode left out or external. Flint copies it onto each positive delivery charge a selection creates, including paid pickup. It doesn't change charges that already exist, and tax.charge_calculations overrides a generated charge. A new selection creates the charges again and applies the template again. Send null to clear it. Without it, a paid selection leaves the order's tax incomplete and payment returns 409 ACTION_NOT_ALLOWED with reason configuration_required. A callback order takes no template: its callback returns each generated charge's calculation. See Tax delivery charges.
An unknown ID returns 404 RESOURCE_NOT_FOUND with details[0].resource_type order_line_item or order_charge, and a repeated ID returns 400 INVALID_REQUEST. Sending these lists to an order whose tax is automatic or off returns 400 INVALID_REQUEST with detail code NOT_ALLOWED. Switching to automatic tax, or turning tax off, clears unsettled calculations in the same update; settled ones stay for history. A settled component's calculation can't change, and once any payment has settled, neither can the tax mode or whether tax is on: both return 409 ACTION_NOT_ALLOWED with reason payment_collected.
Edit a paid order#
An order edit swaps items on a paid order. It removes unshipped units, adds items, or both. By default, removed value and released charges must cover the added items. Send balance_due_behavior: "collect" to collect a balance before applying the edit. Any remaining credit goes back to the buyer. To swap a size before shipping, remove the old units and add the new variant in the same edit. Preview the change before committing it. Edit a paid order walks through the whole flow.
POST /v1/orders/{order_id}/edits makes the edit. It requires an Idempotency-Key and both commerce.orders.write and commerce.refunds.write, because it changes the order and moves money. An open order that hasn't been paid keeps the line item routes.
| Field | Meaning |
|---|---|
expected_order_version | The order version you read. Required. If the order has changed since, the request returns 409 VERSION_CONFLICT and nothing changes. |
remove_line_items | 1 to 100 entries, each with an order_line_item_id and a whole quantity to remove. A line can appear once. Send this, add_line_items, or both. |
add_line_items | 1 to 100 lines in the line item create shape, added after removals. Only variant, bundle, and custom lines with a delivery requirement can be added. |
charge_refunds | Charges to release as credit, such as a delivery charge, each with an order_charge_id. Leave out amount_money to release what is still refundable on the charge. Charges you don't list stay as they are. Optional. |
destinations | Where the original payments go back to, with the same values and defaults as a refund. Optional. |
reason | Why the items are coming off: any refund reason, including out_of_stock for units you couldn't supply. Optional. |
note | A note for your team, up to 500 characters. Buyers never see it, and it doesn't become the refund's reason_message. Optional. |
Only quantity that is still unassigned_quantity can come off, because no fulfillment has claimed it. For a bundle line, a unit comes off only when every component of that unit is unassigned. Quantity in a fulfillment, shipped, or delivered stays on the order:
- Units in a fulfillment that hasn't been handed off: end the fulfillment with
failandrelease_quantity: true, which returns the units tounassigned_quantity, then edit the order. See Cancel, fail, and try again. - Units that were dispatched or delivered: use a Return.
Tracked stock can take a moment to release after a fulfillment fails. Edits that remove units from the affected lines can return 409 OPERATION_IN_PROGRESS in the meantime. Retry the same request with the same Idempotency-Key after a short delay.
The line keeps its original quantity and price. Lines with no fulfillment_quantities, such as services, digital items, gift cards, and tickets, or any line on an order whose obligations are unknown, can't be removed. Refund them through POST /v1/refunds.
<!-- docs-test {"skip":"Paid-order edits and fulfillment changes are outside payment-request coverage."} -->
curl -X POST https://api.withflintpay.com/v1/orders/ord_01KEZF7C00JBKMARG3P06Z224B/edits \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Flint-Version: 2026-09-07" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: edit-ord_01KEZF7C00JBKMARG3P06Z224B-1" \
-d '{
"expected_order_version": 7,
"reason": "out_of_stock",
"note": "Warehouse count came up short on the large size",
"remove_line_items": [
{"order_line_item_id": "li_01KEZF7C004XP0V220YVMGQ354", "quantity": 1}
]
}'
The response is 201 with the pending or completed order_edit, the current order, and the refunds the edit created. This example shows only the fields an edit changes on the order and the refund:
{
"data": {
"order_edit": {
"order_edit_id": "oed_01KEZF7C00R4Q8T5N2M6W1XV3C",
"order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
"status": "completed",
"reason": "out_of_stock",
"note": "Warehouse count came up short on the large size",
"remove_line_items": [
{
"order_line_item_id": "li_01KEZF7C004XP0V220YVMGQ354",
"quantity": 1,
"refund_money": {"amount": 1200, "currency": "USD"},
"total_money": {"amount": 1200, "currency": "USD"}
}
],
"add_line_items": [],
"added_total_money": {"amount": 0, "currency": "USD"},
"charge_refunds": [],
"removed_total_money": {"amount": 1200, "currency": "USD"},
"refund_money": {"amount": 1200, "currency": "USD"},
"refund_ids": ["ref_01KEZF7C00H2GAMWD73WZ7K81W"],
"unrefunded_money": {"amount": 0, "currency": "USD"},
"supported_actions": [],
"created_at": "2026-11-06T00:05:00Z"
},
"order": {
"order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
"version": 8,
"refund_status": "partially_refunded",
"refund_ids": ["ref_01KEZF7C00H2GAMWD73WZ7K81W"]
},
"refunds": [
{
"refund_id": "ref_01KEZF7C00H2GAMWD73WZ7K81W",
"order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
"order_edit_id": "oed_01KEZF7C00R4Q8T5N2M6W1XV3C",
"status": "pending",
"reason": "out_of_stock",
"amount_money": {"amount": 1200, "currency": "USD"}
}
]
}
}
An edit records proposed item changes while pending, then becomes completed when the changes are applied or canceled when it ends without applying them. Once completed or canceled, its status and item changes never change again. Its remove_line_items and charge_refunds hold the amounts Flint calculated when it was created, so they don't move if prices, tax rules, or refund settings change later. Each removal's total_money is the value of the units and refund_money the part refunded to the buyer; each charge's amount_money is the value released and refund_money the part refunded. removed_total_money adds up the removals' total_money. add_line_items lists each new order_line_item_id, quantity, and total_money, and added_total_money adds up those values. Each new order line carries order_edit_id, the edit that added it; lines not added by an edit carry null. With no additions, add_line_items is [] and added_total_money is zero. status is pending, completed, or canceled. Read edits with GET /v1/orders/{order_id}/edits and GET /v1/orders/{order_id}/edits/{order_edit_id}, which need commerce.orders.read. The order's activity log gets an order_edited row.
What an edit does#
When you send the request, Flint does these together, and either all of them happen or none do:
- Checks
expected_order_version. - Checks again that the units are still unassigned. If a fulfillment claims them first, the request fails and nothing changes. Read the order again and rebuild the edit.
- Checks that removed value and released charges cover the added items, and records the edit with its frozen values and refund amounts.
- Releases the stock behind the removed units. Units that are still backordered go first, then committed ones, so a line waiting for stock gives up its place in line before it gives up stock set aside for it. Released committed stock counts in
available_quantityagain, and nothing physical moves. See Track inventory. - Adds the new lines, commits their stock and tax, and adds the
order_editedactivity row. - Saves the refund to create.
Flint then creates the refund and returns it in refunds. If it can't finish during the request, the edit still stands and refunds can be []. Flint keeps trying on its own, and sends refund.created once the refund exists. If it stops without creating one, retry the edit. To find the refund, read the edit's refund_ids or follow refund.created; repeating the request with the same Idempotency-Key returns the same edit and doesn't edit the order twice.
Each removed unit is valued the same way as a quantity refund, including its share of discounts and tax. Its value pays for added items first; the remainder goes back to the payment that paid for the line. Flint doesn't re-evaluate promotions, and charges change only through charge_refunds. Tax goes back as it does for any refund.
Units with a value of zero, such as a fully discounted item, are still removed and recorded in the edit. They add nothing to a refund, so an edit that comes to zero creates no refund, and refund_ids and refunds are [].
Removed units count as final in the order's fulfillment_status, like canceled ones. Existing lines keep their sale prices. Added lines increase the order's pricing_amounts. Money refunded to the buyer appears in settlement_amounts and refund_status, as for any refund. settlement_amounts.removed_money adds up the value every edit removed, including its charge_refunds. By default, an edit checks that removed value and released charges cover the added lines before committing. Opt in to collecting the balance to apply the edit after payment.
When the edit applies, Flint emails the buyer what was added or removed, or confirms cancellation if the edit removes every item. The email includes any refund due. The buyer also gets the usual refund receipt when the refund succeeds. The edit's note stays private. An edit with the reason out_of_stock shows "Item out of stock" on the refund receipt. Other reasons follow the refund's receipt rules.
An edit sends order_edit.created. An edit that collects a balance also sends order_edit.completed when applied, order_edit.canceled when canceled, and order_edit.updated when its payment link changes. The refund it creates sends refund.created and the other refund.* events. See Webhook events and payloads.
Collect a balance on an edit#
If the payment processor cancels the balance payment, Flint creates a new one and sends order_edit.updated with the new payment_intent_id; read the edit again and confirm the new intent.
Send balance_due_behavior: "collect" when creating an edit whose added items cost more than the removed value and released charges. Omit it, or send refuse, to keep the default 409 LIMIT_EXCEEDED refusal. Send the preview's amount_due_money as expected_amount_due_money: a different balance returns 409 VERSION_CONFLICT before any write, including when the expected balance is zero.
The create result contains order_edit, order and refunds. An edit with a balance starts pending; refunds is empty. Confirm its payment_intent_id with the buyer's card using POST /v1/payment-intents/{payment_intent_id}/confirm. If the ID is briefly null, read the edit again. Use a saved card with customer_presence: "absent" for an off-session charge, or collect a new credential with the buyer present. Complete a bank authentication step through current_payment_action, then confirm again. A decline leaves the edit pending; retry confirm with another credential.
The balance is frozen in amount_due_money, including tax. The payment captures automatically and accepts cards only. Platform fees and splits are refused. Cancel the edit instead of canceling or changing its payment intent. The intent names both order_id and order_edit_id.
The order stays paid and closed with zero outstanding money while the edit is pending. pending_order_edit_id names the edit. Its removed units cannot join a fulfillment, and their reserved credit cannot be refunded or returned; untouched units and unreserved value remain available. A second edit returns 409 ACTION_NOT_ALLOWED, reason order_edit_pending. Cancel the pending edit, or wait for its payment, then try again.
Read status before fulfilling added items. Fulfill on order_edit.completed, or order_edit.created with status completed. The reserved add_line_items[].order_line_item_id is not on the order until completion. The order emits order.updated when the pending pointer is set or cleared, including completion, and does not emit another order.paid.
POST /v1/orders/{order_id}/edits/{order_edit_id}/cancel requires an Idempotency-Key and commerce.orders.write. Its optional body accepts the edit's expected_version. It returns 200 with order_edit and order. Reuse the same key to replay the result. A completed edit refuses cancellation with 409 ACTION_NOT_ALLOWED and reason terminal_status. An already canceled edit with a new key returns 409 ACTION_NOT_ALLOWED with reason already_applied. A processing payment refuses cancellation with in_progress.
At expires_at, 24 hours after creation, an unpaid edit cancels with cancellation_reason: expired. Processing payments and payment reviews defer expiry until they resolve. Other cancellation reasons are merchant_request, payment_disputed and payment_returned. Cancellation releases every hold without applying the edit. If payment succeeds but Flint cannot apply the edit, Flint returns the payment in full with a refund whose reason is payment_returned; the payment intent keeps its status: succeeded, or canceled when Stripe reported the capture after Flint canceled the intent. It shows the returned money through its refunds.
Confirming a fresh payment after expires_at cancels the edit with cancellation_reason: expired and returns 409 ACTION_NOT_ALLOWED with reason terminal_status, naming the order edit with current_status: canceled, unless an admitted payment defers expiry or cancellation needs recovery.
Every edit includes version, amount_due_money, nullable payment_intent_id, expires_at, completed_at, canceled_at and cancellation_reason. created_at records creation; completed_at records application. Pending and canceled edits have zero refund_money and unrefunded_money and empty refund_ids. supported_actions contains cancel while pending unless the payment is processing or succeeded; completed edits can still list retry for remaining refunds. Filter the edit list by status.
Retry a refund that failed#
An edit can end up owing the buyer money in two ways. The refund it created can fail, fully or in part, like any other refund. Or Flint can stop trying to create the refund after the edit committed. Either way the edit stays completed and its units stay removed. Flint holds the money the edit refunds for that edit, so a refund you create with POST /v1/refunds can't use it. Retry from the edit instead.
Each edit reports what it still owes the buyer:
| Field | Meaning |
|---|---|
unrefunded_money | The refund money the edit froze, less its pending and succeeded refunds. It is above zero until a refund is created or after one fails, and drops as refunds go back. |
supported_actions | Contains retry when unrefunded_money is above zero and nothing is in progress: none of the edit's refunds is pending, and Flint isn't still creating the first one. Otherwise it is empty. |
POST /v1/orders/{order_id}/edits/{order_edit_id}/retry refunds unrefunded_money. It requires an Idempotency-Key and both commerce.orders.write and commerce.refunds.write. The body is optional. Send destinations to choose where the original payments go back to, with the same values as when you created the edit, or leave the body out to reuse the destinations you chose then.
<!-- docs-test {"skip":"Paid-order edits and fulfillment changes are outside payment-request coverage."} -->
curl -X POST https://api.withflintpay.com/v1/orders/ord_01KEZF7C00JBKMARG3P06Z224B/edits/oed_01KEZF7C00R4Q8T5N2M6W1XV3C/retry \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Flint-Version: 2026-09-07" \
-H "Idempotency-Key: retry-oed_01KEZF7C00R4Q8T5N2M6W1XV3C-1"
The response is 201 with the order_edit and the refunds this call created. The new refund carries the edit's order_edit_id and reason, and it covers only the money still owed, even for a line whose removed units an earlier refund already covered. Watch it like any refund, with refund.created and the other refund.* events. If it fails too, unrefunded_money is above zero again and you can retry again.
A retry returns 409 ACTION_NOT_ALLOWED in these cases, with details[0].reason:
already_applied: nothing is left to refund, becauseunrefunded_moneyis zero.in_progress: one of the edit's refunds is stillpending, or Flint is still creating the edit's refund and hasn't recorded one yet. Wait for it to finish, then read the edit again.supported_actionsincludesretryonce nothing is in progress and money is still owed.payment_disputed: the payment is under dispute or a bank return took the money back, as on a refund.
If Flint can't create the refund while the edit request runs, refunds is [] and Flint keeps trying on its own, as What an edit does describes. While it does, supported_actions is empty and a retry returns in_progress, so don't retry. If Flint stops trying without creating a refund, the edit still owes the full amount, supported_actions includes retry, and a retry creates the refund.
An edit returns these errors:
| Status and code | Meaning and what to do |
|---|---|
409 VERSION_CONFLICT | The order changed after your read, or the balance differs from expected_amount_due_money. Read it again, preview again, and send the new version and expected balance. |
409 LIMIT_EXCEEDED | With reason order_edit_balance_due, added items cost more than the credit: maximum_money is the removed value plus released charges. Nothing changes. Send balance_due_behavior: "collect", add items worth at most that amount, or remove more. Otherwise the quantity is more than the unassigned quantity, a charge refund is more than the charge has left, or Flint can't refund the remaining value, such as a recorded offline payment or return credit. details[0].available_quantity or details[0].maximum_money has the most you can send. |
409 ACTION_NOT_ALLOWED | The order can't be edited. details[0].reason says why: status_not_reached when the order isn't paid, subscription_owned or return_owned when a subscription or a return created it, or payment_disputed. Reason order_edit_pending means another edit is waiting for payment; cancel it or wait for its payment, then try again. Reason not_offered means an unresolved inventory exception. |
409 RESOURCE_IN_USE | An invoice collected the order. Correct it with a credit note. |
400 INVALID_REQUEST | The body is malformed, a removed line has no known fulfillment quantities, or an added line is a kind that can't be added to a paid order (detail NOT_ALLOWED at add_line_items[i]). |
409 INVENTORY_INSUFFICIENT | Stock can't cover the added line at add_line_items[i]. Add fewer units, or sell it on a new order once stock arrives. |
404 RESOURCE_NOT_FOUND | The order, line, or charge doesn't exist for your account. |
Preview removing items from a paid order#
POST /v1/order-edit-previews calculates the refund for taking items off a paid order before they ship, and the cost of adding items in their place. It only calculates. It doesn't change the order, hold stock, or set aside refundable money, so it takes no Idempotency-Key and works with commerce.orders.read.
| Field | Meaning |
|---|---|
order_id | The paid order. Required. |
remove_line_items | 1 to 100 entries, each with an order_line_item_id and a whole quantity to remove. A line can appear once. |
add_line_items | 1 to 100 lines to add after the removals. See Add or replace items in a preview. |
charge_refunds | Charges to release as well, such as a delivery charge, each with an order_charge_id. Leave out amount_money to release what is still refundable on the charge. Charges you don't list stay as they are. |
destinations | Where the original payments go back to, with the same values and defaults as a refund. |
reason | Why the items are coming off: any refund reason, including out_of_stock for units you couldn't supply. |
Send remove_line_items, add_line_items, or both. With neither, the preview returns 400 INVALID_REQUEST on remove_line_items.
A preview applies the same rules as the edit about which quantity can come off, so a quantity above removable_quantity is refused the same way.
<!-- docs-test {"skip":"Paid-order edits and fulfillment changes are outside payment-request coverage."} -->
curl -X POST https://api.withflintpay.com/v1/order-edit-previews \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Flint-Version: 2026-09-07" \
-H "Content-Type: application/json" \
-d '{
"order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
"remove_line_items": [
{"order_line_item_id": "li_01KEZF7C004XP0V220YVMGQ354", "quantity": 1}
]
}'
{
"data": {
"order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
"based_on_order_version": 7,
"calculated_at": "2026-11-06T00:00:00Z",
"remove_line_items": [
{
"order_line_item_id": "li_01KEZF7C004XP0V220YVMGQ354",
"quantity": 1,
"removable_quantity": 2,
"refund_money": {"amount": 1200, "currency": "USD"},
"total_money": {"amount": 1200, "currency": "USD"}
}
],
"add_line_items": [],
"charge_refunds": [],
"removed_total_money": {"amount": 1200, "currency": "USD"},
"added_total_money": {"amount": 0, "currency": "USD"},
"refund_money": {"amount": 1200, "currency": "USD"},
"amount_due_money": {"amount": 0, "currency": "USD"}
}
}
Each line's total_money is the value of the removed units at the price the buyer paid, including their share of discounts and tax, rounded the same way as a quantity refund, and its refund_money is the part that would be refunded after paying for added lines. removable_quantity is how many units of the line could come off before this removal. removed_total_money adds up the lines' total_money. The top-level refund_money adds the line refunds to any charge_refunds, which return with the value released from each charge in amount_money and the part that would be refunded in refund_money.
A removal can have a value of 0, such as a free item or a line the buyer paid nothing for. The preview accepts it and returns a refund_money of 0 for that line, because the value comes from what the buyer paid. When the top-level refund_money is 0, removing the items would return no money.
Add or replace items in a preview#
add_line_items takes lines in the same shape as POST /v1/orders/{order_id}/line-items: a catalog variant, a bundle, or a custom item. To swap a size, remove the old units and add the new variant in the same preview. To commit it, send those same remove_line_items, add_line_items, and charge_refunds to POST /v1/orders/{order_id}/edits, with expected_order_version from the preview and an Idempotency-Key. A commit repeats the calculation and stock checks. If prices or refund capacity have changed, its totals can differ from the preview.
- Only lines Flint can fulfill can be added: variant, bundle, and custom lines with a delivery requirement. Gift cards, subscribe-and-save lines, lines with fulfillment requirement
nonesuch as services and digital items, and lines on an order sold through an event payment link return400 INVALID_REQUESTwith detailNOT_ALLOWEDatadd_line_items[i](oradd_line_itemsfor the whole list). Sell those on a new order. - Added lines are priced like any new line: the catalog, price list, or customer price sets the unit price. Promotions aren't evaluated again, so
discount_moneyis 0. - Tax is calculated for the added lines through the order's tax settings, at the order's destination. They aren't in the order's delivery selection, so automatic tax calculates them from your legal origin. Tax already committed on the order's other lines doesn't change.
- Added lines don't join the delivery selection, and delivery charges stay as they are. Their units become pending
fulfillment_quantitiesfor you to fulfill. - Stock must cover each added line, or a variant must allow backorders. Otherwise the preview returns
409 INVENTORY_INSUFFICIENTat the firstadd_line_items[i]it can't cover. Stock the removed units free doesn't count toward the added lines, because it goes to older backorders first.
Every variant line response includes its required product_id beside variant_id, including order lists, buyer orders, invoice snapshots, webhooks, and delivery previews. Bundle lines name bundle_id instead: a bundle has no single parent product, and each component names its own product_id and variant_id. Custom lines have no catalog parent. Create inputs need only variant_id, because the variant determines its product.
The removed value pays for the added lines first, taken from remove_line_items in request order and then from charge_refunds. Whatever is left goes back to the buyer. Each removal's total_money is its value and refund_money the part refunded; each charge's amount_money is the value released and refund_money the part refunded. The credit stays with the payment that made it: an added line refunds later to the card or gift card that paid for the units it replaced.
{
"data": {
"remove_line_items": [
{"order_line_item_id": "li_01KEZF7C004XP0V220YVMGQ354", "quantity": 1, "removable_quantity": 1,
"total_money": {"amount": 2400, "currency": "USD"}, "refund_money": {"amount": 0, "currency": "USD"}}
],
"add_line_items": [
{"type": "variant", "product_id": "prod_01KEZF7C00BVSHCNWVH528HB66", "variant_id": "var_01KEZF7C00Q0Y1Z9G7F3J6V2DD", "name": "Mug, large", "sku": "MUG-L", "quantity": 1,
"unit_price_money": {"amount": 2600, "currency": "USD"}, "subtotal_money": {"amount": 2600, "currency": "USD"},
"discount_money": {"amount": 0, "currency": "USD"}, "tax_money": {"amount": 190, "currency": "USD"},
"total_money": {"amount": 2790, "currency": "USD"}}
],
"charge_refunds": [
{"order_charge_id": "och_01KEZF7C00T3W5A8N2K6R4Y9QB", "amount_money": {"amount": 500, "currency": "USD"}, "refund_money": {"amount": 110, "currency": "USD"}}
],
"removed_total_money": {"amount": 2400, "currency": "USD"},
"added_total_money": {"amount": 2790, "currency": "USD"},
"refund_money": {"amount": 110, "currency": "USD"},
"amount_due_money": {"amount": 0, "currency": "USD"}
}
}
amount_due_money is the collectible balance after applying the removed value, released charges, and any small-balance adjustment to the added lines. A preview can report a balance due. Without balance_due_behavior: "collect", committing it returns 409 LIMIT_EXCEEDED with reason order_edit_balance_due and maximum_money equal to the removed value plus released charges, without changing the order. Send balance_due_behavior: "collect" to collect a balance on an order edit. For USD orders, a positive balance below 50 cents is waived, including a tax-rounding difference on an equivalent swap. The preview and edit report it in small_balance_adjustment_money, with amount_due_money of zero; no balance payment is created. Flint keeps the freshly calculated tax and records the waived amount in settlement_amounts.written_off_money, separately from payments and refundable value. Removing a line later also removes its absorbed share from the current total and reverses that share of the write-off. The edit reports a negative small_balance_adjustment_money for the reversal; it never refunds the absorbed money. If the same edit absorbs a new balance, the field reports the net adjustment. Balances of 50 cents or more follow the collection behavior above. At most one of refund_money and amount_due_money is above zero. refund_money minus amount_due_money minus small_balance_adjustment_money equals removed_total_money plus the charges' amount_money minus added_total_money. Only refund_money needs a payment that can take a refund.
based_on_order_version is the order version the calculation read. The numbers can change when the order does, or when another refund uses the same money, so treat a preview as an estimate and calculate again before you rely on it.
A preview returns these errors:
| Status and code | Meaning and what to do |
|---|---|
400 INVALID_REQUEST | The body is malformed: a missing or repeated line, a quantity below 1, a charge refund of zero, or a line with no known fulfillment quantities (detail NOT_ALLOWED). Refund a line with unknown quantities through POST /v1/refunds. |
404 RESOURCE_NOT_FOUND | The order, line, or charge doesn't exist for your account. |
409 LIMIT_EXCEEDED | The quantity is more than the unassigned quantity, or a charge refund is more than the charge has left. details[0].available_quantity has the most you can remove from the line. |
409 INVENTORY_INSUFFICIENT | Stock can't cover the added line named by param. Add fewer units, or sell it on a new order once stock arrives. |
409 ACTION_NOT_ALLOWED | The order can't be edited. details[0].reason says why: the order isn't paid, a subscription or a return created it, or its payment is disputed. |
409 ACTION_NOT_ALLOWED, reason not_offered | The order has an unresolved inventory exception. Resolve it first. |
409 RESOURCE_IN_USE | An invoice collected the order. Correct it with a credit note. |
Pay with gift cards#
Gift cards pay an order's balance after discounts and tax, alongside at most one processor payment. They work on USD orders that aren't subscriptions, and an order can select up to 20 cards.
- 1
Select the cards#
Send each code as
codetoPOST /v1/orders/{order_id}/gift-cards. Selecting a card holds and debits nothing. The order returns maskedgift_cardsin the order they apply and agift_card_estimatethat splits the balance intogift_card_moneyandprocessor_money. Remove a card withDELETE /v1/orders/{order_id}/gift-cards/{gift_card_id}?expected_version=..., which requiresexpected_versionand has no body. After repeated failed codes, a checkout credential also needs a verification proof. - 2
Check the estimate#
Pay only when
gift_card_estimate.can_payistrue. It isfalsewhen a selected card needs its current code applied again (requires_authorization: true), when a payment attempt has reserved the selection (is_reserved: true), or when an order under $0.50 isn't fully covered by the cards. On larger orders, the estimate lowers the gift card share when needed so the processor charge is at least $0.50. New gift card purchase value always goes to the processor. - 3
Pay with the accepted estimate#
Send
accepted_gift_card_allocationtoPOST /v1/orders/{order_id}/paywith anIdempotency-Key, copyingorder_version,gift_cards,gift_card_money, andprocessor_moneyfrom the estimate. Useaction: "pay"with apayment_sourcefor a positiveprocessor_money, or without one when the cards cover everything. To use an existing payment intent for the remainder, sendaction: "confirm_payment_intents"and select exactly one intent. If the allocation changed when the payment starts, the request returns409 VERSION_CONFLICTwithparam: accepted_gift_card_allocationand changes nothing. Read the order, accept the new estimate, and send the request again. Whenremediation.next_stepssays the request changed nothing, reuse itsIdempotency-Key. Otherwise send a new key.
The payment attempt returns masked gift_card_redemptions beside its payment_intents. Retry a lost response with the same request and key to recover the same attempt.
Pay on a reader#
Send action: "pay" with a reader payment_source to POST /v1/orders/{order_id}/pay. Flint creates an automatic-capture payment intent for the outstanding balance with payment_options: ["card_present"] and presents it on the reader:
{
"action": "pay",
"payment_source": {
"credential_type": "reader",
"reader_id": "rdr_01J00000000000000000000000",
"tip": {"enabled": true}
}
}
For a manual hold, a partial payment, or a retry after a decline, first create the order's payment intent with payment_options: ["card_present"], then use action: "confirm_payment_intents" with one selection:
{
"action": "confirm_payment_intents",
"payment_intents": [
{
"payment_intent_id": "pi_01J00000000000000000000000",
"payment_source": {
"credential_type": "reader",
"reader_id": "rdr_01J00000000000000000000000"
}
}
],
"completion_behavior": "partial_payment"
}
A request with a reader selection must have exactly one payment intent. Present split payments one at a time, with a new attempt for each. expected_outstanding_money and expected_version work as for other payments. Smart readers and Tap to Pay readers can take these payments. The credential also needs payments.readers.write; checkout session credentials cannot use a reader. A reader cannot be used for action: "setup", save_payment_method: true, or with buyer_ip_address.
The attempt and leg are processing while the smart reader collects the card, with no pending browser action. The leg's reader_id identifies the reader. Wait for payment intent events or read the order to learn the outcome. A manual authorization becomes requires_capture. A smart-reader decline fails the attempt and leaves the leg reusable; select it again with a reader credential. Cancel through the existing order payment attempt route while waiting on the reader.
On a Tap to Pay reader, the attempt and leg are requires_action, with is_resumable: true and a card_presentment pending action. Use its client_action.stripe.terminal_payment_intent with the Stripe Terminal SDK to collect and confirm, then send action: "resume" with the attempt ID. Nothing presented yet or a decline keeps the attempt open with the same client secret; a decline updates the payment intent's last_payment_error. Authorization, capture, or processing applies the outcome. Tap to Pay describes the SDK calls and cancellation.
The optional tip.enabled shows a smart reader's tip screen before the card. It defaults to false and is refused on Tap to Pay readers, on an order with a requested tip or a leg carrying one. A tip selected on the reader increases the leg's amount_money at authorization. The order includes that payment's tip in its one tip and total only when capture collects it; an uncaptured payment never adds its tip to the next guest's bill. Card-present payments describes reader admission, card details, and decline codes.
Close an order#
Close an order with POST /v1/orders/{order_id}/close to stop collecting on it. The body is optional. reason_message is a note for your records of up to 500 characters, returned as closed_reason_message.
If the order collected money that can still be refunded, the close returns 409 ACTION_NOT_ALLOWED with reason payment_collected, param: collected_money_behavior, and the refundable amount in details[0].current_money. Either refund the order first, or send collected_money_behavior: "keep" to close and keep the money. Keeping changes nothing about money already collected: the unpaid balance stops being collectible, and you can still refund the order later. keep is accepted when nothing was collected, so a client can always send it. Money that can't go back through a refund, such as a recorded offline payment, return credit, or a written-off balance, doesn't count.
<!-- docs-test {"scenario":"close","status":200,"fixtures":{"order":2500},"expect":{"data.status":"closed"}} -->
curl -X POST https://api.withflintpay.com/v1/orders/ord_01J5Z8N3QK4W7Y2RB6TPVXHC9D/close \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: close-ord_01J5Z8N3QK4W7Y2RB6TPVXHC9D" \
-d '{
"collected_money_behavior": "keep",
"reason_message": "Buyer paid the deposit and canceled the rest"
}'
Closing cancels pending discounts and releases their reservations, then recalculates the total. Payment intents on the order that never started an attempt (requires_payment_method) are canceled shortly after the close commits, with cancellation_reason: "order_closed", and each sends payment_intent.canceled. Nothing is refunded and the buyer isn't notified. A payment in progress blocks the close with 409 OPERATION_IN_PROGRESS, and an authorization waiting for capture blocks it with 409 PAYMENT_ATTEMPT_ACTIVE; capture or cancel it first. Closing an order that is already closed returns 409 ACTION_NOT_ALLOWED with details[0].current_status: closed.
To finish a zero-balance order as paid instead, use POST /v1/orders/{order_id}/pay with action: "pay" and no payment source.
Inventory exceptions#
Flint holds an order's routed stock when payment begins, commits it when payment succeeds, and consumes it when fulfillment hands the goods off. inventory_reservation_id points at the hold. If payment succeeds but the stock can't be committed, inventory_exception_status is paid_inventory_failed and the order waits for POST /v1/orders/{order_id}/resolve-inventory-exception, unless your settings refund such orders automatically. When the exception needs merchant action, supported_actions includes resolve_inventory_exception, even on a closed order. The action is unavailable while inventory_exception_reason is auto_refund_required. Resolving removes the action, sets resolved, and keeps the cause in inventory_exception_reason. A reason_message you send returns as inventory_exception_resolution_message, which buyers can't read. See When payment succeeds but stock can't be committed.
Event tickets#
An order that sold tickets through an event payment link reports them in ticketed_event: the event's name, starts_at, timezone, and location, its ticket_numbers, and a ticket_status. Changing the link's event date, time zone, or venue updates these details and sends order.updated with previous_attributes.ticketed_event. Ticket numbers stay the same. Buyer reads include ticketed_event too, though they omit metadata. Other orders omit the field.
ticket_status on ticketed eventpendingFlint hasn't issued the tickets yet, soticket_numbersis empty.issuedThe numbers inticket_numbersare valid.voidedA full refund released the tickets. A refund before issue leaves avoidedevent with noticket_numbers.
Each number in ticket_numbers is also a ticket with its own ID. List an order's tickets with GET /v1/tickets?order_id=; see Read individual tickets.
Receipts and buyer links#
POST /v1/orders/{order_id}/send-receipt emails a receipt for a paid order, including gift card payments, and returns the order unchanged. Send email to choose the address, or omit it to use the order's. If the order has no email on file, email is required: a credential that may send it gets 400 INVALID_REQUEST with a REQUIRED detail at email, and one that can't, such as a buyer session, gets 409 ACTION_NOT_ALLOWED with reason configuration_required. It needs Flint-managed receipt delivery, and otherwise returns 409 ACTION_NOT_ALLOWED with reason merchant_managed_email. Buyers in a customer session use POST /v1/me/orders/{order_id}/send-receipt, which always sends to the order's email. Each order sends to the same address at most once every five minutes, and a checkout credential has tighter address limits, listed on the route below.
GET /v1/orders/{order_id}/receipt-pdf downloads the receipt as a PDF named receipt-{order_number}.pdf, so a store can offer "Download receipt" without sending an email. Use it with an API key that has commerce.orders.read, or with the checkout credential of the order's own checkout session, which lets a guest download it from your thank-you page. Buyers in a customer session, including one opened from an order access link, use GET /v1/me/orders/{order_id}/receipt-pdf. The response is application/pdf with Cache-Control: private, no-store, not JSON.
The PDF is available under the same conditions as send-receipt and under either order_receipts delivery mode: the order has a successful payment intent or a gift card redemption, including after a partial or full refund. An order that hasn't reached that point returns 409 ACTION_NOT_ALLOWED with reason status_not_reached and the order's current_status. An order paid only by a recorded cash, check, or wire payment, such as an invoice paid offline, returns 409 ACTION_NOT_ALLOWED with reason unsupported_state, and its message points to the invoice PDF. An unknown order returns 404. A payment intent that has no order has no PDF.
The receipt is titled "Receipt" and numbered by order_number. It lists the lines with their modifiers, discounts, charges, tax, tip, and total, each successful payment with its method and any gift card redemptions, and the refunds, amount paid, and balance due. As in the receipt email, an order that was also paid partly by a recorded cash, check, or wire payment lists only its card and other successful payment intent payments and gift card redemptions, not the recorded payment. Test mode documents carry a "Test mode" band. Flint records the seller and buyer details when the order is first paid, or on the first download for an older order, and the receipt keeps showing them if the customer or your tax identity changes later. Payments, refunds, and your branding are read when you download, and Flint stores no PDF. Deleting the customer erases the buyer details Flint recorded.
When you send your own receipt or shipping email, create a link with POST /v1/orders/{order_id}/access-links. Its url opens the order in your Flint-hosted customer account without a sign-in, for 30 days or 10 opens. The url is a credential that Flint returns only once; see Link the buyer to their order.
Read what is left to fulfill#
A line item that needs fulfillment carries fulfillment_quantities, with one entry for a single item or one per bundle component that needs fulfillment, identified by bundle_component_id. Each entry splits the required quantity by who owns it:
| Field | Owned by |
|---|---|
unassigned_quantity | No fulfillment, including quantity a fail with release_quantity: true handed back |
assigned_quantity | A fulfillment that hasn't ended, including one on hold |
fulfilled_quantity | A completed fulfillment |
canceled_quantity | A canceled or no_show fulfillment |
failed_quantity | A failed fulfillment that kept its quantity (release_quantity: false) |
removed_quantity | Units taken off the paid order before any fulfillment claimed them |
The six always add up to required_quantity. A single item counts in units of the line; a bundle component counts in units of that component, so a line with quantity: 2 and a component that comes 3 per bundle has required_quantity: 6 for it. Never add a bundle's entries together or compare them with the line's quantity.
The line item itself also carries removed_quantity, in units of the line. A bundle component's removed_quantity is that number times the component's quantity per bundle. Removing units doesn't shrink the line: quantity and pricing_amounts stay the record of the sale, and required_quantity keeps counting the removed units. The money that went back shows in settlement_amounts and refund_status, as it does for any refund. A removed unit is final, like a canceled one: it never returns to unassigned_quantity, and a fulfillment can't claim it. See Edit a paid order.
unassigned_quantity is what you can still put into new fulfillments, so read it instead of summing fulfillment line items. POST /v1/fulfillments can't claim more: a request above what remains returns 409 LIMIT_EXCEEDED with the remaining quantity in details[0].available_quantity, and a line with nothing left to assign returns 409 ACTION_NOT_ALLOWED. Each request line names the order line and its bundle_component_id, which is null for a single item and the component's ID for a bundle line.
Units on backorder are still unassigned, but they can't ship until stock fills them. What you can fulfill now is unassigned_quantity minus the line's backordered_quantity. A fulfillment that claims backordered units returns 409 INVENTORY_INSUFFICIENT, with the units that can be fulfilled in details[0].available_quantity. Flint creates the fulfillments for a delivery choice only when all of the remaining units are in stock, so ship the units you have sooner by creating a fulfillment yourself; see Automatic creation waits for stock. See also Backordered and pre-ordered lines.
The array is omitted on a line that needs no fulfillment. When any line on the order predates recorded fulfillment_requirements, Flint can't work out the order's obligations and no line carries the array. In that case the obligations are unknown: don't read the missing arrays as nothing left to fulfill.
The numbers describe the order at the time of the read, and change whenever a fulfillment is created, canceled, failed, or completed, or units are removed. Buyer reads and orders in webhooks carry them too. If a create request times out, replay it with the same Idempotency-Key to get the original fulfillment back, then read the order again before sending a different request. See Fulfill and ship orders.
Filter orders by unassigned quantity#
has_unassigned_fulfillment_quantity=true on GET /v1/orders lists orders whose unassigned_quantity values add up to more than zero, with bundle components counted in component units. false lists the rest, including orders that need no fulfillment and orders whose obligations are unknown. Send the value once, as true or false; anything else returns a validation error naming the parameter.
The filter ignores payment, so an unpaid order with work to do matches true. Add payment_status=paid to list orders you can act on:
<!-- docs-test {"scenario":"list","status":200,"list":true,"expect":{"request_id":"req_..."}} -->
curl -G https://api.withflintpay.com/v1/orders \
-H "Authorization: Bearer YOUR_API_KEY" \
-d payment_status=paid \
-d has_unassigned_fulfillment_quantity=true
A fulfillment that fails with release_quantity: true returns its order to the true set; one that fails with release_quantity: false doesn't. GET /v1/me/orders doesn't accept the filter.
Backordered and pre-ordered lines#
A line can be sold ahead of its variant's release_date whether or not the variant tracks inventory. Selling past available stock needs a tracked variant whose inventory item has backorder.enabled. The line reports how many units are waiting and when Flint expects to ship them. Merchant reads, buyer reads, and order.* webhooks carry the same three fields. Pre-orders and backorders shows when the buyer is charged:
| Field | Meaning |
|---|---|
backordered_quantity | Units of the line waiting for stock, in units of the line. 0 when none are. Lines that track inventory always carry it. |
release_date | The variant's release_date when the line was created, if that date was after today in your account's time zone. Otherwise null. Flint copies it once, so later edits to the variant don't change it. |
expected_ship_date | When Flint expects the line to ship, in YYYY-MM-DD form. It appears once a delivery or payment hold exists on the order, even when no unit is backordered. The line's release_date supplies it when the line has one. Otherwise, when units are backordered, the inventory item's backorder.expected_ship_date does, unless that date is in the past; today's date in your account's time zone still counts. null when neither supplies a date. |
{
"order_line_item_id": "li_01KEZF7C004XP0V220YVMGQ354",
"quantity": 3,
"backordered_quantity": 2,
"release_date": null,
"expected_ship_date": "2026-12-15",
"fulfillment_quantities": [{ "required_quantity": 3, "unassigned_quantity": 3 }]
}
The example is abridged. One unit is in stock and two are backordered, so unassigned_quantity is 3 and one unit can ship now.
Tentative and firm units#
Until the order is paid, backordered units sit on its stock hold. They are tentative: they carry the hold's deadline, and Flint releases them if the payment fails or the hold lapses. They become firm when the order's payment_status is paid. A partial payment, or one tender of a split payment, doesn't make them firm. Firm units keep their place in line until stock fills them or an edit removes them.
Before payment, expected_ship_date is Flint's current estimate and can change as the order's holds change. When the order is paid, the date freezes, so a pre-order that stock fully covers keeps its release_date as its expected_ship_date. A past item date is never frozen. After payment the date changes only when you set or clear it with the line item PATCH, which also lets you set a new date on a line that has none, and never because stock arrives.
When stock arrives#
Every stock change that raises sellable stock fills firm backordered units first, oldest payment first, and a line can be filled in part. Flint then updates the order: the line's backordered_quantity goes down, the order's version goes up, and Flint sends order.updated. The order catches up shortly after the stock command commits, so a read right after the command can still show the old quantity. A fill changes quantities only; the line's expected_ship_date stays as it was. Read backordered_quantity again, or follow order.updated.
Units that won't arrive can come off the order. They are unassigned, so an edit removes them and refunds their value, and releases backordered units before committed ones.
Change an expected ship date#
Set or clear a paid line's date with PATCH /v1/orders/{order_id}/line-items/{order_line_item_id}. On a paid order this route accepts expected_ship_date: a YYYY-MM-DD date, or null to clear it. It can't be combined with other line item fields in one update, so send it on its own. expected_version is the one exception: send the order's version there, and a stale value returns 409 VERSION_CONFLICT with the current version in details[0].current_version.
This request moves the date for line li_01KEZF7C004XP0V220YVMGQ354 on order ord_01KEZF7C00JBKMARG3P06Z224B, which is at version 9:
<!-- docs-test {"skip":"Paid-order edits and fulfillment changes are outside payment-request coverage."} -->
curl -X PATCH https://api.withflintpay.com/v1/orders/ord_01KEZF7C00JBKMARG3P06Z224B/line-items/li_01KEZF7C004XP0V220YVMGQ354 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "expected_version": 9, "expected_ship_date": "2026-12-22" }'
The response is the updated order, with the line's new date and the order's next version. A change takes effect as one step: the line's date, the order's version, and the order.updated event move together. Sending the date the line already has, or null on a line that has no date, changes nothing: the version stays the same and Flint sends no event. Before payment the date is Flint's estimate and follows the order's holds, so an order that isn't paid doesn't take this field. The date is information for you and the buyer: it doesn't hold a fulfillment back, and Flint doesn't block shipping before release_date or expected_ship_date.
Each change you make emails the buyer the line's new date, or tells them it no longer has one, using the shipping update email. The email follows customer_email_delivery.fulfillment_updates and the buyer's shipping_updates preference, both checked when it's sent, so Flint sends nothing with merchant_sends set or after the buyer unsubscribes. If you change the same line again before the email goes out, Flint sends only the email for the latest change. The date Flint sets at payment, and stock filling a backorder, send no such email. To send your own, follow order.updated and compare the line's expected_ship_date. See Customer email delivery.
The payment receipt notes each pre-order line as "Pre-order, releases January 3, 2027" and each backordered line as "Backordered, ships about January 3, 2027", or just "Backordered" when the line has no date.
Filter orders by backordered quantity#
has_backordered_quantity=true on GET /v1/orders lists orders with at least one line whose backordered_quantity is above zero. false lists the rest, including orders with no tracked lines. Send the value once, as true or false; anything else returns a validation error naming the parameter. The filter ignores payment, so an unpaid order whose hold carries backordered units matches true. Add payment_status=paid to list the orders you are waiting on stock for:
<!-- docs-test {"scenario":"list","status":200,"list":true,"expect":{"request_id":"req_..."}} -->
curl -G https://api.withflintpay.com/v1/orders \
-H "Authorization: Bearer YOUR_API_KEY" \
-d payment_status=paid \
-d has_backordered_quantity=true
What never backorders#
- Bundle components. A bundle line whose components stock can't cover fails with
409 INVENTORY_INSUFFICIENT, as it does without backorders. - Subscription renewals. A renewal that stock can't cover keeps waiting in
inventory_wait; see Renewals that need attention. Thebackorderednotice in subscription emails is a separate delivery notice, not an order backorder. - Reservations you create.
POST /v1/inventory-reservationsreturns409 INVENTORY_INSUFFICIENTwhen stock falls short, whatever the item's backorder setting.
Sell past available stock covers how an order claims, caps, and fills backordered units.
List and find orders#
Filters on GET /v1/orders combine: values within one filter match any of them, and separate filters must all match. status, closed_reason, payment_status, refund_status, fulfillment_status, and origin take one value, a repeated parameter, or comma-separated values, so payment_status=unpaid,partially_paid lists orders with a balance still to collect. A customer session filters GET /v1/me/orders the same way. Sort with sort_by and sort_direction; the default is created_at, newest first. Keep the same filters while you follow next_page_token.
Use product_id or variant_id to find orders with any line item referencing that exact ID. Each accepts one ID and combines with the other filters using AND. Unknown IDs return an empty page. A bundle line doesn't match the products or variants inside the bundle.
email filters to orders whose buyer_email or linked customer's email equals the address, ignoring case and any whitespace stored around it, with accents preserved. Send one bare email address without surrounding whitespace, and URL-encode plus signs as %2B. It matches the complete address, so jose@example.com does not match josé@example.com. Invalid addresses return 400 INVALID_REQUEST with detail INVALID_VALUE on email. query searches line item names, saved SKUs, and the order's own buyer_email, not the linked customer's name or email, so use email or customer_id to find a customer's orders. These three filters are available on GET /v1/orders.
To fetch a known set of orders, repeat order_id or send comma-separated IDs, up to 100. Unknown IDs and orders outside your merchant or environment are left out, other filters still apply, and results keep the list's normal sort order.
expand adds a related record beside its ID on every listed order, or null when the order has none. Every path also needs commerce.orders.read, and a key without a path's scope gets 403 INSUFFICIENT_SCOPE with param: expand. See Expand related records.
expand | Adds | Also needs |
|---|---|---|
customer | The customer summary for customer_id | customers.read |
subscription | The subscription summary for subscription_id | commerce.subscriptions.read |
subscription_plan | The plan summary for subscription_plan_id | commerce.subscription_plans.read |
Expanded order summaries#
Other lists and reads that expand order or replacement_order, such as GET /v1/returns?expand=order, return an order summary instead of the full order. It is the same on a list and a detail read, and carries order_id, order_number, status, payment_status, refund_status, fulfillment_status, closed_reason, closed_at, customer_id, payment_intent_ids, governing_delivery_selection_id, pricing_amounts, settlement_amounts, created_at, updated_at, and buyer_contact.
buyer_contact is the email and phone the order recorded when payment started. Guest orders have no customer_id, so it's how a returns or refunds table shows a guest buyer's email without another read. It belongs to the order and doesn't change when the customer later changes their email. It is omitted when the order recorded no contact, and summaries in /v1/me responses never include it.
{
"order_id": "ord_01KEZF7C00RWKW7JDYTZ5A6ET0",
"order_number": "1001",
"status": "closed",
"payment_status": "paid",
"refund_status": "none",
"closed_reason": "paid",
"governing_delivery_selection_id": null,
"buyer_contact": {
"email": "guest@example.com",
"phone": null,
"is_email_cleared": false,
"is_phone_cleared": false
}
}
The example is abridged; a summary also carries its amounts and timestamps.
Webhooks#
order.created, order.updated, and order.closed mirror an order's state, and order.partially_paid, order.paid, order.partially_refunded, and order.refunded report its money. Each carries the order, including each line's backordered_quantity, release_date, and expected_ship_date. See Orders in the event catalog for when each fires.
Related guides#
Why Flint is orders-firstCreate an order, change it, and collect it through checkout, your own form, or an invoice.Tips and chargesRequested tips, service charges, and how the total adds up.Fulfill and ship ordersTurn paid orders into fulfillments, shipments, and handoffs.Sales taxAutomatic and external tax on orders, invoices, and refunds.External tax jurisdictions#
External tax accepts any ISO 3166-1 alpha-2 jurisdiction country. Percentage components accept sales_tax, use_tax, vat, gst, hst, pst, and qst; hst, pst, and qst require Canada. Jurisdiction levels include country and province. A non-US percentage component may record taxability_reason: reverse_charge with percent: 0. See External tax for subdivision rules and examples. Automatic tax covers US sales, and digital goods, software, and SaaS in Canada, the EU, the UK, Australia, and New Zealand. See EU, UK, Australia, and New Zealand coverage.
Reverse charge#
tax.reverse_charge is set when the buyer accounts for the order's tax: automatic tax got a reverse-charge answer for the customer's tax ID, or an external component sent taxability_reason: reverse_charge. It is {"customer_tax_id": {"country", "region", "identifier_type", "value"}}, a copy of the customer's tax ID. It's frozen once the order is paid; recalculating tax before payment reads the customer's current tax IDs again. customer_tax_id is null when external tax sent a reverse charge and the customer has no tax ID for that country. tax.reverse_charge is null otherwise. Its rows have taxability_reason: reverse_charge and zero tax, and tax.status stays calculated. See Reverse charge for business buyers.
The Order object#
A customer's purchase and its payment and fulfillment progress.
Returned by GET /v1/orders/{order_id} and carried by the endpoints below.
Attributes
active_payment_attemptobjectThe payment attempt currently collecting this order. Omitted when no attempt is active or its collection surface belongs to another caller.
active_payment_review_idstring or nullThe earliest open or resolving payment review on this order's counted payments. `null` when no review is open or resolving. List reviews with GET /v1/payment-reviews?order_id=&status=open. Omitted for buyer credentials. Always present with merchant credentials.
Not returned with a checkout credential or a customer session
authorization_amountsobjectThe amounts authorized and still capturable on the order's payments.
buyer_actionsarray of objectWhat the buyer can do with the order, in this order: start_return, then resend_receipt. A buyer's read through a customer session on /v1/me, a checkout credential on GET /v1/orders/{order_id}, or Flint's buyer account lists both every time. Merchant order responses omit this field. A list of orders leaves start_return out, since only a read of one order checks return eligibility. start_return is due when the last open return window ends.
Not returned with a bearer token
buyer_contactobjectEmail and phone saved when payment started, from the pay request's buyer_contact or the paying checkout session's saved contact. It does not change the linked customer.
buyer_notestringA note to the buyer.
chargesarray of objectRequiredCharges added to the order, such as delivery or service fees, each with its applied amount, tax, and refunded amount.
checkout_billing_contactobjectBilling name and address collected in Checkout for a successful payment. Omitted for buyer credentials and when Checkout did not collect the details.
Not returned with a checkout credential or a customer session
checkout_session_idsarray of stringRequiredIDs of the checkout sessions opened for this order.
client_referencestring or nullThe 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 or a customer session
closed_atstringWhen the order last closed. Present exactly when status is closed.
closed_reasonenumWhy the order closed. Present exactly when status is closed. Flint returns other for an unrecognized reason and may add new values.
invoice_voidedpaidclosed_by_merchantcheckout_expiredwritten_offsupersededreturn_resolution_canceledother
closed_reason_messagestringThe caller note supplied when closing the order. System closures leave it absent. It is not shown to the buyer.
Not returned with a checkout credential or a customer session
created_atstringRequiredRFC3339 timestamp.
custom_field_answersarray of one ofThe buyer's answers to the payment link's custom fields, recorded when checkout started, in the order the link showed the fields. Each answer keeps the field's key, label, and type from that moment, so later changes to the link don't change it. Optional fields the buyer left blank are left out. Read-only. Empty when the order didn't come from a payment link, the link had no custom fields, or the buyer answered none. Orders created before Flint recorded answers here also return an empty list and keep their answers in `metadata` as `custom_field_<key>`. Deleting the customer removes the answers. Returned only to merchant credentials; omitted for buyer credentials. Always present with merchant credentials.
Not returned with a checkout credential or a customer session
customerobject or nullCustomer summary included when `expand` names `customer`; `null` when expanded and no customer is linked. Present only when `expand` includes `customer`; `null` when expanded and there is no related customer.
Not returned with a checkout credential or a customer session
customer_idstringID of the customer this order belongs to.
deferred_promotionsarray of objectRequiredPromotions accepted at subscription signup. They attach when the subscription is provisioned and first discount its first charged cycle. They do not discount this order and are separate from discounts and order totals. Always present; empty when no promotions are deferred.
deliveryobjectMethod, type and recipient of governing_delivery_selection_id. The address remains in delivery_destination. Omitted when no shipment or local-delivery selection governs the order.
delivery_destinationobjectThe shipment or local-delivery destination committed for this order. Payment freezes this value; fulfillment recipient changes do not replace it. Omitted for a checkout session credential that doesn't act for the customer the buyer verified.
discountsarray of objectRequiredDiscounts applied to the order, each with its amount, status, and the line items and charges it covers.
dispute_statusenumAggregate dispute state across the order's counted payment intents, excluding payment_returned. Always returned to merchant credentials and omitted from buyer reads. Open states take precedence in this order: needs_response, under_review, inquiry_needs_response, inquiry_under_review, other. Otherwise the most severe closed state wins: lost, won, prevented, inquiry_closed; none when no disputes count. List individual cases with GET /v1/disputes?order_id={order_id}. Always present with merchant credentials.
Not returned with a checkout credential or a customer session
noneinquiry_needs_responseinquiry_under_reviewinquiry_closedneeds_responseunder_reviewwonlostpreventedother
external_reference_idstringCaller-owned identifier for this resource in an external system.
Not returned with a checkout credential or a customer session
fulfillment_statusenumAggregate progress across the order's fulfillment quantities.
not_fulfilledpartially_fulfilledfulfilledcancelednot_applicableclosed
fulfillmentsarray of objectRequiredFulfillments created for the order, each covering a set of its line items.
gift_card_estimateobjectAn estimate of how the order balance splits between gift cards and the payment processor.
gift_card_settlementsarray of objectRequiredThe gift card redemptions applied to the order's payments.
gift_card_tender_enabledbooleanRequiredWhether gift cards can pay for this order now. Gift cards pay only USD orders that still accept changes, are not subscription purchases, and whose merchant has at least one gift card that is not closed in this environment. Gift cards cannot fund gift card purchases; this is false when those purchases leave no amount eligible for gift card tender. Recomputed on each read; a spent but open card still counts.
gift_cardsarray of objectRequiredGift cards available to pay the order, with each card's available balance.
governing_delivery_selection_idstring or nullRequiredID of the delivery selection that governs this order, including pickup choices without a delivery destination: the checkout's provisional selection before payment, and the selection a payment committed after. Read it with GET /v1/delivery-selections/{delivery_selection_id}. Null when no selection governs the order. While set, change the destination through the delivery selection.
handoverobjectCarry-out handover: every physical item is handed to the buyer at this location when the order is paid, in place of a delivery selection. Payment then creates one completed `handover` fulfillment. Absent without a handover.
Not returned with a checkout credential or a customer session
internal_notestringA note for your team. Buyer reads leave it out.
Not returned with a checkout credential or a customer session
inventory_exception_reasonenumWhy inventory could not be committed after payment. The cause remains after resolution. Omitted when no reason was recorded. Unrecognized reasons are returned as other; new values may be added.
Not returned with a checkout credential or a customer session
inventory_deduction_failedinventory_handoff_failedauto_refund_requiredauto_refund_failedpolicy_resolution_failedother
inventory_exception_resolution_messagestringThe merchant note supplied when resolving the inventory exception. It is not shown to the buyer.
Not returned with a checkout credential or a customer session
inventory_exception_statusenumWhether an inventory problem after payment needs attention.
Not returned with a checkout credential or a customer session
paid_inventory_failedresolved
inventory_reservation_idstringThe reservation holding stock for this order, when one exists.
Not returned with a checkout credential or a customer session
inventory_routing_sourceobjectWhere this order's tracked demand is routed. Required before an order containing tracked variants can hold stock.
Not returned with a checkout credential or a customer session
invoice_idstring or nullRequiredThe invoice associated with this order. Null when the order has no invoice. A replacement invoice replaces this ID; voiding an invoice preserves it.
line_itemsarray of objectRequiredItems the order sells, each with its pricing, tax, and fulfillment quantities.
merchant_idstringRequiredID of the merchant this resource belongs to.
metadatamap of stringStored caller-owned key-value data. See `MetadataInput` for key, value, and size rules.
Not returned with a checkout credential or a customer session
order_idstringRequiredUnique identifier for this order, prefixed `ord_`.
order_numberstringHuman-readable order number for receipts and merchant reference.
originenumHow the order was created. invoice means a Quick Pay invoice created the order; attaching an invoice to an existing order preserves its origin.
virtual_terminalpayment_linkshopcheckoutapisubscriptioninvoice
paid_atstring or nullRequiredWhen the current paid state began, including a final capture that releases the remaining balance. A reversal that reopens the order clears this timestamp. `null` when `payment_status` isn't `paid`, including an order whose balance was written off without being paid.
payment_collectionobjectPayment options and collection instructions for the order's outstanding balance. Omitted when collection is unavailable to this caller.
payment_intent_idsarray of stringRequiredIDs of the payment intents created to collect this order.
payment_intentsarray of objectPayment intents included when `expand` names `payment_intents`.
Not returned with a checkout credential or a customer session
payment_link_idstringPayment link that created this order or started the subscription it renews. Absent for other orders. Filter GET /v1/orders by payment_link_id to list a link's orders.
payment_statusenumRequiredCollection progress. Reversing a recorded invoice payment can move this back to unpaid or partially_paid. An invoice write-off also completes collection without receiving the written-off amount.
unpaidpartially_paidpaid
pending_order_edit_idstring or nullThe order edit waiting for its balance payment. While it is set, the units that edit removes can't join a fulfillment and the order refuses another edit. `null` when there is none. Omitted for buyer credentials. Always present with merchant credentials.
Not returned with a checkout credential or a customer session
prepayment_order_idstring or nullRequiredOrder that paid for this prepaid delivery. Null when this is not a prepaid delivery order.
pricing_amountsobjectRequiredThe order's money totals: subtotal, discounts, charges, tax, requested tip, and total.
refund_idsarray of stringRequiredIDs of the refunds that name this order. This includes refunds Flint makes to return a payment it couldn't accept (`reason` `payment_returned`), which never count toward `refund_status` or the order's refunded amounts.
refund_statusenumRequiredRefund progress for collected money. Refunds with `reason` `payment_returned` return money the order never received and don't count.
nonepartially_refundedrefunded
return_credit_settlementsarray of objectRequiredValue applied to this order from items the buyer returned, such as an exchange's replacement order. Included in settlement_amounts.paid_money.
return_resolution_idstringID of the return resolution that created this order as a replacement. Omitted for orders a return did not create.
settlement_amountsobjectRequiredHow much of the order has been paid, refunded, credited, written off, and settled as tips, and what is still outstanding.
setup_collectionobjectInstructions for saving a payment method for a subscription order. Omitted when setup is unavailable.
shop_idstringID of the shop that started checkout.
statusenumRequiredWhether the order still accepts changes and new payments. An order closed as paid reopens if reversing a recorded invoice payment leaves an outstanding order balance. Refunds, fulfillment, disputes, returns, and metadata or note edits continue on a closed order.
openclosed
subscriptionobject or nullSubscription summary included when `expand` names `subscription`; `null` when expanded and this order does not bill a subscription. Present only when `expand` includes `subscription`; `null` when expanded and there is no related subscription.
Not returned with a checkout credential or a customer session
subscription_cycleintegerCharged subscription cycle associated with this order. Signup is cycle 1; unpaid retries and skipped renewals do not advance the cycle.
subscription_delivery_changed_atstringTime the subscriber changed delivery after this paid renewal was prepared. The order keeps its committed destination until you correct it or refund and replace it.
subscription_delivery_numberinteger or nullRequiredPosition of this delivery among the deliveries one charge paid for, starting at 2. Null when this is not a prepaid delivery order.
subscription_idstringID of the subscription this order bills. Absent on an order that isn't from a subscription.
subscription_planobject or nullPlan summary included when `expand` names `subscription_plan`; `null` when expanded and this order does not bill a subscription plan. Present only when `expand` includes `subscription_plan`; `null` when expanded and there is no related subscription plan.
Not returned with a checkout credential or a customer session
subscription_plan_idstringID of the subscription plan this order bills. Absent on an order that isn't from a subscription.
supported_actionsarray of enumLifecycle actions Flint accepts now, independent of permissions. Includes close when closure is allowed, and pay while open without an active attempt and with an outstanding balance or payment-method setup available. Always present with merchant credentials.
Not returned with a checkout credential or a customer session
closepayresolve_inventory_exception
taxobjectRequiredThe order's tax state: whether tax is enabled, its status, location, exemption, and per-jurisdiction rows.
ticketed_eventobjectEvent and tickets this order sold through an event payment link. Absent on other orders.
tipsarray of objectRequiredTips on the order, each with its requested, settled, and refunded amounts. A tip cleared before payment stays listed as canceled.
updated_atstringRequiredRFC3339 timestamp.
versionintegerRequiredOrder version for optimistic concurrency. Send this value as the expected version when changing the order. Increases with every change to the order. Ignore an order webhook snapshot whose version is lower than one you have already applied.
{
"active_payment_review_id": null,
"charges": [],
"checkout_session_ids": [],
"client_reference": null,
"created_at": "2026-03-17T14:30:00Z",
"custom_field_answers": [
{
"custom_field_type": "dropdown",
"key": "t_shirt_size",
"label": "T-shirt size",
"payment_link_custom_field_id": "plcf_01K4W8TSHRTS2ZEQ7XN5V3D2JA",
"value": "Medium"
},
{
"custom_field_type": "checkbox",
"key": "newsletter",
"label": "Email me about future events",
"payment_link_custom_field_id": "plcf_01K4W8NEWSETTER5G7MB2C4KP0",
"value": false
}
],
"customer_id": "cus_01KEZF7C003ACYXT6Q5EQZ78EE",
"deferred_promotions": [],
"discounts": [],
"dispute_status": "none",
"fulfillments": [],
"gift_card_settlements": [],
"gift_card_tender_enabled": false,
"gift_cards": [],
"governing_delivery_selection_id": null,
"invoice_id": null,
"line_items": [
{
"backordered_quantity": 0,
"base_subtotal_money": {
"amount": 5000,
"currency": "USD"
},
"bundle_components": [],
"categories": [],
"discount_money": {
"amount": 0,
"currency": "USD"
},
"expected_ship_date": null,
"inventory_snapshot": null,
"license_key_quantity": 0,
"metadata": {
"ticket_type": "ga"
},
"modifier_total_money": {
"amount": 0,
"currency": "USD"
},
"modifiers": [],
"name": "General Admission",
"order_edit_id": null,
"order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
"order_line_item_id": "li_01KEZF7C004XP0V220YVMGQ354",
"payment_link_line_item_key": "general-admission",
"product_type": null,
"purchased_gift_cards": [],
"quantity": 2,
"refundable": {
"discount_money": {
"amount": 0,
"currency": "USD"
},
"gross_money": {
"amount": 0,
"currency": "USD"
},
"quantity": 0,
"tax_money": {
"amount": 0,
"currency": "USD"
},
"total_money": {
"amount": 0,
"currency": "USD"
}
},
"refunded_money": {
"amount": 0,
"currency": "USD"
},
"refunded_quantity": 0,
"release_date": null,
"removed_quantity": 0,
"selected_options": [],
"subtotal_money": {
"amount": 5000,
"currency": "USD"
},
"tax_money": {
"amount": 0,
"currency": "USD"
},
"total_money": {
"amount": 5000,
"currency": "USD"
},
"type": "custom",
"unit_price_money": {
"amount": 2500,
"currency": "USD"
}
}
],
"merchant_id": "mer_01KEZF7C00MPP0T9S0KH5BB4CC",
"metadata": {
"event_id": "evt_123"
},
"order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
"order_number": "1001",
"origin": "payment_link",
"paid_at": null,
"payment_intent_ids": [],
"payment_link_id": "pl_01KEZF7C00FEBVYY6R0DKKQRWX",
"payment_status": "unpaid",
"pending_order_edit_id": null,
"prepayment_order_id": null,
"pricing_amounts": {
"additive_tax_money": {
"amount": 0,
"currency": "USD"
},
"charge_money": {
"amount": 0,
"currency": "USD"
},
"discount_money": {
"amount": 0,
"currency": "USD"
},
"inclusive_tax_money": {
"amount": 0,
"currency": "USD"
},
"requested_tip_money": {
"amount": 0,
"currency": "USD"
},
"subtotal_money": {
"amount": 5000,
"currency": "USD"
},
"tax_money": {
"amount": 0,
"currency": "USD"
},
"total_money": {
"amount": 5000,
"currency": "USD"
}
},
"refund_ids": [],
"refund_status": "none",
"return_credit_settlements": [],
"settlement_amounts": {
"dispute_lost_money": {
"amount": 0,
"currency": "USD"
},
"disputed_money": {
"amount": 0,
"currency": "USD"
},
"net_collected_money": {
"amount": 0,
"currency": "USD"
},
"outstanding_money": {
"amount": 5000,
"currency": "USD"
},
"overpaid_money": {
"amount": 0,
"currency": "USD"
},
"paid_money": {
"amount": 0,
"currency": "USD"
},
"refunded_money": {
"amount": 0,
"currency": "USD"
},
"released_money": {
"amount": 0,
"currency": "USD"
},
"removed_money": {
"amount": 0,
"currency": "USD"
},
"settled_tip_money": {
"amount": 0,
"currency": "USD"
},
"written_off_money": {
"amount": 0,
"currency": "USD"
}
},
"status": "open",
"subscription_delivery_number": null,
"supported_actions": [],
"tax": {
"attention": null,
"enabled": false,
"mode": "automatic",
"price_mode": "additive",
"reverse_charge": null,
"status": "not_required"
},
"tips": [],
"updated_at": "2026-03-17T14:30:00Z",
"version": 0
}Create discount preview#
/v1/discount-previewsRequires scope commerce.orders.read or commerce.orders.write
Rate limit: read
Evaluates promotion outcomes for an order without changing it. Returns the complete result inside data, without creating a resource or requiring an idempotency key. Use `promotion_id` for server-side apply flows where you already know the promotion, including code-gated promotions, which then apply without a code and count only toward the promotion's `max_uses`. Checkout credentials must use `promotion_code`. The response includes applied, skipped, and single-threshold available promotion candidates.
Request body
discountobjectPromotion to preview. Manual discounts are not supported.
order_idstringRequiredThe order to evaluate. Checkout session credentials can use only their own order.
Response · 200
The discount preview.
dataobjectRequiredResource, collection, or operation result returned by this request.
metaobjectAdditional information about this response.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl -X POST https://api.withflintpay.com/v1/discount-previews \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"discount": {
"promotion": {
"promotion_code": "SPRING15"
}
},
"order_id": "ord_01HZYV7Q9Y0Y4H8Q3H9F6R7T8J"
}'Create order edit preview#
/v1/order-edit-previewsRequires scope commerce.orders.read or commerce.orders.write
Rate limit: read
Calculates removing items from a paid order, adding items to it, or both, without changing it. Only whole unassigned units are removable; bundle components must all be unassigned. Original line quantity and pricing stay unchanged. Each removed unit's value includes its share of discounts and tax. Charges are released only when you list them in charge_refunds. Added lines use the line item create shape, are priced and taxed as usual without promotions, and must be lines Flint can fulfill: variant, bundle, and custom lines with a delivery requirement. The removed value and released charges pay for added lines first, removals in request order and then charges; the rest is refund_money, and what the added lines cost beyond that is amount_due_money. Invoice-collected, subscription-owned, return-owned, and disputed orders, and orders with an unresolved inventory exception, cannot be edited. Refund a line without fulfillment quantities, such as a digital item or service, with POST /v1/refunds. This calculation holds no stock and sets aside no refundable amount.
Request body
add_line_itemsarray of one ofLines to add after the removals, in the same shape as POST /v1/orders/{order_id}/line-items. Only lines Flint can fulfill can be added: variant, bundle, and custom lines with a delivery requirement. Added lines are priced and taxed as usual, without promotions, and don't join the order's delivery selection.
charge_refundsarray of objectCharges to release. Omitting amount_money releases the charge's remaining refundable amount. Charges you don't list are unchanged.
destinationsobjectWhere each original payment is refunded to, with the same defaults as a refund.
order_idstringRequiredThe paid order to edit.
reasonenumReason for removing the items.
duplicatefraudulentrequested_by_customerdefective_productwrong_item_shippednever_receivednot_as_describedarrived_too_latecustomer_changed_mindbetter_price_foundaccidental_orderotherout_of_stock
remove_line_itemsarray of objectOriginal line units to remove. Each line can appear only once. Send remove_line_items, add_line_items, or both.
Response · 200
The calculated item removals and refund.
dataobjectRequiredThe calculated removal and its refund.
metaobjectAdditional information about this response.
request_idstringRequiredIdentifier of this API request, useful when contacting support.
curl -X POST https://api.withflintpay.com/v1/order-edit-previews \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
"reason": "out_of_stock",
"remove_line_items": [
{
"order_line_item_id": "li_01KEZF7C004XP0V220YVMGQ354",
"quantity": 1
}
]
}'List orders#
/v1/ordersRequires scope commerce.orders.read or commerce.orders.write
Rate limit: read
Returns a paginated list of orders for the authenticated merchant. Default order: created_at descending, then order_id descending.
Query parameters
page_sizeintegerMaximum number of results to return, from 1 to 100. Defaults to 20.
page_tokenstringOpaque, 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.
customer_idstringFilter by customer ID.
product_idstringFilter to orders with any line item referencing this product ID. Bundle lines don't match their component products. An unknown product ID returns an empty page.
variant_idstringFilter to orders with any line item referencing this variant ID. Bundle lines don't match their component variants. An unknown variant ID returns an empty page.
emailstringFilter to orders whose buyer_email or linked customer's email equals this address, ignoring case and any whitespace stored around it, with accents preserved. Requires one bare email address without surrounding whitespace.
order_idarray of stringExact-match filter on order IDs. Matches any of up to 100 distinct IDs. Unknown IDs and orders outside your merchant or environment are absent. Other filters still apply, and results keep the list's ordering and pagination. Keep the same ID set on subsequent pages.
closed_reasonarray of enumWhy a closed order closed. Matches orders closed for any reason given. 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.
invoice_voidedpaidclosed_by_merchantcheckout_expiredwritten_offsupersededreturn_resolution_canceledother
statusarray of enumOrder status: open or closed. Selecting open and closed includes both statuses. 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.
openclosed
payment_statusarray of enumFilter by settled collection status. 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.
unpaidpartially_paidpaid
refund_statusarray of enumFilter by refund progress. 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.
nonepartially_refundedrefunded
fulfillment_statusarray of enumFilter by aggregate order fulfillment status. 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.
not_fulfilledpartially_fulfilledfulfilledcancelednot_applicableclosed
order_numberstringFilter by merchant-visible order number.
has_backordered_quantitybooleanFilter by whether any tracked line has units waiting for stock. False includes orders with no backordered units.
has_unassigned_fulfillment_quantitybooleanFilter by whether any required fulfillment quantity is unassigned. True includes orders with a positive sum of line fulfillment_quantities.unassigned_quantity; false includes orders with no unassigned quantity, including orders that need no fulfillment.
has_invoicebooleanFilter by whether invoice_id is set, including a voided invoice. False includes orders with no invoice.
has_open_fulfillmentbooleanFilter by whether the order has an open fulfillment. A fulfillment remains open until it completes, is canceled, fails, or is marked as a no-show. False includes orders with no fulfillments.
external_reference_idstringExact-match filter on the caller-owned external reference ID.
originarray of enumFilter by order origin. 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.
virtual_terminalpayment_linkshopcheckoutapisubscriptioninvoice
querystringSearch across order_id, order number, external_reference_id, fulfillment external_reference_id, buyer_email, notes, and line item names and SKUs. The linked customer's name and email aren't searched; use email or customer_id to find a customer's orders. 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 ord_01.
subscription_idstringFilter by subscription ID.
subscription_delivery_changedbooleanFilter by whether the subscriber changed delivery after this order was paid.
return_idstringFilter by the Return that created a replacement order.
return_resolution_idstringFilter by the ReturnResolution that created a replacement order.
shop_idstringFilter by Flint shop ID.
payment_link_idstringFilter by the payment link whose checkout created the order.
min_amountintegerInclusive lower bound on pricing_amounts.total_money.amount. Requires currency.
max_amountintegerInclusive upper bound on pricing_amounts.total_money.amount. Requires currency.
currencystringISO 4217 currency for min_amount and max_amount.
sort_byenumField to sort by. Defaults to created_at; ties are broken by order_id.
created_atupdated_atsettlement_amounts.outstanding_moneypricing_amounts.total_money
sort_directionenumSort direction. Defaults to desc.
ascdesc
created_afterstringInclusive lower bound on created_at.
created_beforestringExclusive upper bound on created_at.
updated_afterstringInclusive lower bound on updated_at.
updated_beforestringExclusive upper bound on updated_at.
expandarray of enumInclude related objects in the response. Supported expansions: customer, subscription, subscription_plan. 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.
customersubscriptionsubscription_plan
Response · 200
A page of orders.
dataarray of objectRequiredResource, collection, or operation result returned by this request.
metaobjectAdditional information about this response.
next_page_tokenstringOpaque token to send as `page_token` to retrieve the next page. Omitted when there is no next page.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl https://api.withflintpay.com/v1/orders \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY"A page of orders.
{
"data": [
{
"active_payment_review_id": null,
"charges": [],
"checkout_session_ids": [],
"client_reference": null,
"created_at": "2026-03-17T14:30:00Z",
"custom_field_answers": [
{
"custom_field_type": "dropdown",
"key": "t_shirt_size",
"label": "T-shirt size",
"payment_link_custom_field_id": "plcf_01K4W8TSHRTS2ZEQ7XN5V3D2JA",
"value": "Medium"
},
{
"custom_field_type": "checkbox",
"key": "newsletter",
"label": "Email me about future events",
"payment_link_custom_field_id": "plcf_01K4W8NEWSETTER5G7MB2C4KP0",
"value": false
}
],
"customer_id": "cus_01KEZF7C003ACYXT6Q5EQZ78EE",
"deferred_promotions": [],
"discounts": [],
"dispute_status": "none",
"fulfillments": [],
"gift_card_settlements": [],
"gift_card_tender_enabled": false,
"gift_cards": [],
"governing_delivery_selection_id": null,
"invoice_id": null,
"line_items": [
{
"backordered_quantity": 0,
"base_subtotal_money": {
"amount": 5000,
"currency": "USD"
},
"bundle_components": [],
"categories": [],
"discount_money": {
"amount": 0,
"currency": "USD"
},
"expected_ship_date": null,
"inventory_snapshot": null,
"license_key_quantity": 0,
"metadata": {
"ticket_type": "ga"
},
"modifier_total_money": {
"amount": 0,
"currency": "USD"
},
"modifiers": [],
"name": "General Admission",
"order_edit_id": null,
"order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
"order_line_item_id": "li_01KEZF7C004XP0V220YVMGQ354",
"payment_link_line_item_key": "general-admission",
"product_type": null,
"purchased_gift_cards": [],
"quantity": 2,
"refundable": {
"discount_money": {
"amount": 0,
"currency": "USD"
},
"gross_money": {
"amount": 0,
"currency": "USD"
},
"quantity": 0,
"tax_money": {
"amount": 0,
"currency": "USD"
},
"total_money": {
"amount": 0,
"currency": "USD"
}
},
"refunded_money": {
"amount": 0,
"currency": "USD"
},
"refunded_quantity": 0,
"release_date": null,
"removed_quantity": 0,
"selected_options": [],
"subtotal_money": {
"amount": 5000,
"currency": "USD"
},
"tax_money": {
"amount": 0,
"currency": "USD"
},
"total_money": {
"amount": 5000,
"currency": "USD"
},
"type": "custom",
"unit_price_money": {
"amount": 2500,
"currency": "USD"
}
}
],
"merchant_id": "mer_01KEZF7C00MPP0T9S0KH5BB4CC",
"metadata": {
"event_id": "evt_123"
},
"order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
"order_number": "1001",
"origin": "payment_link",
"paid_at": null,
"payment_intent_ids": [],
"payment_link_id": "pl_01KEZF7C00FEBVYY6R0DKKQRWX",
"payment_status": "unpaid",
"pending_order_edit_id": null,
"prepayment_order_id": null,
"pricing_amounts": {
"additive_tax_money": {
"amount": 0,
"currency": "USD"
},
"charge_money": {
"amount": 0,
"currency": "USD"
},
"discount_money": {
"amount": 0,
"currency": "USD"
},
"inclusive_tax_money": {
"amount": 0,
"currency": "USD"
},
"requested_tip_money": {
"amount": 0,
"currency": "USD"
},
"subtotal_money": {
"amount": 5000,
"currency": "USD"
},
"tax_money": {
"amount": 0,
"currency": "USD"
},
"total_money": {
"amount": 5000,
"currency": "USD"
}
},
"refund_ids": [],
"refund_status": "none",
"return_credit_settlements": [],
"settlement_amounts": {
"dispute_lost_money": {
"amount": 0,
"currency": "USD"
},
"disputed_money": {
"amount": 0,
"currency": "USD"
},
"net_collected_money": {
"amount": 0,
"currency": "USD"
},
"outstanding_money": {
"amount": 5000,
"currency": "USD"
},
"overpaid_money": {
"amount": 0,
"currency": "USD"
},
"paid_money": {
"amount": 0,
"currency": "USD"
},
"refunded_money": {
"amount": 0,
"currency": "USD"
},
"released_money": {
"amount": 0,
"currency": "USD"
},
"removed_money": {
"amount": 0,
"currency": "USD"
},
"settled_tip_money": {
"amount": 0,
"currency": "USD"
},
"written_off_money": {
"amount": 0,
"currency": "USD"
}
},
"status": "open",
"subscription_delivery_number": null,
"supported_actions": [],
"tax": {
"attention": null,
"enabled": false,
"mode": "automatic",
"price_mode": "additive",
"reverse_charge": null,
"status": "not_required"
},
"tips": [],
"updated_at": "2026-03-17T14:30:00Z",
"version": 0
}
],
"meta": {
"api_version": "2026-09-07"
},
"request_id": "req_01KWM67Q32H15VBMRXQA9VYRDH"
}Create order#
/v1/ordersIdempotentRequires scope commerce.orders.write
Also requires commerce.delivery.write when delivery is present.
Rate limit: payment
Creates an order for the authenticated merchant. For USD orders, an effective requested tip may be up to the larger of $1,000 or 100% of the post-discount merchandise subtotal.
Request body
buyer_notestringA note to the buyer. Surrounding whitespace is trimmed before length validation. A supplied value cannot be blank; use null where clearing is supported.
customer_idstringID of the customer this order belongs to.
deliveryobjectQuotes the exact delivery method and atomically selects it with its charge and inventory hold. Requires orders-write and delivery-write. Shipment and local delivery with one choice group are supported. Cannot be combined with delivery_destination or handover.
delivery_destinationobjectShipment or local-delivery destination for an order created without a delivery selection.
discountsarray of one ofDiscounts applied to the order, each with its amount, status, and the line items and charges it covers.
external_reference_idstringCaller-owned identifier for this resource in an external system.
handoverobjectCarry-out sale: every physical item is handed to the buyer at this location when the order is paid, so paying needs no delivery selection. Can't be combined with delivery_destination.
internal_notestringA note for your team. Buyer reads leave it out. Surrounding whitespace is trimmed before length validation. A supplied value cannot be blank; use null where clearing is supported.
inventory_routing_sourceone ofWhere tracked demand is routed. When no source is stored or sent, Flint uses settings.inventory.default_routing_source, then the active Location in the current environment that has had inventory allocation enabled the longest. If no Location is eligible, send a routing source or configure the merchant default. The order stores the resolved source.
line_itemsarray of one ofRequiredItems the order sells, each with its pricing, tax, and fulfillment quantities.
metadatamap of stringCaller-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.
requested_tipone ofOptional requested tip. Its effective amount must satisfy the CreateOrderTip limit.
taxobjectTax settings for the order.
Response · 201
The created order.
dataobjectRequiredResource, collection, or operation result returned by this request.
metaobjectAdditional information about this response.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl -X POST https://api.withflintpay.com/v1/orders \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{
"discounts": [
{
"manual": {
"amount_money": {
"amount": 500,
"currency": "USD"
},
"name": "Launch credit"
}
}
],
"line_items": [
{
"fulfillment": {
"requirement": "none"
},
"metadata": {
"ticket_type": "ga"
},
"name": "General Admission",
"quantity": 2,
"type": "custom",
"unit_price_money": {
"amount": 2500,
"currency": "USD"
}
}
],
"metadata": {
"event_id": "evt_123"
}
}'Get order#
/v1/orders/{order_id}Requires scope commerce.orders.read or commerce.orders.write
Rate limit: read
Returns a single order by ID.
Path parameters
order_idstringRequiredFlint order ID. Must be a valid ID with prefix ord_. 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 enumInclude related objects in the response. Supported expansions: customer, fulfillments.packages, fulfillments.shipments, payment_intents, subscription, subscription_plan. For merchant credentials, expansion requires the base order read scope 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 can expand only fulfillments.packages, fulfillments.shipments.
customerfulfillments.packagesfulfillments.shipmentspayment_intentssubscriptionsubscription_plan
curl https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY"The requested order.
{
"data": {
"active_payment_review_id": null,
"charges": [],
"checkout_session_ids": [],
"client_reference": null,
"created_at": "2026-03-17T14:30:00Z",
"custom_field_answers": [
{
"custom_field_type": "dropdown",
"key": "t_shirt_size",
"label": "T-shirt size",
"payment_link_custom_field_id": "plcf_01K4W8TSHRTS2ZEQ7XN5V3D2JA",
"value": "Medium"
},
{
"custom_field_type": "checkbox",
"key": "newsletter",
"label": "Email me about future events",
"payment_link_custom_field_id": "plcf_01K4W8NEWSETTER5G7MB2C4KP0",
"value": false
}
],
"customer_id": "cus_01KEZF7C003ACYXT6Q5EQZ78EE",
"deferred_promotions": [],
"discounts": [],
"dispute_status": "none",
"fulfillments": [],
"gift_card_settlements": [],
"gift_card_tender_enabled": false,
"gift_cards": [],
"governing_delivery_selection_id": null,
"invoice_id": null,
"line_items": [
{
"backordered_quantity": 0,
"base_subtotal_money": {
"amount": 5000,
"currency": "USD"
},
"bundle_components": [],
"categories": [],
"discount_money": {
"amount": 0,
"currency": "USD"
},
"expected_ship_date": null,
"inventory_snapshot": null,
"license_key_quantity": 0,
"metadata": {
"ticket_type": "ga"
},
"modifier_total_money": {
"amount": 0,
"currency": "USD"
},
"modifiers": [],
"name": "General Admission",
"order_edit_id": null,
"order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
"order_line_item_id": "li_01KEZF7C004XP0V220YVMGQ354",
"payment_link_line_item_key": "general-admission",
"product_type": null,
"purchased_gift_cards": [],
"quantity": 2,
"refundable": {
"discount_money": {
"amount": 0,
"currency": "USD"
},
"gross_money": {
"amount": 0,
"currency": "USD"
},
"quantity": 0,
"tax_money": {
"amount": 0,
"currency": "USD"
},
"total_money": {
"amount": 0,
"currency": "USD"
}
},
"refunded_money": {
"amount": 0,
"currency": "USD"
},
"refunded_quantity": 0,
"release_date": null,
"removed_quantity": 0,
"selected_options": [],
"subtotal_money": {
"amount": 5000,
"currency": "USD"
},
"tax_money": {
"amount": 0,
"currency": "USD"
},
"total_money": {
"amount": 5000,
"currency": "USD"
},
"type": "custom",
"unit_price_money": {
"amount": 2500,
"currency": "USD"
}
}
],
"merchant_id": "mer_01KEZF7C00MPP0T9S0KH5BB4CC",
"metadata": {
"event_id": "evt_123"
},
"order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
"order_number": "1001",
"origin": "payment_link",
"paid_at": null,
"payment_intent_ids": [],
"payment_link_id": "pl_01KEZF7C00FEBVYY6R0DKKQRWX",
"payment_status": "unpaid",
"pending_order_edit_id": null,
"prepayment_order_id": null,
"pricing_amounts": {
"additive_tax_money": {
"amount": 0,
"currency": "USD"
},
"charge_money": {
"amount": 0,
"currency": "USD"
},
"discount_money": {
"amount": 0,
"currency": "USD"
},
"inclusive_tax_money": {
"amount": 0,
"currency": "USD"
},
"requested_tip_money": {
"amount": 0,
"currency": "USD"
},
"subtotal_money": {
"amount": 5000,
"currency": "USD"
},
"tax_money": {
"amount": 0,
"currency": "USD"
},
"total_money": {
"amount": 5000,
"currency": "USD"
}
},
"refund_ids": [],
"refund_status": "none",
"return_credit_settlements": [],
"settlement_amounts": {
"dispute_lost_money": {
"amount": 0,
"currency": "USD"
},
"disputed_money": {
"amount": 0,
"currency": "USD"
},
"net_collected_money": {
"amount": 0,
"currency": "USD"
},
"outstanding_money": {
"amount": 5000,
"currency": "USD"
},
"overpaid_money": {
"amount": 0,
"currency": "USD"
},
"paid_money": {
"amount": 0,
"currency": "USD"
},
"refunded_money": {
"amount": 0,
"currency": "USD"
},
"released_money": {
"amount": 0,
"currency": "USD"
},
"removed_money": {
"amount": 0,
"currency": "USD"
},
"settled_tip_money": {
"amount": 0,
"currency": "USD"
},
"written_off_money": {
"amount": 0,
"currency": "USD"
}
},
"status": "open",
"subscription_delivery_number": null,
"supported_actions": [],
"tax": {
"attention": null,
"enabled": false,
"mode": "automatic",
"price_mode": "additive",
"reverse_charge": null,
"status": "not_required"
},
"tips": [],
"updated_at": "2026-03-17T14:30:00Z",
"version": 0
},
"meta": {
"api_version": "2026-09-07"
},
"request_id": "req_01KWM67Q32H15VBMRXQA9VYRDH"
}Update order#
/v1/orders/{order_id}IdempotentRequires scope commerce.orders.write
Also requires commerce.delivery.write when delivery is present, including null.
Rate limit: payment
Applies a sparse update to mutable order fields such as customer_id, notes, metadata, tax, the delivery destination, and the requested tip. catalog_price_behavior defaults to keep. Send reprice with an explicit non-null customer_id to refresh every catalog variant line on an open, unpaid order; reassignment resolves the new customer’s direct list, then segment list, then variant prices. Customer removal is not supported. Checkout verification never reprices existing lines. A request containing only metadata, internal_note, buyer_note, or external_reference_id, with optional expected_version, can update open, closed, paid, and invoice-locked orders without changing totals. Other merchant edits keep hosted and headless checkout sessions open unless an edit closes or completes the order, which ends the session with order_mutated. Edits can also end invoice, return-resolution, and subscription-plan sessions with order_mutated. A session already past expires_at ends with expired before the edit is applied. These annotation updates are blocked while any order payment attempt remains non-terminal, including an authorization awaiting capture, or checkout payment work is still resolving. Requests combining annotations with other fields use the financial mutation rules for the entire request. Send requested_tip: null to clear the current requested tip. Once a payment's capture sets its own tip with tip_money, the order's tip is set per payment: setting or clearing requested_tip returns ACTION_NOT_ALLOWED with reason payment_collected. A merchant can correct a paid subscription signup or renewal destination before shipment by sending delivery_destination and the current order version as expected_version. The committed delivery methods must remain eligible, and shipping and tax totals must stay unchanged. When the correction would change the paid totals, the request fails with `ACTION_NOT_ALLOWED` and reason `payment_collected`. The detail can include shipping_money, requoted_shipping_money, tax_money, and requoted_tax_money.
Path parameters
order_idstringRequiredFlint order ID. Must be a valid ID with prefix ord_. 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_notestring or nullBuyer-provided note about this order, such as a gift message or purchase preference. Send null to clear it. Surrounding whitespace is trimmed before length validation. A supplied value cannot be blank; use null where clearing is supported.
catalog_price_behaviorenumDefaults to keep, preserving frozen prices. Send reprice with an explicit non-null customer_id to refresh every catalog variant line on an open, unpaid order. Reassigning resolves the new customer’s direct list, then segment list, then variant pricing. Subscription-owned prices remain locked. If any catalog line’s variant is no longer for sale, reprice is refused; remove that line first.
keepreprice
customer_idstringCustomer to attach. Cannot be null or cleared. Reassignment requires catalog_price_behavior: reprice, which resolves the new customer’s direct list, then segment list, then variant pricing.
deliveryobject or nullComplete replacement delivery preference. Omit to leave unchanged. Requires expected_version, orders-write and delivery-write. Send null to clear a provisional direct-order selection, its charge and hold. Draft invoice orders are allowed until issue; checkout-owned, subscription-owned, paid and locked orders are refused. Change delivery separately from delivery_destination, handover and shipping charge calculations.
delivery_destinationobject or nullComplete replacement destination. Allowed while the order is open and unpaid and no delivery selection controls it. A merchant may also correct a paid subscription signup or renewal before shipment by sending expected_version, when the committed delivery methods remain eligible and shipping and tax totals stay the same. A paid destination cannot be cleared. Send null to clear an unpaid order's delivery destination.
expected_versionintegerOrder version from the last order read. Required when sending delivery or correcting a paid delivery destination. Optional for other updates; when supplied, the update fails if the order changed.
external_reference_idstring or nullCaller-owned identifier for this resource in an external system. Send null to clear external_reference_id.
handoverobject or nullCarry-out handover to set or replace. Allowed while the order is open, nothing is paid, and no checkout session or delivery selection controls its delivery. Can't be combined with delivery_destination. Send null to clear it.
internal_notestring or nullInternal note about this order, visible only to the merchant. Send null to clear it. Surrounding whitespace is trimmed before length validation. A supplied value cannot be blank; use null where clearing is supported.
inventory_routing_sourceone ofWhere tracked demand is routed. When no source is stored or sent, Flint uses settings.inventory.default_routing_source, then the active Location in the current environment that has had inventory allocation enabled the longest. If no Location is eligible, send a routing source or configure the merchant default. The order stores the resolved source.
metadatamap of string or nullCaller-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. Send null to clear caller-owned metadata and preserve Flint-managed keys.
requested_tipone of or nullRequested tip to set or replace. Send null to clear the current requested tip. Refused with ACTION_NOT_ALLOWED and reason payment_collected once a payment's capture has set its own tip.
taxobjectTax settings for the order.
curl -X PATCH https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A \
-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_note": "Please include a gift receipt.",
"expected_version": 1708355100,
"internal_note": "VIP hold",
"metadata": {
"priority": "vip"
},
"requested_tip": {
"calculation_type": "percent",
"percent": 18
}
}'Create an order access link#
/v1/orders/{order_id}/access-linksIdempotentRequires scope commerce.orders.read or commerce.orders.write
Rate limit: sensitive_write
Creates the link Flint's receipt email carries, to put in buyer email or messages you send yourself. It opens the order in your Flint-hosted customer account without a sign-in, and lets the buyer have the receipt sent again to the order's email. It works for 30 days or 10 opens, whichever comes first; after that the buyer signs in to see the order. The url is a bearer credential. Flint returns it only in this response and in a retry with the same idempotency key, so send it only to the buyer and keep it out of logs. A call with a new key creates another link; earlier links keep working until they expire. When customer_account.mode is merchant_hosted it fails with `ACTION_NOT_ALLOWED` and reason `merchant_hosted_customer_accounts`, and for an order without a customer, with reason `configuration_required`. Dashboard sessions may create links when the staff member can view orders. Send no request body or an empty object ({}). Idempotency is scoped to the merchant, credential, environment, and this resource's route. A replay returns the original link without extending its lifetime or replenishing its opens. Without an idempotency key, each call creates a new link and has no replay result. If Flint cannot retain a result after minting, contact support with the request ID before sending a new request.
Path parameters
order_idstringRequiredFlint order ID. Must be a valid ID with prefix ord_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
Response · 201
The link, what it opens, and when it stops working.
dataobjectRequiredResource, collection, or operation result returned by this request.
metaobjectAdditional information about this response.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl -X POST https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/access-links \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{}'List order activities#
/v1/orders/{order_id}/activitiesRequires scope commerce.orders.read or commerce.orders.write
Rate limit: read
Returns a read-only, human-readable history log for an order. Use it to render timelines and debug what happened, not as a source of truth, ledger, or webhook replacement. Read the owning resource for authoritative state: the order for balances and status, the payment for payment state, the refund for refund outcomes, and the checkout session for checkout state. Do not sum balance_delta_money to compute an order balance. Informational rows such as payment_failed, refund_failed, and checkout_session_expired have a zero balance delta. The default order is newest first. Use sort_direction=asc for chronological timeline rendering. A typical chronological log might show created, payment_failed, payment, refund, then refund_failed; each row gives one reference to click through for the authoritative resource. Default order: created_at descending, then order_activity_id descending.
Path parameters
order_idstringRequiredFlint order ID. Must be a valid ID with prefix ord_. 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_sizeintegerMaximum number of results to return, from 1 to 100. Defaults to 20.
page_tokenstringOpaque, 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.
sort_directionenumSort direction. Defaults to desc.
ascdesc
activity_typearray of enumFilter by activity 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.
createddispute_openeddispute_closedline_item_addedline_item_updatedline_item_removeddiscount_applieddiscount_removedtax_updatedrequested_tip_addedrequested_tip_updatedrequested_tip_removedcharge_addedcharge_updatedcharge_removedcharge_fulfillment_updatedorder_editedpayment_review_openedpayment_review_closedorder_updatedadjustmentclosedpaymentpayment_failedrefundrefund_failedcheckout_session_createdcheckout_session_expiredcheckout_session_invalidatedfulfillment_createdfulfillment_updatedfulfillment_state_changed
Response · 200
A page of order activities.
dataarray of objectRequiredResource, collection, or operation result returned by this request.
metaobjectAdditional information about this response.
next_page_tokenstringOpaque token to send as `page_token` to retrieve the next page. Omitted when there is no next page.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/activities \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY"A page of order activities.
{
"data": [
{
"activity_type": "payment",
"balance_delta_money": {
"amount": -5000,
"currency": "USD"
},
"created_at": "2026-03-17T14:35:00Z",
"description": "Payment received",
"order_activity_id": "oact_01KEZF7C0007V3W9TZ95D9HSF9",
"order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
"payment_intent_id": "pi_01KEZF7C0050JFFB0HNCWWV1G3",
"running_balance_money": {
"amount": 0,
"currency": "USD"
}
}
],
"meta": {
"api_version": "2026-09-07"
},
"next_page_token": "example",
"request_id": "req_01KWM6G1WPHEA46S2C88M4G4PC"
}List order charges#
/v1/orders/{order_id}/chargesRequires scope commerce.orders.read or commerce.orders.write
Rate limit: read
Returns the order's charges sorted by ID in ascending order. Default order: order_charge_id ascending.
Path parameters
order_idstringRequiredFlint order ID. Must be a valid ID with prefix ord_. 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_sizeintegerMaximum number of results to return, from 1 to 100. Defaults to 20.
page_tokenstringOpaque, 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
A page of order charges.
dataarray of objectRequiredResource, collection, or operation result returned by this request.
metaobjectAdditional information about this response.
next_page_tokenstringOpaque token to send as `page_token` to retrieve the next page. Omitted when there is no next page.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/charges \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY"A page of order charges.
{
"data": [],
"meta": {
"api_version": "2026-09-07"
},
"next_page_token": "example",
"request_id": "req_01KWM6WAHG3N9Q8T2V5XRZ7C4D"
}Add order charge#
/v1/orders/{order_id}/chargesIdempotentRequires scope commerce.orders.write
Rate limit: payment
Adds a service charge, fee, or surcharge to an order.
Path parameters
order_idstringRequiredFlint order ID. Must be a valid ID with prefix ord_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
Request body
chargeone ofRequiredThe charge to add.
expected_order_versionintegerOptional order version from the last order read. The mutation fails if the order changed.
curl -X POST https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/charges \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{
"charge": {
"amount_money": {
"amount": 500,
"currency": "USD"
},
"calculation_type": "amount",
"fulfillment_id": "ful_01KEZF7C009ZMPJ33XHS45DMQ5",
"name": "Delivery",
"tax": {
"taxable": true
},
"type": "delivery_fee"
}
}'Update order charge#
/v1/orders/{order_id}/charges/{order_charge_id}IdempotentRequires scope commerce.orders.write
Rate limit: payment
Updates a single service charge, fee, or surcharge on an order.
Path parameters
order_idstringRequiredFlint order ID. Must be a valid ID with prefix ord_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
order_charge_idstringRequiredFlint order charge ID. Must be a valid ID with prefix och_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
Request body
amount_moneyobjectReplacement fixed charge amount in the order currency. The amount and every computed order amount must not exceed 99999999 minor units ($999,999.99 USD). Flint rejects an input or calculation above this ceiling with INVALID_REQUEST and detail INVALID_VALUE at the responsible input field. Lower payment option limits can apply.
calculation_basisenumThe amount a percent charge is calculated from.
subtotal_pre_discountsubtotal_post_discount
descriptionstring or nullSend null to clear description.
expected_versionintegerOptional order version from the last order read. The mutation fails if the order changed.
fulfillment_idstring or nullSend null to unlink the fulfillment.
metadatamap of string or nullCaller-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. Send null to clear all metadata.
namestringWhat the buyer sees for this charge at checkout and on receipts. Surrounding whitespace is trimmed before length validation. A supplied value cannot be blank; use null where clearing is supported.
percentnumberPercentage points of the base `calculation_basis` names, such as `3` for 3%. Fixed charges use `amount_money` instead.
taxobjectHow tax applies to this charge.
typeenumWhat the charge is for. It classifies the charge in reporting and sets its default tax category.
service_feedelivery_feeshipping_feehandling_feepackaging_feesmall_order_feeservice_area_feesetup_feeinstallation_feecleaning_feebooking_feereservation_feeticket_feefulfillment_feerestocking_feerush_feeother
curl -X PATCH https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/charges/och_01KEZF7C00XX8AKACP0GHKFWWT \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{
"amount_money": {
"amount": 700,
"currency": "USD"
},
"fulfillment_id": "ful_01KEZF7C009ZMPJ33XHS45DMQ5",
"name": "Priority delivery"
}'Delete order charge#
/v1/orders/{order_id}/charges/{order_charge_id}IdempotentRequires scope commerce.orders.write
Rate limit: payment
Removes a single service charge, fee, or surcharge from an order.
Path parameters
order_idstringRequiredFlint order ID. Must be a valid ID with prefix ord_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
order_charge_idstringRequiredFlint order charge ID. Must be a valid ID with prefix och_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
Query parameters
expected_versionintegerOrder version from the last order read. The mutation fails if the order changed.
curl -X DELETE https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/charges/och_01KEZF7C00XX8AKACP0GHKFWWT \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY"Close order#
/v1/orders/{order_id}/closeIdempotentRequires scope commerce.orders.write
Rate limit: payment
Closes an open order and stops further payment. Cancels pending discounts, releases their reservations, and recalculates totals; canceled discounts remain visible with status: "canceled" but no longer reduce the total. Unused order-owned payment intents are canceled. When collected money remains refundable, send collected_money_behavior: keep to close and keep it, or refund it first with POST /v1/refunds and order_id. Closing does not refund money; refunds remain available afterwards. Closing is blocked while payment collection is in progress. To complete a zero-balance order as paid, use POST /v1/orders/{order_id}/pay. closed_reason and closed_at record why and when the order closed. The request body is optional. Send expected_version to reject a mutation based on an outdated order read.
Path parameters
order_idstringRequiredFlint order ID. Must be a valid ID with prefix ord_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
Request body
collected_money_behaviorenumSend keep to close while keeping collected money. Required when collected money remains refundable to its original tenders, after pending refunds. Closing does not refund money, and the order remains refundable. Accepted when nothing was collected.
keep
expected_versionintegerOptional order version from the last order read. The mutation fails if the order changed.
reason_messagestringYour note explaining why you are closing the order. It is not shown to the buyer.
curl -X POST https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/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": "Customer canceled before payment."
}'Apply discount#
/v1/orders/{order_id}/discountsIdempotentRequires scope commerce.orders.write
Rate limit: payment
Applies a promotion-backed or manual discount to an order. Checkout-authenticated buyers must provide a promotion code; resource IDs and manual discounts require merchant authentication. Unknown promotion codes have separate one-hour failure budgets of 5 per checkout session, 10 per IP within the merchant environment, and 50 per merchant environment. Exhausting any budget returns 429 RATE_LIMIT_EXCEEDED with Retry-After before another code lookup. Creating another checkout session does not reset the IP or merchant budget. Known codes do not consume failure budget.
Path parameters
order_idstringRequiredFlint order ID. Must be a valid ID with prefix ord_. 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 `Promotion` variant of `ApplyDiscountRequest`.
expected_versionintegerOptional order version from the last order read. The mutation fails if the order changed.
promotionone ofRequiredThe promotion to apply.
The `Manual` variant of `ApplyDiscountRequest`.
expected_versionintegerOptional order version from the last order read. The mutation fails if the order changed.
manualobjectRequiredA discount you set by hand, with a name and an amount.
curl -X POST https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/discounts \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{
"promotion": {
"promotion_code": "SPRING15"
}
}'Remove discounts#
/v1/orders/{order_id}/discounts/removeIdempotentRequires scope commerce.orders.write
Rate limit: payment
Removes pending applied discounts or deferred promotions from an order. Send at least one ID across order_discount_ids and deferred_promotion_ids. Deferred promotions can be removed before payment. Redeemed or canceled discounts are settlement history and cannot be removed.
Path parameters
order_idstringRequiredFlint order ID. Must be a valid ID with prefix ord_. 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 at least one of these
deferred_promotion_idsarray of stringIDs from the order's deferred_promotions to remove before payment. May be omitted or empty when order_discount_ids contains an ID.
expected_versionintegerOptional order version from the last order read. The mutation fails if the order changed.
order_discount_idsarray of stringRequiredIDs of the order discounts to remove.
deferred_promotion_idsarray of stringRequiredIDs from the order's deferred_promotions to remove before payment. May be omitted or empty when order_discount_ids contains an ID.
expected_versionintegerOptional order version from the last order read. The mutation fails if the order changed.
order_discount_idsarray of stringIDs from the order's discounts to remove. May be omitted or empty when deferred_promotion_ids contains an ID.
curl -X POST https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/discounts/remove \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{
"order_discount_ids": [
"ad_01JFXH8Z2K7QF9V3MB0N4T6RCP"
]
}'Reprice discounts#
/v1/orders/{order_id}/discounts/repriceIdempotentRequires scope commerce.orders.write
Rate limit: payment
Recalculates pending discounts and automatic promotions for a mutable order. The request body is optional. Send expected_version to reject a mutation based on an outdated order read.
Path parameters
order_idstringRequiredFlint order ID. Must be a valid ID with prefix ord_. 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_versionintegerOptional order version from the last order read. The mutation fails if the order changed.
curl -X POST https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/discounts/reprice \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{
"expected_version": 1
}'List order edits#
/v1/orders/{order_id}/editsRequires scope commerce.orders.read or commerce.orders.write
Rate limit: read
Lists edits for this order, newest created_at first, with descending order_edit_id as the tiebreaker. Defaults to 20 results. Keep filters unchanged when using a page token. Default order: created_at descending, then order_edit_id descending.
Path parameters
order_idstringRequiredThe order that owns the edit. Must be a valid ID with prefix ord_. 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_sizeintegerMaximum number of results to return, from 1 to 100. Defaults to 20.
page_tokenstringOpaque, 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 enumExact edit status. Values match any supplied status. 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.
pendingcompletedcanceled
created_afterstringInclusive lower bound on created_at.
created_beforestringExclusive upper bound on created_at.
Response · 200
The order edit.
dataarray of objectRequiredResource, collection, or operation result returned by this request.
metaobjectAdditional information about this response.
next_page_tokenstringOpaque token to send as `page_token` to retrieve the next page. Omitted when there is no next page.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/edits \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY"The order edit.
{
"data": [
{
"add_line_items": [
{
"discount_money": {
"amount": 0,
"currency": "USD"
},
"name": "Replacement",
"order_line_item_id": "li_01J00000000000000000000001",
"quantity": 1,
"subtotal_money": {
"amount": 110,
"currency": "USD"
},
"tax_money": {
"amount": 0,
"currency": "USD"
},
"total_money": {
"amount": 110,
"currency": "USD"
},
"type": "custom",
"unit_price_money": {
"amount": 110,
"currency": "USD"
}
}
],
"added_total_money": {
"amount": 110,
"currency": "USD"
},
"amount_due_money": {
"amount": 0,
"currency": "USD"
},
"canceled_at": null,
"cancellation_reason": null,
"charge_refunds": [],
"completed_at": "2026-11-06T00:00:00Z",
"created_at": "2026-11-06T00:00:00Z",
"expires_at": null,
"order_edit_id": "oed_01J00000000000000000000000",
"order_id": "ord_01J00000000000000000000000",
"payment_intent_id": null,
"reason": "requested_by_customer",
"refund_ids": [],
"refund_money": {
"amount": 110,
"currency": "USD"
},
"remove_line_items": [
{
"order_line_item_id": "li_01J00000000000000000000000",
"quantity": 1,
"refund_money": {
"amount": 110,
"currency": "USD"
},
"total_money": {
"amount": 220,
"currency": "USD"
}
}
],
"removed_total_money": {
"amount": 220,
"currency": "USD"
},
"small_balance_adjustment_money": {
"amount": 0,
"currency": "USD"
},
"status": "completed",
"supported_actions": [],
"unrefunded_money": {
"amount": 110,
"currency": "USD"
},
"version": 1
}
],
"meta": {
"api_version": "2026-09-07"
},
"next_page_token": "next",
"request_id": "req_01KWM6WAHG3N9Q8T2V5XRZ7C4D"
}Create order edit#
/v1/orders/{order_id}/editsKey requiredRequires scopes commerce.orders.write (or the matching write scope) and commerce.refunds.write (or the matching write scope)
Rate limit: payment
Removes unassigned units from a paid order, adds items the removed value and released charges pay for, or does both, and queues any remaining refund atomically. Removed value and released charges pay for added lines first; only the remainder is refunded. Added lines are priced and taxed as usual, without promotions, and must be variant, bundle, or custom lines with a delivery requirement. They do not join the order's delivery selection. An edit that would leave a balance due defaults to refusing with LIMIT_EXCEEDED and reason order_edit_balance_due. Send balance_due_behavior: collect to create a pending edit and its payment intent. Confirm that payment intent to collect the balance. The order stays paid and closed with zero outstanding money. The edit holds stock, removed units and credit for 24 hours; cancellation releases those holds without changing the order. Send expected_amount_due_money to fence the previewed balance. Bundle components must all be unassigned; dispatched quantities use Returns. Original quantities and pricing remain the sale record. The edit, added stock commitments, committed tax, and release of removed stock commit together; refund processing can continue afterward. Invoice-collected, subscription-owned, return-owned, disputed orders and unresolved inventory exceptions cannot be edited. Charges change only through charge_refunds. A zero-value edit creates no refund. Refund processing may still be pending, so refunds can be empty and refund.created follows later. Refund failures leave the completed edit recorded. When supported_actions contains retry, use POST /v1/orders/{order_id}/edits/{order_edit_id}/retry to refund the remaining money. On VERSION_CONFLICT, keep the draft, fetch the order, preview again, and reconcile it before committing with the new expected_order_version and a new key. Retry a lost response with the original Idempotency-Key and unchanged body: Flint recovers the committed edit and its current order and refunds, without repeating the edit. If recovery cannot complete, retain the key and request ID for support; do not change keys to retry an uncertain result.
Path parameters
order_idstringRequiredThe order that owns the edit. Must be a valid ID with prefix ord_. 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 at least one of these
add_line_itemsarray of one ofLines to add after removals, in the same shape as POST /v1/orders/{order_id}/line-items. Only variant, bundle, and custom lines with a delivery requirement can be added. Added lines are priced and taxed as usual, without promotions, and do not join the order's delivery selection.
balance_due_behaviorenumWhat happens when the added items cost more than the removed value and released charges. refuse returns 409 LIMIT_EXCEEDED and changes nothing. collect creates the edit as pending and a payment intent for the balance; the edit is applied when that payment succeeds.
refusecollect
charge_refundsarray of objectCharges to release. Released value pays for added lines first and the rest is refunded. Omitting amount_money releases the charge's remaining refundable amount.
destinationsobjectRefund destinations, with the same defaults as POST /v1/refunds.
expected_amount_due_moneyobjectThe balance you showed the buyer, usually the preview's amount_due_money. If the edit would freeze a different balance, the request returns 409 VERSION_CONFLICT and changes nothing.
expected_order_versionintegerRequiredThe order.version the edit draft was based on. On VERSION_CONFLICT, keep the draft, fetch the order, preview again, and reconcile before committing with the new version and a new Idempotency-Key.
notestringInternal merchant note. Omitted from buyer and webhook payloads and refund messages.
reasonenumReason for the edit and any refund it creates.
duplicatefraudulentrequested_by_customerdefective_productwrong_item_shippednever_receivednot_as_describedarrived_too_latecustomer_changed_mindbetter_price_foundaccidental_orderotherout_of_stock
remove_line_itemsarray of objectRequiredWhole unassigned units to remove. Each line appears once. Original quantities and pricing stay unchanged. Send remove_line_items, add_line_items, or both.
add_line_itemsarray of one ofRequiredLines to add after removals, in the same shape as POST /v1/orders/{order_id}/line-items. Only variant, bundle, and custom lines with a delivery requirement can be added. Added lines are priced and taxed as usual, without promotions, and do not join the order's delivery selection.
balance_due_behaviorenumWhat happens when the added items cost more than the removed value and released charges. refuse returns 409 LIMIT_EXCEEDED and changes nothing. collect creates the edit as pending and a payment intent for the balance; the edit is applied when that payment succeeds.
refusecollect
charge_refundsarray of objectCharges to release. Released value pays for added lines first and the rest is refunded. Omitting amount_money releases the charge's remaining refundable amount.
destinationsobjectRefund destinations, with the same defaults as POST /v1/refunds.
expected_amount_due_moneyobjectThe balance you showed the buyer, usually the preview's amount_due_money. If the edit would freeze a different balance, the request returns 409 VERSION_CONFLICT and changes nothing.
expected_order_versionintegerRequiredThe order.version the edit draft was based on. On VERSION_CONFLICT, keep the draft, fetch the order, preview again, and reconcile before committing with the new version and a new Idempotency-Key.
notestringInternal merchant note. Omitted from buyer and webhook payloads and refund messages.
reasonenumReason for the edit and any refund it creates.
duplicatefraudulentrequested_by_customerdefective_productwrong_item_shippednever_receivednot_as_describedarrived_too_latecustomer_changed_mindbetter_price_foundaccidental_orderotherout_of_stock
remove_line_itemsarray of objectWhole unassigned units to remove. Each line appears once. Original quantities and pricing stay unchanged. Send remove_line_items, add_line_items, or both.
Response · 201
The pending or completed edit and refunds created so far.
dataobjectRequiredResource, collection, or operation result returned by this request.
metaobjectAdditional information about this response.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl -X POST https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/edits \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{
"add_line_items": [
{
"quantity": 1,
"type": "variant",
"variant_id": "var_01J00000000000000000000000"
}
],
"balance_due_behavior": "collect",
"expected_amount_due_money": {
"amount": 110,
"currency": "USD"
},
"expected_order_version": 1793923200,
"reason": "requested_by_customer"
}'Get order edit#
/v1/orders/{order_id}/edits/{order_edit_id}Requires scope commerce.orders.read or commerce.orders.write
Rate limit: read
Returns the edit with its current lifecycle, frozen balance and refund amounts, and current refund IDs. The internal note is visible to merchant callers only.
Path parameters
order_idstringRequiredThe order that owns the edit. Must be a valid ID with prefix ord_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
order_edit_idstringRequiredThe edit belonging to this order. Must be a valid ID with prefix oed_. 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 order edit.
dataobjectRequiredResource, collection, or operation result returned by this request.
metaobjectAdditional information about this response.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/edits/oed_01KEZF7C00A6BQ4TBGWFDJ944A \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY"The order edit.
{
"data": {
"add_line_items": [
{
"discount_money": {
"amount": 0,
"currency": "USD"
},
"name": "Replacement",
"order_line_item_id": "li_01J00000000000000000000001",
"quantity": 1,
"subtotal_money": {
"amount": 110,
"currency": "USD"
},
"tax_money": {
"amount": 0,
"currency": "USD"
},
"total_money": {
"amount": 110,
"currency": "USD"
},
"type": "custom",
"unit_price_money": {
"amount": 110,
"currency": "USD"
}
}
],
"added_total_money": {
"amount": 110,
"currency": "USD"
},
"amount_due_money": {
"amount": 0,
"currency": "USD"
},
"canceled_at": null,
"cancellation_reason": null,
"charge_refunds": [],
"completed_at": "2026-11-06T00:00:00Z",
"created_at": "2026-11-06T00:00:00Z",
"expires_at": null,
"order_edit_id": "oed_01J00000000000000000000000",
"order_id": "ord_01J00000000000000000000000",
"payment_intent_id": null,
"reason": "requested_by_customer",
"refund_ids": [],
"refund_money": {
"amount": 110,
"currency": "USD"
},
"remove_line_items": [
{
"order_line_item_id": "li_01J00000000000000000000000",
"quantity": 1,
"refund_money": {
"amount": 110,
"currency": "USD"
},
"total_money": {
"amount": 220,
"currency": "USD"
}
}
],
"removed_total_money": {
"amount": 220,
"currency": "USD"
},
"small_balance_adjustment_money": {
"amount": 0,
"currency": "USD"
},
"status": "completed",
"supported_actions": [],
"unrefunded_money": {
"amount": 110,
"currency": "USD"
},
"version": 1
},
"meta": {
"api_version": "2026-09-07"
},
"request_id": "req_01KWM6WAHG3N9Q8T2V5XRZ7C4D"
}Cancel order edit#
/v1/orders/{order_id}/edits/{order_edit_id}/cancelKey requiredRequires scope commerce.orders.write
Rate limit: payment
Cancels the payment intent, releases every hold, and leaves the order's items and money unchanged. Refused while the balance payment is processing or under review. Use the same Idempotency-Key to replay the recorded result.
Path parameters
order_idstringRequiredThe order that owns the edit. Must be a valid ID with prefix ord_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
order_edit_idstringRequiredThe pending edit to cancel. Must be a valid ID with prefix oed_. 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_versionintegerThe order edit version to cancel. A mismatch returns VERSION_CONFLICT before changes.
Response · 200
The order edit.
dataobjectRequiredResource, collection, or operation result returned by this request.
metaobjectAdditional information about this response.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl -X POST https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/edits/oed_01KEZF7C00A6BQ4TBGWFDJ944A/cancel \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{
"expected_version": 1
}'Retry order edit refund#
/v1/orders/{order_id}/edits/{order_edit_id}/retryKey requiredRequires scopes commerce.orders.write (or the matching write scope) and commerce.refunds.write (or the matching write scope)
Rate limit: payment
Refunds the edit's remaining frozen money after refund processing has failed. Pending and succeeded linked refunds count toward the edit's refunded value. Omit the body or destinations to reuse the edit's original destinations. Retry is unavailable while a linked refund is pending, when nothing remains, or when a payment is disputed. While Flint is still processing the original refund and no linked refund exists, supported_actions is empty and retry returns in_progress. If processing ends without creating a refund, retry becomes available. Use a new Idempotency-Key for a new retry attempt, and the same key and body to recover its lost response. The response contains only refunds created by this attempt.
Path parameters
order_idstringRequiredThe order that owns the edit. Must be a valid ID with prefix ord_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
order_edit_idstringRequiredThe edit belonging to this order. Must be a valid ID with prefix oed_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
Request body
destinationsobjectRefund destinations, with the same shape as on create. Omit to reuse the destinations frozen on the edit.
Response · 201
The edit and refunds created by this attempt.
dataobjectRequiredResource, collection, or operation result returned by this request.
metaobjectAdditional information about this response.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl -X POST https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/edits/oed_01KEZF7C00A6BQ4TBGWFDJ944A/retry \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{}'Apply a gift card to an order#
/v1/orders/{order_id}/gift-cardsIdempotentRequires scope commerce.orders.write
Rate limit: write
Selects a gift card by its current code and returns masked selections and an unreserved estimate. No value is held or debited. Optional expected_version must match the order version returned by the last read. An order may select at most 20 gift cards. Gift card value cannot pay for subscription orders. Retry a lost response with the same idempotency key to recover the original selection result.
Path parameters
order_idstringRequiredOrder ID. Must be a valid ID with prefix ord_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
Request body
codestringRequiredThe gift card's code. Spaces and hyphens are ignored.
expected_versionintegerOptional order version from the last order read. The mutation fails if the order changed.
Response · 200
The order with masked gift card selections and an unreserved allocation estimate.
Same response as Create order.
curl -X POST https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/gift-cards \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{
"code": "0123456789AB1234",
"expected_version": 1773757800
}'Remove a selected gift card#
/v1/orders/{order_id}/gift-cards/{gift_card_id}IdempotentRequires scope commerce.orders.write
Rate limit: write
Removes a selected gift card without moving value. The expected_version must still match the order version. Selections cannot change during an active payment attempt. Retry a lost response with the same idempotency key to recover the original selection result.
Path parameters
order_idstringRequiredOrder ID. Must be a valid ID with prefix ord_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
gift_card_idstringRequiredSelected gift card ID. Must be a valid ID with prefix gc_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
Query parameters
expected_versionintegerRequiredOrder version from the last order read. The mutation fails if the order changed.
Response · 200
The order with masked gift card selections and an unreserved allocation estimate.
Same response as Create order.
curl -X DELETE "https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/gift-cards/gc_01KEZF7C00RT1618WYBM1Y94CG?expected_version=1" \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY"List order line items#
/v1/orders/{order_id}/line-itemsRequires scope commerce.orders.read or commerce.orders.write
Rate limit: read
Returns the order's line items sorted by ID in ascending order. Default order: order_line_item_id ascending.
Path parameters
order_idstringRequiredFlint order ID. Must be a valid ID with prefix ord_. 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_sizeintegerMaximum number of results to return, from 1 to 100. Defaults to 20.
page_tokenstringOpaque, 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
A page of order line-items.
dataarray of objectRequiredResource, collection, or operation result returned by this request.
metaobjectAdditional information about this response.
next_page_tokenstringOpaque token to send as `page_token` to retrieve the next page. Omitted when there is no next page.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/line-items \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY"A page of order line-items.
{
"data": [],
"meta": {
"api_version": "2026-09-07"
},
"next_page_token": "example",
"request_id": "req_01KWM6WAHG3N9Q8T2V5XRZ7C4D"
}Add line items#
/v1/orders/{order_id}/line-itemsIdempotentRequires scope commerce.orders.write
Rate limit: payment
Adds one or more line items to an order.
Path parameters
order_idstringRequiredFlint order ID. Must be a valid ID with prefix ord_. 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_order_versionintegerOptional order version from the last order read. The mutation fails if the order changed.
line_itemsarray of one ofRequiredLine items to add to the order.
curl -X POST https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/line-items \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{
"line_items": [
{
"fulfillment": {
"requirement": "none"
},
"name": "Backstage Upgrade",
"quantity": 1,
"type": "custom",
"unit_price_money": {
"amount": 1500,
"currency": "USD"
}
}
]
}'Update line item#
/v1/orders/{order_id}/line-items/{order_line_item_id}IdempotentRequires scope commerce.orders.write
Rate limit: payment
Updates a single line item on an order. On paid orders, send expected_ship_date as a YYYY-MM-DD calendar date or null to clear it. It must be the only field apart from expected_version. expected_version is the order version returned in data.version. Send gift_card_face_value_money and expected_version to select an unpaid gift card line's face value within its frozen offer and reprice the order before any purchase funding. Send gift_card_recipient and expected_version to replace or clear recipient delivery details before any purchase funding. Checkout credentials can update gift card face value and recipient details together, modifiers, or a line subscription offer selection, each with expected_version. Repeating the current gift card face value does not change the order version. Set subscription to null to buy the line once.
Path parameters
order_idstringRequiredFlint order ID. Must be a valid ID with prefix ord_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
order_line_item_idstringRequiredFlint order line item ID. Must be a valid ID with prefix li_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
Request body
descriptionstring or nullSend null to clear description.
expected_ship_datestring or nullExpected ship date in YYYY-MM-DD format. Send null to clear it. Omission preserves it. Accepted on paid orders as the only field apart from expected_version. Repeating the current date or clearing an already-null date leaves the order version unchanged.
expected_versionintegerOrder version from the last order read, returned in data.version. Required when any of these fields is present: modifiers, gift_card_recipient, gift_card_face_value_money, subscription.
gift_card_face_value_moneyobjectSelects the face value of an unpaid, unfunded gift card line within its frozen offer's custom_amount_bounds and reprices the order. Fixed-denomination offers accept only their current value. Omission preserves the value; null is not allowed. Requires expected_version from the order. Checkout credentials may send this field alone or together with gift_card_recipient. Currency must be USD. Amount must be between 1 and 200000 minor units, inclusive. The amount and every computed order amount must not exceed 99999999 minor units ($999,999.99 USD). Flint rejects an input or calculation above this ceiling with INVALID_REQUEST and detail INVALID_VALUE at the responsible input field. Lower payment option limits can apply.
gift_card_recipientobject or nullReplaces the recipient of an unfunded gift card purchase. Omission preserves it; null clears it. Send expected_version from the order. Send null to clear gift_card_recipient. Requires expected_version.
metadatamap of string or nullCaller-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. Send null to clear all metadata.
modifiersarray of one ofThe line item's modifier selections. Sending the field replaces the current selections, so include every modifier you want to keep. Requires `expected_version`. Flint reprices the line item. Modifiers can't change once the line item has been paid for, and the request returns 409.
namestringName of the line item. Surrounding whitespace is trimmed before length validation. A supplied value cannot be blank; use null where clearing is supported.
product_typeenumClassification of a custom line for ACH debit: physical, digital, service, or fee. Omit to leave it unclassified; no default is inferred from fulfillment. Null is not accepted. Does not change tax, delivery, or inventory. On an order line PATCH, omission preserves the classification. Catalog lines use their product's type and reject this input.
physicalservicefeedigital
quantityintegerReplacement quantity, from 1 through 9999. The extended line subtotal, including modifiers, must satisfy the order money ceiling.
subscriptionobject or nullSelects an active subscription offer and reprices an unpaid line. Null selects a one-time purchase. Omission preserves the selection. Requires expected_version from the order and clears the delivery selection when terms change. Send null to clear subscription. Requires expected_version.
taxobjectTax settings for the line item.
unit_price_moneyobjectPrice of one unit. The amount and every computed order amount must not exceed 99999999 minor units ($999,999.99 USD). Flint rejects an input or calculation above this ceiling with INVALID_REQUEST and detail INVALID_VALUE at the responsible input field. Lower payment option limits can apply.
curl -X PATCH https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/line-items/li_01KEZF7C008YPRCK7VDKTGWR31 \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{
"expected_version": 1,
"modifiers": [
{
"text": {
"modifier_group_id": "mg_01KEZF7C00VQB2J7N5CX0VZMNH",
"value": "No onions"
},
"type": "text"
}
]
}'Delete line item#
/v1/orders/{order_id}/line-items/{order_line_item_id}IdempotentRequires scope commerce.orders.write
Rate limit: payment
Removes a single line item from an order.
Path parameters
order_idstringRequiredFlint order ID. Must be a valid ID with prefix ord_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
order_line_item_idstringRequiredFlint order line item ID. Must be a valid ID with prefix li_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
Query parameters
expected_versionintegerOrder version from the last order read. The mutation fails if the order changed.
curl -X DELETE https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/line-items/li_01KEZF7C008YPRCK7VDKTGWR31 \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY"Pay order#
/v1/orders/{order_id}/payKey requiredRequires scope commerce.orders.write
Also requires payments.payment_methods.write when an API key or partner token sends save_payment_method: true.
Also requires payments.readers.write when a payment source or selection has credential_type reader.
Rate limit: payment
Starts or resumes a payment attempt on the order. For a new headless order-checkout payment, Flint automatically quotes and selects a single available delivery option when saved destination and recipient inputs suffice. Existing choices, multiple options, required windows or instructions, and methods requiring explicit quotes keep the explicit selection path. The order reports the applied governing_delivery_selection_id and delivery. A changed delivery total still requires the caller to refresh and review expected_outstanding_money before payment. Starting a subscription requires buyer_contact.email or an email already saved on the checkout session or order. Set action to pay to charge the full outstanding balance, confirm_payment_intents to confirm order-owned payment intents, setup to save a newly collected token on a zero-balance order, or resume to continue an attempt after a pending client action. Each action accepts only its own fields. Only confirm_payment_intents accepts completion_behavior. A pay action without payment_source is valid only when the outstanding balance is zero. To continue a resumable attempt, send action: resume with order_payment_attempt_id and a new Idempotency-Key. A Tap to Pay reader returns requires_action, is_resumable true, and a card_presentment pending action with stripe.terminal_payment_intent authority for the Stripe Terminal SDK. After the app collects and confirms, resume reads the outcome: authorization or capture applies it, processing keeps the attempt processing, and no card or a decline keeps it requires_action with the same authority. A decline updates last_payment_error without ending the attempt; cancel to give up. An exact retry of the original request with its Idempotency-Key returns the stored response if the request completed, or recovers the same attempt if it was interrupted. Payment intents with manual capture return an active authorization instead of settling immediately. A replay preserves the original HTTP status and domain result, including when the original checkout credential retries after its session becomes paid. A resume of an already finished attempt returns its recorded outcome. A resume of the attempt that paid the order can return its success after the checkout session becomes paid. Reusing a recorded Idempotency-Key with a different request returns IDEMPOTENCY_KEY_REUSED even after the order is paid. A new payment or a resume of a different attempt on a paid order returns ACTION_NOT_ALLOWED with reason payment_collected, naming the order and its payment. Replays return no URL token or Stripe client secret; pending_actions is empty when action authority was stripped. Read the attempt to recover its current permitted actions. Read GET /v1/orders/{order_id}/payment-attempts/{order_payment_attempt_id} for the attempt's current state.
Path parameters
order_idstringRequiredFlint order ID. Must be a valid ID with prefix ord_. 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 `pay` variant of `PayOrderRequest`.
accepted_gift_card_allocationobjectThe gift card allocation to apply to this payment. Send `order_version`, `gift_cards`, `gift_card_money`, and `processor_money` as they appear in the order's current `gift_card_estimate`.
actionenumRequiredPay the order's outstanding balance with a payment source you send. Flint creates the payment for you.
pay
buyer_contactobjectBuyer email and phone recorded on the order. A checkout session payment uses the session's saved contact for omitted fields. Email and phone cannot be null.
buyer_ip_addressstringThe buyer's IP address, for risk screening, when your server pays on the buyer's behalf. Write-only.
Not accepted with a checkout credential
client_action_typeenumHow to complete the authentication step. Flint's API returns a Stripe client secret only for client_action_type stripe. A url action opens in a redirect, popup, or iframe; Stripe's authentication page receives what it needs to run the challenge, including the client secret for hosted 3DS2. If a payment is confirmed with a payment method Flint didn't approve, Flint doesn't count the charge, returns it to the buyer, and the payment intent ends canceled with cancellation_reason payment_returned. The Stripe secret can also confirm the payment with another card, so use it only with handleNextAction. Reader credentials do not support url; omit client_action_type or send stripe for reader payments. Defaults to url for a new confirmation; omission on a continuation keeps the existing type.
urlstripe
expected_outstanding_moneyobjectThe outstanding balance you reviewed. Required with checkout credentials, and with an API key or partner token when the order has an open checkout session. Optional otherwise. The amount and every computed order amount must not exceed 99999999 minor units ($999,999.99 USD). Flint rejects an input or calculation above this ceiling with INVALID_REQUEST and detail INVALID_VALUE at the responsible input field. Lower payment option limits can apply.
expected_versionintegerOptional version from the order you reviewed. A mismatch returns VERSION_CONFLICT, even when the outstanding amount is unchanged. Starting a payment advances the order's version. After a declined or failed attempt, use the order returned in the pay response or read the order again before retrying. When accepted_gift_card_allocation is sent, its order_version must match this value.
payment_return_urlstringWhere Flint sends the buyer after a redirect or authentication step, adding only payment_intent_id for a payment, or payment_method_id for a setup. The completion message uses type flint.payment_action.completed and exactly that one subject key. Without it, the step ends on a Flint page that tells the parent or opener the step completed. Accepts an absolute HTTPS URL or an app return URL with a custom scheme other than http, javascript, data, file, blob, or about. Cannot contain credentials, a query, 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. With a checkout credential on order pay, omit payment_return_url; checkout sessions use their own configured return URL.
payment_sourceone ofA saved card on a checkout whose customer came from a code requires a code confirmed with this credential in the last 15 minutes when the order ships to a new address. Otherwise pay returns 409 ACTION_NOT_ALLOWED with reason verification_required and a next action to request purpose pay_to_new_address. Known addresses are saved addresses or destinations of earlier paid orders for this customer at this business; for a Flint wallet card, wallet addresses count too. Pickup and orders that ship nothing never require it. A merchant-named customer, typed card, Apple Pay, and Google Pay are unaffected.
platform_feeobjectA platform fee your partner app charges on the processor payment pay creates, checked against what that payment collects after gift cards. A pay that gift cards or a zero balance settle creates no processor payment and charges no fee. 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).
save_payment_methodbooleanSaves the card this payment collects. The credential determines how it is saved. With an API key, partner token, or Dashboard session, saves the card for the order's customer with usage off_session, so you can charge it later without the buyer. Send true only when the buyer agreed to that on your page. Requires customer_id on the order and exactly one newly collected card, Apple Pay, or Google Pay credential: payment_source.stripe.confirmation_token created with setup_future_usage off_session, or payment_source.stripe.payment_method (credential_type stripe_payment_method). For confirm_payment_intents, send the credential in payment_intents[i].payment_source.stripe.confirmation_token or payment_intents[i].payment_source.stripe.payment_method. Other selected payments may use saved payment methods. API keys and partner tokens also need payments.payment_methods.write. Flint saves the card once the payment is approved, including an authorization awaiting capture, sends payment_method.activated, and sets payment_source.card.payment_method_id on the payment intent. If the bank asks the buyer to authenticate, that one authentication also covers the saved card. A resume keeps the choice the attempt started with. With the checkout session's own credential, records the buyer's choice to save the card they typed for faster checkout at this merchant. Send true only from the checkout session's own credential, when the session's can_save_payment_method is true, for one newly collected card sent as payment_source.stripe.confirmation_token, or payment_intents[i].payment_source.stripe.confirmation_token for a selected payment, created with setup_future_usage on_session. The card is saved with usage on_session once the payment succeeds, for the customer the checkout acts for: the customer the merchant created the session for, or the customer whose email the buyer confirmed in it. When save_payment_method_requires_verification is true, buyer_contact.email is required. The card is kept pending for the customer with that email, creating one if needed, and opens nothing until confirmed on the receipt within 24 hours. Without save_payment_method_phone, payment_method_save.email_confirmation_required is true and an emailed code confirms the save with purpose confirm_saved_payment_method and channel email. The code goes only to the email given with the payment. Subscription signup and setup still require email verification before collection when the email belongs to an existing customer. A checkout the buyer bound by a texted code saves the card with that number. A checkout whose buyer confirmed the customer's email can also send save_payment_method_phone, to save the card with a number the buyer confirms by text after paying. A checkout can send the buyer's choice with every payment button: Apple Pay, Google Pay, a bank account, or Affirm, in payment_source.stripe.confirmation_token created with no setup_future_usage, pays without the save, and the payment attempt's payment_method_save reports not_saved with reason payment_method_not_saveable. The session's save_payment_method_types lists what is saved. Send false or omit it when the buyer does not choose to save; payment_source.stripe.confirmation_token must then have no setup_future_usage, except for a subscription signup.
save_payment_method_consent_textstringThe wording the buyer agreed to when saving this card. Send only when save_payment_method is true, using an API key or partner token with payments.payment_methods.write, or a Dashboard session. Flint trims surrounding whitespace and stores the remaining text exactly. The trimmed wording must contain 1 to 1,000 characters and cannot contain a null character. Checkout supplies its own wording and cannot send this field.
Not accepted with a checkout credential
save_payment_method_phonestringA US or Canadian mobile phone number in E.164 format, such as +14155552671, that confirms a card saved while the checkout acts for no customer, or for the customer whose email the buyer confirmed in it. Send it with save_payment_method: true only from the checkout session's own credential, when the session's can_save_payment_method_with_phone is true. The card is kept for the customer the checkout acts for, or else the merchant's customer with the buyer's email, once the payment succeeds, or once it is approved when the merchant captures later, but works for nothing until the buyer confirms it within 24 hours, with a code texted to this number or, when the customer's email is the email of the payment, emailed there instead: request the code with POST /v1/checkout-sessions/{checkout_session_id}/customer-verifications and purpose confirm_saved_payment_method, and read payment_method_save on the checkout session. A card saved with the number makes it the customer's saved number, and the cards saved with the number it replaces are removed. A card not confirmed in time is not saved.
splitsarray of objectDivide this payment's funds between the collecting merchant and sellers; this is separate from split tender, where a buyer uses several payment methods. Only the collecting merchant's own credentials can send splits. Each install must belong to the same app owned by the collecting merchant, with the seller's approval in this mode and readiness to receive payouts. Test mode needs no platform review; live mode requires the app's active payment_splits capability and Flint support for the collecting account. Can't be combined with platform_fee or saved payment credentials. The total must fit after the largest Flint fee for the offered payment options, leaving one minor unit for the collecting merchant; otherwise INVALID_REQUEST with INVALID_VALUE on splits and maximum_money. Fixed after create, except capture's final amounts. Part of the idempotency fingerprint. On pay, the total must fit the processor payment after gift cards. A payment funded entirely by gift cards can't have splits.
The `confirm_payment_intents` variant of `PayOrderRequest`.
accepted_gift_card_allocationobjectThe gift card allocation to apply to this payment. Send `order_version`, `gift_cards`, `gift_card_money`, and `processor_money` as they appear in the order's current `gift_card_estimate`.
actionenumRequiredConfirm payment intents you already created for the order.
confirm_payment_intents
buyer_contactobjectBuyer email and phone recorded on the order. A checkout session payment uses the session's saved contact for omitted fields. Email and phone cannot be null.
client_action_typeenumHow to complete the authentication step. Flint's API returns a Stripe client secret only for client_action_type stripe. A url action opens in a redirect, popup, or iframe; Stripe's authentication page receives what it needs to run the challenge, including the client secret for hosted 3DS2. If a payment is confirmed with a payment method Flint didn't approve, Flint doesn't count the charge, returns it to the buyer, and the payment intent ends canceled with cancellation_reason payment_returned. The Stripe secret can also confirm the payment with another card, so use it only with handleNextAction. Reader credentials do not support url; omit client_action_type or send stripe for reader payments. Defaults to url for a new confirmation; omission on a continuation keeps the existing type.
urlstripe
completion_behaviorenumWhat happens when the selected payment intents don't cover the balance. Defaults to complete_order.
complete_orderpartial_payment
expected_outstanding_moneyobjectThe outstanding balance you reviewed. Required with checkout credentials, and with an API key or partner token when the order has an open checkout session. Optional otherwise. The amount and every computed order amount must not exceed 99999999 minor units ($999,999.99 USD). Flint rejects an input or calculation above this ceiling with INVALID_REQUEST and detail INVALID_VALUE at the responsible input field. Lower payment option limits can apply.
expected_versionintegerOptional version from the order you reviewed. A mismatch returns VERSION_CONFLICT, even when the outstanding amount is unchanged. Starting a payment advances the order's version. After a declined or failed attempt, use the order returned in the pay response or read the order again before retrying. When accepted_gift_card_allocation is sent, its order_version must match this value.
payment_intentsarray of objectRequiredThe payment intents to confirm, each with the credential to use. Send at least one. With a reader credential, send only one payment intent.
payment_return_urlstringWhere Flint sends the buyer after a redirect or authentication step, adding only payment_intent_id for a payment, or payment_method_id for a setup. The completion message uses type flint.payment_action.completed and exactly that one subject key. Without it, the step ends on a Flint page that tells the parent or opener the step completed. Accepts an absolute HTTPS URL or an app return URL with a custom scheme other than http, javascript, data, file, blob, or about. Cannot contain credentials, a query, 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. With a checkout credential on order pay, omit payment_return_url; checkout sessions use their own configured return URL.
save_payment_methodbooleanSaves the card this payment collects. The credential determines how it is saved. With an API key, partner token, or Dashboard session, saves the card for the order's customer with usage off_session, so you can charge it later without the buyer. Send true only when the buyer agreed to that on your page. Requires customer_id on the order and exactly one newly collected card, Apple Pay, or Google Pay credential: payment_source.stripe.confirmation_token created with setup_future_usage off_session, or payment_source.stripe.payment_method (credential_type stripe_payment_method). For confirm_payment_intents, send the credential in payment_intents[i].payment_source.stripe.confirmation_token or payment_intents[i].payment_source.stripe.payment_method. Other selected payments may use saved payment methods. API keys and partner tokens also need payments.payment_methods.write. Flint saves the card once the payment is approved, including an authorization awaiting capture, sends payment_method.activated, and sets payment_source.card.payment_method_id on the payment intent. If the bank asks the buyer to authenticate, that one authentication also covers the saved card. A resume keeps the choice the attempt started with. With the checkout session's own credential, records the buyer's choice to save the card they typed for faster checkout at this merchant. Send true only from the checkout session's own credential, when the session's can_save_payment_method is true, for one newly collected card sent as payment_source.stripe.confirmation_token, or payment_intents[i].payment_source.stripe.confirmation_token for a selected payment, created with setup_future_usage on_session. The card is saved with usage on_session once the payment succeeds, for the customer the checkout acts for: the customer the merchant created the session for, or the customer whose email the buyer confirmed in it. When save_payment_method_requires_verification is true, buyer_contact.email is required. The card is kept pending for the customer with that email, creating one if needed, and opens nothing until confirmed on the receipt within 24 hours. Without save_payment_method_phone, payment_method_save.email_confirmation_required is true and an emailed code confirms the save with purpose confirm_saved_payment_method and channel email. The code goes only to the email given with the payment. Subscription signup and setup still require email verification before collection when the email belongs to an existing customer. A checkout the buyer bound by a texted code saves the card with that number. A checkout whose buyer confirmed the customer's email can also send save_payment_method_phone, to save the card with a number the buyer confirms by text after paying. A checkout can send the buyer's choice with every payment button: Apple Pay, Google Pay, a bank account, or Affirm, in payment_source.stripe.confirmation_token created with no setup_future_usage, pays without the save, and the payment attempt's payment_method_save reports not_saved with reason payment_method_not_saveable. The session's save_payment_method_types lists what is saved. Send false or omit it when the buyer does not choose to save; payment_source.stripe.confirmation_token must then have no setup_future_usage, except for a subscription signup.
save_payment_method_consent_textstringThe wording the buyer agreed to when saving this card. Send only when save_payment_method is true, using an API key or partner token with payments.payment_methods.write, or a Dashboard session. Flint trims surrounding whitespace and stores the remaining text exactly. The trimmed wording must contain 1 to 1,000 characters and cannot contain a null character. Checkout supplies its own wording and cannot send this field.
Not accepted with a checkout credential
save_payment_method_phonestringA US or Canadian mobile phone number in E.164 format, such as +14155552671, that confirms a card saved while the checkout acts for no customer, or for the customer whose email the buyer confirmed in it. Send it with save_payment_method: true only from the checkout session's own credential, when the session's can_save_payment_method_with_phone is true. The card is kept for the customer the checkout acts for, or else the merchant's customer with the buyer's email, once the payment succeeds, or once it is approved when the merchant captures later, but works for nothing until the buyer confirms it within 24 hours, with a code texted to this number or, when the customer's email is the email of the payment, emailed there instead: request the code with POST /v1/checkout-sessions/{checkout_session_id}/customer-verifications and purpose confirm_saved_payment_method, and read payment_method_save on the checkout session. A card saved with the number makes it the customer's saved number, and the cards saved with the number it replaces are removed. A card not confirmed in time is not saved.
The `setup` variant of `PayOrderRequest`.
actionenumRequiredSave a payment method on an order with no balance, without charging it. Send setup_payment_source to start; omit it to continue the same setup attempt after the buyer finishes its pending action.
setup
buyer_contactobjectBuyer email and phone recorded on the order. A checkout session payment uses the session's saved contact for omitted fields. Email and phone cannot be null.
client_action_typeenumHow to complete the authentication step. Flint's API returns a Stripe client secret only for client_action_type stripe. A url action opens in a redirect, popup, or iframe; Stripe's authentication page receives what it needs to run the challenge, including the client secret for hosted 3DS2. If a payment is confirmed with a payment method Flint didn't approve, Flint doesn't count the charge, returns it to the buyer, and the payment intent ends canceled with cancellation_reason payment_returned. The Stripe secret can also confirm the payment with another card, so use it only with handleNextAction. Reader credentials do not support url; omit client_action_type or send stripe for reader payments. Defaults to url for a new confirmation; omission on a continuation keeps the existing type.
urlstripe
expected_outstanding_moneyobjectThe outstanding balance you reviewed. Required with checkout credentials, and with an API key or partner token when the order has an open checkout session. Optional otherwise. The amount and every computed order amount must not exceed 99999999 minor units ($999,999.99 USD). Flint rejects an input or calculation above this ceiling with INVALID_REQUEST and detail INVALID_VALUE at the responsible input field. Lower payment option limits can apply.
expected_versionintegerOptional version from the order you reviewed. A mismatch returns VERSION_CONFLICT, even when the outstanding amount is unchanged. Starting a payment advances the order's version. After a declined or failed attempt, use the order returned in the pay response or read the order again before retrying. When accepted_gift_card_allocation is sent, its order_version must match this value.
payment_return_urlstringWhere Flint sends the buyer after a redirect or authentication step, adding only payment_intent_id for a payment, or payment_method_id for a setup. The completion message uses type flint.payment_action.completed and exactly that one subject key. Without it, the step ends on a Flint page that tells the parent or opener the step completed. Accepts an absolute HTTPS URL or an app return URL with a custom scheme other than http, javascript, data, file, blob, or about. Cannot contain credentials, a query, 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. With a checkout credential on order pay, omit payment_return_url; checkout sessions use their own configured return URL.
setup_payment_sourceobjectThe credential for the payment method to save. Nothing is charged. Required to start a setup. Omit it only to continue a setup attempt in requires_action with a pending setup step; continuation reuses that attempt. If no setup exists, omission returns 400 INVALID_REQUEST with detail REQUIRED and param setup_payment_source. A terminal or replaced setup returns 409 ACTION_NOT_ALLOWED naming the attempt and its status.
The `resume` variant of `PayOrderRequest`.
actionenumRequiredContinue a payment attempt after the buyer finishes its pending actions.
resume
buyer_contactobjectBuyer email and phone recorded on the order. A checkout session payment uses the session's saved contact for omitted fields. Email and phone cannot be null.
client_action_typeenumHow to complete the authentication step. Flint's API returns a Stripe client secret only for client_action_type stripe. A url action opens in a redirect, popup, or iframe; Stripe's authentication page receives what it needs to run the challenge, including the client secret for hosted 3DS2. If a payment is confirmed with a payment method Flint didn't approve, Flint doesn't count the charge, returns it to the buyer, and the payment intent ends canceled with cancellation_reason payment_returned. The Stripe secret can also confirm the payment with another card, so use it only with handleNextAction. Reader credentials do not support url; omit client_action_type or send stripe for reader payments. Defaults to url for a new confirmation; omission on a continuation keeps the existing type.
urlstripe
expected_outstanding_moneyobjectOptional. When sent, Flint compares it with the amount fixed on the attempt, not the order's current balance.
order_payment_attempt_idstringRequiredID of the payment attempt to resume, prefixed `opat_`. Resume it only when its `is_resumable` is true.
payment_return_urlstringWhere Flint sends the buyer after a redirect or authentication step, adding only payment_intent_id for a payment, or payment_method_id for a setup. The completion message uses type flint.payment_action.completed and exactly that one subject key. Without it, the step ends on a Flint page that tells the parent or opener the step completed. Accepts an absolute HTTPS URL or an app return URL with a custom scheme other than http, javascript, data, file, blob, or about. Cannot contain credentials, a query, 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. With a checkout credential on order pay, omit payment_return_url; checkout sessions use their own configured return URL.
Response · 200
The updated order and any pending payment actions.
dataobjectRequiredResource, collection, or operation result returned by this request.
metaobjectAdditional information about this response.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl -X POST https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/pay \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{
"action": "confirm_payment_intents",
"buyer_contact": {
"email": "buyer@example.com"
},
"expected_outstanding_money": {
"amount": 2500,
"currency": "USD"
},
"payment_intents": [
{
"payment_intent_id": "pi_01KEZF7C0050JFFB0HNCWWV1G3",
"payment_source": {
"credential_type": "stripe_confirmation_token",
"stripe": {
"confirmation_token": "ctoken_123"
}
}
}
]
}'List order payment attempts#
/v1/orders/{order_id}/payment-attemptsRequires scope commerce.orders.read or commerce.orders.write
Rate limit: read
Returns payment attempts for the order, newest first. API keys can use the commerce.orders.read scope. Dashboard Viewers can list attempts for orders they can access. Checkout-session callers see only attempts created by their own session. A list filtered by idempotency_key omits pending_actions; read the attempt by ID to get them. Default order: started_at descending, then order_payment_attempt_id descending.
Path parameters
order_idstringRequiredFlint order ID. Must be a valid ID with prefix ord_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
Query parameters
idempotency_keystringFilter by the original Idempotency-Key, after trimming surrounding whitespace. Matching is exact and case-sensitive. Returns only resources created in your caller namespace, plus resources created before caller scoping under the original key. Returns current authorized resources, not the recorded response. A pending resource does not prove that the operation succeeded, and an empty list does not prove that it had no effect. A match can show `idempotency_key: null` when that request sent no key, Flint created the resource, the reader isn't the caller that created it (another app install, a buyer, or the merchant reading an app's or buyer's record), or the caller that created an older record is unknown.
page_sizeintegerMaximum number of results to return, from 1 to 100. Defaults to 20.
page_tokenstringOpaque, 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
A page of payment attempts.
dataarray of objectRequiredResource, collection, or operation result returned by this request.
metaobjectAdditional information about this response.
next_page_tokenstringOpaque token to send as `page_token` to retrieve the next page. Omitted when there is no next page.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/payment-attempts \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY"A page of payment attempts.
{
"data": [
{
"expected_outstanding_money": {
"amount": 2500,
"currency": "USD"
},
"gift_card_redemptions": [],
"idempotency_key": null,
"is_resumable": true,
"mode": "payment",
"order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
"order_payment_attempt_id": "opat_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"payment_intents": [
{
"amount_money": {
"amount": 2500,
"currency": "USD"
},
"payment_intent_id": "pi_01KEZF7C0050JFFB0HNCWWV1G3",
"status": "requires_action",
"tip_money": {
"amount": 0,
"currency": "USD"
}
}
],
"pending_actions": [
{
"action_type": "payment_authentication",
"client_action": {
"type": "url",
"url": "https://payment-returns.example/payment-returns/actions/pendact_01ARZ3NDEKTSV4RRFFQ69G5FAV/fixture-token"
},
"expires_at": "2026-11-11T12:30:00Z",
"pending_action_id": "pendact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"subject": {
"payment_intent": {
"payment_intent_id": "pi_01KEZF7C0050JFFB0HNCWWV1G3"
}
}
}
],
"status": "requires_action",
"supported_actions": []
}
],
"meta": {
"api_version": "2026-09-07"
},
"next_page_token": "example",
"request_id": "req_01KWM69G6J23J8QZ64745XTS8J"
}Get order payment attempt#
/v1/orders/{order_id}/payment-attempts/{order_payment_attempt_id}Requires scope commerce.orders.read or commerce.orders.write
Rate limit: read
Returns one durable payment attempt for the order. Checkout-session callers can read only attempts created by their own session.
Path parameters
order_idstringRequiredFlint order ID. Must be a valid ID with prefix ord_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
order_payment_attempt_idstringRequiredFlint order payment attempt ID. Must be a valid ID with prefix opat_. 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 requested payment attempt.
dataobjectRequiredResource, collection, or operation result returned by this request.
metaobjectAdditional information about this response.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/payment-attempts/opat_01KEZF7C00B5PW9F2R8A4YSH5D \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY"The requested payment attempt.
{
"data": {
"expected_outstanding_money": {
"amount": 2500,
"currency": "USD"
},
"gift_card_redemptions": [],
"idempotency_key": null,
"is_resumable": true,
"mode": "payment",
"order_id": "ord_01KEZF7C00JBKMARG3P06Z224B",
"order_payment_attempt_id": "opat_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"payment_intents": [
{
"amount_money": {
"amount": 2500,
"currency": "USD"
},
"payment_intent_id": "pi_01KEZF7C0050JFFB0HNCWWV1G3",
"status": "requires_action",
"tip_money": {
"amount": 0,
"currency": "USD"
}
}
],
"pending_actions": [
{
"action_type": "payment_authentication",
"client_action": {
"type": "url",
"url": "https://payment-returns.example/payment-returns/actions/pendact_01ARZ3NDEKTSV4RRFFQ69G5FAV/fixture-token"
},
"expires_at": "2026-11-11T12:30:00Z",
"pending_action_id": "pendact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
"subject": {
"payment_intent": {
"payment_intent_id": "pi_01KEZF7C0050JFFB0HNCWWV1G3"
}
}
}
],
"status": "requires_action",
"supported_actions": []
},
"meta": {
"api_version": "2026-09-07"
},
"request_id": "req_01KWM64K6QWKKR0SHE7TV7VAM6"
}Cancel order payment attempt#
/v1/orders/{order_id}/payment-attempts/{order_payment_attempt_id}/cancelIdempotentRequires scope commerce.orders.write
Rate limit: payment
Cancels an active order payment attempt, its unsettled payment legs, and its attempt-owned holds.
Path parameters
order_idstringRequiredFlint order ID. Must be a valid ID with prefix ord_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
order_payment_attempt_idstringRequiredFlint order payment attempt ID. Must be a valid ID with prefix opat_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
Request body
cancellation_reasonenumOptional merchant-supplied cancellation reason.
requested_by_customerduplicatefraudulentabandoned
Response · 200
The updated order and canceled payment attempt.
dataobjectRequiredResource, collection, or operation result returned by this request.
metaobjectAdditional information about this response.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl -X POST https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/payment-attempts/opat_01KEZF7C00B5PW9F2R8A4YSH5D/cancel \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{
"cancellation_reason": "abandoned"
}'Download order receipt PDF#
/v1/orders/{order_id}/receipt-pdfRequires scope commerce.orders.read or commerce.orders.write
Rate limit: read
Downloads a numbered receipt for an order with collected money, covering successful payment intents and gift card redemptions, including payments and refunds. Orders paid only by manual cash, check, or wire invoice payments return 409 ACTION_NOT_ALLOWED with reason unsupported_state; download the invoice PDF instead. Mixed orders list only successful payment intents and gift card redemptions. Available under either order_receipts email delivery mode. Buyer and seller identity is frozen on the first snapshot write; payments, refunds, and branding are current.
Path parameters
order_idstringRequiredFlint order ID. Must be a valid ID with prefix ord_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
Response · 200
A PDF receipt.
Content type application/pdf
curl https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/receipt-pdf \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY"A PDF receipt.
Returns application/pdf.
Resolve order inventory exception#
/v1/orders/{order_id}/resolve-inventory-exceptionIdempotentRequires scope commerce.orders.write
Rate limit: write
Marks a paid inventory failure as resolved after an operator has completed manual inventory remediation.
Path parameters
order_idstringRequiredFlint order ID. Must be a valid ID with prefix ord_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
Request body
reason_messagestringYour note explaining this action. Leading and trailing whitespace is removed; the remaining note can contain at most 500 characters.
curl -X POST https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/resolve-inventory-exception \
-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": "Manual inventory sourced and deducted."
}'Send an order receipt#
/v1/orders/{order_id}/send-receiptIdempotentRequires scope commerce.orders.write
Rate limit: external_provider_action
Queues a receipt for a paid order, including gift card payments and settled payments, and returns the order unchanged. Send email to choose a recipient, or omit it to use the order's email. If no receipt email is on file, email is required when your credential can set it. Otherwise, the request returns ACTION_NOT_ALLOWED with reason configuration_required. Requires Flint-managed receipt delivery. Sending is limited to once every five minutes per order and normalized recipient. Checkout credentials can send only to the address on file. If no address is on file, checkout credentials can send to at most three distinct addresses over the order's lifetime. Receipt requests for this order through this route count toward this limit, including failed deliveries and requests made with a secret API key. Merchant callers can choose any address.
Path parameters
order_idstringRequiredFlint order ID. Must be a valid ID with prefix ord_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
Request body
emailstringReceipt email, limited to 254 characters (Unicode code points) after trimming surrounding whitespace. The local part before @ must be at most 64 octets (UTF-8 bytes).
curl -X POST https://api.withflintpay.com/v1/orders/ord_01KEZF7C0054GQKJ142A8X367A/send-receipt \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{
"email": "alex@example.com"
}'Was this helpful?