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

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

const { price_count } = await client.prices.bulkUpsert({
  prices: [
    {
      variant_id: 'variant_xxx',
      currency: 'USD',
      price_list_id: 'pl_xxx',
      amount: '11.11',
    },
    {
      variant_id: 'variant_yyy',
      currency: 'USD',
      price_list_id: 'pl_xxx',
      amount: '22.22',
    },
  ],
})
{
  "price_count": 2
}

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
prices
object[]
required

Response

prices upserted

price_count
integer