Skip to content

get-wishlist

Method: GET
Path: /wishlist/{user_id}

Tags: Carts

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({
  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.name, "Price:", product.price);
  });
}

TypeScript Definition

typescript
"get-wishlist": {
        parameters: {
            query?: never;
            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"]["Item"][];
                        };
                    };
                };
            };
            400: components["responses"]["BadRequest"];
            401: components["responses"]["Unauthorized"];
            404: components["responses"]["NotFound"];
        };
    };

Component References

ReferenceResolves To
components["schemas"]["Item"]Item
components["responses"]["BadRequest"]BadRequest
components["responses"]["Unauthorized"]Unauthorized
components["responses"]["NotFound"]NotFound

Parameters

  • user_id (path): user id

Responses

200

OK

400

Bad request

401

Not authorized for given operation on the Resource

404

Requested resource not found

OpenAPI Definition

json
{
  "tags": [
    "Carts"
  ],
  "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": "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/Item"
                    }
                  }
                },
                "required": [
                  "products"
                ],
                "type": "object"
              }
            }
          }
        }
      }
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    }
  },
  "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: