Real-time Validate PAN
This API call is used to validate a single PAN.
Endpoint and method
Method: POST
Endpoint: https://api.cardtokens.io/api/cu/validatepan
Encryption
Response payload for the reply from Cardtokens is encrypted using RSA public / private key encryption. The response is JSON formatted like:
{ “encdata”: “BASE-64-ENCODED-ENCRYPTED-DATA” }
Request parameters
Name | Type | Description |
---|---|---|
Pan | String | Required. The PAN to validate. |
Expmonth | String | Required. The expiry month of the card. Formatted as MM |
Expyear | String | Required. The expiry year of the card. Formatted as YYYY |
Merchantid | String | Required. The unique reference to the merchant in the Cardtokens system. |
Response parameters
Name | Type | Description |
---|---|---|
status | String | A: Account number change message. C: Closed account advice. E: Expiration date change. N: Non-participating BIN. Q: Contact cardholder advice. O: Cardholder Opt-Out. P: Participating BIN, no match. V: Match made, account number and expiration date unchanged. |
scheme | String | Can be one of “visa”, “mastercard”. |
oldpan | String | |
oldexpmonth | String | |
oldexpyear | String | |
newpan | String | If a new PAN was present. |
newexpmonth | String | If a new expiry month was present. Formatted MM. |
newexpyear | String | If a new expyear was present. Formatted YYYY. |
Example request
{
"pan": "4571233011221122",
"expmonth": "01",
"expyear": "2096",
"merchantid": "361ec97b904d406d90d2df47e2f5f955"
}
Example encrypted response
{
"encdata":"TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdCwgc2VkIGRvIGVpdXNtb2QgdGVtcG9yIGl
uY2lkaWR1bnQgdXQgbGFib3JlIGV0IGRvbG9yZSBtYWduYSBhbGlxdWEuIFV0IGVuaW0gYWQgbWluaW0gdmVuaWFtLCBxdWlzIG5vc3RydWQgZXh
lcmNpdGF0aW9uIHVsbGFtY28gbGFib3JpcyBuaXNpIHV0IGFsaXF1aXAgZXggZWEgY29tbW9kbyBjb25zZXF1YXQuIER1aXMgYXV0ZSBpcnVyZSBkb2x
vciBpbiByZXByZWhlbmRlcml0IGluIHZvbHVwdGF0ZSB2ZWxpdCBlc3NlIGNpbGx1bSBkb2xvcmUgZXUgZnVnaWF0IG51bGxhIHBhcmlhdHVyLiBFeGN
lcHRldXIgc2ludCBvY2NhZWNhdCBjdXBpZGF0YXQgbm9uIHByb2lkZW50LCBzdW50IGluIGN1bHBhIHF1aSBvZmZpY2lhIGRlc2VydW50IG1vbGxpdCB
hbmltIGlkIGVzdCBsYWJvcnVtLg=="
}
Example decrypted response
{
"status": "E",
"scheme": "visa",
"oldpan": "4571233011221122",
"oldexpmonth": "01",
"oldexpyear": "2096",
"newpan": "4571233011221121",
"newexpmonth": "02",
"newexpyear": "2097"
}