ascroob
New Contributor

X Pay Token Validation Failed

I'm trying to integrate the Visa in-app provisioning API into a project. In Postman I am able to successfully generate an x-pay token, however, my request fails every time with error status 401 code 9159 (Token Validation Failed).

 

Under the X Pay Token documentation there is a table with resource paths for different APIs. This table doesn't reference the in-app provisioning API so I don't know if that may be part of the issue. Any guidance on where I am going wrong would be appreciated.

 

Thanks.

 

Please see the following screenshots for my pre-request script: I have the x pay token set as a collection variable and it updates when the pre-request script runs.

Screenshot 2021-01-23 163042.png

 

 

3 REPLIES 3
DianaTran
Visa Dev Moderator

Re: X Pay Token Validation Failed

Hey @ascroob,

 

I'm happy to help. Please provide the following information for further assistance:

1. Endpoint
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.

 

Here's the link to Visa Developer error codes and how to resolve them - https://developer.visa.com/pages/visa-developer-error-codes 

 

If you don't find an error code listed here, refer to the API-specific error codes in its respective documentation pages. 




Thanks,

Diana



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

ascroob
New Contributor

Re: X Pay Token Validation Failed

Hi @DianaTran,

 

1. Endpoint: https://sandbox.api.visa.com/universal/core/customers?apikey={apiKey}
2. Request Header: 

request-header.PNG
3. Request Body

request-body.PNG

Pre-request script:

prereq-script.PNG

4. Response Header (include the x-correlation-id)

response-header.PNG
5. Response Body

{
    "responseStatus": {
        "status"401,
        "code""9159",
        "severity""ERROR",
        "message""Token Validation Failed",
        "info"""
    }
}
 
I understand that the error is with the x-pay token but none of the existing API docs provide assistance with troubleshooting the x pay token generation for the in-app provisioning API specifically.
 
Thank you!
DianaTran
Visa Dev Moderator

Re: X Pay Token Validation Failed

Hey @ascroob,

 

 

Please re-examine the creation of their x-pay token. The error indicates that there is a hash mismatch. Sometimes, this is because the resource path is determined incorrectly. The error indicates it is failing right at the x-pay-token calculation. They're not matching. Please test again and share your results with us. 




Thanks,

Diana



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