Skip to content

/custom_request_password_reset

/accounts/custom_request_password_reset

Target audience: Developers

1
Release version: 4.1.3

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

Required scope

1
/external/account/w

Parameters

Field Required Type Description
email 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
curl --request POST \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/accounts/custom_equest_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:

1
2
Reset password link: "https://www.yoursite.se/reset_password?id=account_id&confirmation_code=123456&return_url=https://www.yoursite.se/return_url"
Fallback link: "https://www.yoursite.se/return_url"

Response

Example Response

1
2
HTTP 200 Ok
{}

Errors

Example error response

1
2
3
4
5
6
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