# 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. For a better understanding of the relationship between locations, inventory levels and inventory items, refer to the InventoryLevel resource reference documentation
## Resource Properties ### Location * active: Whether the location is active. Iftrue
, then the location can be used to sell products,
stock inventory, and fulfill orders. Merchants can deactivate locations from the Shopify admin.
Deactivated locations don't contribute to the shop's
location limit.
* Type: x-string
* Example: true
* address1: The location's street address.
* Type: x-string
* Example: "126 York Street"
* address2: The optional second line of the location's street address.
* Type: x-string
* Example: "Unit 42"
* city: The city the location is in.
* Type: x-string
* Example: "Ottawa"
* country: The country the location is in.
* Type: x-string
* Example: "Canada"
* country_code: The two-letter code (ISO 3166-1 alpha-2 format) corresponding to country the location is in.
* Type: x-string
* Example: "CA"
* created_at: The date and time (ISO 8601 format) when the location was created.
* Type: x-string
* Example: "2008-12-31T19:00:00-05:00"
* id: The ID of the location.
* Type: x-string
* Example: 121
* legacy: 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.
* Type: x-string
* Example: true
* name: The name of the location.
* Type: x-string
* Example: "Ottawa Store"
* phone: The phone number of the location. This value can contain special characters, such as -
or +
.
* Type: x-string
* Example: "18883290139"
* province: The province, state, or district of the location.
* Type: x-string
* Example: "Ontario"
* province_code: The province, state, or district code (ISO 3166-2 alpha-2 format) of the location.
* Type: x-string
* Example: "ON"
* updated_at: The date and time (ISO 8601 format) when the location was last updated.
* Type: x-string
* Example: "2009-01-31T19:00:00-05:00"
* zip: The zip or postal code.
* Type: x-string
* Example: "k1n5t5"
* localized_country_name: The localized name of the location's country.
* Type: x-string
* Example: "Canada"
* localized_province_name: The localized name of the location's region. Typically a province, state, or district.
* Type: x-string
* Example: "Ontario"
## Retrieve a list of locations
Retrieve a list of locations. Note: This endpoint implements pagination by using links that are provided in the response header. To learn more, refer to Make paginated requests to the REST Admin API.
### Endpoint
/admin/api/#{api_version}/locations.json (GET)
### Parameters
* api_version (required):
* limit: The maximum number of results to show.
### Responses
#### 200
Retrieve a list of locations
Examples:
##### Retrieve a list of all locations
Request:
```
GET /admin/api/unstable/locations.json
```
Response:
```
HTTP/1.1 200 OK
{"locations":[{"id":655441491,"name":"50 Rideau Street","address1":"50 Rideau Street","address2":null,"city":"Ottawa","zip":"K1N 9J7","province":"Ontario","country":"CA","phone":null,"created_at":"2025-01-02T11:09:43-05:00","updated_at":"2025-01-02T11:09:43-05:00","country_code":"CA","country_name":"Canada","province_code":"ON","legacy":false,"active":true,"admin_graphql_api_id":"gid://shopify/Location/655441491","localized_country_name":"Canada","localized_province_name":"Ontario"},{"id":24826418,"name":"Apple Api Shipwire","address1":null,"address2":null,"city":null,"zip":null,"province":null,"country":"DE","phone":null,"created_at":"2025-01-02T11:09:43-05:00","updated_at":"2025-01-02T11:09:43-05:00","country_code":"DE","country_name":"Germany","province_code":null,"legacy":true,"active":true,"admin_graphql_api_id":"gid://shopify/Location/24826418","localized_country_name":"Germany","localized_province_name":null},{"id":844681632,"name":"Apple Cupertino","address1":null,"address2":null,"city":null,"zip":null,"province":null,"country":"US","phone":null,"created_at":"2025-01-02T11:09:43-05:00","updated_at":"2025-01-02T11:09:43-05:00","country_code":"US","country_name":"United States","province_code":null,"legacy":false,"active":true,"admin_graphql_api_id":"gid://shopify/Location/844681632","localized_country_name":"United States","localized_province_name":null},{"id":611870435,"name":"Apple Shipwire","address1":null,"address2":null,"city":null,"zip":null,"province":null,"country":"DE","phone":null,"created_at":"2025-01-02T11:09:43-05:00","updated_at":"2025-01-02T11:09:43-05:00","country_code":"DE","country_name":"Germany","province_code":null,"legacy":true,"active":true,"admin_graphql_api_id":"gid://shopify/Location/611870435","localized_country_name":"Germany","localized_province_name":null},{"id":487838322,"name":"Fifth Avenue AppleStore","address1":null,"address2":null,"city":null,"zip":null,"province":null,"country":"US","phone":null,"created_at":"2025-01-02T11:09:43-05:00","updated_at":"2025-01-02T11:09:43-05:00","country_code":"US","country_name":"United States","province_code":null,"legacy":false,"active":true,"admin_graphql_api_id":"gid://shopify/Location/487838322","localized_country_name":"United States","localized_province_name":null}]}
```
## Retrieve a single location by its ID
Retrieve a single location by its ID.
### Endpoint
/admin/api/#{api_version}/locations/{location_id}.json (GET)
### Parameters
* api_version (required):
* location_id (required):
### Responses
#### 200
Retrieve a single location by its ID
Examples:
##### Retrieve a single location
Request:
```
GET /admin/api/unstable/locations/487838322.json
```
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":"2025-01-02T11:09:43-05:00","updated_at":"2025-01-02T11:09:43-05:00","country_code":"US","country_name":"United States","province_code":null,"legacy":false,"active":true,"admin_graphql_api_id":"gid://shopify/Location/487838322"}}
```
## Retrieve a count of locations
Retrieve a count of locations.
### Endpoint
/admin/api/#{api_version}/locations/count.json (GET)
### Parameters
* api_version (required):
### Responses
#### 200
Retrieve a count of locations
Examples:
##### Count all store locations
Request:
```
GET /admin/api/unstable/locations/count.json
```
Response:
```
HTTP/1.1 200 OK
{"count":5}
```
## Retrieve a list of inventory levels for a location
Retrieve a list of inventory levels for a location. Note: This endpoint implements pagination by using links that are provided in the response header. To learn more, refer to Make paginated requests to the REST Admin API.
### Endpoint
/admin/api/#{api_version}/locations/{location_id}/inventory_levels.json (GET)
### Parameters
* api_version (required):
* location_id (required):
### Responses
#### 200
Retrieve a list of inventory levels for a location
Examples:
##### Retrieve a list of all inventory for a location by its ID
Request:
```
GET /admin/api/unstable/locations/487838322/inventory_levels.json
```
Response:
```
HTTP/1.1 200 OK
{"inventory_levels":[{"inventory_item_id":49148385,"location_id":487838322,"available":18,"updated_at":"2025-01-02T11:09:43-05:00","admin_graphql_api_id":"gid://shopify/InventoryLevel/548380009?inventory_item_id=49148385"},{"inventory_item_id":808950810,"location_id":487838322,"available":9,"updated_at":"2025-01-02T11:09:43-05:00","admin_graphql_api_id":"gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"},{"inventory_item_id":457924702,"location_id":487838322,"available":36,"updated_at":"2025-01-02T11:09:43-05:00","admin_graphql_api_id":"gid://shopify/InventoryLevel/548380009?inventory_item_id=457924702"},{"inventory_item_id":39072856,"location_id":487838322,"available":27,"updated_at":"2025-01-02T11:09:43-05:00","admin_graphql_api_id":"gid://shopify/InventoryLevel/548380009?inventory_item_id=39072856"}]}
```