--- title: locations - GraphQL Admin description: >- A paginated list of inventory locations where merchants can stock [`Product`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Product) items and fulfill [`Order`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Order) items. Returns only active locations by default. Use the [`includeInactive`](https://shopify.dev/docs/api/admin-graphql/latest/queries/locations#arguments-includeInactive) argument to retrieve deactivated locations that can no longer stock inventory or fulfill orders. Use the [`includeLegacy`](https://shopify.dev/docs/api/admin-graphql/latest/queries/locations#arguments-includeLegacy) argument to include locations that [`FulfillmentService`](https://shopify.dev/docs/api/admin-graphql/latest/objects/FulfillmentService) apps manage. Use the [`query`](https://shopify.dev/docs/api/admin-graphql/latest/queries/locations#arguments-query) argument to filter by location attributes like name, address, and whether local pickup is enabled. api_version: 2026-01 api_name: admin type: query api_type: graphql source_url: html: 'https://shopify.dev/docs/api/admin-graphql/latest/queries/locations' md: 'https://shopify.dev/docs/api/admin-graphql/latest/queries/locations.md' --- # locations query A paginated list of inventory locations where merchants can stock [`Product`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Product) items and fulfill [`Order`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Order) items. Returns only active locations by default. Use the [`includeInactive`](https://shopify.dev/docs/api/admin-graphql/latest/queries/locations#arguments-includeInactive) argument to retrieve deactivated locations that can no longer stock inventory or fulfill orders. Use the [`includeLegacy`](https://shopify.dev/docs/api/admin-graphql/latest/queries/locations#arguments-includeLegacy) argument to include locations that [`FulfillmentService`](https://shopify.dev/docs/api/admin-graphql/latest/objects/FulfillmentService) apps manage. Use the [`query`](https://shopify.dev/docs/api/admin-graphql/latest/queries/locations#arguments-query) argument to filter by location attributes like name, address, and whether local pickup is enabled. ## LocationConnection arguments [LocationConnection!](https://shopify.dev/docs/api/admin-graphql/latest/connections/LocationConnection) * after * before * first * includeInactive * includeLegacy * last * query * reverse * sortKey *** ## Possible returns * edges * nodes * pageInfo *** ## Examples * ### Retrieve a list of locations #### Description Retrieves the first 5 locations. #### Query ```graphql query { locations(first: 5) { edges { node { id name address { formatted } } } } } ``` #### cURL ```bash curl -X POST \ https://your-development-store.myshopify.com/admin/api/2026-01/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query { locations(first: 5) { edges { node { id name address { formatted } } } } }" }' ``` #### React Router ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query { locations(first: 5) { edges { node { id name address { formatted } } } } }`, ); const json = await response.json(); return json.data; } ``` #### Ruby ```ruby session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Graphql::Admin.new( session: session ) query = <<~QUERY query { locations(first: 5) { edges { node { id name address { formatted } } } } } QUERY response = client.query(query: query) ``` #### Node.js ```javascript const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: `query { locations(first: 5) { edges { node { id name address { formatted } } } } }`, }); ``` #### Response ```json { "locations": { "edges": [ { "node": { "id": "gid://shopify/Location/346779380", "name": "Ottawa Store", "address": { "formatted": [ "126 york street", "second and third floor", "ottawa ON k1n5t5", "Canada" ] } } }, { "node": { "id": "gid://shopify/Location/648019273", "name": "Ottawa Store geo located", "address": { "formatted": [ "126 york street", "second and third floor", "ottawa ON k1n5t5", "Canada" ] } } }, { "node": { "id": "gid://shopify/Location/884687543", "name": "Ottawa Warehouse", "address": { "formatted": [ "Canada" ] } } }, { "node": { "id": "gid://shopify/Location/124656943", "name": "Shipping Origin", "address": { "formatted": [ "190 MacLaren Street", "Ottawa ON K2P 0L6", "Canada" ] } } }, { "node": { "id": "gid://shopify/Location/750123840", "name": "Toronto Store", "address": { "formatted": [ "620 King St. W", "toronto ON m5v1m5", "Canada" ] } } } ] } } ```