Skip to content

list-marketplace-product-variants ​

Method: GET
Path: /catalog/marketplace/products/{product_id}/variants

Tags: Marketplace catalog

Summary ​

Retrieve product variants

Description ​

Retrieves the variants of an existing marketplace product. Product slug is supported in place of product ID in the path. Commerce Engine returns the corresponding product variants information.

Storefront SDK Usage ​

SDK Method: sdk.catalog.listMarketplaceProductVariants()

Example:

typescript
const { data, error } = await sdk.catalog.listMarketplaceProductVariants({"product_id": "product-id-123"}, {}, {});

TypeScript Definition ​

typescript
"list-marketplace-product-variants": {
        parameters: {
            query?: {
                /** @description Determines whether to include or exlude inventory details in response json */
                inventory?: boolean;
                /** @description Use `aggregated` for inventory totals instead of lot/batch entries. */
                inventory_format?: 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: {
                /** @description Product ID or product slug. Either is accepted in the path. */
                product_id: string;
            };
            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: {
                            variants: components["schemas"]["MarketplaceVariantWithShipping"][];
                        };
                    };
                };
            };
            401: components["responses"]["Unauthorized"];
            403: components["responses"]["Forbidden"];
            404: components["responses"]["NotFound"];
            500: components["responses"]["InternalServerError"];
            504: components["responses"]["GatewayTimeout"];
        };
    };

Component References ​

ReferenceResolves To
components["parameters"]["CustomerGroupId"]CustomerGroupId
components["schemas"]["MarketplaceVariantWithShipping"]MarketplaceVariantWithShipping
components["responses"]["Unauthorized"]Unauthorized
components["responses"]["Forbidden"]Forbidden
components["responses"]["NotFound"]NotFound
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.
  • inventory (query): Determines whether to include or exlude inventory details in response json
  • inventory_format (query): Use aggregated for inventory totals instead of lot/batch entries.
  • product_id (path): Product ID or product slug. Either is accepted in the path.

Responses ​

200 ​

Success response

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.

404 ​

Requested resource not found

500 ​

The request failed because of an unexpected error.

504 ​

The request timed out.

OpenAPI Definition ​

json
{
  "tags": [
    "Marketplace catalog"
  ],
  "operationId": "list-marketplace-product-variants",
  "summary": "Retrieve product variants",
  "description": "Retrieves the variants of an existing marketplace product. Product slug is supported in place of product ID in the path. Commerce Engine returns the corresponding product variants information.",
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/storefront/operations/list-marketplace-product-variants",
    "description": "API reference for the list-marketplace-product-variants operation"
  },
  "parameters": [
    {
      "$ref": "#/components/parameters/CustomerGroupId"
    },
    {
      "name": "inventory",
      "in": "query",
      "description": "Determines whether to include or exlude inventory details in response json",
      "schema": {
        "type": "boolean"
      }
    },
    {
      "name": "inventory_format",
      "in": "query",
      "description": "Use `aggregated` for inventory totals instead of lot/batch entries.",
      "schema": {
        "type": "string",
        "examples": [
          "aggregated"
        ]
      }
    },
    {
      "name": "product_id",
      "in": "path",
      "description": "Product ID or product slug. Either is accepted in the path.",
      "required": true,
      "schema": {
        "type": "string",
        "examples": [
          "01H7YK0C86V9PGT0HXRJVEZXJQ",
          "detox-candy"
        ]
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Success response",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "message",
              "success",
              "content"
            ],
            "properties": {
              "message": {
                "type": "string",
                "examples": [
                  "Products retrieved successfully."
                ]
              },
              "success": {
                "type": "boolean"
              },
              "content": {
                "properties": {
                  "variants": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/MarketplaceVariantWithShipping"
                    }
                  }
                },
                "required": [
                  "variants"
                ],
                "type": "object"
              }
            }
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/Forbidden"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "500": {
      "$ref": "#/components/responses/InternalServerError"
    },
    "504": {
      "$ref": "#/components/responses/GatewayTimeout"
    }
  },
  "security": [
    {
      "Authorization": []
    }
  ],
  "x-speakeasy-group": "marketplace",
  "x-speakeasy-ignore": false,
  "x-speakeasy-name-override": "listProductVariants"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: