get https://{shopdomain}.myshoplaza.com/openapi/2022-01/products//inventory
Requires
read_inventoryaccess scope. More access scope
The List Product Inventory API retrieves the inventory details of a product by its unique identifier (product_id). This includes stock levels for different locations, helping businesses manage inventory efficiently.This API is especially useful for:
- Fetching stock levels of a product across various locations.
- Managing inventory levels for specific products.
- Supporting decision-making in restocking and inventory transfers.
Request Parameters
Public Request Parameters
Path Parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| product_id | string | Yes | a1b2c3d4-e5f6-7g8h | Unique identifier of the product. |
| location_id | No | 327627904831724000 | Unique identifier of the location to filter inventory details (optional). |
Response Explanation
Public Response Parameters
Success Response
| Field | Type | Example | Description |
|---|---|---|---|
| product_id | string | f854e9a2-986d-4e2b-9df0-8e4c139ae80e | Unique identifier of the product. |
| variants | array | List of variant objects containing inventory details. | |
| variants.variant_id | string | 5723299f-238a-4491-8b42-a187462e748a | Unique identifier of the product variant. |
| variants.location_items | array | Inventory details for each location. | |
| variants.location_items. location_id | uint64 | 327627904831724000 | Unique identifier of the location. |
| variants. location_items. stock | integer | 1 | Current stock quantity at the location. |
Error Response
Error responses in the API can be represented using two different fields: errors and error. Both fields provide details about issues encountered during request processing. Below is an explanation of the fields with their respective examples and descriptions.
| Field | Type | Example | Description |
|---|---|---|---|
errors | Array | [ "collect_id has an invalid UUID"] | A list of errors encountered during the request processing. |
| Field | Type | Example | Description |
|---|---|---|---|
error | Array | "invalid UUID length: 10" | Indicates an error encountered during the process. |
Error Details
| Status Code | Message | Possible Reason | Example Response |
|---|---|---|---|
| 400 | Bad Request | Invalid input format or request structure (e.g., missing required fields or incorrect data types). | Bad Request |
| Unauthorized | The request is missing valid authentication credentials or the credentials provided are invalid. | Unauthorized | |
| 500 | Invalid product_id | product_id with incorrect UUID types | { "errors": [ "invalid UUID length: 10"]} |
