curl --request POST \
--url https://demo.spreecommerce.org/api/v2/storefront/account/addresses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"address": {
"firstname": "Mark",
"lastname": "Winterburn",
"company": "Paper Street Soap Co.",
"address1": "775 Old Georgetown Road",
"address2": "3rd Floor",
"city": "Qethesda",
"phone": "3488545445002",
"zipcode": "90210",
"state_name": "CA",
"country_iso": "US",
"label": "Work"
}
}
'{
"data": {
"id": "29",
"type": "address",
"attributes": {
"firstname": "Mark",
"lastname": "Winterburn",
"address1": "775645 Old Georgetown Road",
"address2": "3rd Floor",
"city": "Qethesda",
"zipcode": "90210",
"phone": "3488545445002",
"state_name": "California",
"company": "Paper Street Soap Co.",
"country_name": "United States",
"country_iso3": "USA",
"country_iso": "US",
"label": "Work",
"state_code": "CA"
}
}
}Creates a new address for the current user.
curl --request POST \
--url https://demo.spreecommerce.org/api/v2/storefront/account/addresses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"address": {
"firstname": "Mark",
"lastname": "Winterburn",
"company": "Paper Street Soap Co.",
"address1": "775 Old Georgetown Road",
"address2": "3rd Floor",
"city": "Qethesda",
"phone": "3488545445002",
"zipcode": "90210",
"state_name": "CA",
"country_iso": "US",
"label": "Work"
}
}
'{
"data": {
"id": "29",
"type": "address",
"attributes": {
"firstname": "Mark",
"lastname": "Winterburn",
"address1": "775645 Old Georgetown Road",
"address2": "3rd Floor",
"city": "Qethesda",
"zipcode": "90210",
"phone": "3488545445002",
"state_name": "California",
"company": "Paper Street Soap Co.",
"country_name": "United States",
"country_iso3": "USA",
"country_iso": "US",
"label": "Work",
"state_code": "CA"
}
}
}User token to authorize Cart and Checkout requests.
It is required to associate Cart with the User.
Specify the fields you would like returned in the response body. More information.
Show child attributes
Street address
City, town
Country ISO (2-chars) or ISO3 (3-chars) code. List of all codes
Additional address information, floor no etc
Valid zipcode, will be validated against the selected Country
State/region/province 2 letter abbreviation
Company name
"Paper Street Soap Co."
The internal name for this address (Work, Home)
"Work"
{
"firstname": "John",
"lastname": "Snow",
"address1": "7735 Old Georgetown Road",
"address2": "2nd Floor",
"city": "Bethesda",
"phone": "3014445002",
"zipcode": "20814",
"state_name": "MD",
"country_iso": "US"
}
200 Success - Returns the address object.
The Address model holds the customer details, such as name, address, and phone number.
Show child attributes
"1"
Show child attributes
"John"
"Doe"
"1600 Amphitheatre Pkwy"
"Suite 1"
"Mountain View"
"94043"
"(+1) 123 456 789"
"California"
State abbreviation
"CA"
"United States of America"
Country ISO3 code
"USA"
Company name
"Google Inc."
The internal name for this address (Work, Home)
"Home"
Was this page helpful?