Skip to content

Delivery selections

A delivery selection records one chosen option for every required choice group in a quote. The chosen price, window, origin, and execution legs are stored evidence used when Flint commits checkout to the order. While the selection is provisional, its delivery tax follows the order's tax.

A selection is the step between a delivery quote and payment. The buyer picks from a quote, you create a selection with the checkout credential from the browser or with your API key from your server, and Flint adds the delivery charge to the order. Each checkout has at most one current selection. A new one replaces it, and a payment that collects money commits it to the order. Build your own checkout walks through the whole flow.

Existing shipping charges#

Hosted checkout prefills shipping from the order's delivery address and recipient. You can override either value with prefill.shipping_address or prefill.shipping_recipient_name when creating the session. The buyer can edit the address; checkout quotes shipping and tax for that address before payment.

When you open checkout for an unpaid order with delivery already set, selecting a delivery option replaces the order's provisional delivery selection and its charge. It also replaces merchant-supplied shipping and delivery fees that are not assigned to a fulfillment. The new selection adds one charge for each priced delivery choice group for the current delivery; free options add no current-delivery charge. Prepaid subscriptions can also have a separate charge for later deliveries in the period. Other charge types stay on the order.

A shipping or delivery fee already assigned to a fulfillment prevents checkout from replacing delivery. Render the returned order total after every selection. Payment collects that total, and the receipt uses the same charges.

Select an option#

Create the selection with POST /v1/delivery-selections. Send the quote's delivery_quote_id and one entry in choices for every choice group in it, using the group and option IDs from that quote. IDs are new in every quote, so never reuse them from an earlier one. The selection acts on the quote's checkout session. The checkout credential can select only from its own session's quotes: any other delivery_quote_id returns 404 RESOURCE_NOT_FOUND, the same as one that doesn't exist.

FieldSend it when
choices[].input.delivery_window_idThe option's window_selection is offered. Use a delivery_window_id from its offered_windows. Omit it for any other option.
choices[].input.instructionsThe option's buyer_instructions.enabled is true, and always when buyer_instructions.required is true. Up to 2,000 characters, without leading or trailing whitespace.
recipientThe option lists fields in recipient_requirements. You can send them later; see recipient details.
destination_addressThe quote was priced from a partial address and the option is a shipment or local delivery. Send the complete address before payment; see destination address.
expected_delivery_selection_idAlways, to keep an older tab from replacing a newer choice; see protect the buyer's latest choice.

Send an Idempotency-Key. If you lose the response, send the same key and body to recover a committed selection. Selections don't take your own IDs: put them in the checkout session's or order's external_reference_id and metadata. Each choice's merchant_reference carries the reference your rate service returned for that option.

This request selects a local delivery option and one of its windows before the buyer's phone number is known. null asserts that the checkout has no selection yet:

cURL
curl -X POST https://api.withflintpay.com/v1/delivery-selections \
  -H "Authorization: Bearer ckat_1kmn0aExample" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: select-cart-42-local-1" \
  -d '{
    "delivery_quote_id": "dqt_1kmn0aExample",
    "expected_delivery_selection_id": null,
    "choices": [
      {
        "delivery_choice_group_id": "dcgrp_1kmn0aExample",
        "delivery_option_id": "dopt_1kmn0aExample",
        "input": { "delivery_window_id": "fwin_1kmn0aExample" }
      }
    ],
    "recipient": { "name": "Alex Kim" }
  }'

The response carries the selection, the checkout session, and the order repriced with the delivery charge. Render totals from the returned order. The option requires a phone number, so input_requirements lists it:

JSON
{
  "data": {
    "delivery_selection": {
      "delivery_selection_id": "dsel_1kmn0aExample",
      "delivery_quote_id": "dqt_1kmn0aExample",
      "status": "selected",
      "amount_money": { "amount": 800, "currency": "USD" },
      "choices": [
        {
          "order_id": "ord_1kmn0aExample",
          "delivery_choice_group_id": "dcgrp_1kmn0aExample",
          "stable_key": "grp_1kmn0aExample",
          "delivery_option_id": "dopt_1kmn0aExample",
          "delivery_method_id": "dmet_1kmn0aExample",
          "type": "local_delivery",
          "name": "Local courier",
          "amount_money": { "amount": 800, "currency": "USD" },
          "total_money": { "amount": 800, "currency": "USD" },
          "delivery_plan": { "type": "single_delivery" },
          "delivery_window_id": "fwin_1kmn0aExample",
          "window_start_at": "2026-08-03T22:00:00Z",
          "window_end_at": "2026-08-03T23:00:00Z",
          "timezone": "America/New_York",
          "input": { "delivery_window_id": "fwin_1kmn0aExample" }
        }
      ],
      "recipient": { "name": "Alex Kim" },
      "input_requirements": [
        {
          "delivery_input_requirement_id": "req_dc2e269c6bf08230ce8a13f7",
          "purpose": "selection",
          "field_path": "recipient.phone",
          "delivery_choice_group_ids": ["dcgrp_1kmn0aExample"],
          "delivery_method_ids": ["dmet_1kmn0aExample"],
          "delivery_option_ids": ["dopt_1kmn0aExample"],
          "constraint": { "type": "phone", "format": "e164", "minimum_length": 8, "maximum_length": 16 }
        }
      ],
      "expires_at": "2026-08-03T20:30:00Z",
      "supported_actions": ["release"]
    },
    "checkout_session": {
      "checkout_session_id": "cs_1kmn0aExample",
      "status": "open",
      "surface": "headless"
    },
    "order": {
      "order_id": "ord_1kmn0aExample",
      "version": 1790760300,
      "pricing_amounts": {
        "subtotal_money": { "amount": 4200, "currency": "USD" },
        "discount_money": { "amount": 0, "currency": "USD" },
        "charge_money": { "amount": 800, "currency": "USD" },
        "additive_tax_money": { "amount": 444, "currency": "USD" },
        "total_money": { "amount": 5444, "currency": "USD" }
      }
    }
  },
  "request_id": "req_1kmn0aExample"
}

With your API key, the response also has inventory_reservation when the cart has tracked inventory. The selection holds stock at the chosen Locations for up to two minutes. Use inventory_reservation.expires_at for the stock deadline and delivery_selection.expires_at for the delivery choice. If the stock hold expires first, payment tries to reserve the stock again and returns 409 INVENTORY_INSUFFICIENT if it has sold out.

Recipient details#

Each option lists the recipient fields it asks for in recipient_requirements, such as a phone number for local delivery. A selection can leave out a required field, because Apple Pay and Google Pay reveal the buyer's name and phone only after the buyer approves the payment sheet. The selection's input_requirements lists each required field it's still missing, with the same delivery_input_requirement_id the quote gave that option, and is empty once nothing is missing.

A value you do send is checked when you select: a malformed email or phone number returns 400 INVALID_REQUEST with detail code INVALID_VALUE on that field. The reference gives each field's format and length.

While a required field is missing, paying the order fails before any payment is attempted, with 409 ACTION_NOT_ALLOWED, reason configuration_required, and resource_type: delivery_selection. The error's next_actions includes update_checkout_session, whose required_fields names every missing field, such as delivery_selection.recipient.phone.

To supply them, select again from the same quote with the same choices and the full recipient, and assert the selection you're replacing. On the same quote the price doesn't change:

cURL
curl -X POST https://api.withflintpay.com/v1/delivery-selections \
  -H "Authorization: Bearer ckat_1kmn0aExample" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: select-cart-42-local-2" \
  -d '{
    "delivery_quote_id": "dqt_1kmn0aExample",
    "expected_delivery_selection_id": "dsel_1kmn0aExample",
    "choices": [
      {
        "delivery_choice_group_id": "dcgrp_1kmn0aExample",
        "delivery_option_id": "dopt_1kmn0aExample",
        "input": { "delivery_window_id": "fwin_1kmn0aExample" }
      }
    ],
    "recipient": { "name": "Alex Kim", "phone": "+12125550123" }
  }'

The new selection has an empty input_requirements, and the checkout can collect payment.

Destination address#

A quote can be priced from a partial address, such as the city, state, and ZIP code Apple Pay and Google Pay reveal before the buyer approves the payment sheet. A selection without destination_address keeps the quote's address, complete or not.

A shipment or local delivery is paid only with a complete address: line1, city, and country, plus state and postal_code in the US. While the selection's address lacks any of them, its input_requirements lists each missing member, such as destination_address.line1, with purpose selection and the same delivery_input_requirement_id the quote gave the option. Paying fails before any payment is attempted, with 409 ACTION_NOT_ALLOWED, reason configuration_required, and param naming the first missing member, such as delivery_selection.destination_address.line1. The error's next_actions includes update_checkout_session, whose required_fields names every missing field, as for recipient details.

To supply the address, select again from the same quote with the same choices and the complete destination_address, and assert the selection you're replacing. Flint stores the address you send, using the quote's value for each member it was priced from, and the order's delivery_destination reads it back. A destination_address sent with a selection must be complete, as the reference describes for each member. A missing member returns 400 INVALID_REQUEST with detail code REQUIRED, and an empty, over-long, or invalid member returns detail code INVALID_VALUE. param names the member, such as destination_address.state.

The address must also match every member the quote was priced from. A different value, or leaving out a member the quote had, returns 409 DELIVERY_REQUOTE_REQUIRED with reason destination_changed. Quote the new address, then select from that quote.

Protect the buyer's latest choice#

The checkout session reports its current selection as delivery.delivery_selection_id. Send that value as expected_delivery_selection_id when you quote or select, so a request from an older browser tab can't overwrite a newer buyer choice:

You sendFlint checks
NothingNothing. Flint uses whichever selection is current.
nullThat no selection is current.
A selection IDThat this selection is current.

A failed check returns 409 VERSION_CONFLICT with param: expected_delivery_selection_id, and changes nothing. details[0].current_delivery_selection_id is the current selection's ID, or null when none is current. Read the checkout again, show the buyer the current choice, and quote again if they still want to change it.

A quote also remembers the selection that was current when you created it, with or without an assertion. Selecting from that quote after a different selection became current returns 409 DELIVERY_REQUOTE_REQUIRED with reason quote_stale, unless the current selection came from the same quote.

To return the checkout to an unselected state, release the current selection with POST /v1/delivery-selections/{delivery_selection_id}/release. Flint releases its stock hold, removes its charge from the order, and returns the released selection with the checkout session and the repriced order. The path names the selection, so release needs no assertion: it's allowed while the selection's supported_actions lists release, which it does while status is selected. Releasing a selection in any other status returns 409 ACTION_NOT_ALLOWED with current_status and an empty supported_actions, or 409 OPERATION_IN_PROGRESS while a payment owns it. The checkout credential can release only its own session's selections.

Status#

Delivery selection statusFinal
  • selected moves to locked_for_payment on payment starts
  • locked_for_payment moves to committed on payment collects money
  • locked_for_payment moves to selected on payment declined
  • locked_for_payment moves to released on fails after expiry
  • selected moves to superseded on replaced
  • selected moves to expired on expires
  • selected moves to released on cleared or cart changed
status on delivery selection
Final values do not change again
  • selected
    The checkout's provisional choice. It can be replaced or released before payment and until expires_at.
  • locked_for_payment
    A payment is running with this selection. It can't be replaced or cleared until the payment finishes; clearing returns 409 OPERATION_IN_PROGRESS.
  • committedFinal
    A payment collected money with this selection, and the order's delivery comes from it. It can't be replaced or cleared.
  • supersededFinal
    A newer selection on the same checkout replaced it.
  • expiredFinal
    Its expires_at or the checkout's calculation deadline passed. Quote and select again.
  • releasedFinal
    It stopped being current without a replacement: the buyer cleared it, the cart changed, a dependency was revoked, the checkout ended, or a payment failed after it expired. Quote and select again.

Every read with your API key includes lifecycle_events, the selection's history in order. Each event's reason says what caused the change, such as replacement_selected, payment_started, or quote_basis_changed.

Paying with a selection#

A payment, with the checkout credential or with your API key, uses the session's current selection. An issued invoice uses the delivery set on the order. Flint secures stock for that delivery before submitting payment, including when the original hold has expired. If the inventory is no longer available, payment returns 409 INVENTORY_INSUFFICIENT and the amount due stays the same. A payment that collects money, the whole balance or part of it, commits the selection to the order. A declined payment returns it to selected so the buyer can try another card without choosing delivery again, unless it expired while the payment ran. Paying the order with your API key covers how that ends the session.

How long a selection lasts#

The buyer can pay with a selection until its expires_at, the earliest of three deadlines. limiting_deadline_reason names the one that set it:

Deadlinelimiting_deadline_reason
The checkout's calculation_expires_at, which never comes after the session expirescalculation_expiry
The chosen options' price guarantee, belowselection_guarantee_expiry
24 hours after the selection was createdselection_maximum_lifetime

When the calculation and the guarantee end at the same moment, the reason is calculation_expiry. The stock deadline is reported separately in inventory_reservation.expires_at.

How long an option's price is guaranteed depends on how its method is priced:

PricingThe price holds until
fixed, tiered, or rate_tableThe checkout's calculation_expires_at. When the cart has tracked inventory, until the quote's 5-minute stock check ends instead.
calculatedThe option's expires_at.
callback or caller_suppliedThe selection_guarantee_expires_at your server returned with the rate.

For a fixed, tiered, rate_table, or calculated method, the method's selection_guarantee_seconds extends a shorter price guarantee to that many seconds after the quote was evaluated. A chosen window ends the guarantee at the window's expires_at, which for a schedule_window method is the preparation lead time before the window starts.

Promotion or code expiry does not end the delivery selection's validity. Before a new payment, Flint rechecks promotion availability and removes unavailable discounts. A still-valid delivery choice and its tax location stay on the order, and the payment response asks the buyer to review the complete updated total. If delivery is no longer valid, the response gives the delivery-requote remediation.

Changes that keep or release a selection#

A delivery price depends on the cart and the customer, not on the tip or the tax location. A selection stays current while the order keeps the line items and quantities, their prices and discounts, and the customer it was priced from. Applying or removing a promotion code requotes the chosen delivery and keeps it when it is still valid:

Keeps the selectionReleases it
A promotion-code change whose delivery requote succeeds, a tip or tax location set with the checkout credential, the buyer's contact, a declined payment, and a charge, tip, or tax change made with your API keyA promotion-code change that invalidates delivery, changing a line item's modifiers, and, with your API key, a new quantity, line item, discount, or inventory_routing_source

A kept selection keeps its ID, options, price, window, and expires_at. After a code change, older quote alternatives become stale; create a new quote to choose different delivery. If delivery is invalidated, the code-change response includes delivery_requote_required in meta.warnings. When the order's tax changes, the tax on the delivery charge follows it: each choice's tax_money and total_money, and the selection's amount_money. A change that releases the selection does so in the same request, with the lifecycle reason order_mutated. The order the change returns has no delivery charge and governing_delivery_selection_id: null, the selection's stock hold is released, and the session stays open. Quote and select again before payment. Stock the selection doesn't hold, such as stock kept for the rest of a partly paid order, stays held, and a change to a tracked line's quantity, a tracked line, or inventory_routing_source returns 409 RESOURCE_IN_USE naming that reservation. Keep the selection through later changes shows how to handle each case in a checkout.

Read selections#

CallCredentialReturns
GET /v1/delivery-selections/{delivery_selection_id}Checkout credential or API keyOne current or earlier selection, such as the one the session's delivery.delivery_selection_id or the order's governing_delivery_selection_id names, or a replaced selection from a support case
GET /v1/delivery-selectionsCheckout credential or API keyA checkout session's or an order's selections, current and earlier, newest first by created_at and then delivery_selection_id. 20 per page unless you send page_size, up to 100.

Send checkout_session_id or order_id to the list; without either it returns 400 INVALID_REQUEST. status filters on each selection's current status and takes several values. With a status filter, each page examines at most 500 selections, so a page can hold fewer than page_size, or none, while next_page_token is present. Keep requesting pages until a response has no next_page_token.

A checkout credential can read its session's selections. For an issued invoice, the credential can also get the merchant-set selection named by the order's governing_delivery_selection_id. Listing selections requires the credential's own checkout_session_id. Other sessions and selections return 404 RESOURCE_NOT_FOUND. These reads keep working after payment so a receipt can show the committed delivery.

To find the selection in effect for a checkout, read the session's delivery.delivery_selection_id while it's open, or the order's governing_delivery_selection_id, which orders describes, and read that selection.

What each credential sees#

Each choice includes required order_id, including when read with a checkout credential. It identifies the order that owns any order_charge_id on the choice. A checkout credential can read only its own session's order.

A selection read with the checkout credential has the same shape as one read with your API key, without the merchant bookkeeping: top-level IDs such as checkout_session_id and order_id, the deadlines calculation_expires_at and limiting_deadline_reason, lifecycle_events, and on each choice discount_money, tax_money, order_charge_id, and merchant_reference. The reference marks each of these fields.

The buyer's delivery details have their own rules:

  • recipient and destination_address. After the buyer confirms a verification code, only the checkout credential that confirmation issued reads them, because they can come from the customer's saved addresses. Every other checkout credential for the session gets the selection without them.
  • buyer_location and the top-level instructions. Only your API key or a dashboard credential reads them.
  • A different customer. When a later code confirmation binds a different customer, Flint releases the selection and removes these details from the checkout's earlier quotes and selections for every caller.
  • Retention. Flint erases a selection's recipient, address, buyer location, and instructions once 24 hours have passed since it stopped being current or since payment committed it, and sets redacted_at. For a paid order, read the delivery address and recipient from the order's delivery_destination, which payment freezes.

Errors#

  • HTTP 409
    VERSION_CONFLICTRefresh, then retry
    expected_delivery_selection_id doesn't match the current selection. details[0].current_delivery_selection_id names the current one, or is null. Read the checkout and rebuild the request.
  • HTTP 409
    DELIVERY_REQUOTE_REQUIREDRefresh, then retry
    The quote, option, or window can't be selected anymore. details[0].reason says why, such as quote_expired, quote_stale, option_expired, window_expired, or destination_changed. Reason caller_rates_required means your server still owes rates for the quote. Reason input_required means a choice group offers no option until the quote gets more input: each detail names one such group with resource_type: delivery_choice_group, and the quote's input_requirements name the fields to send. Create a new quote, let the buyer choose again, and select with a new Idempotency-Key.
  • HTTP 409
    Another selection holds the option. details[0].current_resource names it. Read the checkout, then quote again if the buyer wants a different choice.
  • HTTP 400
    A field is missing or invalid, and param names it. details[0].code is REQUIRED for a choice group missing from choices or a missing address member, UNKNOWN_FIELD for a field selections don't take, and INVALID_VALUE for the rest: an option from another choice group, a window the option doesn't offer or a missing one, instructions the option doesn't accept or requires, or a malformed recipient field.
  • HTTP 409
    OPERATION_IN_PROGRESSRetry the same request
    A payment owns the selection, so it can't be released. details[0].current_status is locked_for_payment and supported_actions is []. Wait for the payment to finish, then read the checkout.
  • HTTP 409
    When paying, reason configuration_required: the order needs a selection, or the selection is missing address members or recipient details, as destination address and recipient details describe. When selecting, reason choice_group_unavailable: a choice group has no option for this destination and cart. Each detail names one such group with resource_type: delivery_choice_group. Change the destination or cart and quote again, or review the configuration named in the quote's merchant_diagnostics. When selecting, the checkout session is no longer open (reason terminal_status), or payment already committed the order's delivery (reason payment_collected). When releasing, reason payment_collected means the selection is committed; reason terminal_status means it is released, expired, or superseded. The refusal names the selection and includes its current_status and empty supported_actions.
Build your own checkoutQuote the buyer's address, select an option, and pay.Delivery quotesPrice the delivery methods a checkout offers, and read their options.Delivery optionsConfigure the methods, windows, and recipient requirements a buyer chooses from.

The Delivery selection object#

The delivery choice selected for a checkout or order. Poll GET /v1/delivery-selections/{delivery_selection_id} or list delivery selections to read its current status.

Returned by GET /v1/delivery-selections/{delivery_selection_id} and carried by the endpoints below.

Attributes

amount_moneyobjectRequired

Delivery charge committed by this selection.

buyer_locationone of

Buyer location snapshot used to evaluate pickup proximity. Returned with an API key or dashboard credential.

Not returned with a checkout credential

calculation_expires_atstring

Deadline after which calculated pricing evidence is no longer valid. Always present with an API key or dashboard credential.

Not returned with a checkout credential

checkout_session_idstring

Checkout session that owns the selection. Always present with an API key or dashboard credential.

Not returned with a checkout credential

choicesarray of objectRequired

One chosen option for each required choice group.

created_atstring

Time the selection was created. Always present with an API key or dashboard credential.

Not returned with a checkout credential

delivery_quote_idstringRequired

Quote from which this selection was made.

delivery_selection_idstringRequired

Stable delivery selection ID.

destination_addressobject

Destination address snapshot used for delivery evaluation. Omitted for a checkout session credential that doesn't act for the customer the buyer verified.

expires_atstringRequired

Deadline after which this provisional selection can no longer be committed.

input_requirementsarray of objectRequired

Inputs this selection still needs before payment: each destination_address member a chosen shipment or local delivery needs that the stored address lacks (line1, city, and country, plus state and postal_code in the US), and each recipient field a chosen option requires that the selection does not include. Each entry repeats the quote's requirement for that option, with the same delivery_input_requirement_id. Payment fails with ACTION_NOT_ALLOWED, reason configuration_required, and the delivery_selection reference until a new delivery selection includes them. Empty when nothing is missing, and always empty unless status is selected.

instructionsstring

Buyer-provided delivery instructions. Returned with an API key or dashboard credential.

Not returned with a checkout credential

lifecycle_eventsarray of object

Ordered lifecycle events recorded for this selection.

Not returned with a checkout credential

lifecycle_updated_atstring

Time the selection lifecycle last changed. Always present with an API key or dashboard credential.

Not returned with a checkout credential

limiting_deadline_reasonenum

The deadline that set expires_at: the earliest of the chosen options' guarantee, the calculation expiry, and the maximum selection lifetime. A tie between the calculation and the guarantee reports calculation_expiry. Always present with an API key or dashboard credential. - `selection_guarantee_expiry`: The earliest guarantee among the chosen options and delivery windows comes first. When the selection holds stock, the hold ends at this deadline too. - `calculation_expiry`: The calculation the selection was priced against expires first. It ends no later than the checkout session's expires_at, and earlier when an applied promotion ends first. - `selection_maximum_lifetime`: The selection reaches the longest a provisional selection can last, 24 hours after it was created.

Not returned with a checkout credential

  • selection_guarantee_expiry
  • calculation_expiry
  • selection_maximum_lifetime
order_idstring

Order affected by the selection. Always present with an API key or dashboard credential.

Not returned with a checkout credential

private_data_statusenum

Availability state of merchant-private selection evidence.

Not returned with a checkout credential

  • available
  • redacted
recipientobject

Recipient details captured with the selection. Omitted for a checkout session credential that doesn't act for the customer the buyer verified.

redacted_atstring

Time merchant-private selection evidence was redacted.

Not returned with a checkout credential

statusenumRequired

Current selection lifecycle status. - `selected`: These choices are provisional and can be replaced before payment. - `locked_for_payment`: A payment attempt owns these choices. They are frozen until payment finishes. - `committed`: Payment fixed these choices on the order. - `superseded`: A newer selection replaced these choices. - `expired`: The selection is no longer usable because its deadline passed. - `released`: These choices were withdrawn. Create a new selection before paying for delivery.

  • selected
  • locked_for_payment
  • committed
  • superseded
  • expired
  • released
supported_actionsarray of enumRequired

Contains release while status is selected and the selection belongs to a checkout session: POST /v1/delivery-selections/{delivery_selection_id}/release clears it from the checkout. Empty in every other status. Independent of caller permissions.

  • release
JSON
{
  "amount_money": {
    "amount": 0,
    "currency": "USD"
  },
  "choices": [
    {
      "amount_money": {
        "amount": 0,
        "currency": "USD"
      },
      "delivery_choice_group_id": "dcgrp_01K1P6G4M7H2N8Q9R3S5T6V7WX",
      "delivery_method_id": "dmet_01K1P6G4M7H2N8Q9R3S5T6V7WX",
      "delivery_option_id": "dopt_01K1P6G4M7H2N8Q9R3S5T6V7WX",
      "delivery_plan": {
        "type": "single_delivery"
      },
      "discount_money": {
        "amount": 0,
        "currency": "USD"
      },
      "name": "Standard delivery",
      "order_charge_id": null,
      "order_id": "ord_01K1P6G4M7H2N8Q9R3S5T6V7WX",
      "shipment": {
        "service_level": "Ground"
      },
      "stable_key": "example",
      "tax_money": {
        "amount": 0,
        "currency": "USD"
      },
      "total_money": {
        "amount": 0,
        "currency": "USD"
      },
      "type": "shipment"
    }
  ],
  "delivery_quote_id": "dqt_01K1P6G4M7H2N8Q9R3S5T6V7WX",
  "delivery_selection_id": "dsel_01K1P6G4M7H2N8Q9R3S5T6V7WX",
  "expires_at": "2026-08-02T16:00:00Z",
  "input_requirements": [
    {
      "constraint": {
        "type": "string"
      },
      "delivery_input_requirement_id": "req_0123456789abcdef",
      "field_path": "destination_address",
      "purpose": "quote"
    }
  ],
  "status": "selected",
  "supported_actions": [
    "release"
  ]
}

List delivery selections#

GET/v1/delivery-selections

Requires scope commerce.delivery.read or commerce.delivery.write

Rate limit: read

Returns a checkout session's or an order's delivery selections, current and earlier, newest first by created_at and delivery_selection_id, with economics, lifecycle events, and retention-aware private data. Send checkout_session_id or order_id. A checkout credential must send its own checkout_session_id. With a status filter, each page examines at most 500 selections and may hold fewer than page_size while next_page_token is present. Default order: created_at descending, then delivery_selection_id descending.

Query parameters

checkout_session_idstring

List this checkout session's selections. Send this or order_id. Required with a checkout credential, and must be the credential's own checkout session.

order_idstring

List this order's selections. Send this or checkout_session_id.

statusarray of enum

Filter by current lifecycle 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.

  • selected
  • locked_for_payment
  • committed
  • superseded
  • expired
  • released
page_sizeinteger

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

page_tokenstring

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

Response · 200

Delivery selection page.

dataarray of objectRequired

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

metaobject

Additional information about this response.

next_page_tokenstring

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

request_idstringRequired

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

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

Delivery selection page.

JSON
{
  "data": [
    {
      "amount_money": {
        "amount": 0,
        "currency": "USD"
      },
      "choices": [
        {
          "amount_money": {
            "amount": 0,
            "currency": "USD"
          },
          "delivery_choice_group_id": "dcgrp_01K1P6G4M7H2N8Q9R3S5T6V7WX",
          "delivery_method_id": "dmet_01K1P6G4M7H2N8Q9R3S5T6V7WX",
          "delivery_option_id": "dopt_01K1P6G4M7H2N8Q9R3S5T6V7WX",
          "delivery_plan": {
            "type": "single_delivery"
          },
          "discount_money": {
            "amount": 0,
            "currency": "USD"
          },
          "name": "Standard delivery",
          "order_charge_id": null,
          "order_id": "ord_01K1P6G4M7H2N8Q9R3S5T6V7WX",
          "shipment": {
            "service_level": "Ground"
          },
          "stable_key": "example",
          "tax_money": {
            "amount": 0,
            "currency": "USD"
          },
          "total_money": {
            "amount": 0,
            "currency": "USD"
          },
          "type": "shipment"
        }
      ],
      "delivery_quote_id": "dqt_01K1P6G4M7H2N8Q9R3S5T6V7WX",
      "delivery_selection_id": "dsel_01K1P6G4M7H2N8Q9R3S5T6V7WX",
      "expires_at": "2026-08-02T16:00:00Z",
      "input_requirements": [
        {
          "constraint": {
            "type": "string"
          },
          "delivery_input_requirement_id": "req_0123456789abcdef",
          "field_path": "destination_address",
          "purpose": "quote"
        }
      ],
      "status": "selected",
      "supported_actions": [
        "release"
      ]
    }
  ],
  "meta": {
    "api_version": "2026-09-07"
  },
  "next_page_token": "page_2",
  "request_id": "req_01KWM6AASYFSEP53E9W34N8J33"
}

Create delivery selection#

POST/v1/delivery-selectionsIdempotent

Requires scope commerce.delivery.write

Rate limit: delivery_selection

Selects one unexpired option per required choice group of delivery_quote_id. Replaces the checkout's provisional selection and stock hold, applies delivery charges, and returns the repriced order. Shipment and local delivery choices can keep a partial quote address when destination_address is omitted. Missing destination members and recipient fields appear in input_requirements and must be supplied by replacing the selection before payment. The selection acts on the quote's checkout session. A checkout credential can select only from quotes of its own checkout session; any other quote is refused as not found.

Request body

choicesarray of objectRequired

One chosen option for every required choice group in the quote. Use group and option IDs from this quote, not an earlier quote.

delivery_quote_idstringRequired

ID of the quote whose options to choose. The selection belongs to that quote's checkout session.

destination_addressobject

Destination address for shipment or local delivery. When sent, it must be a complete address. When omitted, Flint keeps the quote's address, even when partial; missing members appear in input_requirements and must be supplied before payment.

expected_delivery_selection_idstring or null

Optional assertion on CheckoutSession.delivery.delivery_selection_id. Omit to make no assertion, send null to assert that no selection exists, or send an ID to assert that it is current.

inventory_reservation_idsarray of string

Requires a merchant credential with delivery-write scope. Merchant-created cart reservations to adopt atomically into the selection hold at the selected inventory items and locations. Only matching held units are released; unused units stay held, and any remaining demand uses available stock. At most 100 unique IDs. Explicit IDs, including an empty array, replace the session binding for this request. When omitted, both merchant and buyer requests use eligible session-bound holds; ineligible bound holds are silently skipped. First adopter wins when sessions share a hold. Ineligible explicit IDs are refused as not found.

Not accepted with a checkout credential

recipientobject

Recipient details the chosen options ask for. Missing required fields are returned in input_requirements and must be supplied before payment.

Response · 201

Delivery selection with the checkout session and its repriced order.

dataobjectRequired

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

metaobject

Additional information about this response.

request_idstringRequired

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

curl -X POST https://api.withflintpay.com/v1/delivery-selections \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "choices": [
      {
        "delivery_choice_group_id": "dcgrp_01K1P6G4M7H2N8Q9R3S5T6V7WX",
        "delivery_option_id": "dopt_01K1P6G4M7H2N8Q9R3S5T6V7WX"
      }
    ],
    "delivery_quote_id": "dqt_01K1P6G4M7H2N8Q9R3S5T6V7WX",
    "expected_delivery_selection_id": null
  }'

Retrieve delivery selection#

GET/v1/delivery-selections/{delivery_selection_id}

Requires scope commerce.delivery.read or commerce.delivery.write

Rate limit: read

Returns one delivery selection, current or earlier, with its economics, lifecycle events, and retention-aware private data. While the selection is selected, the tax on its delivery charges follows the order's tax. A checkout credential receives the buyer view of its own session's selections. For an issued invoice, it can also retrieve the merchant-set selection named by the order's governing_delivery_selection_id. Other selections return 404.

Path parameters

delivery_selection_idstringRequired

ID of the delivery selection to retrieve, whether current or historical. Must be a valid ID with prefix dsel_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Response · 200

Delivery selection.

dataobjectRequired

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

metaobject

Additional information about this response.

request_idstringRequired

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

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

Delivery selection.

JSON
{
  "data": {
    "amount_money": {
      "amount": 0,
      "currency": "USD"
    },
    "choices": [
      {
        "amount_money": {
          "amount": 0,
          "currency": "USD"
        },
        "delivery_choice_group_id": "dcgrp_01K1P6G4M7H2N8Q9R3S5T6V7WX",
        "delivery_method_id": "dmet_01K1P6G4M7H2N8Q9R3S5T6V7WX",
        "delivery_option_id": "dopt_01K1P6G4M7H2N8Q9R3S5T6V7WX",
        "delivery_plan": {
          "type": "single_delivery"
        },
        "discount_money": {
          "amount": 0,
          "currency": "USD"
        },
        "name": "Standard delivery",
        "order_charge_id": null,
        "order_id": "ord_01K1P6G4M7H2N8Q9R3S5T6V7WX",
        "shipment": {
          "service_level": "Ground"
        },
        "stable_key": "example",
        "tax_money": {
          "amount": 0,
          "currency": "USD"
        },
        "total_money": {
          "amount": 0,
          "currency": "USD"
        },
        "type": "shipment"
      }
    ],
    "delivery_quote_id": "dqt_01K1P6G4M7H2N8Q9R3S5T6V7WX",
    "delivery_selection_id": "dsel_01K1P6G4M7H2N8Q9R3S5T6V7WX",
    "expires_at": "2026-08-02T16:00:00Z",
    "input_requirements": [
      {
        "constraint": {
          "type": "string"
        },
        "delivery_input_requirement_id": "req_0123456789abcdef",
        "field_path": "destination_address",
        "purpose": "quote"
      }
    ],
    "status": "selected",
    "supported_actions": [
      "release"
    ]
  },
  "meta": {
    "api_version": "2026-09-07"
  },
  "request_id": "req_01KWM6AASYFSEP53E9W34N8J33"
}

Release delivery selection#

POST/v1/delivery-selections/{delivery_selection_id}/releaseIdempotent

Requires scope commerce.delivery.write

Rate limit: delivery_selection

Clears the checkout's provisional selection: releases its stock hold, removes its delivery charges, and recalculates the order. Available while supported_actions lists release. A checkout credential can release only its own session's selection; any other is refused as not found.

Path parameters

delivery_selection_idstringRequired

ID of the provisional selection to withdraw. Its supported_actions must include release. Must be a valid ID with prefix dsel_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Response · 200

Released selection with the checkout session and its repriced order.

Same response as Create delivery selection.

curl -X POST https://api.withflintpay.com/v1/delivery-selections/dsel_01KEZF7C00QC35XBXVXQSCEB2D/release \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

Was this helpful?