JavaScript
import { createClient } from '@spree/sdk' const client = createClient({ baseUrl: 'https://your-store.com', publishableKey: '<api-key>', }) const address = await client.customer.addresses.update('addr_abc123', { city: 'Los Angeles', }, { bearerToken: '<token>', })
{ "id": "addr_EfhxLZ9ck8", "first_name": "John", "last_name": "Doe", "full_name": "John Doe", "address1": "21 Lovely Street", "address2": "Northwest", "postal_code": "35005", "city": "Los Angeles", "phone": "555-555-0199", "company": "Company", "country_name": "NAME_7", "country_iso": "I7", "state_text": "STATE_ABBR_19", "state_abbr": "STATE_ABBR_19", "quick_checkout": false, "is_default_billing": false, "is_default_shipping": false, "state_name": "STATE_NAME_19" }
Publishable API key for store access
JWT token for authenticated customers
"John"
"Doe"
"456 Oak Ave"
"Los Angeles"
Set as default billing address
true
Set as default shipping address
address updated
Was this page helpful?