Token Validation Failed (9201) for foreignexchangerates

New Contributor

Token Validation Failed (9201) for foreignexchangerates

I got this error when trying to call API and use x-pay-token for authentication

I have tried request to HelloWorld API and it worked.

Here is my request headers

POST /forexrates/v2/foreignexchangerates?apiKey=U0ZA115Y7BUYIQXJTGUF21PwqciBWLoKc-R5p-mloS0DCI1ro HTTP/1.1
x-pay-token: xv2:1685707360:534e3b01f238247677213a07266b8d58bdb431d44a0038460d38307de9588d7f
Content-Type: application/json
User-Agent: PostmanRuntime/7.32.2
Accept: */*
Postman-Token: 7cd60b08-d07d-4bd8-8bda-82fc5a190ff8
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Length: 102

Here is my request body


Here is my response

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

 Here is my postman pre-request script


Here is my credential page


Please help. 

Community Moderator

Re: Token Validation Failed (9201) for foreignexchangerates

Thank you for reaching out, @TTBBANK. An agent will get back to you as soon as possible. In the meantime, if any community member knows the solution, please reply to this thread!

Visa Developer Support Specialist

Re: Token Validation Failed (9201) for foreignexchangerates



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. 


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.