Customer reset password

Please make sure you read the Conventions before continuing with this guide.

Requirements.

You will need an X-API-KEY for the steps that interact with the API.

1) Configure an application in the backoffice.

Go to the backoffice, in the adminstration menu (alt+A) go to applications section, create a new application or edit one if there's one you can able to, whether you choose create new application or modify one, you need to configure the following fields:

  1. Name: If you are modifying an existing application, this can be remain unchanged.
  2. Request endpoint: A valid domain with a protocol like https://www.domain-of-your-app.org/actions/

The key here is the name of the application, it will be the way to inform to the system you want to use the request endpoint domain to create an email with that information and with a query string instead of the default URL with a route to websales.

2) Send the reset password email

You will interact with the /notifications/customers/reset endpoint of the Notifications Bucket to send the email for reset password.

On the appName field in the query string goes the name of the application configured before, if this field is incorrectly set it will not take effect and the system will send the email with the default URL to websales.

When successful, an email will be sended with a link with the necessary information to reset the password, it will have a structure like this


https://www.domain-of-your-app.com/actions/?accountId={{accountId}}&customerId={{customerId}}&token={{token}}&action=resetPwd

3) Reset the password

In your application you need to obtain the query string values in the URL created in the email when the user clicks it and lands to the page of your application dedicated to manage this information, in this case the important values are customerId, token and action.

The action value it will be the mechanism to inform to your application what kind of action is and with that the API you will interact, in this case is resetPwd so it will be /accounts/customers/{{customerId}} endpoint of the Accounts Bucket to use values {{token}} and {{customerId}} to peform the reset password.

When successful, the reset password is done.