Skip to main content

Real-time Validate PAN

This API call is used to validate a single PAN. Real-time Validate 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

NameTypeDescription
PanStringRequired. The PAN to validate.
ExpmonthStringRequired. The expiry month of the card. Formatted as MM
ExpyearStringRequired. The expiry year of the card. Formatted as YYYY
MerchantidStringRequired. The unique reference to the merchant in the Cardtokens system.

Response parameters

NameTypeDescription
statusStringA: 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.
schemeStringCan be one of “visa”, “mastercard”.
oldpanString
oldexpmonthString
oldexpyearString
newpanStringIf a new PAN was present.
newexpmonthStringIf a new expiry month was present. Formatted MM.
newexpyearStringIf 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"
}