Skip to main content
POST
/
api
/
v3
/
store
/
customer
/
addresses
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.create({
  firstname: 'John',
  lastname: 'Doe',
  address1: '123 Main St',
  city: 'New York',
  zipcode: '10001',
  country_iso: 'US',
  state_abbr: 'NY',
  phone: '+1 555 123 4567',
}, {
  bearerToken: '<token>',
})
{
  "id": "addr_VqXmZF31wY",
  "firstname": "John",
  "lastname": "Doe",
  "full_name": "John Doe",
  "address1": "123 Main St",
  "address2": null,
  "city": "New York",
  "zipcode": "10001",
  "phone": "+1 555 123 4567",
  "company": null,
  "country_name": "NAME_3",
  "country_iso": "I3",
  "state_text": "STATE_ABBR_7",
  "state_abbr": "STATE_ABBR_7",
  "quick_checkout": false,
  "state_name": "STATE_NAME_7"
}

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

Body

application/json
firstname
string
required
Example:

"John"

lastname
string
required
Example:

"Doe"

address1
string
required
Example:

"123 Main St"

city
string
required
Example:

"New York"

zipcode
string
required
Example:

"10001"

country_iso
string
required

ISO 3166-1 alpha-2 country code (e.g., "US", "DE")

Example:

"US"

address2
string
Example:

"Apt 4B"

phone
string
Example:

"+1 555 123 4567"

company
string
Example:

"Acme Inc"

state_abbr
string

ISO 3166-2 subdivision code without country prefix (e.g., "CA", "NY")

Example:

"NY"

state_name
string

State name - for countries without predefined states

Example:

"New York"

Response

address created

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