Skip to content

list-upsell-products ​

Method: GET
Path: /catalog/products/up-sell

Tags: Products

Summary ​

Retrieve up-sell products

Description ​

Retrieves the up-sell products of the products in product_id, or the store's up-sell products without it. Returns only products the customer can add to the cart now: active, in stock, priced and on the customer's sales channel. A product with variants appears only as one of its variants. Only products available on this sales channel are returned.

Storefront SDK Usage ​

SDK Method: sdk.catalog.listUpSellProducts()

Example:

typescript
// Basic usage - get up-sell products for cart items
const { data, error } = await sdk.catalog.listUpSellProducts({
  product_id: ["prod_01H9XYZ12345ABCDE"]
});

// Advanced usage with pagination
const { data, error } = await sdk.catalog.listUpSellProducts({
  product_id: ["prod_01H9XYZ12345ABCDE"],
  page: 1,
  limit: 15
});

// Override customer group ID for this specific request
const { data, error } = await sdk.catalog.listUpSellProducts(
  {
    product_id: ["prod_01H9XYZ12345ABCDE"],
    page: 1,
    limit: 15
  },
  {
    "x-customer-group-id": "01H9XYZ12345USERID" // Override default SDK config
  }
);

if (error) {
  console.error("Failed to get up-sell products:", error.message);
} else {
  console.log("Up-sell products found:", data.products.length);
  console.log("Pagination:", data.pagination);

  data.products.forEach(product => {
    console.log(`Up-sell: ${product.product_name} - ${product.pricing?.selling_price}`);
  });
}

TypeScript Definition ​

typescript
"list-upsell-products": {
        parameters: {
            query?: {
                /** @description Results per page. Values outside 1–100 are clamped to that range. Non-integer input returns 400. */
                limit?: number;
                /** @description Page number, starting at 1. Non-integer values and values below 1 return 400. */
                page?: number;
                /** @description Product ids of cart items */
                product_id?: 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": {
                        /** @description Message */
                        message: string;
                        success: boolean;
                        content: {
                            products: components["schemas"]["CatalogListItem"][];
                            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"]["CustomerGroupId"]CustomerGroupId
components["schemas"]["CatalogListItem"]CatalogListItem
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 ​

  • 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.
  • limit (query): Results per page. Values outside 1–100 are clamped to that range. Non-integer input returns 400.
  • page (query): Page number, starting at 1. Non-integer values and values below 1 return 400.
  • product_id (query): Product ids of cart items

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
{
  "tags": [
    "Products"
  ],
  "operationId": "list-upsell-products",
  "summary": "Retrieve up-sell products",
  "description": "Retrieves the up-sell products of the products in `product_id`, or the store's up-sell products without it. Returns only products the customer can add to the cart now: active, in stock, priced and on the customer's sales channel. A product with variants appears only as one of its variants. Only products available on this sales channel are returned.",
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/storefront/operations/list-upsell-products",
    "description": "API reference for the list-upsell-products operation"
  },
  "parameters": [
    {
      "$ref": "#/components/parameters/CustomerGroupId"
    },
    {
      "name": "limit",
      "in": "query",
      "description": "Results per page. Values outside 1–100 are clamped to that range. Non-integer input returns 400.",
      "schema": {
        "type": "integer",
        "maximum": 100,
        "minimum": 1
      }
    },
    {
      "name": "page",
      "in": "query",
      "description": "Page number, starting at 1. Non-integer values and values below 1 return 400.",
      "schema": {
        "type": "integer",
        "minimum": 1
      }
    },
    {
      "name": "product_id",
      "in": "query",
      "description": "Product ids of cart items",
      "schema": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "explode": false,
      "style": "form"
    }
  ],
  "responses": {
    "200": {
      "description": "Success response",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "message",
              "success",
              "content"
            ],
            "properties": {
              "message": {
                "description": "Message",
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "content": {
                "properties": {
                  "products": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/CatalogListItem"
                    }
                  },
                  "pagination": {
                    "$ref": "#/components/schemas/Pagination"
                  }
                },
                "required": [
                  "products",
                  "pagination"
                ],
                "type": "object"
              }
            }
          }
        }
      },
      "links": {
        "AddItemToCart": {
          "operationId": "update-cart",
          "requestBody": {
            "product_id": "$response.body#/content/products/0/product_id",
            "variant_id": "$response.body#/content/products/0/variant_id"
          },
          "description": "Add an up-sell product to a cart."
        }
      }
    },
    "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"
    }
  },
  "security": [
    {
      "Authorization": []
    },
    {
      "X-Api-Key": []
    }
  ],
  "x-speakeasy-group": "catalog",
  "x-speakeasy-ignore": false,
  "x-speakeasy-name-override": "listUpsellProducts"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: