Skip to main content
POST
/
api
/
v3
/
admin
/
price_lists
Spree Admin SDK
import { createAdminClient } from '@spree/admin-sdk'

const client = createAdminClient({
  baseUrl: 'https://your-store.com',
  secretKey: 'sk_xxx',
})

// Server-to-server one-shot create. Ship the rules that gate the list
// and the exact per-variant prices in a single request — variants in
// `prices` implicitly become part of the list (upserted on the unique
// key `(variant_id, currency, price_list_id)`), so there's no need to
// pre-declare `product_ids` separately.
const priceList = await client.priceLists.create({
  name: 'EU wholesale',
  description: 'Tiered pricing for verified B2B customers',
  match_policy: 'all',
  starts_at: '2026-06-01T00:00:00Z',
  ends_at: '2026-09-01T00:00:00Z',
  rules: [
    {
      type: 'customer_group_rule',
      preferences: { customer_group_ids: ['cg_aBc123'] },
    },
    {
      type: 'volume_rule',
      preferences: { min_quantity: 10 },
    },
  ],
  prices: [
    {
      variant_id: 'variant_xY9',
      currency: 'USD',
      amount: '19.99',
      compare_at_amount: '24.99',
    },
    {
      variant_id: 'variant_aB7',
      currency: 'USD',
      amount: '21.99',
    },
  ],
})
{
  "id": "pl_EfhxLZ9ck8",
  "name": "EU wholesale",
  "description": null,
  "status": "draft",
  "position": 3,
  "match_policy": "all",
  "starts_at": null,
  "ends_at": null,
  "deleted_at": null,
  "created_at": "2026-06-17T13:37:31.595Z",
  "updated_at": "2026-06-17T13:37:31.597Z",
  "currently_active": false,
  "products_count": 1,
  "prices_count": 2,
  "product_ids": [
    "prod_UkLWZg9DAJ"
  ]
}

Authorizations

x-spree-api-key
string
header
required

Secret API key for admin access

Authorization
string
header
required

JWT token for admin user authentication

Headers

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

Body

application/json
name
string
required
Example:

"EU wholesale"

description
string | null
starts_at
string | null
Example:

"2026-06-01T00:00:00Z"

ends_at
string | null
Example:

"2026-09-01T00:00:00Z"

match_policy
enum<string>
Available options:
all,
any
Example:

"all"

position
integer
Example:

1

product_ids
string[]

Prefixed product ids to seed the list with.

Example:
["prod_aBc123"]
rules
object[]

STI-typed price rules to attach on create. Existing rules on the same payload via PATCH reconcile by id.

prices
object[]

Server-to-server alternative to product_ids: ship the exact per-variant prices the list should contain. Each row upserts on the unique key (variant_id, currency, price_list_id). Mix-and-match with product_ids is supported but typically unnecessary — prices alone tells the server which variants belong to the list and what the override amount is.

Response

price list created (server-to-server — rules + prices, no product_ids)

id
string
required
name
string
required
description
string | null
required
status
string
required
position
number
required
match_policy
string
required
starts_at
string | null
required
ends_at
string | null
required
deleted_at
string | null
required
created_at
string
required
updated_at
string
required
currently_active
boolean
required
products_count
number
required
prices_count
number
required
product_ids
string[]
required
price_rules
object[]