get_locations

Updated May 19, 20261 min read

List locations for a tenant via middleware, with merchant-access filtering. Use select (json-mask) for response trimming.

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
tenantIdstringYesThe tenant to list.
selectstringNojson-mask — useful for trimming the response.
merchantstring | string[]NoFilter by one or more merchants.
countrystring | string[]NoFilter by location country.
status / statusesstring | string[]NoFilter by status.
location_id / location_name / location_codestring | string[]NoFilter by identifier or name.
country_access / location_accessstring | string[]NoStandard scope filters.
search_stringstringNoFree-text search.
page, page_size, sort_by, sort_directionNoPagination + sort.
creation_date_from / creation_date_tostringNoFilter by creation date.
cachestringNoCache-control flag for the underlying query.

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.