Create a wishlist
Creates a new wishlist for the customer
POST
Spree SDK
Authorizations
Publishable API key for store access
JWT token for authenticated customers
Body
application/json
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Creates a new wishlist for the customer
import { createClient } from '@spree/sdk'
const client = createClient({
baseUrl: 'https://your-store.com',
publishableKey: '<api-key>',
})
const wishlist = await client.wishlists.create({
name: 'Birthday Ideas',
is_private: true,
}, {
token: '<token>',
})curl --request POST \
--url http://{defaultHost}/api/v3/store/wishlists \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-spree-api-key: <api-key>' \
--data '
{
"name": "Birthday Ideas",
"is_private": true,
"is_default": false
}
'{
"id": "wl_gbHJdmfrXB",
"name": "Birthday Ideas",
"token": "355Jp84AbFjhG5NdeggsYJg3",
"is_default": false,
"is_private": true
}{
"error": {
"code": "validation_error",
"message": "Name can't be blank",
"details": {
"name": [
"can't be blank"
]
}
}
}Publishable API key for store access
JWT token for authenticated customers
Was this page helpful?
import { createClient } from '@spree/sdk'
const client = createClient({
baseUrl: 'https://your-store.com',
publishableKey: '<api-key>',
})
const wishlist = await client.wishlists.create({
name: 'Birthday Ideas',
is_private: true,
}, {
token: '<token>',
})curl --request POST \
--url http://{defaultHost}/api/v3/store/wishlists \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-spree-api-key: <api-key>' \
--data '
{
"name": "Birthday Ideas",
"is_private": true,
"is_default": false
}
'{
"id": "wl_gbHJdmfrXB",
"name": "Birthday Ideas",
"token": "355Jp84AbFjhG5NdeggsYJg3",
"is_default": false,
"is_private": true
}{
"error": {
"code": "validation_error",
"message": "Name can't be blank",
"details": {
"name": [
"can't be blank"
]
}
}
}