Account
Update an Account
Storefront API
- Authentication
- Account
- Account / Address
- Account / Credit Cards
- Account / Orders
- Order Status
- Cart
- Cart / Line Items
- Cart / Other
- Cart / Coupons
- Checkout
- Checkout / State
- Checkout / Shipments
- Checkout / Payments
- Checkout / Store Credit
- Stripe
- Products
- Vendors
- Stores
- Taxons
- Countries
- CMS Pages
- Menus
- Wishlists
- Wishlists / Wished Items
- Digital Downloads
Platform API
- Authentication
- Addresses
- Adjustments
- Classifications
- CMS Pages
- CMS Sections
- Countries
- Data Feeds
- Digital Links
- Digital Assets
- Line Items
- Menu Items
- Menus
- Option Types
- Option Values
- Orders
- Payment Methods
- Payments
- Products
- Promotion Actions
- Promotion Categories
- Promotion Rules
- Promotions
- Roles
- Shipments
- Shipping Categories
- Shipping Methods
- States
- Stock Items
- Stock Locations
- Store Credit Categories
- Store Credit Types
- Store Credits
- Tax Categories
- Tax Rates
- Taxonomies
- Taxons
- Users
- Variants
- Vendors
- Webhook Events
- Webhook Subscribers
- Wished Items
- Wishlists
- Zones
Account
Update an Account
Updates the users account details. This endpoint requires the Spree Auth Devise gem to be installed.
PATCH
/
api
/
v2
/
storefront
/
account
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"
}
}
}
}
}
Authorizations
User token to authorize Cart and Checkout requests.
It is required to associate Cart with the User.
Body
application/vnd.api+json
Response
200
application/vnd.api+json
200 Success - Returns the `user` object.
Number of placed Orders by this User
List of tags associated with the user
The public metadata for this User
State abbreviation
Country ISO3 code
Company name
The internal name for this address (Work, Home)
Was this page helpful?
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"
}
}
}
}
}