curl --request PATCH \
--url https://demo.spreecommerce.org/api/v2/storefront/account \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"user": {
"email": "[email protected]",
"first_name": "John",
"last_name": "Snow",
"selected_locale": "fr",
"bill_address_id": "1",
"ship_address_id": "1",
"password": "spree123",
"password_confirmation": "spree123"
}
}
'{
"data": {
"id": "1",
"type": "user",
"attributes": {
"email": "[email protected]",
"first_name": "John",
"last_name": "Snow",
"selected_locale": "en",
"store_credits": 0,
"completed_orders": 0,
"tags": [
"VIP",
"supplier"
],
"public_metadata": {
"user_segment": "supplier"
}
},
"relationships": {
"default_billing_address": {
"data": {
"id": "2",
"type": "address"
}
},
"default_shipping_address": {
"data": {
"id": "1",
"type": "address"
}
}
}
}
}Updates the users account details
curl --request PATCH \
--url https://demo.spreecommerce.org/api/v2/storefront/account \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"user": {
"email": "[email protected]",
"first_name": "John",
"last_name": "Snow",
"selected_locale": "fr",
"bill_address_id": "1",
"ship_address_id": "1",
"password": "spree123",
"password_confirmation": "spree123"
}
}
'{
"data": {
"id": "1",
"type": "user",
"attributes": {
"email": "[email protected]",
"first_name": "John",
"last_name": "Snow",
"selected_locale": "en",
"store_credits": 0,
"completed_orders": 0,
"tags": [
"VIP",
"supplier"
],
"public_metadata": {
"user_segment": "supplier"
}
},
"relationships": {
"default_billing_address": {
"data": {
"id": "2",
"type": "address"
}
},
"default_shipping_address": {
"data": {
"id": "1",
"type": "address"
}
}
}
}
}User token to authorize Cart and Checkout requests.
It is required to associate Cart with the User.
Show child attributes
"John"
"Snow"
"fr"
"1"
"1"
"spree123"
"spree123"
200 Success - Returns the user object.
Show child attributes
"1"
Show child attributes
"John"
"Doe"
"fr"
150.75
Number of placed Orders by this User
3
List of tags associated with the user
The public metadata for this User
{ "user_segment": "supplier" }Show child attributes
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?