Skip to content

get-wishlist ​

Method: GET
Path: /wishlist/{user_id}

Tags: Wishlist

Summary ​

Retrieve wishlist

Description ​

Retrieve products in wishlist

Storefront SDK Usage ​

SDK Method: sdk.cart.getWishlist()

Example:

typescript
const { data, error } = await sdk.cart.getWishlist();

// With query parameters
const { data: filtered } = await sdk.cart.getWishlist({
  seller_id: ["seller_123"],
});

// You can still pass an explicit user_id when needed
const { data: asUser } = await sdk.cart.getWishlist({
  user_id: "01H9USER12345ABCDE",
});

if (error) {
  console.error("Failed to get wishlist:", error.message);
} else {
  const products = data.products;
  console.log("Wishlist items:", products.length);
  products.forEach(product => {
    console.log("Product:", product.product_name, "Price:", product.pricing?.selling_price);
  });
}

TypeScript Definition ​

typescript
"get-wishlist": {
        parameters: {
            query?: {
                /** @description Seller ID. If not provided, all products will be returned. To be used for multi-seller marketplace stores only. */
                seller_id?: string[];
            };
            header?: never;
            path: {
                /** @description user id */
                user_id: string;
            };
            cookie?: never;
        };
        requestBody?: never;
        responses: {
            /** @description OK */
            200: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "application/json": {
                        message: string;
                        success: boolean;
                        content: {
                            products: components["schemas"]["WishlistItem"][];
                        };
                    };
                };
            };
            400: components["responses"]["BadRequest"];
            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["schemas"]["WishlistItem"]WishlistItem
components["responses"]["BadRequest"]BadRequest
components["responses"]["Unauthorized"]Unauthorized
components["responses"]["Forbidden"]Forbidden
components["responses"]["NotFound"]NotFound
components["responses"]["InternalServerError"]InternalServerError
components["responses"]["GatewayTimeout"]GatewayTimeout

Parameters ​

  • seller_id (query): Seller ID. If not provided, all products will be returned. To be used for multi-seller marketplace stores only.
  • user_id (path): user id

Responses ​

200 ​

OK

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.

404 ​

Requested resource not found

500 ​

The request failed because of an unexpected error.

504 ​

The request timed out.

OpenAPI Definition ​

json
{
  "tags": [
    "Wishlist"
  ],
  "operationId": "get-wishlist",
  "summary": "Retrieve wishlist",
  "description": "Retrieve products in wishlist",
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/storefront/operations/get-wishlist",
    "description": "API reference for the get-wishlist operation"
  },
  "parameters": [
    {
      "name": "seller_id",
      "in": "query",
      "description": "Seller ID. If not provided, all products will be returned. To be used for multi-seller marketplace stores only.",
      "required": false,
      "schema": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "explode": false,
      "style": "form"
    },
    {
      "name": "user_id",
      "in": "path",
      "description": "user id",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "message",
              "success",
              "content"
            ],
            "properties": {
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "content": {
                "properties": {
                  "products": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/WishlistItem"
                    }
                  }
                },
                "required": [
                  "products"
                ],
                "type": "object"
              }
            }
          }
        }
      }
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "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": "carts",
  "x-speakeasy-ignore": true,
  "x-speakeasy-name-override": "getWishlist"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: