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

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

// `customer_ids` is a full-set update — the model reconciles the membership
// to match the array (adds new IDs, removes ones not present).
const group = await client.customerGroups.update('cg_UkLWZg9DAJ', {
  name: 'VIP customers (Q1)',
  customer_ids: ['cus_UkLWZg9DAJ'],
})
{
  "id": "cg_UkLWZg9DAJ",
  "name": "VIP customers (Q1)",
  "description": "Top spenders",
  "customers_count": 0,
  "created_at": "2026-05-24T17:36:40.533Z",
  "updated_at": "2026-05-24T17:36:40.811Z"
}

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

Path Parameters

id
string
required

Customer group prefixed ID

Body

application/json
name
string
Example:

"VIP customers (Q1)"

description
string | null
Example:

"Updated description"

customer_ids
string[]
Example:
["cus_UkLWZg9DAJ"]

Response

customer group updated

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