Skip to main content

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.

PUT /purchase/customer-tokens/916f7730-8d24-4dd9-9778-92b75b747382 HTTP/1.1
Host: api.uat.walleydev.com // (Please note! Different hostname in production)
Authorization: Bearer bXlVc2VybmFtZTpmN2E1ODA4MGQzZTk0M2VmNWYyMTZlMDE...
Content-Type: application/json

{
"AuthorizationFailure":
{
"Reason": "PAYMENT_METHOD_EXPIRED"
}
}

Request Properties​

Request headers

HeaderRequiredExplanation
AuthorizationYesInstructions on how to generate the authorization header value can be found here.

Request body

PropertyRequiredExplanation
AuthorizationFailureNoProvide null to remove the error, or an object describing the reason

AuthorizationFailure object

PropertyRequiredExplanation
ReasonNoOne of the error reasons mentioned here. Set to null to remove the error

Important status codes​

Http status codeCause
401Incorrect, missing or expired bearer token
404The customer token was not found for the authenticated bearer token
503There was some internal error. Please try again