Visa Developer Community

Helper

Tokens API Error Code 400

I'm working with the tokens API ('/cybersource/flex/v1/tokens?apikey=API_KEY').  When invoking the API, I get the error shown below. I'm using the test credit card number 411111111111111, which is what I found in some documentation. I can't seem to understand what might be wrong with the data I'm sending. Any help with be appreciated very much.

 

 

{
	"responseStatus": {
		"status": 400,
		"reason": "TOKENIZATION_ERROR",
		"message": "Token not created: One or more fields in the request contain invalid data.  Resend the request with the correct information.",
		"correlationId": null,
		"details": [],
		"_embedded": {
			"icsReply": {
				"requestId": "5458678759626638204006",
				"_links": {
					"self": {
						"href": "/cybersource/flex/search/v1/logs/tokenProvider/5458678759626638204006"
					}
				}
			}
		}
	},
	"_links": {
		"self": null,
		"documentation": [],
		"next": []
	}
}

 

My JSON request payload: 

 

{
	"keyId": "08vfZkhLfr6TMgDjMgzcB3UYG8CqOBro",
	"cardInfo": {
		"cardNumber": "YKsd2pCtopMmrTzHp15zSUT5+HemiojfL7to36HJzONNifEq598UnGDpTVArQZiSvm2c6BLr3cdMmBnpr6WpqWklAa5d1UJgaaMJypsq6UdZY/gaA325JtX3oBHvttI+0Idfem9t/OUhgy93aXnN+4dSDrSHX9P0xvNk+rm1yqAVZaXePYvh1EwfbiTmqc3+TzL+Fl7vGVjWQUVnFND0td/zqBswie/wlMojwrvXlb9IIc5wGc/TGAuHr4tVDdI1lN50GTFhpGZrWy/vyXt9BVmjgDDbPW4B2pPok8eqFnevGKss4vVkkujNaJYgY/rrjXGirlNqPhE10G6KTgONCg==",
		"cardType": "001"
	}
}

 

 

Tags (2)
9 REPLIES 9
Community Manager

Re: Tokens API Error Code 400

Hey @jbonglo,

 

Sorry to hear that. I am looking into this for you.

 

If you have any additional questions let me know. I'll get back to you within 24hrs. 

 

Thanks!

Ricardo

Community Manager

Re: Tokens API Error Code 400

Hey @jbonglo - when the key was generated what encryption type was specified? 

Highlighted
Newbie

Re: Tokens API Error Code 400

Thanks For sharing this topic.

Regard

Group D Result

Helper

Re: Tokens API Error Code 400

RsaOaep256.

Helper

Re: Tokens API Error Code 400

RsaOaep256.
Helper

Re: Tokens API Error Code 400

Any update on this issue?

Community Manager

Re: Tokens API Error Code 400

Hey @jbonglo - sorry about the delay here. Still looking into this. Will get back to you ASAP. 

Community Manager

Re: Tokens API Error Code 400

Hi @jbonglo,

One quick torublshooting step might be to load up this tutorial through the code in the debugger: 

https://github.com/CyberSource/cybersource-flex-samples/tree/173ad128642408bd123432f8751c8ccfaebffcf...

 

The FlexKeyProvider.java file shows how to call the keys API with RsaOaep256: https://github.com/CyberSource/cybersource-flex-samples/blob/173ad128642408bd123432f8751c8ccfaebffcf... 

 

Let me know how it goes. 

 

Thanks,

Ricardo 

Re: Tokens API Error Code 400

Hello, 

I have the same problem. I am stuck also on this tokenization of card. The same card number used. I used the encryption of card below base on the example . EncryptionType used is also RsaOaep256. Really Appreciate for your kind support on this one.

 

Screen Shot 2019-01-29 at 11.02.44 PM.png