Custom request password reset
    
        
        /accounts/custom_request_password_reset
    
Target audience: Developers
Release version: 4.1.3
Custom request password reset¶
Introduction¶
This endpoint is used to initialize the password reset flow for an existing account. It will trigger the "account_requested_password_reset" event with the corresponding data.
URI¶
| Environment | URI | 
|---|---|
| Stage | https://payway-api.stage.adeprimo.se/external/api/v1/accounts/custom_request_password_reset | 
| Production | https://backend.worldoftulo.com/external/api/v1/accounts/custom_request_password_reset | 
Requirements¶
| Identity | Scope | 
|---|---|
| No | /external/account/w | 
Parameters¶
| Field | Required | Type | Description | 
|---|---|---|---|
| Required | String | The email for the account. Size range: ..1024 Allowed values: "/\A[\w+-.]+@[a-z\d-]+(.[a-z]+)*.[a-z]+\z/i" | |
| reset_password_url | Required | String | Reset password URL | 
| return_url | Required | String | Return URL | 
Curl Example¶
curl --request POST \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/accounts/custom_request_password_reset \
  --header 'accept: application/json' \
  --header 'authorization: Bearer token' \
  --header 'content-type: application/json' \
  --data '{
            "email": "test@example.com",
            "reset_password_url": "https://www.yoursite.se/reset_password",
            "return_url": "https://www.yoursite.se/return_url"
          }'
Additional information¶
Published event¶
Posting to /custom_request_password_reset will publish the event "account_requested_password_reset".
If third part emailservice is used, relevant data will be posted, if not, a reset password email will be sent from Payway.
The reset password email from Payway will contain two links:
Reset password link: "https://www.yoursite.se/reset_password?id=account_id&confirmation_code=123456&return_url=https://www.yoursite.se/return_url"
Response¶
Example Response¶
HTTP 200 Ok
{}
Errors¶
Example error response¶
HTTP 400 Bad Request
{
  "code": "invalid_parameter",
  "field": "contact_email",
  "message": "Parameter must match format (?i-mx:\\\\A[\\\\w+\\\\-.]+@[a-z\\\\d\\\\-]+(\\\\.[a-z]+)*\\\\.[a-z]+\\\\z)"
}
HTTP 400 Bad Request¶
| Name | Type | Description | 
|---|---|---|
| invalid_parameter | Object | Validation error on any of the fields in the posted json | 
| json_parser_error | Object | The request body could not be parsed as valid json | 
| invalid_content_type_error | Object | The requests Content-Type header isn't set to application/json | 
| unknown_parameter | Object | One or more of the fields in the posted json was not recognized | 
HTTP 404 Not Found¶
| Name | Type | Description | 
|---|---|---|
| not_found | Object | The package could not be found | 
HTTP 500 Internal Server Error¶
| Name | Type | Description | 
|---|---|---|
| internal_server_error | Object | Something unexpected happened server side |