> ## Documentation Index
> Fetch the complete documentation index at: https://docs.salesive.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Add item to wishlist

> Add a product, food, or service item to the authenticated shopper's wishlist.

## Request

```http theme={null}
POST /wishlist
Authorization: Bearer {{token}}
x-shop-id: {{shopId}}
Content-Type: application/json

{
  "productId": "69fb494e51280f9f65d059ae"
}
```

## Headers

| Header          | Type   | Description                                   |
| --------------- | ------ | --------------------------------------------- |
| `Authorization` | string | Provide the customer token as `Bearer <jwt>`. |
| `x-shop-id`     | string | Identify the shop that owns the wishlist.     |
| `Content-Type`  | string | Always set to `application/json`.             |

## Body parameters

| Field       | Type   | Required | Description                                                                                   |
| ----------- | ------ | -------- | --------------------------------------------------------------------------------------------- |
| `productId` | string | No       | Product identifier (ecommerce). Provide exactly one of `productId`, `foodId`, or `serviceId`. |
| `foodId`    | string | No       | Food item identifier (restaurant stores).                                                     |
| `serviceId` | string | No       | Service identifier (business stores).                                                         |
| `variantId` | string | No       | Variant identifier. Only valid for product wishlist items.                                    |

<Note>
  Wishlist items are typed: a product item returns a populated `product`, a food item returns `food` (with a `foodId` field), and a service item returns `service` (with a `serviceId` field).
</Note>

## Successful response

```json theme={null}
{
    "status": 200,
    "success": true,
    "message": "Item added to wishlist",
    "data": {
        "_id": "693c048b5b24f53cda947ddb",
        "user": "69360693a7a8f7dc8ae32d6d",
        "shop": "68b8f52575da81b332af29f1",
        "items": [
            {
                "product": {
                    "_id": "69fb494e51280f9f65d059ae",
                    "images": [
                        "https://cdn.salesive.com/products/wristwatch.webp"
                    ],
                    "name": "Wristwatch",
                    "price": 45000,
                    "promoPrice": null,
                    "formattedPrice": "45000.00",
                    "promoActive": false,
                    "formattedPromoPrice": null,
                    "isAvailable": true,
                    "lowestPrice": 45000,
                    "highestPrice": 45000,
                    "image": "https://cdn.salesive.com/products/wristwatch.webp",
                    "plainDescription": "High quality and affordable wristwatch",
                    "id": "69fb494e51280f9f65d059ae"
                },
                "addedAt": "2026-06-09T09:10:33.816Z"
            }
        ],
        "createdAt": "2025-12-12T12:03:23.104Z",
        "updatedAt": "2026-06-09T09:10:33.818Z",
        "__v": 3,
        "id": "693c048b5b24f53cda947ddb"
    }
}
```

## Error response

```json theme={null}
{
    "status": 404,
    "success": false,
    "message": "Product not found",
    "data": {}
}
```


## OpenAPI

````yaml POST /wishlist
openapi: 3.1.0
info:
  title: Salesive Store API
  description: >-
    REST interface for querying products, categories, and merchandising banners
    exposed by Salesive storefronts.
  version: 1.0.0
servers:
  - description: Production
    url: https://store.salesive.com/api/v1
security:
  - BearerAuth: []
    ShopIdHeader: []
paths:
  /wishlist:
    post:
      summary: Add item to wishlist
      description: Add a product or variant to the authenticated shopper's wishlist.
      parameters:
        - $ref: '#/components/parameters/XShopIdHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddWishlistItemRequest'
      responses:
        '200':
          description: Item added to wishlist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WishlistResponse'
        '401':
          description: Unauthorized.
        '404':
          description: Product not found.
components:
  parameters:
    XShopIdHeader:
      name: x-shop-id
      in: header
      description: >-
        Optional identifier that scopes responses to a specific storefront when
        the referer cannot be inferred.
      required: false
      schema:
        type: string
  schemas:
    AddWishlistItemRequest:
      type: object
      description: >-
        Add a product, food, or service item to the wishlist. Provide exactly
        one of productId, foodId, or serviceId.
      properties:
        productId:
          type: string
          description: Product identifier to add to wishlist (ecommerce stores).
        foodId:
          type: string
          description: Food item identifier to add to wishlist (restaurant stores).
        serviceId:
          type: string
          description: Service identifier to add to wishlist (business stores).
        variantId:
          type: string
          description: Optional variant identifier (product wishlist items only).
      anyOf:
        - required:
            - productId
        - required:
            - foodId
        - required:
            - serviceId
    WishlistResponse:
      type: object
      required:
        - status
        - success
        - message
        - data
      properties:
        status:
          type: integer
        success:
          type: boolean
        message:
          type: string
        data:
          $ref: '#/components/schemas/Wishlist'
    Wishlist:
      type: object
      required:
        - _id
        - user
        - shop
        - items
      properties:
        _id:
          type: string
          description: Wishlist identifier.
        user:
          type: string
          description: Identifier of the shopper who owns the wishlist.
        shop:
          type: string
          description: Identifier of the shop associated with the wishlist.
        items:
          type: array
          items:
            $ref: '#/components/schemas/WishlistItem'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    WishlistItem:
      type: object
      required:
        - product
        - addedAt
      properties:
        product:
          type: object
          description: Product or variant metadata.
          properties:
            _id:
              type: string
            name:
              type: string
            price:
              type: number
            images:
              type: array
              items:
                type: string
                format: uri
            formattedPrice:
              type: string
            sku:
              type: string
        variant:
          type: string
          description: Variant identifier if applicable.
        variantAttributes:
          type: object
          additionalProperties:
            type: string
        addedAt:
          type: string
          format: date-time
          description: Timestamp when item was added to wishlist.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT issued by the Salesive Store API for authenticated shoppers.
    ShopIdHeader:
      type: apiKey
      in: header
      name: x-shop-id
      description: >-
        Optional storefront identifier sent as a header to scope responses to a
        specific shop. Try It requests remember this value once provided.

````