---
title: location - GraphQL Admin
description: >-
  Retrieves a
  [`Location`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Location)
  by its ID. Locations are physical places where merchants store inventory, such

  as warehouses, retail stores, or fulfillment centers.


  Each location tracks inventory levels, fulfillment capabilities, and address

  information. Active locations can stock products and fulfill orders based on

  their configuration settings.
api_version: 2026-10
source_url:
  html: 'https://shopify.dev/docs/api/admin-graphql/latest/queries/location'
  md: 'https://shopify.dev/docs/api/admin-graphql/latest/queries/location.md'
api_name: admin
api_type: graphql
type: query
---

# location

query

Retrieves a [`Location`](https://shopify.dev/docs/api/admin-graphql/latest/objects/Location) by its ID. Locations are physical places where merchants store inventory, such as warehouses, retail stores, or fulfillment centers.

Each location tracks inventory levels, fulfillment capabilities, and address information. Active locations can stock products and fulfill orders based on their configuration settings.

## Arguments

* id

  [ID](https://shopify.dev/docs/api/admin-graphql/latest/scalars/ID)

  The ID of the location to return. If no ID is provided, the primary location of the Shop is returned.

***

## Possible returns

* Location

  [Location](https://shopify.dev/docs/api/admin-graphql/latest/objects/Location)

  A physical location where merchants store and fulfill inventory. Locations include retail stores, warehouses, popups, dropshippers, or other places where inventory is managed or stocked.

  Active locations can fulfill online orders when configured with shipping rates, local pickup, or local delivery options. Locations track inventory quantities for [products](https://shopify.dev/docs/api/admin-graphql/latest/objects/Product) and process [order](https://shopify.dev/docs/api/admin-graphql/latest/objects/Order) fulfillment. Third-party apps using [`FulfillmentService`](https://shopify.dev/docs/api/admin-graphql/latest/objects/FulfillmentService) can create and manage their own locations.

  * activatable

    [Boolean!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean)

    non-null

    Whether the location can be reactivated. If `false`, then trying to activate the location with the [`LocationActivate`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/locationActivate) mutation will return an error that describes why the location can't be activated.

  * address

    [Location​Address!](https://shopify.dev/docs/api/admin-graphql/latest/objects/LocationAddress)

    non-null

    The address of this location.

  * address​Verified

    [Boolean!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean)

    non-null

    Whether the location address has been verified.

  * created​At

    [Date​Time!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/DateTime)

    non-null

    The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) that the location was added to a shop.

  * deactivatable

    [Boolean!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean)

    non-null

    Whether this location can be deactivated. If `true`, then the location can be deactivated by calling the [`LocationDeactivate`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/locationDeactivate) mutation. If `false`, then calling the mutation to deactivate it will return an error that describes why the location can't be deactivated.

  * deactivated​At

    [String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String)

    The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) that the location was deactivated at. For example, 3:30 pm on September 7, 2019 in the time zone of UTC (Universal Time Coordinated) is represented as `"2019-09-07T15:50:00Z`".

  * deletable

    [Boolean!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean)

    non-null

    Whether this location can be deleted.

  * fulfillment​Service

    [Fulfillment​Service](https://shopify.dev/docs/api/admin-graphql/latest/objects/FulfillmentService)

    Name of the service provider that fulfills from this location.

  * fulfills​Online​Orders

    [Boolean!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean)

    non-null

    Whether this location can fulfill online orders.

  * has​Active​Inventory

    [Boolean!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean)

    non-null

    Whether this location has active inventory.

  * has​Unfulfilled​Orders

    [Boolean!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean)

    non-null

    Whether this location has orders that need to be fulfilled.

  * id

    [ID!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/ID)

    non-null

    A globally-unique ID.

  * inventory​Level

    [Inventory​Level](https://shopify.dev/docs/api/admin-graphql/latest/objects/InventoryLevel)

    The quantities of an inventory item at this location.

    * include​Inactive

      [Boolean](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean)

      Default:false

      ### Arguments

      Whether to return the inventory level if it is inactive.

    * inventory​Item​Id

      [ID!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/ID)

      required

      The ID of the inventory item to obtain the inventory level for.

    ***

  * inventory​Levels

    [Inventory​Level​Connection!](https://shopify.dev/docs/api/admin-graphql/latest/connections/InventoryLevelConnection)

    non-null

    A list of the quantities of the inventory items that can be stocked at this location.

    * after

      [String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String)

      ### Arguments

      The elements that come after the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).

    * before

      [String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String)

      The elements that come before the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).

    * first

      [Int](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Int)

      The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).

    * include​Inactive

      [Boolean](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean)

      Default:false

      Whether to include inactive inventory levels.

    * last

      [Int](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Int)

      The last `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).

    * query

      [String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String)

      A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about [Shopify API search syntax](https://shopify.dev/api/usage/search-syntax).

      * created\_at

        time

      * * id

          id

        * inventory\_group\_id

          id

        - Filter by `id` range.

        - Example:
          * `id:1234`
          * `id:>=1234`
          * `id:<=1234`

      * inventory\_item\_id

        id

      * updated\_at

        time

    * reverse

      [Boolean](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean)

      Default:false

      Reverse the order of the underlying list.

    ***

  * is​Active

    [Boolean!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean)

    non-null

    Whether the location is active. A deactivated location can be activated (change `isActive: true`) if it has `activatable` set to `true` by calling the [`locationActivate`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/locationActivate) mutation.

  * is​Fulfillment​Service

    [Boolean!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean)

    non-null

    Whether this location is a fulfillment service.

  * legacy​Resource​Id

    [Unsigned​Int64!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/UnsignedInt64)

    non-null

    The ID of the corresponding resource in the REST Admin API.

  * local​Pickup​Settings​V2

    [Delivery​Local​Pickup​Settings](https://shopify.dev/docs/api/admin-graphql/latest/objects/DeliveryLocalPickupSettings)

    Local pickup settings for the location.

  * metafield

    [Metafield](https://shopify.dev/docs/api/admin-graphql/latest/objects/Metafield)

    A [custom field](https://shopify.dev/docs/apps/build/custom-data), including its `namespace` and `key`, that's associated with a Shopify resource for the purposes of adding and storing additional information.

    * key

      [String!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String)

      required

      ### Arguments

      The key for the metafield.

    * namespace

      [String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String)

      The container the metafield belongs to. If omitted, the app-reserved namespace will be used.

    ***

  * metafields

    [Metafield​Connection!](https://shopify.dev/docs/api/admin-graphql/latest/connections/MetafieldConnection)

    non-null

    A list of [custom fields](https://shopify.dev/docs/apps/build/custom-data) that a merchant associates with a Shopify resource.

    * after

      [String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String)

      ### Arguments

      The elements that come after the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).

    * before

      [String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String)

      The elements that come before the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).

    * first

      [Int](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Int)

      The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).

    * keys

      [\[String!\]](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String)

      List of keys of metafields in the format `namespace.key`, will be returned in the same format.

    * last

      [Int](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Int)

      The last `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).

    * namespace

      [String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String)

      The metafield namespace to filter by. If omitted, all metafields are returned.

    * reverse

      [Boolean](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean)

      Default:false

      Reverse the order of the underlying list.

    ***

  * name

    [String!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String)

    non-null

    The name of the location.

  * ships​Inventory

    [Boolean!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean)

    non-null

    Legacy field indicating this location was designated for shipping. All locations with valid addresses can now ship.

  * suggested​Addresses

    [\[Location​Suggested​Address!\]!](https://shopify.dev/docs/api/admin-graphql/latest/objects/LocationSuggestedAddress)

    non-null

    List of suggested addresses for this location (empty if none).

  * updated​At

    [Date​Time!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/DateTime)

    non-null

    The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) when the location was last updated.

  * is​Primary

    [Boolean!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean)

    non-nullDeprecated

  * metafield​Definitions

    [Metafield​Definition​Connection!](https://shopify.dev/docs/api/admin-graphql/latest/connections/MetafieldDefinitionConnection)

    non-nullDeprecated

    * after

      [String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String)

      ### Arguments

      The elements that come after the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).

    * before

      [String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String)

      The elements that come before the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).

    * first

      [Int](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Int)

      The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).

    * last

      [Int](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Int)

      The last `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).

    * namespace

      [String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String)

      Filter metafield definitions by namespace.

    * pinned​Status

      [Metafield​Definition​Pinned​Status](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldDefinitionPinnedStatus)

      Default:ANY

      Filter by the definition's pinned status.

    * query

      [String](https://shopify.dev/docs/api/admin-graphql/latest/scalars/String)

      A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about [Shopify API search syntax](https://shopify.dev/api/usage/search-syntax).

      * * default

          string

        * created\_at

          time

        * id

          id

        * key

          string

        * namespace

          string

        * owner\_type

          string

        * type

          string

        * updated\_at

          time

        - Filter by a case-insensitive search of multiple fields in a document.

        - Example:

          * `query=Bob Norman`
          * `query=title:green hoodie`

          Filter by the date and time when the metafield definition was created.

        - Example:

          * `created_at:>'2020-10-21T23:39:20Z'`
          * `created_at:<now`
          * `created_at:<=2024`

          Filter by `id` range.

        - Example:

          * `id:1234`
          * `id:>=1234`
          * `id:<=1234`

          Filter by the metafield definition [`key`](https://shopify.dev/docs/api/admin-graphql/latest/objects/MetafieldDefinition#field-key) field.

        - Example:

          * `key:some-key`

          Filter by the metafield definition [`namespace`](https://shopify.dev/docs/api/admin-graphql/latest/objects/MetafieldDefinition#field-namespace) field.

        - Example:

          * `namespace:some-namespace`

          Filter by the metafield definition [`ownerType`](https://shopify.dev/docs/api/admin-graphql/latest/objects/MetafieldDefinition#field-ownertype) field.

        - Example:

          * `owner_type:PRODUCT`

          Filter by the metafield definition [`type`](https://shopify.dev/docs/api/admin-graphql/latest/objects/MetafieldDefinition#field-type) field.

        - Example:

          * `type:single_line_text_field`

          Filter by the date and time when the metafield definition was last updated.

          Example:

          * `updated_at:>'2020-10-21T23:39:20Z'`
          * `updated_at:<now`
          * `updated_at:<=2024`

    * reverse

      [Boolean](https://shopify.dev/docs/api/admin-graphql/latest/scalars/Boolean)

      Default:false

      Reverse the order of the underlying list.

    * sort​Key

      [Metafield​Definition​Sort​Keys](https://shopify.dev/docs/api/admin-graphql/latest/enums/MetafieldDefinitionSortKeys)

      Default:ID

      Sort the underlying list using a key. If your query is slow or returns an error, then [try specifying a sort key that matches the field used in the search](https://shopify.dev/api/usage/pagination-graphql#search-performance-considerations).

    ***

***

## Examples

* ### Get a metafield attached to a location

  #### Description

  Get the metafield value identified by \`my\_fields.hours\` on a specific location.

  #### Query

  ```graphql
  query LocationMetafield($namespace: String!, $key: String!, $ownerId: ID!) {
    location(id: $ownerId) {
      hours: metafield(namespace: $namespace, key: $key) {
        value
      }
    }
  }
  ```

  #### Variables

  ```json
  {
    "namespace": "my_fields",
    "key": "hours",
    "ownerId": "gid://shopify/Location/346779380"
  }
  ```

  #### cURL

  ```bash
  curl -X POST \
  https://your-development-store.myshopify.com/admin/api/2026-10/graphql.json \
  -H 'Content-Type: application/json' \
  -H 'X-Shopify-Access-Token: {access_token}' \
  -d '{
  "query": "query LocationMetafield($namespace: String!, $key: String!, $ownerId: ID!) { location(id: $ownerId) { hours: metafield(namespace: $namespace, key: $key) { value } } }",
   "variables": {
      "namespace": "my_fields",
      "key": "hours",
      "ownerId": "gid://shopify/Location/346779380"
    }
  }'
  ```

  #### 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 LocationMetafield($namespace: String!, $key: String!, $ownerId: ID!) {
      location(id: $ownerId) {
        hours: metafield(namespace: $namespace, key: $key) {
          value
        }
      }
    }`,
    {
      variables: {
          "namespace": "my_fields",
          "key": "hours",
          "ownerId": "gid://shopify/Location/346779380"
      },
    },
    );
    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 LocationMetafield($namespace: String!, $key: String!, $ownerId: ID!) {
      location(id: $ownerId) {
        hours: metafield(namespace: $namespace, key: $key) {
          value
        }
      }
    }
  QUERY

  variables = {
    "namespace": "my_fields",
    "key": "hours",
    "ownerId": "gid://shopify/Location/346779380"
  }

  response = client.query(query: query, variables: variables)
  ```

  #### Node.js

  ```javascript
  const client = new shopify.clients.Graphql({session});
  const data = await client.query({
    data: {
      "query": `query LocationMetafield($namespace: String!, $key: String!, $ownerId: ID!) {
        location(id: $ownerId) {
          hours: metafield(namespace: $namespace, key: $key) {
            value
          }
        }
      }`,
      "variables": {
          "namespace": "my_fields",
          "key": "hours",
          "ownerId": "gid://shopify/Location/346779380"
      },
    },
  });
  ```

  #### Shopify CLI

  ```bash
  shopify app execute \
  --query \
  'query LocationMetafield($namespace: String!, $key: String!, $ownerId: ID!) {
    location(id: $ownerId) {
      hours: metafield(namespace: $namespace, key: $key) {
        value
      }
    }
  }' \
  --variables \
  '{
    "namespace": "my_fields",
    "key": "hours",
    "ownerId": "gid://shopify/Location/346779380"
  }'
  ```

  #### Direct API Access

  ```javascript
  const response = await fetch('shopify:admin/api/2026-10/graphql.json', {
    method: 'POST',
    body: JSON.stringify({
      query: `
        query LocationMetafield($namespace: String!, $key: String!, $ownerId: ID!) {
          location(id: $ownerId) {
            hours: metafield(namespace: $namespace, key: $key) {
              value
            }
          }
        }
      `,
      variables: {
          "namespace": "my_fields",
          "key": "hours",
          "ownerId": "gid://shopify/Location/346779380"
      },
    }),
  });

  const { data } = await response.json();
  console.log(data);
  ```

  #### Response

  ```json
  {
    "location": {
      "hours": {
        "value": "Open daily 9AM-5PM"
      }
    }
  }
  ```

* ### Get metafields attached to a location

  #### Description

  Get a page of metafields attached to a specific location.

  #### Query

  ```graphql
  query LocationMetafields($ownerId: ID!) {
    location(id: $ownerId) {
      metafields(first: 3) {
        edges {
          node {
            namespace
            key
            value
          }
        }
      }
    }
  }
  ```

  #### Variables

  ```json
  {
    "ownerId": "gid://shopify/Location/346779380"
  }
  ```

  #### cURL

  ```bash
  curl -X POST \
  https://your-development-store.myshopify.com/admin/api/2026-10/graphql.json \
  -H 'Content-Type: application/json' \
  -H 'X-Shopify-Access-Token: {access_token}' \
  -d '{
  "query": "query LocationMetafields($ownerId: ID!) { location(id: $ownerId) { metafields(first: 3) { edges { node { namespace key value } } } } }",
   "variables": {
      "ownerId": "gid://shopify/Location/346779380"
    }
  }'
  ```

  #### 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 LocationMetafields($ownerId: ID!) {
      location(id: $ownerId) {
        metafields(first: 3) {
          edges {
            node {
              namespace
              key
              value
            }
          }
        }
      }
    }`,
    {
      variables: {
          "ownerId": "gid://shopify/Location/346779380"
      },
    },
    );
    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 LocationMetafields($ownerId: ID!) {
      location(id: $ownerId) {
        metafields(first: 3) {
          edges {
            node {
              namespace
              key
              value
            }
          }
        }
      }
    }
  QUERY

  variables = {
    "ownerId": "gid://shopify/Location/346779380"
  }

  response = client.query(query: query, variables: variables)
  ```

  #### Node.js

  ```javascript
  const client = new shopify.clients.Graphql({session});
  const data = await client.query({
    data: {
      "query": `query LocationMetafields($ownerId: ID!) {
        location(id: $ownerId) {
          metafields(first: 3) {
            edges {
              node {
                namespace
                key
                value
              }
            }
          }
        }
      }`,
      "variables": {
          "ownerId": "gid://shopify/Location/346779380"
      },
    },
  });
  ```

  #### Shopify CLI

  ```bash
  shopify app execute \
  --query \
  'query LocationMetafields($ownerId: ID!) {
    location(id: $ownerId) {
      metafields(first: 3) {
        edges {
          node {
            namespace
            key
            value
          }
        }
      }
    }
  }' \
  --variables \
  '{
    "ownerId": "gid://shopify/Location/346779380"
  }'
  ```

  #### Direct API Access

  ```javascript
  const response = await fetch('shopify:admin/api/2026-10/graphql.json', {
    method: 'POST',
    body: JSON.stringify({
      query: `
        query LocationMetafields($ownerId: ID!) {
          location(id: $ownerId) {
            metafields(first: 3) {
              edges {
                node {
                  namespace
                  key
                  value
                }
              }
            }
          }
        }
      `,
      variables: {
          "ownerId": "gid://shopify/Location/346779380"
      },
    }),
  });

  const { data } = await response.json();
  console.log(data);
  ```

  #### Response

  ```json
  {
    "location": {
      "metafields": {
        "edges": [
          {
            "node": {
              "namespace": "my_fields",
              "key": "hours",
              "value": "Open daily 9AM-5PM"
            }
          }
        ]
      }
    }
  }
  ```

* ### Get pinned metafield definitions associated with a location

  #### Description

  Get names and types of the first page of pinned metafield definitions associated with a location.

  #### Query

  ```graphql
  query LocationMetafieldDefinitions($ownerId: ID!, $first: Int, $pinnedStatus: MetafieldDefinitionPinnedStatus, $sortKey: MetafieldDefinitionSortKeys) {
    location(id: $ownerId) {
      metafieldDefinitions(first: $first, pinnedStatus: $pinnedStatus, sortKey: $sortKey) {
        edges {
          node {
            name
            namespace
            key
            type {
              name
            }
          }
        }
      }
    }
  }
  ```

  #### Variables

  ```json
  {
    "pinnedStatus": "PINNED",
    "ownerId": "gid://shopify/Location/346779380",
    "first": 10,
    "sortKey": "PINNED_POSITION"
  }
  ```

  #### cURL

  ```bash
  curl -X POST \
  https://your-development-store.myshopify.com/admin/api/2026-10/graphql.json \
  -H 'Content-Type: application/json' \
  -H 'X-Shopify-Access-Token: {access_token}' \
  -d '{
  "query": "query LocationMetafieldDefinitions($ownerId: ID!, $first: Int, $pinnedStatus: MetafieldDefinitionPinnedStatus, $sortKey: MetafieldDefinitionSortKeys) { location(id: $ownerId) { metafieldDefinitions(first: $first, pinnedStatus: $pinnedStatus, sortKey: $sortKey) { edges { node { name namespace key type { name } } } } } }",
   "variables": {
      "pinnedStatus": "PINNED",
      "ownerId": "gid://shopify/Location/346779380",
      "first": 10,
      "sortKey": "PINNED_POSITION"
    }
  }'
  ```

  #### 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 LocationMetafieldDefinitions($ownerId: ID!, $first: Int, $pinnedStatus: MetafieldDefinitionPinnedStatus, $sortKey: MetafieldDefinitionSortKeys) {
      location(id: $ownerId) {
        metafieldDefinitions(first: $first, pinnedStatus: $pinnedStatus, sortKey: $sortKey) {
          edges {
            node {
              name
              namespace
              key
              type {
                name
              }
            }
          }
        }
      }
    }`,
    {
      variables: {
          "pinnedStatus": "PINNED",
          "ownerId": "gid://shopify/Location/346779380",
          "first": 10,
          "sortKey": "PINNED_POSITION"
      },
    },
    );
    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 LocationMetafieldDefinitions($ownerId: ID!, $first: Int, $pinnedStatus: MetafieldDefinitionPinnedStatus, $sortKey: MetafieldDefinitionSortKeys) {
      location(id: $ownerId) {
        metafieldDefinitions(first: $first, pinnedStatus: $pinnedStatus, sortKey: $sortKey) {
          edges {
            node {
              name
              namespace
              key
              type {
                name
              }
            }
          }
        }
      }
    }
  QUERY

  variables = {
    "pinnedStatus": "PINNED",
    "ownerId": "gid://shopify/Location/346779380",
    "first": 10,
    "sortKey": "PINNED_POSITION"
  }

  response = client.query(query: query, variables: variables)
  ```

  #### Node.js

  ```javascript
  const client = new shopify.clients.Graphql({session});
  const data = await client.query({
    data: {
      "query": `query LocationMetafieldDefinitions($ownerId: ID!, $first: Int, $pinnedStatus: MetafieldDefinitionPinnedStatus, $sortKey: MetafieldDefinitionSortKeys) {
        location(id: $ownerId) {
          metafieldDefinitions(first: $first, pinnedStatus: $pinnedStatus, sortKey: $sortKey) {
            edges {
              node {
                name
                namespace
                key
                type {
                  name
                }
              }
            }
          }
        }
      }`,
      "variables": {
          "pinnedStatus": "PINNED",
          "ownerId": "gid://shopify/Location/346779380",
          "first": 10,
          "sortKey": "PINNED_POSITION"
      },
    },
  });
  ```

  #### Shopify CLI

  ```bash
  shopify app execute \
  --query \
  'query LocationMetafieldDefinitions($ownerId: ID!, $first: Int, $pinnedStatus: MetafieldDefinitionPinnedStatus, $sortKey: MetafieldDefinitionSortKeys) {
    location(id: $ownerId) {
      metafieldDefinitions(first: $first, pinnedStatus: $pinnedStatus, sortKey: $sortKey) {
        edges {
          node {
            name
            namespace
            key
            type {
              name
            }
          }
        }
      }
    }
  }' \
  --variables \
  '{
    "pinnedStatus": "PINNED",
    "ownerId": "gid://shopify/Location/346779380",
    "first": 10,
    "sortKey": "PINNED_POSITION"
  }'
  ```

  #### Direct API Access

  ```javascript
  const response = await fetch('shopify:admin/api/2026-10/graphql.json', {
    method: 'POST',
    body: JSON.stringify({
      query: `
        query LocationMetafieldDefinitions($ownerId: ID!, $first: Int, $pinnedStatus: MetafieldDefinitionPinnedStatus, $sortKey: MetafieldDefinitionSortKeys) {
          location(id: $ownerId) {
            metafieldDefinitions(first: $first, pinnedStatus: $pinnedStatus, sortKey: $sortKey) {
              edges {
                node {
                  name
                  namespace
                  key
                  type {
                    name
                  }
                }
              }
            }
          }
        }
      `,
      variables: {
          "pinnedStatus": "PINNED",
          "ownerId": "gid://shopify/Location/346779380",
          "first": 10,
          "sortKey": "PINNED_POSITION"
      },
    }),
  });

  const { data } = await response.json();
  console.log(data);
  ```

  #### Response

  ```json
  {
    "location": {
      "metafieldDefinitions": {
        "edges": [
          {
            "node": {
              "name": "Additional Notes",
              "namespace": "my_fields",
              "key": "notes",
              "type": {
                "name": "single_line_text_field"
              }
            }
          },
          {
            "node": {
              "name": "Operating Since",
              "namespace": "my_fields",
              "key": "operating_since",
              "type": {
                "name": "date"
              }
            }
          }
        ]
      }
    }
  }
  ```

* ### Retrieve a list of inventory levels for a location

  #### Query

  ```graphql
  query LocationInventoryLevelList($id: ID!) {
    location(id: $id) {
      inventoryLevels(first: 10) {
        nodes {
          item {
            id
          }
          location {
            id
          }
          quantities(names: ["available"]) {
            name
            quantity
          }
        }
      }
    }
  }
  ```

  #### Variables

  ```json
  {
    "id": "gid://shopify/Location/346779380"
  }
  ```

  #### cURL

  ```bash
  curl -X POST \
  https://your-development-store.myshopify.com/admin/api/2026-10/graphql.json \
  -H 'Content-Type: application/json' \
  -H 'X-Shopify-Access-Token: {access_token}' \
  -d '{
  "query": "query LocationInventoryLevelList($id: ID!) { location(id: $id) { inventoryLevels(first: 10) { nodes { item { id } location { id } quantities(names: [\"available\"]) { name quantity } } } } }",
   "variables": {
      "id": "gid://shopify/Location/346779380"
    }
  }'
  ```

  #### 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 LocationInventoryLevelList($id: ID!) {
      location(id: $id) {
        inventoryLevels(first: 10) {
          nodes {
            item {
              id
            }
            location {
              id
            }
            quantities(names: ["available"]) {
              name
              quantity
            }
          }
        }
      }
    }`,
    {
      variables: {
          "id": "gid://shopify/Location/346779380"
      },
    },
    );
    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 LocationInventoryLevelList($id: ID!) {
      location(id: $id) {
        inventoryLevels(first: 10) {
          nodes {
            item {
              id
            }
            location {
              id
            }
            quantities(names: ["available"]) {
              name
              quantity
            }
          }
        }
      }
    }
  QUERY

  variables = {
    "id": "gid://shopify/Location/346779380"
  }

  response = client.query(query: query, variables: variables)
  ```

  #### Node.js

  ```javascript
  const client = new shopify.clients.Graphql({session});
  const data = await client.query({
    data: {
      "query": `query LocationInventoryLevelList($id: ID!) {
        location(id: $id) {
          inventoryLevels(first: 10) {
            nodes {
              item {
                id
              }
              location {
                id
              }
              quantities(names: ["available"]) {
                name
                quantity
              }
            }
          }
        }
      }`,
      "variables": {
          "id": "gid://shopify/Location/346779380"
      },
    },
  });
  ```

  #### Shopify CLI

  ```bash
  shopify app execute \
  --query \
  'query LocationInventoryLevelList($id: ID!) {
    location(id: $id) {
      inventoryLevels(first: 10) {
        nodes {
          item {
            id
          }
          location {
            id
          }
          quantities(names: ["available"]) {
            name
            quantity
          }
        }
      }
    }
  }' \
  --variables \
  '{
    "id": "gid://shopify/Location/346779380"
  }'
  ```

  #### Direct API Access

  ```javascript
  const response = await fetch('shopify:admin/api/2026-10/graphql.json', {
    method: 'POST',
    body: JSON.stringify({
      query: `
        query LocationInventoryLevelList($id: ID!) {
          location(id: $id) {
            inventoryLevels(first: 10) {
              nodes {
                item {
                  id
                }
                location {
                  id
                }
                quantities(names: ["available"]) {
                  name
                  quantity
                }
              }
            }
          }
        }
      `,
      variables: {
          "id": "gid://shopify/Location/346779380"
      },
    }),
  });

  const { data } = await response.json();
  console.log(data);
  ```

  #### Response

  ```json
  {
    "location": {
      "inventoryLevels": {
        "nodes": [
          {
            "item": {
              "id": "gid://shopify/InventoryItem/113711323"
            },
            "location": {
              "id": "gid://shopify/Location/346779380"
            },
            "quantities": [
              {
                "name": "available",
                "quantity": 8
              }
            ]
          },
          {
            "item": {
              "id": "gid://shopify/InventoryItem/30322695"
            },
            "location": {
              "id": "gid://shopify/Location/346779380"
            },
            "quantities": [
              {
                "name": "available",
                "quantity": 2
              }
            ]
          }
        ]
      }
    }
  }
  ```

* ### Retrieve a single location by its ID

  #### Query

  ```graphql
  query LocationShow($id: ID!) {
    location(id: $id) {
      id
      name
      fulfillmentService {
        handle
      }
      address {
        address1
        address2
        city
        country
        countryCode
        province
        provinceCode
        zip
      }
      fulfillsOnlineOrders
      hasActiveInventory
      isActive
    }
  }
  ```

  #### Variables

  ```json
  {
    "id": "gid://shopify/Location/346779380"
  }
  ```

  #### cURL

  ```bash
  curl -X POST \
  https://your-development-store.myshopify.com/admin/api/2026-10/graphql.json \
  -H 'Content-Type: application/json' \
  -H 'X-Shopify-Access-Token: {access_token}' \
  -d '{
  "query": "query LocationShow($id: ID!) { location(id: $id) { id name fulfillmentService { handle } address { address1 address2 city country countryCode province provinceCode zip } fulfillsOnlineOrders hasActiveInventory isActive } }",
   "variables": {
      "id": "gid://shopify/Location/346779380"
    }
  }'
  ```

  #### 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 LocationShow($id: ID!) {
      location(id: $id) {
        id
        name
        fulfillmentService {
          handle
        }
        address {
          address1
          address2
          city
          country
          countryCode
          province
          provinceCode
          zip
        }
        fulfillsOnlineOrders
        hasActiveInventory
        isActive
      }
    }`,
    {
      variables: {
          "id": "gid://shopify/Location/346779380"
      },
    },
    );
    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 LocationShow($id: ID!) {
      location(id: $id) {
        id
        name
        fulfillmentService {
          handle
        }
        address {
          address1
          address2
          city
          country
          countryCode
          province
          provinceCode
          zip
        }
        fulfillsOnlineOrders
        hasActiveInventory
        isActive
      }
    }
  QUERY

  variables = {
    "id": "gid://shopify/Location/346779380"
  }

  response = client.query(query: query, variables: variables)
  ```

  #### Node.js

  ```javascript
  const client = new shopify.clients.Graphql({session});
  const data = await client.query({
    data: {
      "query": `query LocationShow($id: ID!) {
        location(id: $id) {
          id
          name
          fulfillmentService {
            handle
          }
          address {
            address1
            address2
            city
            country
            countryCode
            province
            provinceCode
            zip
          }
          fulfillsOnlineOrders
          hasActiveInventory
          isActive
        }
      }`,
      "variables": {
          "id": "gid://shopify/Location/346779380"
      },
    },
  });
  ```

  #### Shopify CLI

  ```bash
  shopify app execute \
  --query \
  'query LocationShow($id: ID!) {
    location(id: $id) {
      id
      name
      fulfillmentService {
        handle
      }
      address {
        address1
        address2
        city
        country
        countryCode
        province
        provinceCode
        zip
      }
      fulfillsOnlineOrders
      hasActiveInventory
      isActive
    }
  }' \
  --variables \
  '{
    "id": "gid://shopify/Location/346779380"
  }'
  ```

  #### Direct API Access

  ```javascript
  const response = await fetch('shopify:admin/api/2026-10/graphql.json', {
    method: 'POST',
    body: JSON.stringify({
      query: `
        query LocationShow($id: ID!) {
          location(id: $id) {
            id
            name
            fulfillmentService {
              handle
            }
            address {
              address1
              address2
              city
              country
              countryCode
              province
              provinceCode
              zip
            }
            fulfillsOnlineOrders
            hasActiveInventory
            isActive
          }
        }
      `,
      variables: {
          "id": "gid://shopify/Location/346779380"
      },
    }),
  });

  const { data } = await response.json();
  console.log(data);
  ```

  #### Response

  ```json
  {
    "location": {
      "id": "gid://shopify/Location/346779380",
      "name": "Ottawa Store",
      "fulfillmentService": null,
      "address": {
        "address1": "126 york street",
        "address2": "second and third floor",
        "city": "ottawa",
        "country": "Canada",
        "countryCode": "CA",
        "province": "Ontario",
        "provinceCode": "ON",
        "zip": "k1n5t5"
      },
      "fulfillsOnlineOrders": true,
      "hasActiveInventory": true,
      "isActive": true
    }
  }
  ```

* ### Returns a Location resource by ID

  #### Description

  The following query retrieves the location with the associated ID. It returns the location fields specified in the query.

  #### Query

  ```graphql
  query {
    location(id: "gid://shopify/Location/346779380") {
      id
      name
      address {
        formatted
      }
      deactivatable
      fulfillsOnlineOrders
      hasActiveInventory
      isActive
      shipsInventory
    }
  }
  ```

  #### cURL

  ```bash
  curl -X POST \
  https://your-development-store.myshopify.com/admin/api/2026-10/graphql.json \
  -H 'Content-Type: application/json' \
  -H 'X-Shopify-Access-Token: {access_token}' \
  -d '{
  "query": "query { location(id: \"gid://shopify/Location/346779380\") { id name address { formatted } deactivatable fulfillsOnlineOrders hasActiveInventory isActive shipsInventory } }"
  }'
  ```

  #### 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 {
      location(id: "gid://shopify/Location/346779380") {
        id
        name
        address {
          formatted
        }
        deactivatable
        fulfillsOnlineOrders
        hasActiveInventory
        isActive
        shipsInventory
      }
    }`,
    );
    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 {
      location(id: "gid://shopify/Location/346779380") {
        id
        name
        address {
          formatted
        }
        deactivatable
        fulfillsOnlineOrders
        hasActiveInventory
        isActive
        shipsInventory
      }
    }
  QUERY

  response = client.query(query: query)
  ```

  #### Node.js

  ```javascript
  const client = new shopify.clients.Graphql({session});
  const data = await client.query({
    data: `query {
      location(id: "gid://shopify/Location/346779380") {
        id
        name
        address {
          formatted
        }
        deactivatable
        fulfillsOnlineOrders
        hasActiveInventory
        isActive
        shipsInventory
      }
    }`,
  });
  ```

  #### Shopify CLI

  ```bash
  shopify app execute \
  --query \
  'query {
    location(id: "gid://shopify/Location/346779380") {
      id
      name
      address {
        formatted
      }
      deactivatable
      fulfillsOnlineOrders
      hasActiveInventory
      isActive
      shipsInventory
    }
  }'
  ```

  #### Direct API Access

  ```javascript
  const response = await fetch('shopify:admin/api/2026-10/graphql.json', {
    method: 'POST',
    body: JSON.stringify({
      query: `
        query {
          location(id: "gid://shopify/Location/346779380") {
            id
            name
            address {
              formatted
            }
            deactivatable
            fulfillsOnlineOrders
            hasActiveInventory
            isActive
            shipsInventory
          }
        }
      `,
    }),
  });

  const { data } = await response.json();
  console.log(data);
  ```

  #### Response

  ```json
  {
    "location": {
      "id": "gid://shopify/Location/346779380",
      "name": "Ottawa Store",
      "address": {
        "formatted": [
          "126 york street",
          "second and third floor",
          "ottawa ON k1n5t5",
          "Canada"
        ]
      },
      "deactivatable": true,
      "fulfillsOnlineOrders": true,
      "hasActiveInventory": true,
      "isActive": true,
      "shipsInventory": false
    }
  }
  ```
