Visa Developer Community

Regular Contributor

Token Validation Failed

I thank everyone most especially diana for guiding me so well during this phase of configurations

am able to get the response from the soapui

But when it comes to posting with the x-pay-token

i get the response below

{{"responseStatus":{"code":"9101","severity":"ERROR","message":"Token Validation Failed","info":"","status":401}}


am so positive am about to get this right

May be my problem is with the way i generate my HMACSHA256

But i have worked with it before and didnt really expect this kind of error to have come from it


if someelse can provide solution before i get i would really appreciate it




Visa Dev Moderator

Re: Token Validation Failed

Hello my friend, @ezamarichard,                             


Thanks for the acknowledgement of your appreciation and for mentioning my username. I love helping the developer community and seeing things work out for all things 'technical'.


The 401 Token Validation Failed error you're getting will be seen when the x-pay-token sent in the header is invalid.
A couple of things I'd like you to note while generating the token:
1. For starters, please follow the getting started documentation to generate a valid token.
2. APIkey in the url query param should be the same as the one used to generate xpayToken
3. “resourcePath” sent in the xpaytoken has to be as per the documentation (eg: v2/payments?apikey={apikey}).
4. Payload sent in the request payload should exactly match along with spaces to the “requestBody” value used in xpaytoken.
Can you please provide the request payload of this API call? It's possible that you're missing a field or have an inaccurate format. I'd like to see screenshot attachments of the error provided, if possible.


Also, could you check to see if you're passing a correct value for URI. For example, make sure it’s defined correctly in the beginning of your code, and use the same value for the URI in the middle of your code. In general, for cases like this (i.e. “helloworld works, but the API XX doesn’t”) I'd like to ask of you, if you could, to please extend your SOAPUI project, and make sure that you can call a particular API from SOAPUI project first.


Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.


Regular Visitor

Re: Token Validation Failed

Since the error message from the log clearly suggests that "The user name or password is incorrect", please double-check whether the affected user's password is correct, or newly changed, or expired.

And if the password is really fine, I also want to collect these details:
1. Does the issue occur to all federated users?
2. Are the affected users trying to configure Outlook from internal environment or external?
3. Is it Forms Authentication or Windows Authentication that is being used?
4. What if the affected users try to create a new Outlook profile? Does the issue persist?
5. Please provide a screenshot of what the users encounter from their Outlook.



Re: Token Validation Failed

I have found the same issue as described by you. Let me know any solutions.

Developer at Branex

Re: Token Validation Failed

I have the same issue on my mobile application as you told above, anyone, please provide any detail solution

Visa Dev Moderator

Re: Token Validation Failed

Hi @carljmc and @muneebqadar,                                                         


To further investigate, please email or reply to this forum post and provide the following information:

1. End Point
2. Request Header
3. Request Body
4. Response Header (include the x-correlation-id)
5. Response Body


Using SoapUI, you can find the x-correlation-id in the Raw Tab of the response header.


Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.



Re: Token Validation Failed

Ok, I try to email all the necessary details...


Re: Token Validation Failed

don't hard to get rid of this issue, it may be occur due to your browser cache or related stuff if you want to restart the process and want to complete token failed try resubmission  ...