Creates a new customer account and returns a JWT token
JavaScript
import { createSpreeClient } from '@spree/sdk' const client = createSpreeClient({ baseUrl: 'https://your-store.com', publishableKey: '<api-key>', }) const auth = await client.store.auth.register({ email: 'newuser@example.com', password: 'password123', first_name: 'John', last_name: 'Doe', })
{ "token": "eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6ImIyY2MxZjBkLTM4ODEtNDhlYy05NWQwLTRjMWFiYThmNjdjNiIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzcyNjY5ODA2fQ.TuNtaQsHENSyeVdaLBdxPikT5Efw_BfFSMNW_YSDhYU", "user": { "id": "cus_UkLWZg9DAJ", "email": "newuser@example.com", "first_name": "John", "last_name": "Doe", "created_at": "2026-03-04T23:16:46.619Z", "updated_at": "2026-03-04T23:16:46.619Z", "addresses": [], "default_billing_address": null, "default_shipping_address": null } }
Publishable API key for store access
"newuser@example.com"
6
"password123"
"John"
"Doe"
registration successful
JWT access token
Show child attributes
Was this page helpful?