Location

A location represents a geographical location where your stores, pop-up stores, headquarters, and warehouses exist. You can use the Location resource to track sales, manage inventory, and configure the tax rates to apply at checkout.

What you can do with Location

The Shopify API lets you do the following with the Location resource. More detailed versions of these general actions may be available:

Location properties

address1
"address1": "126 york street"

The first line of the address.

address2
"address2": "second and third floor"

The second line of the address.

city
"city": "ottawa"

The city the location is in.

country
"country": "CA"

The country the location is in.

country_code
"country_code": "CA"

The two-letter code (ISO 3166-1 alpha-2 format) corresponding to country the location is in.

created_at
"created_at": "2008-12-31T19:00:00-05:00"

The date and time (ISO 8601 format) when the location was created.

id
"id": 121

The ID for the location.

legacy
"legacy": true

Whether this is a fulfillment service location. If true, then the location is a fulfillment service location. If false, then the location was created by the merchant and isn't tied to a fulfillment service.

name
"name": "Ottawa Store"

The name of the location.

phone
"phone": "18883290139"

The phone number of the location. This value can contain special characters like - and +.

province
"province": "Ontario"

The province the location is in.

province_code
"province_code": "ON"

The two-letter code corresponding to province or state the location is in.

updated_at
"updated_at": "2009-01-31T19:00:00-05:00"

The date and time (ISO 8601 format) when the location was last updated.

zip
"zip": "k1n5t5"

The zip or postal code.

Endpoints

GET /admin/locations.json
Retrieves a list of locations

Retrieve a list of all locations

GET /admin/locations.json
View Response
HTTP/1.1 200 OK
{
  "locations": [
    {
      "id": 48752903,
      "name": "Apple Api Shipwire",
      "address1": null,
      "address2": null,
      "city": null,
      "zip": null,
      "province": null,
      "country": "DE",
      "phone": null,
      "created_at": "2018-05-07T15:33:38-04:00",
      "updated_at": "2018-05-07T15:33:38-04:00",
      "country_code": "DE",
      "country_name": "Germany",
      "province_code": null,
      "legacy": true
    },
    {
      "id": 61629186,
      "name": "Apple Shipwire",
      "address1": null,
      "address2": null,
      "city": null,
      "zip": null,
      "province": null,
      "country": "DE",
      "phone": null,
      "created_at": "2018-05-07T15:33:38-04:00",
      "updated_at": "2018-05-07T15:33:38-04:00",
      "country_code": "DE",
      "country_name": "Germany",
      "province_code": null,
      "legacy": true
    },
    {
      "id": 487838322,
      "name": "Fifth Avenue AppleStore",
      "address1": null,
      "address2": null,
      "city": null,
      "zip": null,
      "province": null,
      "country": "US",
      "phone": null,
      "created_at": "2018-05-07T15:33:38-04:00",
      "updated_at": "2018-05-07T15:33:38-04:00",
      "country_code": "US",
      "country_name": "United States",
      "province_code": null,
      "legacy": false
    },
    {
      "id": 905684977,
      "name": "50 Rideau Street",
      "address1": "50 Rideau Street",
      "address2": null,
      "city": "Ottawa",
      "zip": "K1N 9J7",
      "province": "Ontario",
      "country": "CA",
      "phone": null,
      "created_at": "2018-05-07T15:33:38-04:00",
      "updated_at": "2018-05-07T15:33:38-04:00",
      "country_code": "CA",
      "country_name": "Canada",
      "province_code": "ON",
      "legacy": false
    }
  ]
}
GET /admin/locations/487838322.json
Retrieves a single location by its ID

Retrieve a single location

GET /admin/locations/#{location_id}.json
View Response
HTTP/1.1 200 OK
{
  "location": {
    "id": 487838322,
    "name": "Fifth Avenue AppleStore",
    "address1": null,
    "address2": null,
    "city": null,
    "zip": null,
    "province": null,
    "country": "US",
    "phone": null,
    "created_at": "2018-05-07T15:33:38-04:00",
    "updated_at": "2018-05-07T15:33:38-04:00",
    "country_code": "US",
    "country_name": "United States",
    "province_code": null,
    "legacy": false
  }
}
GET /admin/locations/count.json
Retrieves a count of locations

Count all store locations

GET /admin/locations/count.json
View Response
HTTP/1.1 200 OK
{
  "count": 4
}
GET /admin/locations/487838322/inventory_levels.json
Retrieves a list of inventory levels for a location

Retrieve a list of all inventory for a location by its ID

GET /admin/locations/#{location_id}/inventory_levels.json
View Response
HTTP/1.1 200 OK
{
  "inventory_levels": [
    {
      "inventory_item_id": 457924702,
      "location_id": 487838322,
      "available": 36,
      "updated_at": "2018-05-07T15:33:38-04:00"
    },
    {
      "inventory_item_id": 39072856,
      "location_id": 487838322,
      "available": 27,
      "updated_at": "2018-05-07T15:33:38-04:00"
    },
    {
      "inventory_item_id": 808950810,
      "location_id": 487838322,
      "available": 9,
      "updated_at": "2018-05-07T15:33:38-04:00"
    },
    {
      "inventory_item_id": 49148385,
      "location_id": 487838322,
      "available": 18,
      "updated_at": "2018-05-07T15:33:38-04:00"
    },
    {
      "inventory_item_id": 447654529,
      "location_id": 487838322,
      "available": 13,
      "updated_at": "2018-05-07T15:33:38-04:00"
    }
  ]
}