Spree SDK
import { createClient } from '@spree/sdk'
const client = createClient({
baseUrl: 'https://your-store.com',
publishableKey: '<api-key>',
})
const customer = await client.customer.update(
{
first_name: 'John',
last_name: 'Doe',
metadata: { preferred_contact: 'email' },
},
{
token: '<token>',
},
)curl --request PATCH \
--url http://{defaultHost}/api/v3/store/customers/me \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-spree-api-key: <api-key>' \
--data '
{
"email": "customer@example.com",
"password": "<string>",
"password_confirmation": "<string>",
"current_password": "<string>",
"first_name": "John",
"last_name": "Doe",
"phone": "+1 555 123 4567",
"accepts_email_marketing": true,
"metadata": {}
}
'{
"id": "cust_UkLWZg9DAJ",
"email": "tabitha@ziemebogisich.info",
"first_name": "Updated",
"last_name": "Name",
"phone": "555-555-0199",
"accepts_email_marketing": false,
"email_marketing_consent_updated_at": "2026-01-15T12:00:00Z",
"full_name": "Updated Name",
"available_store_credit_total": "0.00",
"display_available_store_credit_total": "$0.00",
"addresses": [
{
"id": "addr_UkLWZg9DAJ",
"label": null,
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"address1": "463 Lovely Street",
"address2": "Northwest",
"postal_code": "10118",
"city": "New York",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States",
"country_code": "US",
"state_text": "NY",
"state_code": "NY",
"quick_checkout": false,
"is_default_billing": false,
"is_default_shipping": true,
"state_abbr": "NY",
"country_iso": "US",
"state_name": "New York",
"owner": {
"id": "cust_UkLWZg9DAJ",
"type": "customer",
"name": null
}
},
{
"id": "addr_gbHJdmfrXB",
"label": null,
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"address1": "464 Lovely Street",
"address2": "Northwest",
"postal_code": "10118",
"city": "New York",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States",
"country_code": "US",
"state_text": "NY",
"state_code": "NY",
"quick_checkout": false,
"is_default_billing": true,
"is_default_shipping": false,
"state_abbr": "NY",
"country_iso": "US",
"state_name": "New York",
"owner": {
"id": "cust_UkLWZg9DAJ",
"type": "customer",
"name": null
}
}
],
"default_billing_address": {
"id": "addr_gbHJdmfrXB",
"label": null,
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"address1": "464 Lovely Street",
"address2": "Northwest",
"postal_code": "10118",
"city": "New York",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States",
"country_code": "US",
"state_text": "NY",
"state_code": "NY",
"quick_checkout": false,
"is_default_billing": true,
"is_default_shipping": false,
"state_abbr": "NY",
"country_iso": "US",
"state_name": "New York",
"owner": {
"id": "cust_UkLWZg9DAJ",
"type": "customer",
"name": null
}
},
"default_shipping_address": {
"id": "addr_UkLWZg9DAJ",
"label": null,
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"address1": "463 Lovely Street",
"address2": "Northwest",
"postal_code": "10118",
"city": "New York",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States",
"country_code": "US",
"state_text": "NY",
"state_code": "NY",
"quick_checkout": false,
"is_default_billing": false,
"is_default_shipping": true,
"state_abbr": "NY",
"country_iso": "US",
"state_name": "New York",
"owner": {
"id": "cust_UkLWZg9DAJ",
"type": "customer",
"name": null
}
},
"newsletter_subscriber": null,
"customer_groups": []
}{
"error": {
"code": "validation_error",
"message": "Email can't be blank",
"details": {
"email": [
"can't be blank"
]
}
}
}Update current customer profile
Updates the profile of the currently authenticated customer
PATCH
/
api
/
v3
/
store
/
customers
/
me
Spree SDK
import { createClient } from '@spree/sdk'
const client = createClient({
baseUrl: 'https://your-store.com',
publishableKey: '<api-key>',
})
const customer = await client.customer.update(
{
first_name: 'John',
last_name: 'Doe',
metadata: { preferred_contact: 'email' },
},
{
token: '<token>',
},
)curl --request PATCH \
--url http://{defaultHost}/api/v3/store/customers/me \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-spree-api-key: <api-key>' \
--data '
{
"email": "customer@example.com",
"password": "<string>",
"password_confirmation": "<string>",
"current_password": "<string>",
"first_name": "John",
"last_name": "Doe",
"phone": "+1 555 123 4567",
"accepts_email_marketing": true,
"metadata": {}
}
'{
"id": "cust_UkLWZg9DAJ",
"email": "tabitha@ziemebogisich.info",
"first_name": "Updated",
"last_name": "Name",
"phone": "555-555-0199",
"accepts_email_marketing": false,
"email_marketing_consent_updated_at": "2026-01-15T12:00:00Z",
"full_name": "Updated Name",
"available_store_credit_total": "0.00",
"display_available_store_credit_total": "$0.00",
"addresses": [
{
"id": "addr_UkLWZg9DAJ",
"label": null,
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"address1": "463 Lovely Street",
"address2": "Northwest",
"postal_code": "10118",
"city": "New York",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States",
"country_code": "US",
"state_text": "NY",
"state_code": "NY",
"quick_checkout": false,
"is_default_billing": false,
"is_default_shipping": true,
"state_abbr": "NY",
"country_iso": "US",
"state_name": "New York",
"owner": {
"id": "cust_UkLWZg9DAJ",
"type": "customer",
"name": null
}
},
{
"id": "addr_gbHJdmfrXB",
"label": null,
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"address1": "464 Lovely Street",
"address2": "Northwest",
"postal_code": "10118",
"city": "New York",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States",
"country_code": "US",
"state_text": "NY",
"state_code": "NY",
"quick_checkout": false,
"is_default_billing": true,
"is_default_shipping": false,
"state_abbr": "NY",
"country_iso": "US",
"state_name": "New York",
"owner": {
"id": "cust_UkLWZg9DAJ",
"type": "customer",
"name": null
}
}
],
"default_billing_address": {
"id": "addr_gbHJdmfrXB",
"label": null,
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"address1": "464 Lovely Street",
"address2": "Northwest",
"postal_code": "10118",
"city": "New York",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States",
"country_code": "US",
"state_text": "NY",
"state_code": "NY",
"quick_checkout": false,
"is_default_billing": true,
"is_default_shipping": false,
"state_abbr": "NY",
"country_iso": "US",
"state_name": "New York",
"owner": {
"id": "cust_UkLWZg9DAJ",
"type": "customer",
"name": null
}
},
"default_shipping_address": {
"id": "addr_UkLWZg9DAJ",
"label": null,
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"address1": "463 Lovely Street",
"address2": "Northwest",
"postal_code": "10118",
"city": "New York",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States",
"country_code": "US",
"state_text": "NY",
"state_code": "NY",
"quick_checkout": false,
"is_default_billing": false,
"is_default_shipping": true,
"state_abbr": "NY",
"country_iso": "US",
"state_name": "New York",
"owner": {
"id": "cust_UkLWZg9DAJ",
"type": "customer",
"name": null
}
},
"newsletter_subscriber": null,
"customer_groups": []
}{
"error": {
"code": "validation_error",
"message": "Email can't be blank",
"details": {
"email": [
"can't be blank"
]
}
}
}Authorizations
Publishable API key for store access
JWT token for authenticated customers
Body
application/json
Example:
"customer@example.com"
Changing it signs the customer out everywhere: every refresh token is revoked, so sign in again once the access token expires.
Required when changing the email or the password.
Example:
"John"
Example:
"Doe"
Example:
"+1 555 123 4567"
Write-only key-value metadata.
Response
profile updated
available_store_credit_total formatted with its currency symbol in the request's language.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
⌘I

