Forget Password
The "Forget Password" API allows users to reset their password in case they have forgotten it. This API will send a password reset link to the user's email address or phone number, which will allow them to reset their password and regain access to their account. The API typically requires the user's email address or phone number, and may also require some form of user verification to ensure that the request is legitimate.
Endpoint:
api/customer/auth/forget_password_v2
Http Method:
POST
Using login by email and password or phone number and password if enabled by the enablePhoneLogin
key in the Configuration API. the phone parameter becomes required, and the email parameter becomes optional.
By Using Email
- Request Body:
Key | Type | Required | Description |
---|---|---|---|
email | string | Yes | The email address of the customer. |
{
"email": "doc@supercommerce.io"
}
- Success Response:
{
"code": 200,
"message": "We sent the code as sms to your phone number",
"data": "A reset link has been sent to your email",
"meta": []
}
By Using Phone
- Request Body:
Key | Type | Required | Description |
---|---|---|---|
phone | string | Yes | The phone number of the customer. |
{
"phone": "01111111111"
}
- Success Response:
{
"code": 200,
"message": "We sent the code as sms to your phone number",
"data": "verfication Code Sent Successfully",
"meta": []
}
Check the following section to learn more about the Forget Password API Reference
Reset Password
This API is typically used when a customer has forgotten their password and needs to reset it. The customer can initiate the password reset process by clicking on a "forgot password" link on the website or mobile app, which will trigger a request to the Reset Password API.
Endpoint:
api/customer/auth/reset_password_v2
Http Method:
POST
The API will then send a verification code to the customer's phone number. The customer must enter this code on the website or mobile app to verify their phone number. Once the phone number is verified, the customer can enter a new password and submit the reset password request.
- Success Response:
You can check more details about Customer Resource.
{
"code": 200,
"message": "We sent the code as sms to your phone number",
"data": {
"id": 1153383,
"name": "Test",
"last_name": "Documentation",
"email": "doc2@supercommerce.io",
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..",
"is_guest": false,
//...
}
}
- Failure Response:
the code field represents the HTTP status code for the error. The message field provides a human-readable message explaining the error.
{
"code": 422,
"message": "This link has been expired",
"errors": {
"errorMessage": "invalid data",
"errorDetails": []
}
}
{
"code": 422,
"message": "Incorrect Verification Code!",
"errors": {
"errorMessage": "invalid data",
"errorDetails": []
}
}
Check the following section to learn more about the Reset Password API Reference