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

NameTypeRequiredDescription
tenantIdstringYes
agg_bystringNo
cachestringNo
collection_locationboolean or stringNoFilter locations enabled as customer collection locations.
countryarray or stringNo
country_accessarray or stringNo
creation_date_fromstringNo
creation_date_tostringNo
fulfillment_locationboolean or stringNoFilter locations enabled as fulfillment locations.
inventory_locationboolean or stringNoFilter locations enabled as inventory locations.
location_accessarray or stringNo
location_codearray or stringNo
location_idarray or stringNo
location_namearray or stringNo
location_typearray or stringNo
merchantarray or stringNo
pagestringNo
page_sizestringNo
paginationboolean or stringNo
search_stringstringNo
selectstringNo
sort_bystringNo
sort_directionstringNoValues: asc, desc.
statusarray or stringNo
statusesarray or stringNo
tzoffsetstringNo

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"
)
  • create_shipment — accepts pickup location ids.
  • get_shipment_list — supports pickup_location / dropoff_location filters.
  • Most reports support location_access for scoping.

Notes

  • Lookup is cheap; cache for the session.
  • Use select aggressively — location records can carry a lot of optional fields (operating hours, contact info) the agent rarely needs in chat.