---
title: "Get inventory quantities"
description: >
  Get available inventory quantities for the specified inventory items at locations.
doc_type: openapi
doc_category: openapi
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-rest-api/product/inventory/get-inventory-quantities'
  md: 'https://developer.shopline.com/docs/admin-rest-api/product/inventory/get-inventory-quantities.md'
---
# Get inventory quantities

Get available inventory quantities for the specified inventory items at locations.

- **Base URL:** `https://{handle}.myshopline.com/admin/openapi`
- **Required Scopes:** `read_inventory`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** RESTful

## Endpoint

```http
GET /inventory_levels.json
```

## Base URL

* `https://{handle}.myshopline.com/admin/openapi`

  * `{handle}`: `handle` : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is `open001.myshopline.com` , the store handle is `open001` .

## Required Permissions

* `read_inventory`

## Request

### Query Parameters

* `inventory_item_ids`

  string (required)

  The unique identifiers for inventory items to query, with multiple IDs separated by commas.

* `location_ids`

  string (optional)

  The unique identifiers for locations to query, with multiple IDs separated by commas.

### Request Headers

* `Content-Type`

  string (required)

  The field must be set to the fixed value `application/json; charset=utf-8`.

* `Authorization`

  string (required)

   The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. 

## Response

### Status Codes

* `200`

  For the complete list of codes and messages, see [Http status code](https://developer.shopline.com/docs/apps/api-instructions-for-use/http-status-code.md?lang=en).

* `401`

  

* `429`

  

### Response Headers

* `traceId`

  A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise.

### Response Body

#### 200

* `inventory_levels`

  array<object>

  A list of inventory levels. Each level contains available inventory information for an inventory item at its location.

  * `available`

    long

    The available inventory quantity for the inventory item at this location.

  * `created_at`

    string

    The date and time when the inventory level was created. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).

  * `inventory_item_id`

    string

    The unique identifier for the inventory item.

  * `location_id`

    string

    The unique identifier for the location.

  * `updated_at`

    string

    The date and time when the inventory item was last updated. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).

  * `variant_id`

    string

    The unique identifier for the variant.


#### 401

* `errors`

  string

  Error message. 


#### 429

* `errors`

  string

  Error message. 


## OpenAPI Definition

```json
{
  "tags": [
    "Get inventory quantities"
  ],
  "description": "Get available inventory quantities for the specified inventory items at locations.",
  "externalDocs": {
    "description": "Permission point used by the interface is `read_inventory` , For more information about the use of permission points, see",
    "url": "ec20/3cv5d7wpfgr6a8z5/xabczf5442284vkq?lang=en",
    "errorTableDescription": "| Error Code | HTTP Status Code | Error Description |\n|------------|------------------|-------------------|\n| DATA_NOT_EXIST | 404 | The requested data does not exist. |\n| INVALID_PARAMETER | 400 | The provided parameter is invalid. |\n| SUCCESS | 200 | request success |\n| SYSTEM_ERROR | 500 | system error |\n"
  },
  "operationId": "bAkyZIRu",
  "parameters": [
    {
      "name": "inventory_item_ids",
      "in": "query",
      "description": "The unique identifiers for inventory items to query, with multiple IDs separated by commas.",
      "required": true,
      "style": "form",
      "schema": {
        "name": "inventory_item_ids",
        "description": "The unique identifiers for inventory items to query, with multiple IDs separated by commas.",
        "type": "string",
        "example": "5703943240925324252"
      },
      "example": "5703943240925324252",
      "examples": {
        "Get inventory quantities at multiple locations": {
          "value": "5703943240925324252"
        }
      },
      "explode": true
    },
    {
      "name": "location_ids",
      "in": "query",
      "description": "The unique identifiers for locations to query, with multiple IDs separated by commas.",
      "style": "form",
      "schema": {
        "name": "location_ids",
        "description": "The unique identifiers for locations to query, with multiple IDs separated by commas.",
        "type": "string",
        "example": "5421703880295066100,5421704248135526901"
      },
      "example": "5421703880295066100,5421704248135526901",
      "examples": {
        "Get inventory quantities at multiple locations": {
          "value": "5421703880295066100,5421704248135526901"
        }
      },
      "explode": true
    },
    {
      "name": "Content-Type",
      "in": "header",
      "description": "The field must be set to the fixed value `application/json; charset=utf-8`.",
      "required": true,
      "schema": {
        "name": "Content-Type",
        "type": "string",
        "example": "application/json; charset=utf-8"
      }
    },
    {
      "name": "Authorization",
      "in": "header",
      "description": " The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. ",
      "required": true,
      "style": "string",
      "schema": {
        "name": "Authorization",
        "description": " The access token for the API resource. Refer to [App authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/app-authorization.md?lang=en) to obtain the access token, and then pass the obtained token in the Bearer format. ",
        "type": "string",
        "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
      },
      "example": "Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MCwiYXBwS2V5IjoiNzU2ZjI1NWE2NjdlZTcwNTk1MzM0ZjVjYzk4NzU5MzBmN2E3NGZjMSIsImV4cCI6MTg3OTQ4MjA3NiwiaXNzIjoieXNvdWwiLCJzZWxsZXJJZCI6IjIwMDAyMzQ4ODAiLCJzdG9yZUlkIjoiMTY3MjM2OTcyOTYwNiIsInRpbWVzdGFtcCI6MTc4NDc4NzY3NjY2MSwidmVyc2lvbiI6IlYyIn0.3ZzbGAH4cLU1QR2VPEvMOQInUDvus-C4amkINSQIPuNVlXsFKj0sAt1c0KnUy9MWUOFV9cHlkf7J90r2y1FzpA"
    }
  ],
  "responses": {
    "200": {
      "description": "For the complete list of codes and messages, see [Http status code](https://developer.shopline.com/docs/apps/api-instructions-for-use/http-status-code.md?lang=en).",
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "name": "body",
            "type": "object",
            "properties": {
              "inventory_levels": {
                "name": "inventory_levels",
                "description": "A list of inventory levels. Each level contains available inventory information for an inventory item at its location.",
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "available": {
                      "name": "available",
                      "description": "The available inventory quantity for the inventory item at this location.",
                      "type": "long",
                      "example": 10
                    },
                    "created_at": {
                      "name": "created_at",
                      "description": "The date and time when the inventory level was created. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).",
                      "type": "string",
                      "example": "2022-12-06T20:23:06+08:00"
                    },
                    "inventory_item_id": {
                      "name": "inventory_item_id",
                      "description": "The unique identifier for the inventory item.",
                      "type": "string",
                      "example": "5703943240925324252"
                    },
                    "location_id": {
                      "name": "location_id",
                      "description": "The unique identifier for the location.",
                      "type": "string",
                      "example": "5421703880295066100"
                    },
                    "updated_at": {
                      "name": "updated_at",
                      "description": "The date and time when the inventory item was last updated. Format: [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html).",
                      "type": "string",
                      "example": "2022-12-06T20:25:55+08:00"
                    },
                    "variant_id": {
                      "name": "variant_id",
                      "description": "The unique identifier for the variant.",
                      "type": "string",
                      "example": "18057039432358082693350282"
                    }
                  },
                  "example": {
                    "available": 10,
                    "created_at": "2022-12-06T20:23:06+08:00",
                    "inventory_item_id": "5703943240925324252",
                    "location_id": "5421703880295066100",
                    "updated_at": "2022-12-06T20:25:55+08:00",
                    "variant_id": "18057039432358082693350282"
                  }
                }
              }
            },
            "example": {
              "inventory_levels": null
            }
          },
          "examples": {
            "Get inventory quantities at multiple locations": {
              "description": "Get available inventory quantities for item `5703943240925324252` at two locations. Pass `inventory_item_ids` and `location_ids` as query parameters. In the example response, locations `5421703880295066100` and `5421704248135526901` have available quantities of `10` and `0`, respectively.",
              "value": {
                "inventory_levels": [
                  {
                    "available": 10,
                    "created_at": "2022-12-06T20:23:06+08:00",
                    "inventory_item_id": "5703943240925324252",
                    "location_id": "5421703880295066100",
                    "updated_at": "2022-12-06T20:25:55+08:00",
                    "variant_id": "18057039432358082693350282"
                  },
                  {
                    "available": 0,
                    "created_at": "2022-12-06T20:23:06+08:00",
                    "inventory_item_id": "5703943240925324252",
                    "location_id": "5421704248135526901",
                    "updated_at": "2022-12-06T20:25:55+08:00",
                    "variant_id": "18057039432358082693350282"
                  }
                ]
              }
            }
          }
        }
      }
    },
    "401": {
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "Error message. ",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    },
    "429": {
      "headers": {
        "traceId": {
          "description": "A globally unique identifier for the request. It is used to track the request flow throughout the system, allowing for easy location and debugging when issues arise."
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "errors": {
                "description": "Error message. ",
                "type": "string"
              }
            },
            "required": [
              "errors"
            ]
          }
        }
      }
    }
  },
  "security": [
    {
      "oauth2": []
    }
  ],
  "method": "get",
  "path": "/inventory_levels.json",
  "servers": [
    {
      "url": "https://{handle}.myshopline.com/admin/openapi",
      "variables": {
        "handle": {
          "default": "openapiceshidianpu",
          "description": "`handle` : The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is `open001.myshopline.com` , the store handle is `open001` ."
        }
      }
    }
  ],
  "info": {
    "title": "Get inventory quantities",
    "version": "v20270301"
  },
  "authIndexes": [
    "read_inventory"
  ]
}
```