POST
/
api
/
v2
/
storefront
/
wishlists
/
{token}
/
add_items
curl --request POST \
  --url https://demo.spreecommerce.org/api/v2/storefront/wishlists/{token}/add_items \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/vnd.api+json' \
  --data '{
  "wished_items": [
    {
      "variant_id": "1",
      "quantity": 10
    },
    {
      "variant_id": "2",
      "quantity": 5
    }
  ]
}'
{
  "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"
          }
        ]
      }
    }
  }
}

Authorizations

Authorization
string
header
required

User token to authorize Cart and Checkout requests.

It is required to associate Cart with the User.

Path Parameters

token
string
required

The token is a unique string used to identify the target resource.

Body

application/vnd.api+json
Passing a quantity value is optional for those wishlist systems that do not support quantities. In this scenario, the returned quantity value will always be `1`, allowing the add-to-cart and pricing to reflect the single representation of the wished item accurately. If the wishlist system you are building allows for setting quantity, add the quantity attribute to the request body with an integer value greater than zero.
wished_items
object[]

Response

200
application/vnd.api+json
200 Success - Returns the `wishlist` object.
data
object
required
included
object[]