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

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

const customer = await client.customers.create({
  email: 'jane@example.com',
  first_name: 'Jane',
  last_name: 'Doe',
  phone: '+1 212 555 1234',
  tags: ['wholesale'],
  accepts_email_marketing: true,
})
{
  "id": "cus_gbHJdmfrXB",
  "email": "newcustomer@example.com",
  "first_name": "New",
  "last_name": "Customer",
  "phone": null,
  "accepts_email_marketing": false,
  "full_name": "New Customer",
  "available_store_credit_total": "0",
  "display_available_store_credit_total": "$0.00",
  "login": null,
  "metadata": {},
  "last_sign_in_at": null,
  "current_sign_in_at": null,
  "created_at": "2026-05-24T17:36:51.382Z",
  "updated_at": "2026-05-24T17:36:51.382Z",
  "sign_in_count": 0,
  "failed_attempts": 0,
  "last_sign_in_ip": null,
  "current_sign_in_ip": null,
  "tags": [],
  "internal_note_html": null,
  "default_billing_address_id": null,
  "default_shipping_address_id": null,
  "orders_count": 0,
  "total_spent": "0.0",
  "display_total_spent": "$0.00",
  "last_order_completed_at": null
}

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
email
string
required
Example:

"new@example.com"

first_name
string
last_name
string
phone
string
accepts_email_marketing
boolean
internal_note
string
tags
string[]
metadata
object

Response

201 - application/json

customer created