Skip to content

delete-from-wishlist ​

Method: DELETE
Path: /wishlist/{user_id}

Tags: Wishlist

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({
  product_id: "01F3Z7KG06J4ACWH1C4926KJEC",
  variant_id: null,
});

// You can still pass an explicit user_id when needed
const { data: asUser } = 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?: {
                /** @description A ULID you propose as the `event_id` of the first entry this request returns in `events`. Used only when it is a valid ULID minted within a day of now and not already used; otherwise the server mints one. The `event_id` returned in `events` is the one to send. */
                "X-CE-Event-ID"?: components["parameters"]["ProposedEventId"];
            };
            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"]["WishlistItem"][];
                        };
                        /** @description Analytics events to emit for the change this request made, each with a server-issued `event_id`. Replay them to your analytics destinations so your client-side and server-side copies of the same action dedupe. Empty when the request produced no analytics event. */
                        events: components["schemas"]["StorefrontResponseEvent"][];
                    };
                };
            };
            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["parameters"]["ProposedEventId"]ProposedEventId
components["schemas"]["WishlistItem"]WishlistItem
components["schemas"]["StorefrontResponseEvent"]StorefrontResponseEvent
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 ​

  • X-CE-Event-ID (header): A ULID you propose as the event_id of the first entry this request returns in events. Used only when it is a valid ULID minted within a day of now and not already used; otherwise the server mints one. The event_id returned in events is the one to send.
  • user_id (path): user id

Request Body ​

Content Types: application/json

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": "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": [
    {
      "$ref": "#/components/parameters/ProposedEventId"
    },
    {
      "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",
              "events"
            ],
            "properties": {
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "content": {
                "properties": {
                  "products": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/WishlistItem"
                    }
                  }
                },
                "required": [
                  "products"
                ],
                "type": "object"
              },
              "events": {
                "description": "Analytics events to emit for the change this request made, each with a server-issued `event_id`. Replay them to your analytics destinations so your client-side and server-side copies of the same action dedupe. Empty when the request produced no analytics event.",
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/StorefrontResponseEvent"
                }
              }
            }
          }
        }
      }
    },
    "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": "deleteFromWishlist"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: