Delivery quotes

Delivery quotes are persisted, time-bounded evaluations of the delivery methods assigned to a checkout. Each required choice group contains the options that can satisfy its line items.

Create a new quote whenever the cart, destination, pickup location, current selection, or required callback input changes. Send the current expected_delivery_selection_id, including null when no selection exists, so a stale browser cannot replace a newer choice.

You can quote before the buyer gives an address. A method that needs one reports it in input_requirements with purpose quote, and the quote also lists, with purpose selection, the recipient fields that method requires, such as recipient.phone for a courier. Until an address prices the method, those requirements name its choice group but no delivery_option_ids. The same applies while the buyer must correct an address Flint could not use. Ask for these fields with the address: an Apple Pay or Google Pay sheet can request a phone only when it opens.

Buyer-authenticated responses expose only buyer-actionable buyer_reasons. Merchant-authenticated responses include method-level diagnostics and dependency evidence for configuration debugging.

In merchant-authenticated responses, each option lists execution_legs: the Locations its items leave from. Under method_origin routing each option leaves from its own method's origin, so shipping can leave from a warehouse while pickup leaves from the chosen store. A choice group lists execution_legs only when all of its methods leave from the same Locations.

A quote lasts 24 hours when every method uses fixed, tiered, or rate_table pricing, and at most 15 minutes when any method uses calculated, callback, or caller_supplied pricing. A cart with tracked inventory shortens the quote to the 5 minutes its stock check stays valid. Read expires_at from every quote.

Routes#

  • POST/v1/checkout-sessions/{checkout_session_id}/delivery-quotesRequired API key scope: commerce.delivery.writeReference for POST /v1/checkout-sessions/{checkout_session_id}/delivery-quotes

    Creates a selectable or pending quote for one checkout. Call it after cart, destination, pickup, selection, or pricing input changes.

  • GET/v1/checkout-sessions/{checkout_session_id}/delivery-quotes/{delivery_quote_id}Required API key scopes: commerce.delivery.read or commerce.delivery.writeReference for GET /v1/checkout-sessions/{checkout_session_id}/delivery-quotes/{delivery_quote_id}

    Reads a checkout quote and reconciles it against the current selection. Call it before presenting a previously issued quote again.

  • GET/v1/delivery-quotesRequired API key scopes: commerce.delivery.read or commerce.delivery.writeReference for GET /v1/delivery-quotes

    Lists issued quotes with merchant diagnostics. Call it when investigating recent delivery decisions. Example: GET /v1/delivery-quotes?page_size=20.

For example, create a quote after the buyer enters a destination:

cURL
curl -X POST https://api.withflintpay.com/v1/checkout-sessions/cs_123/delivery-quotes \
  -H "X-Checkout-Session-ID: cs_123" \
  -H "X-Checkout-Session-Secret: CHECKOUT_SECRET" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: quote-cart-42" \
  -d '{
    "expected_delivery_selection_id": null,
    "destination_address": {
      "postal_code": "11249",
      "country": "US"
    }
  }'

Find pickup locations before quoting a chosen store with delivery previews using mode: "pickup_locations" and checkout_session_id.

Create delivery quote#

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

Requires scope commerce.delivery.write

Creates an exact checkout-bound delivery quote without holding inventory.

Path parameters

checkout_session_idstringRequired

Flint checkout session ID.

Request body

basis_delivery_quote_idstring
buyer_locationone of
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.

inventory_assignmentsarray of object
method_resultsarray of object
pickup_location_idstring
tier_keyinteger

Caller-defined nonnegative lookup key used by methods whose tiered pricing basis is caller.tier_key. Merchant authentication is required.

Response · 201

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

Get checkout delivery quote#

GET/v1/checkout-sessions/{checkout_session_id}/delivery-quotes/{delivery_quote_id}

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

Returns a delivery quote for this checkout session. Checkout credentials receive the buyer view.

Path parameters

checkout_session_idstringRequired

Flint checkout session ID.

delivery_quote_idstringRequired

Flint delivery quote ID.

Response · 200

Same response as Create delivery quote.

curl https://api.withflintpay.com/v1/checkout-sessions/cs_123/delivery-quotes/dqt_01K1P6G4M7H2N8Q9R3S5T6V7WX \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"
JSON
{
  "data": {
    "audience": "merchant",
    "checkout_session_id": "cs_01K1P6G4M7H2N8Q9R3S5T6V7WX",
    "choice_groups": [
      {
        "availability_status": "ready",
        "delivery_choice_group_id": "dcgrp_01K1P6G4M7H2N8Q9R3S5T6V7WX",
        "evaluation_status": "complete",
        "input_requirements": [
          {
            "constraint": {
              "type": "string"
            },
            "delivery_input_requirement_id": "example",
            "field_path": "destination_address",
            "purpose": "quote"
          }
        ],
        "line_items": [
          {
            "order_line_item_id": "example",
            "quantity": 1
          }
        ],
        "method_types": [
          "shipment"
        ],
        "options": [
          {
            "amount_money": {
              "amount": 0,
              "currency": "USD"
            },
            "buyer_instructions": {
              "enabled": true,
              "required": true
            },
            "delivery_method_id": "dmet_01K1P6G4M7H2N8Q9R3S5T6V7WX",
            "delivery_plan": {
              "type": "single_delivery"
            },
            "display_position": 1,
            "name": "Standard delivery",
            "recommended": true,
            "taxable": true,
            "type": "shipment",
            "window_selection": "none"
          }
        ],
        "stable_key": "example"
      }
    ],
    "delivery_quote_id": "dqt_01K1P6G4M7H2N8Q9R3S5T6V7WX",
    "delivery_quote_revision": 0,
    "eligibility_context_revision": 0,
    "evaluated_at": "2026-08-02T16:00:00Z",
    "evaluation_status": "complete",
    "expires_at": "2026-08-02T16:00:00Z",
    "input_requirements": [
      {
        "constraint": {
          "type": "string"
        },
        "delivery_input_requirement_id": "example",
        "field_path": "destination_address",
        "purpose": "quote"
      }
    ],
    "merchant_diagnostics": [
      {
        "code": "eligibility_no_match",
        "diagnostic_id": "example",
        "occurred_at": "2026-08-02T16:00:00Z",
        "outcome": "unavailable",
        "recommended_action": "review_configuration",
        "retryable": true,
        "scope": "method",
        "summary": "example"
      }
    ],
    "order_id": "ord_01K1P6G4M7H2N8Q9R3S5T6V7WX",
    "selection_required": true,
    "status": "active"
  },
  "request_id": "req_01K1P6G4M7H2N8Q9R3S5T6V7WX"
}

List delivery quotes#

GET/v1/delivery-quotes

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

Returns persisted delivery quote diagnostics in stable creation order.

Query parameters

checkout_session_idstring

Filter by checkout session.

order_idstring

Filter by order.

statusenum

Filter by lifecycle status.

  • active
  • consumed
  • stale
  • expired
  • revoked
evaluation_statusenum

Filter by evaluation status.

  • complete
  • incomplete
  • degraded
created_afterstring

Inclusive RFC 3339 creation lower bound.

created_beforestring

Inclusive RFC 3339 creation upper bound.

page_sizeinteger

Number of quotes to return.

page_tokenstring

Opaque cursor from the previous page.

Response · 200

dataarray of objectRequired
metaobject
next_page_tokenstring
request_idstring
curl https://api.withflintpay.com/v1/delivery-quotes \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"
JSON
{
  "data": [
    {
      "audience": "merchant",
      "checkout_session_id": "cs_01K1P6G4M7H2N8Q9R3S5T6V7WX",
      "choice_groups": [
        {
          "availability_status": "ready",
          "delivery_choice_group_id": "dcgrp_01K1P6G4M7H2N8Q9R3S5T6V7WX",
          "evaluation_status": "complete",
          "input_requirements": [
            {
              "constraint": {
                "type": "string"
              },
              "delivery_input_requirement_id": "example",
              "field_path": "destination_address",
              "purpose": "quote"
            }
          ],
          "line_items": [
            {
              "order_line_item_id": "example",
              "quantity": 1
            }
          ],
          "method_types": [
            "shipment"
          ],
          "options": [
            {
              "amount_money": {
                "amount": 0,
                "currency": "USD"
              },
              "buyer_instructions": {
                "enabled": true,
                "required": true
              },
              "delivery_method_id": "dmet_01K1P6G4M7H2N8Q9R3S5T6V7WX",
              "delivery_plan": {
                "type": "single_delivery"
              },
              "display_position": 1,
              "name": "Standard delivery",
              "recommended": true,
              "taxable": true,
              "type": "shipment",
              "window_selection": "none"
            }
          ],
          "stable_key": "example"
        }
      ],
      "delivery_quote_id": "dqt_01K1P6G4M7H2N8Q9R3S5T6V7WX",
      "delivery_quote_revision": 0,
      "eligibility_context_revision": 0,
      "evaluated_at": "2026-08-02T16:00:00Z",
      "evaluation_status": "complete",
      "expires_at": "2026-08-02T16:00:00Z",
      "input_requirements": [
        {
          "constraint": {
            "type": "string"
          },
          "delivery_input_requirement_id": "example",
          "field_path": "destination_address",
          "purpose": "quote"
        }
      ],
      "merchant_diagnostics": [
        {
          "code": "eligibility_no_match",
          "diagnostic_id": "example",
          "occurred_at": "2026-08-02T16:00:00Z",
          "outcome": "unavailable",
          "recommended_action": "review_configuration",
          "retryable": true,
          "scope": "method",
          "summary": "example"
        }
      ],
      "order_id": "ord_01K1P6G4M7H2N8Q9R3S5T6V7WX",
      "selection_required": true,
      "status": "active"
    }
  ],
  "next_page_token": "page_2",
  "request_id": "req_01K1P6G4M7H2N8Q9R3S5T6V7WX"
}

Was this helpful?