Locations

Locations

What is a Location in ecartAPI?

A Location is a warehouse, fulfillment center, retail store, or any physical place where a seller stores inventory. Locations are the foundation of inventory management — they answer the question "where is this product stocked, and how much is available there?"

Every ecommerce platform handles locations differently — some have multi-location inventory, others use "Fulfillment Centers," warehouse/storefront models, or have no location concept at all (single implicit location). ecartAPI normalizes all of these into a single canonical shape.

The canonical model

ecartAPI's canonical location includes:

  • A unique identifier and name.
  • A physical address (street, city, country, postal code).
  • Whether it is active.
  • Inventory levels: each product variant has a quantity at each location.
  • Pickup settings for in-store pickup.

ecartAPI maps these fields across all supported platforms. Some platforms have simpler location models (a single location with no address data), while others have rich multi-warehouse setups.

Important: Not all platforms support location management. Some platforms have a single implicit location. Location CRUD and inventory update operations are platform-dependent.


API endpoints

Location CRUD

MethodPathDescription
GET/api/v2/locationsList locations with filters.
GET/api/v2/locations/countCount locations.
GET/api/v2/locations/{id}Get a single location by id.
POST/api/v2/locationsCreate a location. Platform-dependent.
PUT/api/v2/locations/{id}Update a location. Platform-dependent.
DELETE/api/v2/locations/{id}Delete a location. Platform-dependent.

Inventory management

MethodPathDescription
GET/api/v2/locations/{id}/inventoriesList inventories at a specific location.
GET/api/v2/locations/{id}/inventories/{inventoryId}Get inventory for a specific item at a location.
PUT/api/v2/locations/{id}/inventories/{inventoryId}Update inventory quantity at a location.
GET/api/v2/inventories/{id}Get inventory for a product/variant across all locations.

Note: There are two ways to access inventory:

  • By location: /api/v2/locations/{id}/inventories — "what's stocked at this warehouse?"
  • By product: /api/v2/inventories/{id} — "where is this product stocked?"

Both return the same canonical inventory shape.


Query filters

Location filters

ParameterDescription
pagePage token or page number for pagination.
limitMaximum number of locations per page.
locationIdFilter by specific location id.
variantIdFilter locations that stock a specific variant.
createdAt[from], createdAt[to]Filter by creation date range.
pickupFilter by pickup-enabled locations.

Inventory filters

ParameterDescription
limitMaximum number of inventory items per page.
inventoryIdFilter by specific inventory item id.
inventoryIdsComma-separated list of inventory item ids.

Response shape

Location

FieldTypeDescription
idstringLocation's unique identifier on the platform.
codestringLocation code (internal reference).
namestringLocation name (e.g., "Main Warehouse").
typestringLocation type (e.g., warehouse, store, fulfillment center).
address1stringPrimary address line.
address2stringSecondary address line.
citystringCity name.
postalCodestringPostal/ZIP code.
phonestringLocation phone number.
activebooleanWhether the location is active.

country / state

FieldTypeDescription
codestringCountry/state code.
namestringCountry/state full name.
codeIso2stringISO 3166-1 alpha-2 code (country only).
codeIso3stringISO 3166-1 alpha-3 code (country only).

dates

FieldTypeDescription
createdAtstringISO 8601 creation timestamp.
updatedAtstringISO 8601 last-updated timestamp.

pickupSettings

Platform-specific pickup configuration object. Structure varies by platform.


Inventory

FieldTypeDescription
idstringInventory item identifier (typically the SKU or variant id).
locationIdstringThe location where this inventory is held.
productIdstringThe parent product id.
variantIdstringThe variant id.
skustringStock Keeping Unit.
quantitystringAvailable quantity at this location.
locationNamestringName of the location (when available).
ecartapiUrlstringecartAPI URL for this inventory resource.

Inventory dates

FieldTypeDescription
createdAtstringISO 8601 creation timestamp.
updatedAtstringISO 8601 last-updated timestamp.

Important notes

  • Not all platforms have locations. Some platforms use a single implicit location. On those platforms, the locations endpoint may return a single entry or may not be available.
  • Inventory updates (PUT /locations/{id}/inventories/{inventoryId}) allow setting the stock quantity for a specific variant at a specific location.
  • Product-level inventory (GET /inventories/{id}) provides a cross-location view, useful for checking total stock across all warehouses.
  • Response fields are platform-dependent. Not all fields listed in the response shape are available for every ecommerce platform. Some properties may be absent or returned as null depending on what the connected platform's API provides.
  • If a platform does not support location operations, ecartAPI returns 400 with "The resource is not available for this ecommerce".