Location

A Location represents a geographical location where your stores, headquarters, and/or pop-up stores exist. These locations can be used to track sales and to help Shopify configure the tax rates to charge when selling products.

What can you 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

id
{ "id" : 121 }

A unique numeric identifier for the location.

name
{ "name" : "Ottawa Store" }

The name of the location

address1
{ "address1" : "126 york street" }

The first line of the address

address2
{ "address2" : "second and third floor" }

The second line of the address

zip
{ "zip" : "k1n5t5" }

The zip or postal code

city
{ "city" : "ottawa" }

The city the location is in

province
{ "province" : "ontario" }

The province the location is in

country
{ "country" : "CA" }

The country the location is in

phone
{ "phone" : "18883290139" }

The phone number of the location, can contain special chars like - and +

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

The date and time when the location was created. The API returns this value in ISO 8601 format.

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

The date and time when the location was last updated. The API returns this value in ISO 8601 format.

Endpoints

GET /admin/locations.json

Get a list of all locations for a shop

Get a list of all locations for a shop

GET /admin/locations.json
View Response
HTTP/1.1 200 OK
{
  "locations": [
    {
      "id": 487838322,
      "name": "Fifth Avenue AppleStore",
      "deleted_at": null,
      "address1": null,
      "address2": null,
      "city": null,
      "zip": null,
      "province": null,
      "country": "US",
      "phone": null,
      "created_at": "2016-11-11T15:38:25-05:00",
      "updated_at": "2016-11-11T15:38:25-05:00",
      "country_code": "US",
      "country_name": "United States",
      "province_code": null
    },
    {
      "id": 1034478814,
      "name": "Berlin Store",
      "deleted_at": null,
      "address1": null,
      "address2": null,
      "city": null,
      "zip": null,
      "province": null,
      "country": "DE",
      "phone": null,
      "created_at": "2016-11-11T15:38:25-05:00",
      "updated_at": "2016-11-11T15:38:25-05:00",
      "country_code": "DE",
      "country_name": "Germany",
      "province_code": null
    }
  ]
}
GET /admin/locations/487838322.json

Get a single location by its ID

Get a single location

GET /admin/locations/#{id}.json
View Response
HTTP/1.1 200 OK
{
  "location": {
    "id": 487838322,
    "name": "Fifth Avenue AppleStore",
    "deleted_at": null,
    "address1": null,
    "address2": null,
    "city": null,
    "zip": null,
    "province": null,
    "country": "US",
    "phone": null,
    "created_at": "2016-11-11T15:38:25-05:00",
    "updated_at": "2016-11-11T15:38:25-05:00",
    "country_code": "US",
    "country_name": "United States",
    "province_code": null
  }
}