Skip to content

pos-list-inventory ​

Method: GET
Path: /pos/catalog/inventories

Tags: Inventory

Summary ​

List all inventories

Pos SDK Usage ​

SDK Method: pos.listInventories()

Example:

typescript
// Basic inventory listing
const { data, error } = await pos.listInventories();

if (error) {
  console.error("Failed to list inventories:", error.message);
} else {
  console.log("Inventories found:", data.inventories?.length || 0);
  data.inventories?.forEach(inventory => {
    console.log(`Product: ${inventory.product_name} - Stock: ${inventory.stock_quantity}`);
  });
}

// With pagination and filters
const { data: filteredData, error: filteredError } = await pos.listInventories({
  page: 1,
  limit: 20,
  sort_by: JSON.stringify({ "stock_quantity": "desc" }),
  filters: JSON.stringify({ "product_name": "smartphone" })
});

TypeScript Definition ​

typescript
"pos-list-inventory": {
        parameters: {
            query?: {
                /** @description Page number, starting at 1. Non-integer values and values below 1 return 400. */
                page?: components["parameters"]["pageNumber"];
                /** @description Results per page. Values outside 1–100 are clamped to that range. Non-integer input returns 400. */
                limit?: components["parameters"]["pageLimit"];
                /** @description JSON string format: {"field1":"asc", "field2":"desc"} */
                sort_by?: components["parameters"]["sortByOptions"];
                /** @description JSON object */
                filters?: components["parameters"]["columnBasedFilters"];
                product_id?: string;
                product_variant_id?: string;
                search?: string;
                /** @description List stock by item. Use warehouse to include warehouse details alongside each item; quantities remain totals across the item’s warehouses. */
                view?: "item" | "warehouse";
            };
            header?: never;
            path?: never;
            cookie?: never;
        };
        requestBody?: never;
        responses: {
            /** @description OK */
            200: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "application/json": {
                        message: string;
                        success: boolean;
                        content: {
                            inventories: components["schemas"]["ItemWiseInventory"][];
                            pagination: components["schemas"]["AdminPagination"];
                        };
                    };
                };
            };
            400: components["responses"]["AdminBadRequest"];
            401: components["responses"]["AdminUnauthorized"];
            403: components["responses"]["Forbidden"];
            404: components["responses"]["NotFound"];
            500: components["responses"]["AdminInternalServerError"];
            504: components["responses"]["GatewayTimeout"];
        };
    };

Component References ​

ReferenceResolves To
components["parameters"]["pageNumber"]pageNumber
components["parameters"]["pageLimit"]pageLimit
components["parameters"]["sortByOptions"]sortByOptions
components["parameters"]["columnBasedFilters"]columnBasedFilters
components["schemas"]["ItemWiseInventory"]ItemWiseInventory
components["schemas"]["AdminPagination"]AdminPagination
components["responses"]["AdminBadRequest"]AdminBadRequest
components["responses"]["AdminUnauthorized"]AdminUnauthorized
components["responses"]["Forbidden"]Forbidden
components["responses"]["NotFound"]NotFound
components["responses"]["AdminInternalServerError"]AdminInternalServerError
components["responses"]["GatewayTimeout"]GatewayTimeout

Parameters ​

  • product_id (query): No description
  • product_variant_id (query): No description
  • search (query): No description
  • view (query): List stock by item. Use warehouse to include warehouse details alongside each item; quantities remain totals across the item’s warehouses.

Responses ​

200 ​

OK

400 ​

401 ​

403 ​

Access denied. token-required requires an authenticated session; permission-denied means the caller cannot access this resource. On POS, session-expired requires signing in again.

404 ​

Requested resource not found

500 ​

504 ​

The request timed out.

OpenAPI Definition ​

json
{
  "operationId": "pos-list-inventory",
  "summary": "List all inventories",
  "parameters": [
    {
      "$ref": "#/components/parameters/pageNumber"
    },
    {
      "$ref": "#/components/parameters/pageLimit"
    },
    {
      "$ref": "#/components/parameters/sortByOptions"
    },
    {
      "$ref": "#/components/parameters/columnBasedFilters"
    },
    {
      "name": "product_id",
      "in": "query",
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "product_variant_id",
      "in": "query",
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "search",
      "in": "query",
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "view",
      "in": "query",
      "description": "List stock by item. Use warehouse to include warehouse details alongside each item; quantities remain totals across the item’s warehouses.",
      "schema": {
        "type": "string",
        "enum": [
          "item",
          "warehouse"
        ]
      }
    }
  ],
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "content": {
                "properties": {
                  "inventories": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/ItemWiseInventory"
                    }
                  },
                  "pagination": {
                    "$ref": "#/components/schemas/AdminPagination"
                  }
                },
                "required": [
                  "inventories",
                  "pagination"
                ],
                "type": "object"
              }
            },
            "required": [
              "message",
              "success",
              "content"
            ]
          }
        }
      }
    },
    "400": {
      "$ref": "#/components/responses/AdminBadRequest"
    },
    "401": {
      "$ref": "#/components/responses/AdminUnauthorized"
    },
    "403": {
      "$ref": "#/components/responses/Forbidden"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "500": {
      "$ref": "#/components/responses/AdminInternalServerError"
    },
    "504": {
      "$ref": "#/components/responses/GatewayTimeout"
    }
  },
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/admin-pos/operations/pos-list-inventory"
  },
  "security": [
    {
      "Authorization": []
    }
  ],
  "tags": [
    "Inventory"
  ],
  "x-speakeasy-group": "pos"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: