Skip to content

delete-from-wishlist

Method: DELETE
Path: /wishlist/{user_id}

Tags: Carts

Summary

Delete product from wishlist

Description

Remove product from wishlist

Storefront SDK Usage

SDK Method: sdk.cart.removeFromWishlist()

Example:

typescript
const { data, error } = await sdk.cart.removeFromWishlist(
  { user_id: "01H9USER12345ABCDE" },
  {
    product_id: "01F3Z7KG06J4ACWH1C4926KJEC",
    variant_id: null
  }
);

if (error) {
  console.error("Failed to remove from wishlist:", error.message);
} else {
  const products = data.products;
  console.log("Item removed from wishlist, remaining items:", products.length);
}

TypeScript Definition

typescript
"delete-from-wishlist": {
        parameters: {
            query?: never;
            header?: never;
            path: {
                /** @description user id */
                user_id: string;
            };
            cookie?: never;
        };
        requestBody: {
            content: {
                "application/json": {
                    /** @example 01F3Z7KG06J4ACWH1C4926KJEC */
                    product_id: string;
                    variant_id: string | null;
                };
            };
        };
        responses: {
            /** @description OK */
            200: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "application/json": {
                        message: string;
                        success: boolean;
                        content: {
                            products: components["schemas"]["Item"][];
                        };
                    };
                };
            };
            401: components["responses"]["Unauthorized"];
            404: components["responses"]["NotFound"];
        };
    };

Component References

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

Parameters

  • user_id (path): user id

Request Body

Content Types: application/json

Responses

200

OK

401

Not authorized for given operation on the Resource

404

Requested resource not found

OpenAPI Definition

json
{
  "tags": [
    "Carts"
  ],
  "operationId": "delete-from-wishlist",
  "summary": "Delete product from wishlist",
  "description": "Remove product from wishlist",
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/storefront/operations/delete-from-wishlist",
    "description": "API reference for the delete-from-wishlist operation"
  },
  "parameters": [
    {
      "name": "user_id",
      "in": "path",
      "description": "user id",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "description": "",
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "required": [
            "product_id",
            "variant_id"
          ],
          "properties": {
            "product_id": {
              "type": "string",
              "examples": [
                "01F3Z7KG06J4ACWH1C4926KJEC"
              ]
            },
            "variant_id": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        }
      }
    }
  },
  "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"
              }
            }
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    }
  },
  "security": [
    {
      "Authorization": []
    }
  ],
  "x-speakeasy-group": "carts",
  "x-speakeasy-ignore": true,
  "x-speakeasy-name-override": "deleteFromWishlist"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: