curl --request PATCH \
--url http://{defaultHost}/api/v2/platform/users/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"user": {
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"password": "<string>",
"password_confirmation": "<string>",
"selected_locale": "<string>",
"ship_address_id": "<string>",
"bill_address_id": "<string>",
"public_metadata": {},
"private_metadata": {}
}
}'
{
"data": {
"id": "144",
"type": "user",
"attributes": {
"email": "john@example.com",
"first_name": "Astrid",
"last_name": "Kohler",
"selected_locale": "fr",
"created_at": "2022-11-08T19:35:55.180Z",
"updated_at": "2022-11-08T19:35:55.414Z",
"public_metadata": {},
"private_metadata": {},
"average_order_value": [],
"lifetime_value": [],
"store_credits": []
},
"relationships": {
"bill_address": {
"data": null
},
"ship_address": {
"data": null
}
}
}
}
Updates a User
curl --request PATCH \
--url http://{defaultHost}/api/v2/platform/users/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"user": {
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"password": "<string>",
"password_confirmation": "<string>",
"selected_locale": "<string>",
"ship_address_id": "<string>",
"bill_address_id": "<string>",
"public_metadata": {},
"private_metadata": {}
}
}'
{
"data": {
"id": "144",
"type": "user",
"attributes": {
"email": "john@example.com",
"first_name": "Astrid",
"last_name": "Kohler",
"selected_locale": "fr",
"created_at": "2022-11-08T19:35:55.180Z",
"updated_at": "2022-11-08T19:35:55.414Z",
"public_metadata": {},
"private_metadata": {},
"average_order_value": [],
"lifetime_value": [],
"store_credits": []
},
"relationships": {
"bill_address": {
"data": null
},
"ship_address": {
"data": null
}
}
}
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Select which associated resources you would like to fetch, see: <a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>
Record updated
The response is of type object
.
Was this page helpful?