get_locations
Updated September 10, 20261 min read
List locations for a tenant via middleware, with merchant-access filtering. Use optional select with json-mask syntax to return only required fields.
Locations are the physical or logical fulfillment points — warehouses, stores, dark stores, dropship endpoints. The agent needs them when creating a shipment (pickup location), routing decisions, or for reports sliced by location.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
tenantId | string | Yes | — |
agg_by | string | No | — |
cache | string | No | — |
collection_location | boolean or string | No | Filter locations enabled as customer collection locations. |
country | array or string | No | — |
country_access | array or string | No | — |
creation_date_from | string | No | — |
creation_date_to | string | No | — |
fulfillment_location | boolean or string | No | Filter locations enabled as fulfillment locations. |
inventory_location | boolean or string | No | Filter locations enabled as inventory locations. |
location_access | array or string | No | — |
location_code | array or string | No | — |
location_id | array or string | No | — |
location_name | array or string | No | — |
location_type | array or string | No | — |
merchant | array or string | No | — |
page | string | No | — |
page_size | string | No | — |
pagination | boolean or string | No | — |
search_string | string | No | — |
select | string | No | — |
sort_by | string | No | — |
sort_direction | string | No | Values: asc, desc. |
status | array or string | No | — |
statuses | array or string | No | — |
tzoffset | string | No | — |
Returns
An array of location records — id, name, code, country, merchant scope, status.
Example agent prompts
"List our locations."
get_locations(
tenantId="…",
select="location_id,location_name,country,status"
)
"Find the warehouse codes for our UAE locations."
get_locations(
tenantId="…",
country="AE",
select="location_code,location_name"
)
Related tools
create_shipment— accepts pickup location ids.get_shipment_list— supportspickup_location/dropoff_locationfilters.- Most reports support
location_accessfor scoping.
Notes
- Lookup is cheap; cache for the session.
- Use
selectaggressively — location records can carry a lot of optional fields (operating hours, contact info) the agent rarely needs in chat.