Skip to main content
PATCH
/
api
/
v3
/
store
/
customer
/
addresses
/
{id}
/
mark_as_default
Spree SDK
import { createSpreeClient } from '@spree/sdk'

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

const address = await client.store.customer.addresses.markAsDefault('addr_abc123', 'billing', {
  bearerToken: '<token>',
})
{
  "id": "addr_EfhxLZ9ck8",
  "firstname": "John",
  "lastname": "Doe",
  "full_name": "John Doe",
  "address1": "30 Lovely Street",
  "address2": "Northwest",
  "city": "Herndon",
  "zipcode": "35005",
  "phone": "555-555-0199",
  "company": "Company",
  "country_name": "NAME_10",
  "country_iso": "I10",
  "state_text": "STATE_ABBR_28",
  "state_abbr": "STATE_ABBR_28",
  "quick_checkout": false,
  "state_name": "STATE_NAME_28"
}

Authorizations

x-spree-api-key
string
header
required

Publishable API key for store access

Authorization
string
header
required

JWT token for authenticated customers

Headers

x-spree-api-key
string
required
Authorization
string
required

Path Parameters

id
string
required

Body

application/json
kind
enum<string>
required

Address kind: billing or shipping

Available options:
billing,
shipping
Example:

"billing"

Response

address marked as default

id
string
required
firstname
string | null
required
lastname
string | null
required
full_name
string
required
address1
string | null
required
address2
string | null
required
city
string | null
required
zipcode
string | null
required
phone
string | null
required
company
string | null
required
country_name
string
required
country_iso
string
required
state_text
string | null
required
state_abbr
string | null
required
quick_checkout
boolean
required
state_name
string | null
required