Skip to main content
POST
/
api
/
v3
/
store
/
wishlists
Spree SDK
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": "s7B1xNvAPfv6rznQPE8Z2yJj",
  "is_default": false,
  "is_private": true
}
{
  "error": {
    "code": "validation_error",
    "message": "Name can't be blank",
    "details": {
      "name": [
        "can't be blank"
      ]
    }
  }
}

Authorizations

x-spree-api-key
string
header
required

Publishable API key for store access

Authorization
string
header
required

JWT token for authenticated customers

Headers

x-spree-api-key
string
required
Authorization
string
required

Body

application/json
name
string
required
Example:

"Birthday Ideas"

is_private
boolean
Example:

true

is_default
boolean
Example:

false

Response

wishlist created

id
string
required
name
string
required
token
string
required
is_default
boolean
required
is_private
boolean
required
items
object[]