Updates the users account details
JavaScript
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));
200
Standard response
{ "data": { "id": "1", "type": "user", "attributes": { "email": "spree@example.com", "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" } } } } }
Documentation IndexFetch the complete documentation index at: https://spreecommerce.org/docs/llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: https://spreecommerce.org/docs/llms.txt
Use this file to discover all available pages before exploring further.
User token to authorize Cart and Checkout requests.
It is required to associate Cart with the User.
Show child attributes
200 Success - Returns the user object.
user
Was this page helpful?
Contact support