Delivery selections

A delivery selection records one chosen option for every required choice group in a quote. The selected price, tax treatment, window, origin, and execution legs are immutable evidence used when Flint commits checkout to the order.

Create a selection with the quote ID and each chosen option ID. Include a window ID only when the option offers windows. Replacing or clearing a selection requires the current selection ID, which prevents an older browser tab from overwriting a newer buyer choice.

The buyer can pay with a selection until its expires_at, and limiting_deadline_reason names the deadline that set it. Every selection ends by the checkout's calculation_expires_at and lasts at most 24 hours. Before that:

  • A fixed, tiered, or rate_table price holds for as long as the calculation does. When the cart has tracked inventory, it holds only until the quote's 5-minute stock check ends.
  • A calculated price holds until the option's expires_at. A callback or caller_supplied price holds until the selection_guarantee_expires_at your server returned.
  • A method's selection_guarantee_seconds extends a shorter hold to that many seconds after the quote was evaluated.
  • A chosen window ends the selection at that window's expires_at, which for a schedule_window method is the preparation lead time before the window starts.

A selection holds the cart's tracked inventory at the Locations its chosen options leave from, until it expires. To keep holding the stock after that, quote and select again.

A selection stays current while the order keeps what its delivery was priced from: the line items and their quantities, their prices and discounts, and the order's customer. A tip or a tax location set with the checkout credential, the buyer's contact, and a declined payment leave those unchanged, so the selection keeps its ID, option, price, window, and expires_at, and its quote stays active. When a tip or a tax location changes the order's tax, the tax on the delivery charge changes with it: each choice's tax_money and total_money and the selection's amount_money follow the order. With the checkout credential, applying or removing a promotion code or changing a line item's modifiers releases the selection the next time the order or checkout is read, and the order drops the delivery charge. Quote and select again before payment. A financial change to the order made with an API key, such as a new quantity, invalidates the checkout session instead, which ends its selection.

Recipient details#

Each option lists the recipient fields it asks for in recipient_requirements, such as a phone for local delivery. Send them in recipient. 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 is still missing, with the same delivery_input_requirement_id the quote gave that option. It is empty when nothing is missing.

Paying the order with POST /v1/orders/{order_id}/pay fails with DELIVERY_RECIPIENT_REQUIRED while a required field is missing, before any payment is attempted. The error's remediation.missing_or_invalid_fields names every missing field, such as delivery_selection.recipient.phone. To add them, create a selection on the same quote with the same choices and the full recipient, and send the current selection's ID as expected_delivery_selection_id. On the same quote the price does not change. A value you do send is still checked when you select: a malformed email or phone returns DELIVERY_REQUEST_INVALID.

After the buyer confirms a code in the checkout, only the checkout credential that confirmation returned reads the selection's recipient, destination_address, buyer_location, and instructions. Every other checkout credential for the session gets the selection without them, because they may come from the customer's saved addresses. An API key always gets them. 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.

The checkout route returns the effective selection while it is provisional and after it is committed. The order route exposes the committed selection for merchant reconciliation.

Routes#

For example, select a local delivery option and one of its offered_windows from a current quote, before the buyer's phone is known:

JSON
{
  "delivery_quote_id": "dqt_123",
  "expected_delivery_selection_id": null,
  "choices": [
    {
      "delivery_choice_group_id": "dcgrp_123",
      "delivery_option_id": "dopt_123",
      "input": { "delivery_window_id": "fwin_123" }
    }
  ],
  "recipient": { "name": "Alex Kim" }
}

input accepts delivery_window_id and instructions. Send instructions only when the option's buyer_instructions.enabled is true, and always when its buyer_instructions.required is true. Omit input when the option needs neither.

The option requires a phone, so the selection reports it:

JSON
{
  "delivery_selection_id": "dsel_123",
  "status": "selected",
  "recipient": { "name": "Alex Kim" },
  "input_requirements": [
    {
      "delivery_input_requirement_id": "req_dc2e269c6bf08230ce8a13f7",
      "purpose": "selection",
      "field_path": "recipient.phone",
      "delivery_choice_group_ids": ["dcgrp_123"],
      "delivery_option_ids": ["dopt_123"],
      "constraint": { "type": "phone", "format": "e164", "minimum_length": 8, "maximum_length": 16 }
    }
  ]
}

Once the buyer approves and the wallet returns the phone, select again with "expected_delivery_selection_id": "dsel_123" and "recipient": { "name": "Alex Kim", "phone": "+12125550123" }, then pay.

Create delivery selection#

POST/v1/checkout-sessions/{checkout_session_id}/delivery-selectionsIdempotent

Requires scope commerce.delivery.write

Atomically selects one option per choice group, replaces inventory holds, and recalculates checkout economics.

Path parameters

checkout_session_idstringRequired

Flint checkout session ID.

Request body

choicesarray of objectRequired
delivery_quote_idstringRequired
destination_addressobject
expected_delivery_selection_idstring or nullRequired

Current delivery selection ID used for compare-and-swap. Send null to assert that no selection exists.

external_reference_idstring

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

external_systemstring
recipientobject

Response · 201

dataone ofRequired
metaobject
request_idstring
curl -X POST https://api.withflintpay.com/v1/checkout-sessions/cs_123/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": "example"
  }'

Get historical delivery selection#

GET/v1/checkout-sessions/{checkout_session_id}/delivery-selections/{delivery_selection_id}

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

Returns one checkout selection 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.

Path parameters

checkout_session_idstringRequired

Flint checkout session ID.

delivery_selection_idstringRequired

Flint delivery selection ID.

Response · 200

dataobjectRequired
metaobject
request_idstring
curl https://api.withflintpay.com/v1/checkout-sessions/cs_123/delivery-selections/dsel_01K1P6G4M7H2N8Q9R3S5T6V7WX \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"
JSON
{
  "data": {
    "amount_money": {
      "amount": 0,
      "currency": "USD"
    },
    "calculation_expires_at": "2026-08-02T16:00:00Z",
    "checkout_session_id": "cs_01K1P6G4M7H2N8Q9R3S5T6V7WX",
    "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",
        "stable_key": "example",
        "tax_money": {
          "amount": 0,
          "currency": "USD"
        },
        "total_money": {
          "amount": 0,
          "currency": "USD"
        },
        "type": "shipment"
      }
    ],
    "created_at": "2026-08-02T16:00:00Z",
    "delivery_quote_id": "dqt_01K1P6G4M7H2N8Q9R3S5T6V7WX",
    "delivery_quote_revision": 0,
    "delivery_selection_id": "dsel_01K1P6G4M7H2N8Q9R3S5T6V7WX",
    "eligibility_context_revision": 0,
    "expires_at": "2026-08-02T16:00:00Z",
    "input_requirements": [
      {
        "constraint": {
          "type": "string"
        },
        "delivery_input_requirement_id": "example",
        "field_path": "destination_address",
        "purpose": "quote"
      }
    ],
    "lifecycle_updated_at": "2026-08-02T16:00:00Z",
    "limiting_deadline_reason": "selection_guarantee_expiry",
    "order_id": "ord_01K1P6G4M7H2N8Q9R3S5T6V7WX",
    "status": "selected"
  },
  "request_id": "req_01K1P6G4M7H2N8Q9R3S5T6V7WX"
}

Get current delivery selection#

GET/v1/checkout-sessions/{checkout_session_id}/delivery-selections/current

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

Returns the provisional selection or the order-level committed selection effective for this checkout.

Path parameters

checkout_session_idstringRequired

Flint checkout session ID.

Response · 200

dataone ofRequired
metaobject
request_idstring
curl https://api.withflintpay.com/v1/checkout-sessions/cs_123/delivery-selections/current \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"
JSON
{
  "data": {
    "audience": "merchant",
    "mutable": true,
    "source": "none"
  },
  "request_id": "req_01K1P6G4M7H2N8Q9R3S5T6V7WX"
}

Delete current delivery selection#

DELETE/v1/checkout-sessions/{checkout_session_id}/delivery-selections/currentIdempotent

Requires scope commerce.delivery.write

Atomically clears a provisional selection, releases inventory, removes its charges, and recalculates order economics.

Path parameters

checkout_session_idstringRequired

Flint checkout session ID.

Query parameters

expected_delivery_selection_idstringRequired

Current delivery selection ID used as a compare-and-swap fence.

Response · 200

Same response as Create delivery selection.

curl -X DELETE https://api.withflintpay.com/v1/checkout-sessions/cs_123/delivery-selections/current \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

Get current order delivery selection#

GET/v1/orders/{order_id}/delivery-selections/current

Requires scope commerce.orders.read or commerce.orders.write

Returns the delivery selection committed to an order.

Path parameters

order_idstringRequired

Flint order ID.

Response · 200

Same response as Get historical delivery selection.

curl https://api.withflintpay.com/v1/orders/ord_123/delivery-selections/current \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"
JSON
{
  "data": {
    "amount_money": {
      "amount": 0,
      "currency": "USD"
    },
    "calculation_expires_at": "2026-08-02T16:00:00Z",
    "checkout_session_id": "cs_01K1P6G4M7H2N8Q9R3S5T6V7WX",
    "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",
        "stable_key": "example",
        "tax_money": {
          "amount": 0,
          "currency": "USD"
        },
        "total_money": {
          "amount": 0,
          "currency": "USD"
        },
        "type": "shipment"
      }
    ],
    "created_at": "2026-08-02T16:00:00Z",
    "delivery_quote_id": "dqt_01K1P6G4M7H2N8Q9R3S5T6V7WX",
    "delivery_quote_revision": 0,
    "delivery_selection_id": "dsel_01K1P6G4M7H2N8Q9R3S5T6V7WX",
    "eligibility_context_revision": 0,
    "expires_at": "2026-08-02T16:00:00Z",
    "input_requirements": [
      {
        "constraint": {
          "type": "string"
        },
        "delivery_input_requirement_id": "example",
        "field_path": "destination_address",
        "purpose": "quote"
      }
    ],
    "lifecycle_updated_at": "2026-08-02T16:00:00Z",
    "limiting_deadline_reason": "selection_guarantee_expiry",
    "order_id": "ord_01K1P6G4M7H2N8Q9R3S5T6V7WX",
    "status": "selected"
  },
  "request_id": "req_01K1P6G4M7H2N8Q9R3S5T6V7WX"
}

Was this helpful?