Testing Authorization Errors
If you want to test the different outcomes of an authorization, you can simulate an error by modifying the customer token. This is only available in the test environment.
- Request
- Response
- Error
PUT /purchase/customer-tokens/916f7730-8d24-4dd9-9778-92b75b747382 HTTP/1.1
Host: api.uat.walleydev.com
Authorization: Bearer bXlVc2VybmFtZTpmN2E1ODA4MGQzZTk0M2VmNWYyMTZlMDE...
Content-Type: application/json
{
"AuthorizationFailure":
{
"Reason": "PAYMENT_METHOD_EXPIRED"
}
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "17635160-e66f-46b9-84fc-db939005050c"
}
Example error. More errors available below.
HTTP/1.1 404 Not Found
Content-Type: application/json
{
"id": "fe8a21bb-6cb5-4d7d-b7f6-c0c335fc4593",
"error":
{
"code": 404,
"message": "The resource requested was not found.",
"errors": []
}
}
Request properties​
Request headers
| Header | Required | Explanation |
|---|---|---|
| Authorization | Yes | See how to generate the authorization header value. |
Request body
| Property | Required | Explanation |
|---|---|---|
| AuthorizationFailure | No | Provide null to remove the error, or an object describing the reason |
AuthorizationFailure object
| Property | Required | Explanation |
|---|---|---|
| Reason | No | One of the authorization error codes. Set to null to remove the error. Note that these error codes do not work:
|
Important status codes​
| Http status code | Cause |
|---|---|
| 401 | Incorrect, missing or expired bearer token |
| 404 | The customer token was not found for the authenticated bearer token |
| 503 | There was some internal error. Please try again |