Skip to main content

Location

A Location of the store where physical goods reside.

Scopes

PropertyExplanation
read_locationsRequired for all GET resources.
write_locationsRequired for all POST/PUT/DELETE resources.

Properties

PropertyExplanationRequired
idThe unique numeric identifier for the Locationread-only
nameLocalized Location NameYes
addressThe Address of the LocationYes
is_default"true" if it is the default Location, "false" otherwiseNo
allows_pickup"true" if this Location allows pickup, "false" otherwiseNo
priorityPriority of the location to assign stock during checkout. The lower the value the higher the priorityNo
created_atDate when the Location was created in ISO 8601 formatread-only
updated_atDate when the Location was last updated in ISO 8601 formatread-only

Address Properties

PropertyExplanationRequired
zipcodeThe address zipcode.Yes
streetThe address street.Yes
numberThe address number.No
floorThe address floor. Brazil complement.No
localityThe address locality. Brazil neighborhood.No
cityThe address city name.Yes
referenceThe address reference.No
between_streetsThe address bwtween streets reference.No
provinceThe address Province.Yes
regionThe address Region.Yes
countryThe address Country.Yes
verified_atDate when the Location Address was verified in ISO 8601 formatNo

Address Province Properties

PropertyExplanation
nameThe address province name.
codeThe address province code.

Address Region Properties

PropertyExplanation
nameThe address region name.
codeThe address region code.

Address Country Properties

PropertyExplanation
nameThe address country name.
codeThe address country code.

Endpoints

GET /locations

Receive a list of all Locations.

GET /locations

HTTP/1.1 200 OK

[
{
"id": "01HTMFDH09VC6E2Q8KGTGP44D3",
"name": {
"es_AR": "Nombre en espanol",
"pt_BR": "Nome em português",
"en_US": "Name in english"
},
"store_id": "12345",
"priority": 0,
"address": {
"zipcode": "12910802",
"street": "St Louis",
"number": "01",
"floor": "Floor",
"locality": "Locality",
"city": "São Paulo",
"province": {
"code": "SP",
"name": "São Paulo"
},
"region": {
"code": "SE",
"name": "São Paulo"
},
"country": {
"code": "BR",
"name": "São Paulo"
},
"reference": "tiendanube's close",
"between_streets": "St Mark Third",
"verified_at": "1997-07-16T19:20:30+01:00"
},
"is_default": true,
"created_at": "1997-07-16T19:20:30+01:00",
"updated_at": "1997-07-16T19:20:30+01:00"
},
{
"id": "01HTMFFHWXRC8TRS40M43XGQFB",
"name": {
"es_AR": "Nombre en espanol",
"pt_BR": "Nome em português",
"en_US": "Name in english"
},
"store_id": "12345",
"priority": 1,
"address": {
"zipcode": "12910802",
"street": "St Louis",
"number": "01",
"floor": "Floor",
"locality": "Locality",
"city": "São Paulo",
"province": {
"code": "SP",
"name": "São Paulo"
},
"region": {
"code": "SE",
"name": "São Paulo"
},
"country": {
"code": "BR",
"name": "São Paulo"
},
"reference": "tiendanube's close",
"between_streets": "St Mark Third",
"verified_at": "1997-07-17T19:20:30+01:00"
},
"is_default": true,
"created_at": "1997-07-17T19:20:30+01:00",
"updated_at": "1997-07-17T19:20:30+01:00"
}
]

GET /locations/{id}

Receive a single Location

GET /locations/01HTMFDH09VC6E2Q8KGTGP44D3

HTTP/1.1 200 OK

{
"id": "01HTMFDH09VC6E2Q8KGTGP44D3",
"name": {
"es_AR": "Nombre en espanol",
"pt_BR": "Nome em português",
"en_US": "Name in english"
},
"store_id": "12345",
"priority": 0,
"address": {
"zipcode": "12910802",
"street": "St Louis",
"number": "01",
"floor": "Floor",
"locality": "Locality",
"city": "São Paulo",
"province": {
"code": "SP",
"name": "São Paulo"
},
"region": {
"code": "SE",
"name": "São Paulo"
},
"country": {
"code": "BR",
"name": "São Paulo"
},
"reference": "tiendanube's close",
"between_streets": "St Mark Third",
"verified_at": "1997-07-16T19:20:30+01:00"
},
"is_default": true,
"created_at": "1997-07-16T19:20:30+01:00",
"updated_at": "1997-07-16T19:20:30+01:00"
}

POST /locations

Create a new Location

POST /locations

{
"name": {
"es_AR": "Nombre en espanol",
"pt_BR": "Nome em português",
"en_US": "Name in english"
},
"address": {
"zipcode": "12910802",
"street": "Some place",
"number": "12",
"floor": "AP1",
"locality": "Locality",
"reference": "REF12",
"between_streets": "Some place between",
"city": "São Paulo",
"province": {
"code": "SP",
"name": "São Paulo"
},
"region": {
"code": "SE",
"name": "Sudeste"
},
"country": {
"code": "BR",
"name": "Brazil"
}
}
}

HTTP/1.1 201 Created

{
"id": "01HTMFDH09VC6E2Q8KGTGP44D3",
"name": {
"es_AR": "Nombre en espanol",
"pt_BR": "Nome em português",
"en_US": "Name in english"
},
"store_id": "12345",
"priority": 0,
"address": {
"zipcode": "12910802",
"street": "12910802",
"number": "Some place",
"floor": "AP1",
"locality": "Locality",
"city": "São Paulo",
"province": {
"code": "SP",
"name": "São Paulo"
},
"region": {
"code": "SE",
"name": "Sudeste"
},
"country": {
"code": "BR",
"name": "Brazil"
},
"reference": "REF12",
"between_streets": "Some place between",
"verified_at": "1997-07-16T19:20:30+01:00"
},
"is_default": true,
"created_at": "1997-07-16T19:20:30+01:00",
"updated_at": "1997-07-16T19:20:30+01:00"
}

PATCH /locations/priorities

Change priorities of all existing locations from store. On change priority the Location with priority 0 will be updated as default.

PATCH /locations/priorities

[
{
"id": "01HSY0PDQCTWCEKH6Y23W0P2VR",
"priority": 0
},
{
"id": "01HSY0MVKDRAXEZ45B91EGVEJX",
"priority": 2
},
{
"id": "01HSY0PNSV30VZ9F35VCDE0C52",
"priority": 1
}
]

HTTP/1.1 200 Ok

[
{
"id": "01HSY0PDQCTWCEKH6Y23W0P2VR",
"priority": 0
},
{
"id": "01HSY0MVKDRAXEZ45B91EGVEJX",
"priority": 2
},
{
"id": "01HSY0PNSV30VZ9F35VCDE0C52",
"priority": 1
}
]

PUT /locations/{id}

Modify an existing Location

PUT /locations/01HTMFDH09VC6E2Q8KGTGP44D3

{
"name": {
"es_AR": "Nombre en espanol",
"pt_BR": "Nome em português",
"en_US": "Name in english"
},
"address": {
"zipcode": "12910802",
"street": "Some place",
"number": "12",
"floor": "AP1",
"locality": "Locality",
"reference": "REF12",
"between_streets": "Some place between",
"city": "São Paulo",
"province": {
"code": "SP",
"name": "São Paulo"
},
"region": {
"code": "SE",
"name": "Sudeste"
},
"country": {
"code": "BR",
"name": "Brazil"
}
}
}

HTTP/1.1 200 Ok

{
"id": "01HTMFDH09VC6E2Q8KGTGP44D3",
"name": {
"es_AR": "Nombre en espanol",
"pt_BR": "Nome em português",
"en_US": "Name in english"
},
"store_id": "12345",
"priority": 0,
"address": {
"zipcode": "12910802",
"street": "12910802",
"number": "Some place",
"floor": "AP1",
"locality": "Locality",
"city": "São Paulo",
"province": {
"code": "SP",
"name": "São Paulo"
},
"region": {
"code": "SE",
"name": "Sudeste"
},
"country": {
"code": "BR",
"name": "Brazil"
},
"reference": "REF12",
"between_streets": "Some place between",
"verified_at": "1997-07-16T19:20:30+01:00"
},
"is_default": true,
"created_at": "1997-07-16T19:20:30+01:00",
"updated_at": "1997-07-16T19:20:30+01:00"
}

DELETE /locations/{id}

Delete an existing Location, and repreorize remains locations. For the deletion to be successful the Location should not have any inventory levels assigned and Locantion can`t be default.

DELETE /locations/01HTMFDH09VC6E2Q8KGTGP44D3

HTTP/1.1 204 No Content


PATCH /locations/{id}/chosen-as-default

Change an existing Location to default and priority 0, and repreorize other locations. For the change to be successfull the Location should have priority greatter than 0.

PATCH /locations/01HSY0MVKDRAXEZ45B91EGVEJX/chosen-as-default

HTTP/1.1 200 Ok

{
"id": "01HSY0MVKDRAXEZ45B91EGVEJX",
"name": {
"es_AR": "Nombre en espanol",
"pt_BR": "Nome em português",
"en_US": "Name in english"
},
"store_id": "12345",
"priority": 0,
"address": {
"zipcode": "12910802",
"street": "12910802",
"number": "Some place",
"floor": "AP1",
"locality": "Locality",
"city": "São Paulo",
"province": {
"code": "SP",
"name": "São Paulo"
},
"region": {
"code": "SE",
"name": "Sudeste"
},
"country": {
"code": "BR",
"name": "Brazil"
},
"reference": "REF12",
"between_streets": "Some place between",
"verified_at": "1997-07-16T19:20:30+01:00"
},
"is_default": true,
"created_at": "1997-07-16T19:20:30+01:00",
"updated_at": "1997-07-16T19:20:30+01:00"
}

GET /locations/{id}/inventory-levels

Receive the inventory levels assigned to a particular Location.

ParameterExplanation
variant_idFilter only the inventory level of this Product Variant
pagePage to show (optional, default: 1)
per_pageAmount of results (optional, default: 1)

GET /locations/01HTMFDH09VC6E2Q8KGTGP44D3/inventory-levels?page=1&per_page=10

HTTP/1.1 200 OK

{
"total": 4,
"page": 1,
"per_page": 10,
"results": [
{
"id": "1",
"variant_id": "101",
"location_id": "01HTMFDH09VC6E2Q8KGTGP44D3",
"stock": 1,
"created_at": "2022-09-19T10:46:32+0000",
"updated_at": "2022-09-19T10:46:32+0000"
},
{
"id": "2",
"variant_id": "102",
"location_id": "01HTMFDH09VC6E2Q8KGTGP44D3",
"stock": 1,
"created_at": "2022-09-19T10:46:32+0000",
"updated_at": "2022-09-19T10:46:32+0000"
},
{
"id": "3",
"variant_id": "103",
"location_id": "01HTMFDH09VC6E2Q8KGTGP44D3",
"stock": 1,
"created_at": "2022-09-19T10:46:32+0000",
"updated_at": "2022-09-19T10:46:32+0000"
},
{
"id": "4",
"variant_id": "104",
"location_id": "01HTMFDH09VC6E2Q8KGTGP44D3",
"stock": 1,
"created_at": "2022-09-19T10:46:32+0000",
"updated_at": "2022-09-19T10:46:32+0000"
}
]
}

GET /locations/01HTMFDH09VC6E2Q8KGTGP44D3/inventory-levels?page=1&per_page=10&variant_id=101

HTTP/1.1 200 OK

{
"total": 4,
"page": 1,
"per_page": 10,
"results": [
{
"id": "1",
"variant_id": "101",
"location_id": "01HTMFDH09VC6E2Q8KGTGP44D3",
"stock": 1,
"created_at": "2022-09-19T10:46:32+0000",
"updated_at": "2022-09-19T10:46:32+0000"
}
]
}