Update Customer Profile
Update the authenticated customer's profile information.
Endpoint
PUT /api/shop/customer-profile-updates/{id}Request Headers
| Header | Required | Description |
|---|---|---|
Content-Type | Yes | application/json |
X-STOREFRONT-KEY | Yes | Your storefront API key |
Authorization | Yes | Bearer token (customer login required) |
Request Body
json
{
"firstName": "John",
"lastName": "Doe",
"email": "[email protected]",
"phone": "1234567890",
"gender": "M",
"dateOfBirth": "1990-01-15"
}Request Parameters
Every field is optional — the update is a partial patch. Send only what changes; omitted fields keep their stored value.
| Parameter | Type | Description |
|---|---|---|
firstName | string | First name. |
lastName | string | Last name. |
email | string | Email address. Must not already belong to another customer. |
phone | string | Digits only — a value carrying +, spaces, or dashes is rejected with "Mobile number can only contain digits. Special characters are not allowed". |
gender | string | Male, Female, or Other. |
dateOfBirth | string | Birth date as YYYY-MM-DD. |
currentPassword | string | Required only when changing the password — see Change Password. |
password / confirmPassword | string | The new password and its confirmation. Both are needed together, and they must match. |
Response Fields (200 OK)
The response is the updated profile itself — a flat object, not a wrapper.
| Field | Type | Description |
|---|---|---|
id / _id | string | Customer ID. |
firstName / lastName | string | Updated name. |
email | string | Updated email. |
phone | string | Updated phone. |
gender | string | Present once a gender has been set. |
dateOfBirth | string | Present once a birth date has been set. |
status | string | "1" when the account is active. |
subscribedToNewsLetter | boolean | Newsletter subscription state. |
isVerified / isSuspended | string | Account verification and suspension flags, returned as "true" / "false" on this endpoint. |
success | boolean | true on a successful update. |
message | string | Confirmation message. |
Use Cases
- Save a partial edit — an account form that posts only the touched fields works as-is; the endpoint patches what it receives and leaves the rest alone.
- Complete a profile after signup —
genderanddateOfBirthare absent from the profile until first written, and appear in every later read once set. - Rotate a password — send
currentPassword,password, andconfirmPasswordtogether; see Change Password for the failure cases.
Best Practices
- Strip formatting from the phone before sending — the field takes digits only, so
+1 (212) 555-0111is rejected; normalise to12125550111on the client. - Check the email is free before submitting — an address already registered to another account is rejected with a
400and the profile is left untouched. - Read the response instead of re-fetching — the body is the full updated profile, so the account screen can be re-rendered from it directly.
- Do not treat an email change as pending — the new address takes effect immediately and the customer's next login uses it; there is no confirmation step to wait on.
Related Resources
- Get Customer Profile — read the authenticated customer's account details
- Delete Customer Profile — permanently close the account

