Adds a variant to the wishlist
JavaScript
import { createSpreeClient } from '@spree/sdk' const client = createSpreeClient({ baseUrl: 'https://your-store.com', publishableKey: '<api-key>', }) const item = await client.store.wishlists.items.create('wl_abc123', { variant_id: 'variant_abc123', quantity: 1, }, { bearerToken: '<token>', })
{ "id": "wi_gbHJdmfrXB", "variant_id": "variant_gbHJdmfrXB", "wishlist_id": "wl_UkLWZg9DAJ", "quantity": 1, "created_at": "2026-03-06T16:06:54.181Z", "updated_at": "2026-03-06T16:06:54.181Z", "variant": { "id": "variant_gbHJdmfrXB", "product_id": "prod_gbHJdmfrXB", "sku": "SKU-146", "is_master": true, "options_text": "", "track_inventory": true, "image_count": 0, "created_at": "2026-03-06T16:06:54.156Z", "updated_at": "2026-03-06T16:06:54.167Z", "thumbnail": null, "purchasable": true, "in_stock": false, "backorderable": true, "weight": 0, "height": null, "width": null, "depth": null, "price": { "id": "price_gbHJdmfrXB", "amount": "19.99", "amount_in_cents": 1999, "compare_at_amount": null, "compare_at_amount_in_cents": null, "currency": "USD", "display_amount": "$19.99", "display_compare_at_amount": null, "price_list_id": null }, "original_price": null, "option_values": [] } }
Publishable API key for store access
JWT token for authenticated customers
"variant_abc123"
1
item added
Show child attributes
Was this page helpful?