Returns the profile of the currently authenticated customer
import { createClient } from '@spree/sdk'
const client = createClient({
baseUrl: 'https://your-store.com',
publishableKey: '<api-key>',
})
const customer = await client.customer.get({
bearerToken: '<token>',
}){
"id": "cus_UkLWZg9DAJ",
"email": "myrna.klocko@waters.co.uk",
"first_name": "Merilyn",
"last_name": "Connelly",
"phone": "555-555-0199",
"accepts_email_marketing": false,
"available_store_credit_total": "0",
"display_available_store_credit_total": "$0.00",
"addresses": [
{
"id": "addr_gbHJdmfrXB",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"address1": "95 Lovely Street",
"address2": "Northwest",
"postal_code": "35005",
"city": "Herndon",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States of America",
"country_iso": "US",
"state_text": "STATE_ABBR_102",
"state_abbr": "STATE_ABBR_102",
"quick_checkout": false,
"is_default_billing": true,
"is_default_shipping": false,
"state_name": "STATE_NAME_102"
},
{
"id": "addr_UkLWZg9DAJ",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"address1": "94 Lovely Street",
"address2": "Northwest",
"postal_code": "35005",
"city": "Herndon",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States of America",
"country_iso": "US",
"state_text": "STATE_ABBR_101",
"state_abbr": "STATE_ABBR_101",
"quick_checkout": false,
"is_default_billing": false,
"is_default_shipping": true,
"state_name": "STATE_NAME_101"
}
],
"default_billing_address": {
"id": "addr_gbHJdmfrXB",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"address1": "95 Lovely Street",
"address2": "Northwest",
"postal_code": "35005",
"city": "Herndon",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States of America",
"country_iso": "US",
"state_text": "STATE_ABBR_102",
"state_abbr": "STATE_ABBR_102",
"quick_checkout": false,
"is_default_billing": true,
"is_default_shipping": false,
"state_name": "STATE_NAME_102"
},
"default_shipping_address": {
"id": "addr_UkLWZg9DAJ",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"address1": "94 Lovely Street",
"address2": "Northwest",
"postal_code": "35005",
"city": "Herndon",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States of America",
"country_iso": "US",
"state_text": "STATE_ABBR_101",
"state_abbr": "STATE_ABBR_101",
"quick_checkout": false,
"is_default_billing": false,
"is_default_shipping": true,
"state_name": "STATE_NAME_101"
}
}Publishable API key for store access
JWT token for authenticated customers
Comma-separated list of fields to include (e.g., name,slug,price). id is always included.
profile found
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
import { createClient } from '@spree/sdk'
const client = createClient({
baseUrl: 'https://your-store.com',
publishableKey: '<api-key>',
})
const customer = await client.customer.get({
bearerToken: '<token>',
}){
"id": "cus_UkLWZg9DAJ",
"email": "myrna.klocko@waters.co.uk",
"first_name": "Merilyn",
"last_name": "Connelly",
"phone": "555-555-0199",
"accepts_email_marketing": false,
"available_store_credit_total": "0",
"display_available_store_credit_total": "$0.00",
"addresses": [
{
"id": "addr_gbHJdmfrXB",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"address1": "95 Lovely Street",
"address2": "Northwest",
"postal_code": "35005",
"city": "Herndon",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States of America",
"country_iso": "US",
"state_text": "STATE_ABBR_102",
"state_abbr": "STATE_ABBR_102",
"quick_checkout": false,
"is_default_billing": true,
"is_default_shipping": false,
"state_name": "STATE_NAME_102"
},
{
"id": "addr_UkLWZg9DAJ",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"address1": "94 Lovely Street",
"address2": "Northwest",
"postal_code": "35005",
"city": "Herndon",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States of America",
"country_iso": "US",
"state_text": "STATE_ABBR_101",
"state_abbr": "STATE_ABBR_101",
"quick_checkout": false,
"is_default_billing": false,
"is_default_shipping": true,
"state_name": "STATE_NAME_101"
}
],
"default_billing_address": {
"id": "addr_gbHJdmfrXB",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"address1": "95 Lovely Street",
"address2": "Northwest",
"postal_code": "35005",
"city": "Herndon",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States of America",
"country_iso": "US",
"state_text": "STATE_ABBR_102",
"state_abbr": "STATE_ABBR_102",
"quick_checkout": false,
"is_default_billing": true,
"is_default_shipping": false,
"state_name": "STATE_NAME_102"
},
"default_shipping_address": {
"id": "addr_UkLWZg9DAJ",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"address1": "94 Lovely Street",
"address2": "Northwest",
"postal_code": "35005",
"city": "Herndon",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States of America",
"country_iso": "US",
"state_text": "STATE_ABBR_101",
"state_abbr": "STATE_ABBR_101",
"quick_checkout": false,
"is_default_billing": false,
"is_default_shipping": true,
"state_name": "STATE_NAME_101"
}
}