Update an address
PATCH
Spree SDK
Authorizations
Publishable API key for store access
JWT token for authenticated customers
Path Parameters
Body
application/json
Response
200 - application/json
address updated
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
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',
}, {
token: '<token>',
})curl --request PATCH \
--url http://{defaultHost}/api/v3/store/customers/me/addresses/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-spree-api-key: <api-key>' \
--data '
{
"first_name": "John",
"last_name": "Doe",
"address1": "456 Oak Ave",
"city": "Los Angeles",
"is_default_billing": true,
"is_default_shipping": true
}
'{
"id": "addr_EfhxLZ9ck8",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"address1": "96 Lovely Street",
"address2": "Northwest",
"postal_code": "10118",
"city": "Los Angeles",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States of America",
"country_iso": "US",
"state_text": "NY",
"state_abbr": "NY",
"quick_checkout": false,
"is_default_billing": false,
"is_default_shipping": false,
"state_name": "New York"
}Publishable API key for store access
JWT token for authenticated customers
address updated
Was this page helpful?
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',
}, {
token: '<token>',
})curl --request PATCH \
--url http://{defaultHost}/api/v3/store/customers/me/addresses/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-spree-api-key: <api-key>' \
--data '
{
"first_name": "John",
"last_name": "Doe",
"address1": "456 Oak Ave",
"city": "Los Angeles",
"is_default_billing": true,
"is_default_shipping": true
}
'{
"id": "addr_EfhxLZ9ck8",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"address1": "96 Lovely Street",
"address2": "Northwest",
"postal_code": "10118",
"city": "Los Angeles",
"phone": "555-555-0199",
"company": "Company",
"country_name": "United States of America",
"country_iso": "US",
"state_text": "NY",
"state_abbr": "NY",
"quick_checkout": false,
"is_default_billing": false,
"is_default_shipping": false,
"state_name": "New York"
}