Skip to main content
POST
/
api
/
v3
/
store
/
auth
/
login
Spree SDK
import { createClient } from '@spree/sdk'

const client = createClient({
  baseUrl: 'https://your-store.com',
  publishableKey: '<api-key>',
})

const auth = await client.auth.login({
  email: 'customer@example.com',
  password: 'password123',
})
{
  "token": "eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjRjZjZiNzkxLTZiY2MtNDUyMi05YTNhLWQ0ZmMyNzNmNmEwMSIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzczMjQzOTM2fQ.Zi2gcBzDMpqNSeJIoLphDWxYI0C8SQYXihILkuHnFkU",
  "user": {
    "id": "cus_UkLWZg9DAJ",
    "email": "test@example.com",
    "first_name": "Elizebeth",
    "last_name": "Herman",
    "phone": null,
    "accepts_email_marketing": false,
    "created_at": "2026-03-11T14:45:36.632Z",
    "updated_at": "2026-03-11T14:45:36.632Z",
    "addresses": [],
    "default_billing_address": null,
    "default_shipping_address": null
  }
}

Authorizations

x-spree-api-key
string
header
required

Publishable API key for store access

Headers

x-spree-api-key
string
required

Body

application/json
email
string<email>
required
Example:

"customer@example.com"

password
string
required
Example:

"password123"

provider
string

Authentication provider (default: email)

Example:

"email"

Response

login successful

token
string
required

JWT access token

user
object
required