Skip to content

Locations

A Location is a place a merchant operates from: a store, a warehouse, a stockroom. Locations are operational children of a merchant, not organization hierarchy nodes.

A Location has a name, a postal address, and a time zone, and other parts of the API refer to it by location_id. Create one for every place that holds stock, ships or delivers orders, offers pickup, or has registers assigned to it. Payments don't take a Location.

AreaHow it uses a Location
InventoryStock is kept per Location. Orders and reservations claim stock only at Locations that allow inventory allocation.
DeliveryShipping and local delivery leave from origin Locations, and pickup methods offer Locations as stores. Delivery uses the address, and counts business days in the Location's time zone.
Sales taxWhen every taxable item is picked up at one store, that store's address is the order's tax location.
FulfillmentA fulfillment's location_id names the Location responsible for it.
ReturnsReturned items are received and inspected at a Location, and restocked into its inventory.
DevicesA register or terminal can be assigned to one active Location.

Create a Location#

name, address, and timezone are required. timezone is an IANA name such as America/New_York. address.country is an uppercase ISO 3166-1 alpha-2 code such as US, and a US address also needs state and postal_code. Flint rejects values it would have to correct, such as a lowercase country code, with 400 INVALID_REQUEST and the field in param.

A coordinate is optional. Send coordinate together with coordinate_source, either merchant_supplied or geocoded. A new Location is active unless you send "status": "inactive", and it doesn't route stock to orders unless you send "inventory_allocation_enabled": true, which needs an extra scope.

cURL
curl -X POST https://api.withflintpay.com/v1/locations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: location-brooklyn-warehouse" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Brooklyn warehouse",
    "external_reference_id": "wh-bk-01",
    "address": {
      "line1": "120 Kent Avenue",
      "city": "Brooklyn",
      "state": "NY",
      "postal_code": "11249",
      "country": "US"
    },
    "timezone": "America/New_York",
    "coordinate": { "latitude": 40.7213, "longitude": -73.9615 },
    "coordinate_source": "merchant_supplied",
    "inventory_allocation_enabled": true
  }'
Response
{
  "data": {
    "location_id": "loc_01K0P7W6A4N9F3J2T8Q5R1C6XM",
    "version": 1,
    "name": "Brooklyn warehouse",
    "status": "active",
    "metadata": {},
    "external_reference_id": "wh-bk-01",
    "geography_version": 1,
    "address": {
      "line1": "120 Kent Avenue",
      "city": "Brooklyn",
      "state": "NY",
      "postal_code": "11249",
      "country": "US"
    },
    "timezone": "America/New_York",
    "coordinate": { "latitude": 40.7213, "longitude": -73.9615 },
    "coordinate_source": "merchant_supplied",
    "validation_status": "not_validated",
    "inventory_allocation_enabled": true,
    "created_at": "2026-10-28T15:04:00Z",
    "updated_at": "2026-10-28T15:04:00Z"
  },
  "request_id": "req_01KWM6N1JHF8ZAKK41C12T5VJ9"
}

external_reference_id holds your own ID for the place, such as a warehouse code from another system. Flint doesn't require it to be unique. To find Locations by it, list with external_reference_id=wh-bk-01 for an exact match. The query parameter is a looser search: it matches the start of a Location ID, or text anywhere in an external reference ID or name.

Status#

Location statusFinal
  • active moves to inactive on PATCH status: inactive
  • inactive moves to active on PATCH status: active
  • active moves to archived on DELETE
  • inactive moves to archived on DELETE
status on location
Final values do not change again
  • active
    In operation. Only an active Location can route stock to orders, appear in an allocation policy or a delivery location set, or take a device assignment.
  • inactive
    Closed for now, and reversible: PATCH status back to active to reopen it. It keeps its stock, and you can still adjust, count, transfer, and receive stock there, but orders can't claim it.
  • archivedFinal
    Retired by DELETE, and final: an archived Location can't be changed or reactivated. It stays readable by ID, so fulfillments, inventory movements, and other records keep their reference. Lists leave it out unless status names archived.

What blocks deactivating or archiving#

Flint refuses to deactivate or archive a Location that other records still depend on. The request returns 409 RESOURCE_IN_USE and changes nothing. details[0].blocking_resources lists up to 25 of the blockers by resource_type and resource_id, and details[0].blocking_resource_count gives the total.

Deactivating and archiving are both blocked by:

resource_typeBlocker, and how to clear it
deviceA device assigned to the Location. Move the device to another Location, or send "location_id": null.
inventory_allocation_policyAn active allocation policy that lists the Location. Remove the Location from the policy.
fulfillmentAn open fulfillment at the Location. Complete or cancel it.

Archiving is also blocked by:

resource_typeBlocker, and how to clear it
inventory_levelStock with any quantity other than zero, including held, committed, safety, and incoming stock. Transfer or adjust the stock out, and set safety stock to zero.
inventory_reservationAn active reservation that holds or commits stock there. Consume or release that stock.
inventory_transferA transfer to or from the Location that isn't closed. Receive, cancel, or otherwise resolve it until it closes.
inventory_countA draft count at the Location. Apply or cancel it.
merchantSettings saved for this Location alone.

Deactivating or archiving a Location also affects sales tax. An open order whose automatic tax was calculated from this Location, and that has no issued invoice, moves to tax status incomplete. Updating the order calculates its tax again.

Update a Location#

PATCH /v1/locations/{location_id} changes the name, metadata, external_reference_id, status, geography, and inventory_allocation_enabled, alone or together. Fields you leave out keep their values, and a request with none of them returns 400 INVALID_REQUEST. Archiving is the one change PATCH doesn't make: use DELETE.

Versions#

A Location carries two version numbers.

  • version advances with every accepted write. Send the version you read as expected_version to guard a write: in the body for PATCH, and as a query parameter for DELETE. expected_version is optional. When it is stale, the request returns 409 VERSION_CONFLICT with the current value in details[0].current_version, and the Location is unchanged.
  • geography_version advances only when the address, time zone, coordinate, or coordinate source changes to a new value. Sending the same geography again leaves it alone. It is read-only, and records that depend on a Location's geography pin it.

For example, a checkout session records the Location geography it evaluated delivery quotes against as location_geography_version in delivery_pinned_dependencies, and a delivery revocation can target one exact geography version.

Change the geography#

address and coordinate are each replaced whole, so send every line of the address, including line2 when there is one. A coordinate describes the address it came with, which gives these rules:

  • A request that sends address must also send coordinate: the new coordinate, or null to clear it.
  • A non-null coordinate needs coordinate_source in the same request.
  • "coordinate": null clears both the coordinate and its source. coordinate_source must then be omitted or null.
  • timezone and coordinate can each change without address.

Moving the Brooklyn warehouse to a new address, with its new coordinate:

cURL
curl -X PATCH https://api.withflintpay.com/v1/locations/loc_01K0P7W6A4N9F3J2T8Q5R1C6XM \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: location-brooklyn-move-water-st" \
  -H "Content-Type: application/json" \
  -d '{
    "expected_version": 1,
    "address": {
      "line1": "55 Water Street",
      "line2": "Unit 4",
      "city": "Brooklyn",
      "state": "NY",
      "postal_code": "11201",
      "country": "US"
    },
    "coordinate": { "latitude": 40.7033, "longitude": -73.9881 },
    "coordinate_source": "merchant_supplied"
  }'
Response
{
  "data": {
    "location_id": "loc_01K0P7W6A4N9F3J2T8Q5R1C6XM",
    "version": 2,
    "name": "Brooklyn warehouse",
    "status": "active",
    "metadata": {},
    "external_reference_id": "wh-bk-01",
    "geography_version": 2,
    "address": {
      "line1": "55 Water Street",
      "line2": "Unit 4",
      "city": "Brooklyn",
      "state": "NY",
      "postal_code": "11201",
      "country": "US"
    },
    "timezone": "America/New_York",
    "coordinate": { "latitude": 40.7033, "longitude": -73.9881 },
    "coordinate_source": "merchant_supplied",
    "validation_status": "not_validated",
    "inventory_allocation_enabled": true,
    "created_at": "2026-10-28T15:04:00Z",
    "updated_at": "2026-10-28T16:20:00Z"
  },
  "request_id": "req_01KWM6SE31GYFR1FNQTDHY4SNQ"
}

Like deactivating, a change to the geography moves open orders whose automatic tax was calculated from this Location to tax status incomplete until they're updated.

Inventory allocation#

Every Location can hold stock. Two separate rules decide what you can do with it.

Any Location that isn't archived

Record stock

Adjustments, counts, transfers, receipts, safety stock, and Return restocks. These work at an inactive Location too, whatever inventory_allocation_enabled says.

Active, with allocation enabled

Claim stock for demand

Reservations, order holds, fixed_location routing sources, allocation policies, and pickup stock. The Location must be active and have inventory_allocation_enabled: true.

A claim that names a Location that can't route returns 409 ACTION_NOT_ALLOWED. details[0].reason is unsupported_state for an inactive or archived Location, and configuration_required for an active one with allocation off. Recording stock at an archived Location also returns unsupported_state. When an order routes through an allocation policy, Flint skips any Location in the policy that can't route and tries the others.

inventory_allocation_enabled defaults to false, so a new office or pickup counter doesn't start receiving routed orders by accident. Send true on create or on a later PATCH to turn routing on, and false to turn it off. The field is always a boolean: null is rejected, and leaving it out keeps the current setting. Turning allocation off or deactivating never removes stock already on hand, and you can deactivate and turn allocation off in the same request. To find routing Locations, list with inventory_allocation_enabled=true.

The Inventory guide walks through stocking a Location and routing orders across several.

Scopes#

ScopeGrants
merchants.locations.readGet and list Locations, including inventory_allocation_enabled and its list filter.
merchants.locations.writeCreate, update, and archive Locations, and everything the read scope allows.
commerce.inventory.allocation.writeSend inventory_allocation_enabled on create or PATCH, with true or false. It works only alongside merchants.locations.write and grants no Location writes alone.

A request that sends inventory_allocation_enabled without commerce.inventory.allocation.write returns 403 INSUFFICIENT_SCOPE with param: inventory_allocation_enabled and changes nothing. So a key with only merchants.locations.write can manage a Location's name, geography, and status, but can't change whether its stock is routed to orders and pickup.

Errors#

  • HTTP 400
    param names the field, such as address.country, timezone, coordinate, or coordinate_source. Common causes are a lowercase country code, a US address without state or postal_code, a time zone that isn't an IANA name, an address without coordinate, a coordinate without its source, or a PATCH with no fields.
  • HTTP 403
    The credential lacks a Location scope, or sent inventory_allocation_enabled without commerce.inventory.allocation.write. In the second case param is inventory_allocation_enabled.
  • HTTP 404
    No Location with this location_id exists in the credential's environment.
  • HTTP 409
    VERSION_CONFLICTRefresh, then retry
    The Location changed since you read it. Read it again, reapply your change, and send the new version as expected_version with a new Idempotency-Key.
  • HTTP 409
    Deactivating or archiving is blocked. details[0].blocking_resources lists what still depends on the Location. Clear those and retry.
InventoryStock a Location, hold units at checkout, and route orders across several Locations.Delivery optionsShip from warehouses and offer pickup at stores, using each Location's address and time zone.Fulfill and ship ordersPack, ship, and hand over orders from the Location responsible for them.

The Location object#

A physical or logical place a merchant operates from. Every Location can hold stock. inventory_allocation_enabled controls whether it accepts inventory allocation.

Returned by GET /v1/locations/{location_id} and carried by the endpoints below.

Attributes

addressobject or nullRequired

Published postal address. `null` when the Location has no address on record.

coordinateobject

Latitude and longitude of the Location. Omitted when none was sent.

coordinate_sourceenum

Where `coordinate` came from. Omitted when the Location has no coordinate.

  • merchant_supplied
  • geocoded
created_atstringRequired

Time the Location was created.

external_reference_idstring

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

geography_versionintegerRequired

Read-only version that advances only on geography changes and is pinned by tax and delivery dependencies. It is not a request fence.

inventory_allocation_enabledbooleanRequired

Whether this Location accepts inventory allocation. Always present, including false when allocation is not configured.

location_idstringRequired

Stable Location ID.

metadatamap of stringRequired

Caller-owned metadata.

namestringRequired

Merchant-facing Location name.

normalized_addressobject

Provider-normalized address used for geography evaluation.

statusenumRequired

Current Location lifecycle status.

  • active
  • inactive
  • archived
timezonestringRequired

IANA timezone for local schedules.

updated_atstringRequired

Time the Location last changed.

validation_statusenumRequired

Address validation status.

  • not_validated
  • validated
  • merchant_verified
versionintegerRequired

Optimistic-concurrency version that advances on every Location change.

JSON
{
  "address": {
    "city": "Brooklyn",
    "country": "US",
    "line1": "120 Kent Avenue",
    "postal_code": "11249",
    "state": "NY"
  },
  "coordinate": {
    "latitude": 40.7213,
    "longitude": -73.9615
  },
  "coordinate_source": "merchant_supplied",
  "created_at": "2026-05-02T11:04:00Z",
  "geography_version": 2,
  "inventory_allocation_enabled": true,
  "location_id": "loc_01K0P7W6A4N9F3J2T8Q5R1C6XM",
  "metadata": {
    "region": "northeast"
  },
  "name": "Brooklyn warehouse",
  "status": "active",
  "timezone": "America/New_York",
  "updated_at": "2026-07-14T09:12:00Z",
  "validation_status": "not_validated",
  "version": 4
}

List locations#

GET/v1/locations

Requires scope merchants.locations.read or merchants.locations.write

Rate limit: read

List Locations. inventory_allocation_enabled is always included and can be filtered with the Location read scope. The false filter includes Locations without an inventory allocation configuration. Default order: location_id ascending; this key uniquely orders the results.

Query parameters

page_sizeinteger

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

page_tokenstring

Opaque next_page_token from the previous response. 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 invalid, expired, or mismatched token returns a validation error.

statusarray of enum

Filter by status. Omitted, the list leaves out archived rows; name archived to include them. 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.

  • active
  • inactive
  • archived
inventory_allocation_enabledboolean

Filter by whether the Location accepts inventory allocation. false includes Locations without an inventory allocation configuration.

external_reference_idstring

Exact-match filter on the caller-owned external reference ID.

querystring

Search Location ID, external reference ID, or name.

Response · 200

Successful response.

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/locations \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

Successful response.

JSON
{
  "data": [
    {
      "address": {
        "city": "Brooklyn",
        "country": "US",
        "line1": "120 Kent Avenue",
        "postal_code": "11249",
        "state": "NY"
      },
      "coordinate": {
        "latitude": 40.7213,
        "longitude": -73.9615
      },
      "coordinate_source": "merchant_supplied",
      "created_at": "2026-05-02T11:04:00Z",
      "geography_version": 2,
      "inventory_allocation_enabled": true,
      "location_id": "loc_01K0P7W6A4N9F3J2T8Q5R1C6XM",
      "metadata": {
        "region": "northeast"
      },
      "name": "Brooklyn warehouse",
      "status": "active",
      "timezone": "America/New_York",
      "updated_at": "2026-07-14T09:12:00Z",
      "validation_status": "not_validated",
      "version": 4
    }
  ],
  "meta": {
    "api_version": "2026-09-07"
  },
  "next_page_token": "",
  "request_id": "req_01KWM6N1JHF8ZAKK41C12T5VJ9"
}

Create location#

POST/v1/locationsIdempotent

Requires scope merchants.locations.write

Also requires commerce.inventory.allocation.write when setting inventory_allocation_enabled.

Rate limit: write

Create a Location. Sending inventory_allocation_enabled also requires commerce.inventory.allocation.write. Omitted inventory_allocation_enabled defaults to false. Every Location can hold stock. Idempotency is scoped to the authenticated merchant, environment, and endpoint. Its fingerprint includes the canonical request body.

Request body

addressobjectRequired

Postal address of the Location.

coordinateobject

Latitude and longitude of the Location. Send it with `coordinate_source`.

coordinate_sourceenum or null

Where `coordinate` came from: `merchant_supplied` if you chose or measured it, `geocoded` if you got it by geocoding the address. Required with `coordinate`, and rejected without it. `null` is the same as omitting the field.

  • merchant_supplied
  • geocoded
  • null
external_reference_idstring

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

inventory_allocation_enabledboolean

Whether this Location accepts inventory allocation. Sending this field requires commerce.inventory.allocation.write in addition to the route scope.

metadatamap of string

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

namestringRequired

Merchant-facing Location name, from 1 to 255 characters.

statusenum

Status the Location starts in. Defaults to `active`.

  • active
  • inactive
timezonestringRequired

IANA time zone for the Location's local schedules, such as `America/New_York`.

Response · 201

Successful response.

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/locations \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "address": {
      "city": "Brooklyn",
      "country": "US",
      "line1": "120 Kent Avenue",
      "postal_code": "11249",
      "state": "NY"
    },
    "inventory_allocation_enabled": true,
    "name": "Brooklyn warehouse",
    "status": "active",
    "timezone": "America/New_York"
  }'

Get location#

GET/v1/locations/{location_id}

Requires scope merchants.locations.read or merchants.locations.write

Rate limit: read

Returns one location by ID, with its address, timezone, status, and whether it accepts inventory allocation. Archived locations remain readable by ID.

Path parameters

location_idstringRequired

Flint Location ID.

Response · 200

Successful response.

Same response as Create location.

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

Successful response.

JSON
{
  "data": {
    "address": {
      "city": "Brooklyn",
      "country": "US",
      "line1": "120 Kent Avenue",
      "postal_code": "11249",
      "state": "NY"
    },
    "coordinate": {
      "latitude": 40.7213,
      "longitude": -73.9615
    },
    "coordinate_source": "merchant_supplied",
    "created_at": "2026-05-02T11:04:00Z",
    "geography_version": 2,
    "inventory_allocation_enabled": true,
    "location_id": "loc_01K0P7W6A4N9F3J2T8Q5R1C6XM",
    "metadata": {
      "region": "northeast"
    },
    "name": "Brooklyn warehouse",
    "status": "active",
    "timezone": "America/New_York",
    "updated_at": "2026-07-14T09:12:00Z",
    "validation_status": "not_validated",
    "version": 4
  },
  "meta": {
    "api_version": "2026-09-07"
  },
  "request_id": "req_01KWM6N1JHF8ZAKK41C12T5VJ9"
}

Update location#

PATCH/v1/locations/{location_id}Idempotent

Requires scope merchants.locations.write

Also requires commerce.inventory.allocation.write when setting inventory_allocation_enabled.

Rate limit: write

Update a Location's profile, availability, geography, and inventory allocation in one call. Sending inventory_allocation_enabled also requires commerce.inventory.allocation.write. The version advances on every change. expected_version is optional and compared with version when sent. Idempotency is scoped to the authenticated merchant, environment, and endpoint. Its fingerprint includes the canonical request body.

Path parameters

location_idstringRequired

Flint Location ID.

Request body

addressobject

Complete replacement postal address, validated as on create. Requires coordinate in the same request, including null to clear it.

coordinateobject or null

Complete replacement coordinate. Send null to clear both coordinate and coordinate_source. A non-null value requires coordinate_source in the same request.

coordinate_sourceenum or null

Source of the coordinate sent in the same request. A non-null coordinate requires merchant_supplied or geocoded. Send null only with coordinate: null to clear both fields.

  • merchant_supplied
  • geocoded
  • null
expected_versioninteger

Version last read from the resource returned in `data` (the primary resource for a result object). The write fails with `VERSION_CONFLICT` if it has changed. Requiredness depends on the operation and fields being changed.

external_reference_idstring or null

Caller-owned identifier for this resource in an external system. Send null to clear it.

inventory_allocation_enabledboolean

Whether this Location accepts inventory allocation. Sending this field requires commerce.inventory.allocation.write in addition to the route scope.

metadatamap of string or null

Caller-owned metadata. Omit this field to leave metadata unchanged. Send an object to merge by key, set a key to null to remove it, or set metadata to null to clear all caller-owned metadata. An empty object makes no change. Values can't be empty strings. Keys starting with flint_ are reserved for Flint, are not returned, and cannot be written through the public API.

namestring

Merchant-facing Location name, from 1 to 255 characters.

statusenum

New status for the Location. Omit it to leave the status unchanged.

  • active
  • inactive
timezonestring

IANA timezone for local schedules, validated as on create. Can be updated without address.

Response · 200

Successful response.

Same response as Create location.

curl -X PATCH https://api.withflintpay.com/v1/locations/loc_01KEZF7C00CMHRRYA3MV996JB2 \
  -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": 4,
    "inventory_allocation_enabled": true,
    "name": "Brooklyn warehouse (Kent Ave)",
    "timezone": "America/New_York"
  }'

Retire location#

DELETE/v1/locations/{location_id}Idempotent

Requires scope merchants.locations.write

Rate limit: write

Retire a Location. Preserves the archived resource for direct reads.

Path parameters

location_idstringRequired

Flint Location ID.

Query parameters

expected_versioninteger

Current resource version used as a concurrency fence.

Response · 200

Successful response.

Same response as Create location.

curl -X DELETE https://api.withflintpay.com/v1/locations/loc_01KEZF7C00CMHRRYA3MV996JB2 \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

Was this helpful?