Skip to content

Update the logged customer account ​

Last updated View as Markdown

Endpoint: https://my-store.youcan.shop/api/customers/account

Method: PUT

Parameters ​

Send only the fields to change.

Param NameParam TypeDescriptionRequired
emailstringCustomer emailoptional
passwordstringNew password, 6 to 72 charactersoptional
password_confirmationstringThe same passwordwith password
current_passwordstringThe current passwordwhen email or password changes
first_namestringCustomer first nameoptional
last_namestringCustomer last nameoptional
phonestringCustomer phoneoptional

Response ​

Send the customer token from the Login endpoint in the Authorization header.

[200] OK

json
{
    "message": "Customer account updated successfully",
    "type": "success",
    "data": null
}

[200] OK, with a new password

A new password revokes all tokens of the customer. The response holds a new token.

json
{
    "token": "1f3c9a…",
    "token_type": "bearer",
    "expires_in": 2592000
}

[401] Unauthorized

json
{
    "status": 401,
    "detail": "Unauthenticated.",
    "meta": []
}

[422] Unprocessable Entity

json
{
    "status": 422,
    "detail": "The given data was invalid.",
    "meta": {
        "fields": {
            "current_password": [
                "The current password is incorrect."
            ]
        }
    }
}