Skip to content

pos-list-products ​

Method: GET
Path: /pos/catalog/products

Tags: Products

Summary ​

List all products

Description ​

Returns a paginated list of Product objects sorted by creation date (newest first). Pass x-customer-group-id header to retrieve group-specific pricing.

Pos SDK Usage ​

SDK Method: pos.listProducts()

Example:

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

if (error) {
  console.error("Failed to list products:", error.message);
} else {
  console.log("Products found:", data.products?.length || 0);
  console.log("Pagination:", data.pagination);
  data.products?.forEach(product => {
    console.log(`Product: ${product.name} - $${product.pricing?.selling_price}`);
  });
}

// With filtering and pagination
const { data: filteredData, error: filteredError } = await pos.listProducts({
  page: 1,
  limit: 20,
  sort_by: JSON.stringify({ "created_at": "desc" }),
  category_slug: ["electronics", "smartphones"]
});

// Override customer group ID for this specific request
const { data: overrideData, error: overrideError } = await pos.listProducts(
  {
    page: 1,
    limit: 20,
    sort_by: JSON.stringify({ "created_at": "desc" }),
    category_slug: ["electronics", "smartphones"]
  },
  {
    "x-customer-group-id": "01H9XYZ12345USERID" // Override default SDK config
  }
);

TypeScript Definition ​

typescript
"pos-list-products": {
        parameters: {
            query?: {
                /** @description Page number, starting at 1. Non-integer values and values below 1 return 400. */
                page?: components["parameters"]["pageParam"];
                /** @description Results per page. Values outside 1–100 are clamped to that range. Non-integer input returns 400. */
                limit?: components["parameters"]["pageLimitParam"];
                /** @description Filter by the product active flag. */
                active?: boolean;
                /** @description Filter by attribute IDs. */
                attribute_id?: string[];
                /** @description filter products by categories ids */
                category_id?: string[];
                /** @description filter products by categories slugs */
                category_slug?: string[];
                /** @description Filter products by the customer group assigned to their pricing. Use x-customer-group-id to select the prices returned. */
                customer_group_id?: string;
                /** @description Filter by product IDs. */
                product_id?: string[];
                /** @description Filter by product type. */
                product_type?: ("physical" | "digital" | "bundle")[];
                /** @description Sort by product fields such as `name`, `created_at`, `modified_at`, `reviews_count` or `reviews_rating_sum`, using a JSON object of field names and `asc` or `desc` values. */
                sort_by?: string;
                /** @description Filter by an exact product ID. */
                ulid?: string;
            };
            header?: {
                /** @description This param is used to determine product pricing, promotions, and subscription rates.  If a valid customer group id is provided, pricing details will be retrieved accordingly.  If no matching data is found for the specified customer group id, the system will fall back to the default customer group id.  If no data is found for the default group either, the highest applicable price will be returned. */
                "x-customer-group-id"?: components["parameters"]["CustomerGroupId"];
            };
            path?: never;
            cookie?: never;
        };
        requestBody?: never;
        responses: {
            /** @description Success response */
            200: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "application/json": {
                        /** @example Products retrieved successfully. */
                        message: string;
                        success: boolean;
                        content: {
                            products: components["schemas"]["Product"][];
                            pagination: components["schemas"]["Pagination"];
                        };
                    };
                };
            };
            /** @description The request parameters or customer group are invalid. */
            400: components["responses"]["BadRequest"];
            401: components["responses"]["Unauthorized"];
            403: components["responses"]["Forbidden"];
            500: components["responses"]["InternalServerError"];
            504: components["responses"]["GatewayTimeout"];
        };
    };

Component References ​

ReferenceResolves To
components["parameters"]["pageParam"]pageParam
components["parameters"]["pageLimitParam"]pageLimitParam
components["parameters"]["CustomerGroupId"]CustomerGroupId
components["schemas"]["Product"]Product
components["schemas"]["Pagination"]Pagination
components["responses"]["BadRequest"]BadRequest
components["responses"]["Unauthorized"]Unauthorized
components["responses"]["Forbidden"]Forbidden
components["responses"]["InternalServerError"]InternalServerError
components["responses"]["GatewayTimeout"]GatewayTimeout

Parameters ​

  • page (query): Page number, starting at 1. Non-integer values and values below 1 return 400.
  • limit (query): Results per page. Values outside 1–100 are clamped to that range. Non-integer input returns 400.
  • x-customer-group-id (header): This param is used to determine product pricing, promotions, and subscription rates. If a valid customer group id is provided, pricing details will be retrieved accordingly. If no matching data is found for the specified customer group id, the system will fall back to the default customer group id. If no data is found for the default group either, the highest applicable price will be returned.
  • active (query): Filter by the product active flag.
  • attribute_id (query): Filter by attribute IDs.
  • category_id (query): filter products by categories ids
  • category_slug (query): filter products by categories slugs
  • customer_group_id (query): Filter products by the customer group assigned to their pricing. Use x-customer-group-id to select the prices returned.
  • product_id (query): Filter by product IDs.
  • product_type (query): Filter by product type.
  • sort_by (query): Sort by product fields such as name, created_at, modified_at, reviews_count or reviews_rating_sum, using a JSON object of field names and asc or desc values.
  • ulid (query): Filter by an exact product ID.

Responses ​

200 ​

Success response

400 ​

Bad request

401 ​

Authentication failed. Codes include token-required, token-expired and token_not_valid for an invalid or expired token.

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.

500 ​

The request failed because of an unexpected error.

504 ​

The request timed out.

OpenAPI Definition ​

json
{
  "operationId": "pos-list-products",
  "summary": "List all products",
  "description": "Returns a paginated list of `Product` objects sorted by creation date (newest first). Pass `x-customer-group-id` header to retrieve group-specific pricing.",
  "parameters": [
    {
      "$ref": "#/components/parameters/pageParam"
    },
    {
      "$ref": "#/components/parameters/pageLimitParam"
    },
    {
      "$ref": "#/components/parameters/CustomerGroupId"
    },
    {
      "name": "active",
      "in": "query",
      "description": "Filter by the product active flag.",
      "required": false,
      "schema": {
        "type": "boolean"
      }
    },
    {
      "name": "attribute_id",
      "in": "query",
      "description": "Filter by attribute IDs.",
      "required": false,
      "schema": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "explode": false,
      "style": "form"
    },
    {
      "name": "category_id",
      "in": "query",
      "description": "filter products by categories ids",
      "schema": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "explode": false,
      "style": "form"
    },
    {
      "name": "category_slug",
      "in": "query",
      "description": "filter products by categories slugs",
      "schema": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "explode": false,
      "style": "form"
    },
    {
      "name": "customer_group_id",
      "in": "query",
      "description": "Filter products by the customer group assigned to their pricing. Use x-customer-group-id to select the prices returned.",
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "product_id",
      "in": "query",
      "description": "Filter by product IDs.",
      "required": false,
      "schema": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "explode": false,
      "style": "form"
    },
    {
      "name": "product_type",
      "in": "query",
      "description": "Filter by product type.",
      "schema": {
        "type": "array",
        "items": {
          "type": "string",
          "enum": [
            "physical",
            "digital",
            "bundle"
          ]
        }
      },
      "explode": false,
      "style": "form"
    },
    {
      "name": "sort_by",
      "in": "query",
      "description": "Sort by product fields such as `name`, `created_at`, `modified_at`, `reviews_count` or `reviews_rating_sum`, using a JSON object of field names and `asc` or `desc` values.",
      "required": false,
      "schema": {
        "type": "string",
        "examples": [
          "{\"name\":\"asc\"}"
        ]
      }
    },
    {
      "name": "ulid",
      "in": "query",
      "description": "Filter by an exact product ID.",
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Success response",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string",
                "examples": [
                  "Products retrieved successfully."
                ]
              },
              "success": {
                "type": "boolean"
              },
              "content": {
                "properties": {
                  "products": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/Product"
                    }
                  },
                  "pagination": {
                    "$ref": "#/components/schemas/Pagination"
                  }
                },
                "required": [
                  "products",
                  "pagination"
                ],
                "type": "object"
              }
            },
            "required": [
              "message",
              "success",
              "content"
            ]
          }
        }
      },
      "links": {
        "GetProductDetail": {
          "operationId": "pos-get-product-detail",
          "description": "Retrieve full details for a product. Use `id` or `slug` from a `Product` as the `product_id` path parameter (product slug is supported in place of product ID)."
        }
      }
    },
    "400": {
      "description": "The request parameters or customer group are invalid.",
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/Forbidden"
    },
    "500": {
      "$ref": "#/components/responses/InternalServerError"
    },
    "504": {
      "$ref": "#/components/responses/GatewayTimeout"
    }
  },
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/admin-pos/operations/pos-list-products"
  },
  "security": [
    {
      "Authorization": []
    }
  ],
  "tags": [
    "Products"
  ],
  "x-speakeasy-group": "pos",
  "x-speakeasy-name-override": "listProducts"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: