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

# Update a Wishlist

> Updates the specific Wishlist by setting the values passed in the request body. Any parameters not provided will be left unchanged.



## OpenAPI

````yaml /api-reference/storefront.yaml patch /api/v2/storefront/wishlists/{token}
openapi: 3.0.3
info:
  version: 2.0.0
  title: Storefront API
  description: >-
    Storefront API is a modern REST API based on the [JSON API
    spec](https://jsonapi.org/) which provides you with all the necessary
    endpoints to build amazing user interfaces either in JavaScript frameworks
    or native mobile libraries.


    Import to
    [Postman](https://raw.githubusercontent.com/spree/spree/main/docs/api-reference/storefront.yaml)
  contact:
    name: Vendo Connect Inc.
    url: https://spreecommerce.org
    email: hello@spreecommerce.org
  license:
    name: BSD-3-Clause
    url: https://github.com/spree/spree/blob/main/LICENSE.md
servers:
  - url: https://demo.spreecommerce.org
    description: demo
  - url: http://localhost:3000
    description: localhost
security: []
tags:
  - name: Account
  - name: Account / Address
  - name: Account / Credit Cards
  - name: Account / Orders
  - name: Cart
  - name: Cart / Line Items
  - name: Cart / Coupons
  - name: Cart / Other
  - name: Checkout
  - name: Checkout / State
  - name: Checkout / Shipments
  - name: Checkout / Payments
  - name: Checkout / Store Credit
  - name: Stripe
  - name: Adyen
  - name: Countries
  - name: Digital Downloads
  - name: Order Status
  - name: Products
  - name: Variants
  - name: Stores
  - name: Policies
  - name: Taxons
  - name: Vendors
  - name: Wishlists
  - name: Wishlists / Wished Items
paths:
  /api/v2/storefront/wishlists/{token}:
    patch:
      tags:
        - Wishlists
      summary: Update a Wishlist
      description: >-
        Updates the specific Wishlist by setting the values passed in the
        request body. Any parameters not provided will be left unchanged.
      operationId: update-wishlist
      parameters:
        - $ref: '#/components/parameters/Token'
        - $ref: '#/components/parameters/SparseFieldsWishlist'
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              type: object
              properties:
                wishlist:
                  type: object
                  properties:
                    name:
                      type: string
                      description: Change the wishlist name.
                    is_private:
                      type: boolean
                      description: Set the wishlist to public or private.
                    is_default:
                      type: boolean
                      description: Make this wishlist the default wishlist.
            examples:
              Update Name:
                value:
                  wishlist:
                    name: Birthday Ideas
              Set to Private:
                value:
                  wishlist:
                    is_private: true
              Make Default:
                value:
                  wishlist:
                    is_default: true
        description: ''
      responses:
        '200':
          $ref: '#/components/responses/Wishlist'
        '403':
          $ref: '#/components/responses/403Forbidden'
        '422':
          $ref: '#/components/responses/422UnprocessableEntity'
      security:
        - bearerAuth: []
components:
  parameters:
    Token:
      name: token
      in: path
      required: true
      description: The token is a unique string used to identify the target resource.
      schema:
        type: string
      example: vmJtMiMozBdFtn1VkdJ8dYen
    SparseFieldsWishlist:
      in: query
      name: fields[wishlist]
      example: name,token,is_default,is_private,variant_included
      description: >-
        Specify the fields you would like returned in the response body. [More
        information](https://jsonapi.org/format/#fetching-sparse-fieldsets).
      schema:
        type: string
  responses:
    Wishlist:
      description: 200 Success - Returns the `wishlist` object.
      content:
        application/vnd.api+json:
          schema:
            type: object
            properties:
              data:
                $ref: '#/components/schemas/Wishlist'
              included:
                type: array
                items:
                  $ref: '#/components/schemas/WishlistIncludes'
            required:
              - data
          examples:
            Wishlist:
              value:
                data:
                  id: '28'
                  type: wishlist
                  attributes:
                    token: 1inBHcJnxBrVEMAZb9esRqZP
                    name: My Wishlist
                    is_private: false
                    is_default: true
                    variant_included: false
                  relationships:
                    wished_items:
                      data:
                        - id: '14'
                          type: wished_item
            Wishlist including Wished Items:
              value:
                data:
                  id: '28'
                  type: wishlist
                  attributes:
                    token: 1inBHcJnxBrVEMAZb9esRqZP
                    name: My Wishlist
                    is_private: false
                    is_default: true
                    variant_included: false
                  relationships:
                    wished_items:
                      data:
                        - id: '14'
                          type: wished_item
                included:
                  - id: '14'
                    type: wished_item
                    attributes:
                      quantity: 7
                      price: '26.99'
                      total: '188.93'
                      display_price: $26.99
                      display_total: $188.93
                    relationships:
                      variant:
                        data:
                          id: '149'
                          type: variant
                      wishlist:
                        data:
                          id: '28'
                          type: wishlist
    403Forbidden:
      description: 403 Forbidden - You are not authorized to access this page.
      content:
        application/vnd.api+json:
          schema:
            properties:
              error:
                type: string
                example: You are not authorized to access this page.
                default: You are not authorized to access this page.
          examples:
            403 Example:
              value:
                error: You are not authorized to access this page.
    422UnprocessableEntity:
      description: 422 Unprocessable Entity
      content:
        application/vnd.api+json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            422 Example:
              value:
                error: Example is invalid
                errors:
                  example:
                    - Example is invalid
  schemas:
    Wishlist:
      description: ''
      type: object
      title: Wishlist
      x-internal: false
      properties:
        id:
          type: string
        type:
          type: string
          default: wishlist
        attributes:
          type: object
          properties:
            token:
              type: string
            name:
              type: string
            is_private:
              type: boolean
            is_default:
              type: boolean
            variant_included:
              type: boolean
              description: >-
                Returns `true` or `false` depending on the variant ID passed in
                through the `is_variant_included` query param.
        relationships:
          type: object
          properties:
            wished_items:
              type: object
              properties:
                data:
                  type: array
                  items:
                    allOf:
                      - $ref: '#/components/schemas/Relation'
      required:
        - id
        - type
        - attributes
        - relationships
    WishlistIncludes:
      x-internal: false
      title: Wishlist Includes
      allOf:
        - $ref: '#/components/schemas/WishedItem'
    Error:
      x-internal: false
      title: Error
      type: object
      properties:
        error:
          type: string
    Relation:
      type: object
      nullable: true
      properties:
        id:
          type: string
        type:
          type: string
      required:
        - id
        - type
      x-internal: false
      description: ''
    WishedItem:
      type: object
      x-internal: false
      properties:
        id:
          type: string
        type:
          type: string
          default: wished_item
        attributes:
          type: object
          properties:
            quantity:
              type: integer
            price:
              type: string
            total:
              type: string
            display_price:
              type: string
            display_total:
              type: string
        relationships:
          type: object
          properties:
            variant:
              type: object
              properties:
                data:
                  $ref: '#/components/schemas/Relation'
      required:
        - id
        - type
        - attributes
        - relationships
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |-
        User token to authorize Cart and Checkout requests.

        It is required to associate Cart with the User.

````