Skip to content

Update Customer Profile

Update the authenticated customer's profile information.

Endpoint

PUT /api/shop/customer-profile-updates/{id}

Request Headers

HeaderRequiredDescription
Content-TypeYesapplication/json
X-STOREFRONT-KEYYesYour storefront API key
AuthorizationYesBearer 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.

ParameterTypeDescription
firstNamestringFirst name.
lastNamestringLast name.
emailstringEmail address. Must not already belong to another customer.
phonestringDigits only — a value carrying +, spaces, or dashes is rejected with "Mobile number can only contain digits. Special characters are not allowed".
genderstringMale, Female, or Other.
dateOfBirthstringBirth date as YYYY-MM-DD.
currentPasswordstringRequired only when changing the password — see Change Password.
password / confirmPasswordstringThe 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.

FieldTypeDescription
id / _idstringCustomer ID.
firstName / lastNamestringUpdated name.
emailstringUpdated email.
phonestringUpdated phone.
genderstringPresent once a gender has been set.
dateOfBirthstringPresent once a birth date has been set.
statusstring"1" when the account is active.
subscribedToNewsLetterbooleanNewsletter subscription state.
isVerified / isSuspendedstringAccount verification and suspension flags, returned as "true" / "false" on this endpoint.
successbooleantrue on a successful update.
messagestringConfirmation 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 signupgender and dateOfBirth are absent from the profile until first written, and appear in every later read once set.
  • Rotate a password — send currentPassword, password, and confirmPassword together; 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-0111 is rejected; normalise to 12125550111 on the client.
  • Check the email is free before submitting — an address already registered to another account is rejected with a 400 and 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.

Released under the MIT License.