Visa Developer Community

Regular Contributor

Token Validation Failed

may i please give someone all my project files including the certificates,APIKEY sharedsecret

and they send it back to me without this annoying error which av been getting for the last two weeks


am ready to give everything

Smiley Frustrated


HTTP/1.1 401 Unauthorized
Server: Apache
X-SERVED-BY: l73c038
X-CORRELATION-ID: 1527021004_461_77_l73c038_VDP_ARM
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=2592000;includeSubdomains
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: -1
Content-Type: application/json;charset=UTF-8
Content-Length: 112
Date: Tue, 22 May 2018 20:30:04 GMT
Connection: keep-alive

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

Visa Dev Moderator

Re: Token Validation Failed

Hi @ezamarichard,


Please use the below updated groovy script and Request Pay load and let me know if this works. You'll see some green text. Please subsitute the green text for your project credentials that you can retrieve when you can access from your VDP project dashboard.


Groovy Script


import javax.crypto.Mac;

import javax.crypto.spec.SecretKeySpec;

def hmac(String secretKey, String data) {

Mac mac = Mac.getInstance("HmacSHA256")

SecretKeySpec secretKeySpec = new SecretKeySpec(secretKey.getBytes(), "HmacSHA256")


byte[] digest = mac.doFinal(data.getBytes())

return digest


def APIKey = 'Enter Your API Key Here'

def sharedSecret = 'Enter Shared Secret'

def URI = "v2/payments"

def QS = "apikey="+APIKey

def timeStampUTC = String.valueOf(System.currentTimeMillis().intdiv(1000L))

def payload = '{ "clientReferenceInformation":   {   "code":   "TC50171_3"   },  "processingInformation":   {   "commerceIndicator":   "internet"   },"aggregatorInformation": { "subMerchant":  { "cardAcceptorID": "1234567890", "country": "US",  "phoneNumber": "650-432-0000", "address1":"900 Metro  Center", "postalCode":  "94404-2775", "locality": "Foster  City", "name": "Visa  Inc", "administrativeArea":  "CA", "region":"PEN", "email": ""  }, "name": "V-Internatio", "aggregatorID":  "123456789" }, "orderInformation": {  "billTo": { "country":"US", "lastName": "VDP", "address2": "Address 2", "address1": "201 S. Division St.", "postalCode": "48104-2201", "locality": "Ann Arbor","administrativeArea": "MI", "firstName": "RTS", "phoneNumber": "999999999", "district": "MI", "buildingNumber": "123", "company": "Visa","email":  "" },  "amountDetails":  { "totalAmount":  "102.21",  "currency": "USD"  } },  "paymentInformation":  { "card":  {"expirationYear":  "2031",  "number":   "5555555555554444",  "securityCode":  "123",  "expirationMonth":  "12",  "type":   "002"  }  }  }'

def HMACDigest = hmac(sharedSecret, timeStampUTC + URI + QS + payload)

def encodedDigest = HMACDigest.encodeHex().toString()

def XPayToken = "xv2:"+ timeStampUTC + ":" + encodedDigest

testRunner.testCase.setPropertyValue("xpayToken", XPayToken)


Request Payload


{ "clientReferenceInformation":   {   "code":   "TC50171_3"   },  "processingInformation":   {   "commerceIndicator":   "internet"   },"aggregatorInformation": { "subMerchant":  { "cardAcceptorID": "1234567890", "country": "US",  "phoneNumber": "650-432-0000", "address1":"900 Metro  Center", "postalCode":  "94404-2775", "locality": "Foster  City", "name": "Visa  Inc", "administrativeArea":  "CA", "region":"PEN", "email": ""  }, "name": "V-Internatio", "aggregatorID":  "123456789" }, "orderInformation": {  "billTo": { "country":"US", "lastName": "VDP", "address2": "Address 2", "address1": "201 S. Division St.", "postalCode": "48104-2201", "locality": "Ann Arbor","administrativeArea": "MI", "firstName": "RTS", "phoneNumber": "999999999", "district": "MI", "buildingNumber": "123", "company": "Visa","email":  "" },  "amountDetails":  { "totalAmount":  "102.21",  "currency": "USD"  } },  "paymentInformation":  { "card":  {"expirationYear":  "2031",  "number":   "5555555555554444",  "securityCode":  "123",  "expirationMonth":  "12",  "type":   "002"  }  }  }



Regular Visitor

Re: Token Validation Failed

confirm that you have test certificates by following instructions provided on Getting started and used SOAPUI - hello world example with your certs. If that works, then send visa developer support http request and response (complete request and response with header values which has correlation ID) Download Tutuapp  Download 9Apps  Download Aptoide

Re: Token Validation Failed

I am actually an android app developer and I love trying new things to learn something new everyday.

Thanks dude, I have tried at my end it's helpful and benifited me over 70%. 


Re: Token Validation Failed

Thanks dude for sharing this information. Am also a web developer and i trying to learn new thing in everyday.



Re: Token Validation Failed

How can I put money ONTO my US Visa card (make a payment to the card) from overseas?



Download 9Apps

Visa Dev Moderator

Re: Token Validation Failed

Hi @dark007,                             


You've reached the Visa Developer Platform. This platform is for the developer community, banks and merchants to build solutions with our APIs to market to their customers. It's not a solution for end users, though you are free to create an account and experiment in our sandbox. 


If I've misunderstood, and you are a developer looking to build a solution for your customers, please visit this link to "Get Started" and find an API that meets your use case.




Re: Token Validation Failed

You shared a nice information, learning is an ongoing process so keep trying.

Learn how to hack facebook account using Z Shadow hacker.


Re: Token Validation Failed


Re: Token Validation Failed

Thanks for sharing this information

Kinemaster for PC

Free fire for PC