Updates the users account details
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
user: {
email: 'john@snow.org',
first_name: 'John',
last_name: 'Snow',
selected_locale: 'fr',
bill_address_id: '1',
ship_address_id: '1',
password: 'spree123',
password_confirmation: 'spree123'
}
})
};
fetch('https://demo.spreecommerce.org/api/v2/storefront/account', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));User token to authorize Cart and Checkout requests.
It is required to associate Cart with the User.
Show child attributes
Was this page helpful?
const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
user: {
email: 'john@snow.org',
first_name: 'John',
last_name: 'Snow',
selected_locale: 'fr',
bill_address_id: '1',
ship_address_id: '1',
password: 'spree123',
password_confirmation: 'spree123'
}
})
};
fetch('https://demo.spreecommerce.org/api/v2/storefront/account', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));