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

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

const group = await client.customerGroups.create({
  name: 'VIP customers',
  description: 'Top spenders, eligible for early access',
  customer_ids: ['cus_UkLWZg9DAJ', 'cus_QrLWXg9CAJ'],
})
{
  "id": "cg_EfhxLZ9ck8",
  "name": "Wholesale 2",
  "description": "B2B accounts",
  "customers_count": 1,
  "created_at": "2026-05-24T17:36:39.101Z",
  "updated_at": "2026-05-24T17:36:39.101Z"
}

Documentation Index

Fetch the complete documentation index at: https://spreecommerce.org/docs/llms.txt

Use this file to discover all available pages before exploring further.

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:

"Wholesale"

description
string | null
Example:

"B2B accounts"

customer_ids
string[]
Example:
["cus_UkLWZg9DAJ"]

Response

customer group created

id
string
required
name
string
required
description
string | null
required
customers_count
number
required
created_at
string
required
updated_at
string
required
customers
object[]