Check

Use this API to validate an existing Token against the VISA, MasterCard and AMEX network at any time.

Using the card check API provides you with a simple and effective way against fraud. Thereby we run a zero amount call against the Visa, MasterCard and AMEX network to check if the card is still valid, not stolen or expired. The authorization request does not appear on the customer statement but still gives you the ability to test the validity of a stored credit card.

The service requires HTTP Basic Authentication. Provide your merchantId as the basic authentication username value. The password can be found in the Web Admin Tool under UPP Administration > Security > Server-to-Server services security.

1. Activate credit card check feature

Please contact PCI Proxy team to activate the credit card check feature on your PCI Proxy account.

2. Call the validate API

post
Validate method

https://api.sandbox.datatrans.com/v1/transactions/validate
Request
Response
Headers
Authorization
required
string
Basic MTEwMDAwNzAwNjpLNnFYMXUklQ==
Content-Type
required
string
application/json; charset=UTF-8
Body Parameters
currency
required
string
3 letter ISO-4217 character code. For VISA and MC cards use CHF and for AMEX cards use EUR
refno
required
string
Your unique reference number (AN 1..20)
card
required
object
Card object must contain following parameters below
alias
required
string
Credit card token received from initial tokenisation
expiryMonth
required
string
The expiry month of the credit card token (AN2)
expiryYear
required
string
The expiry year of the credit card token (AN2)
200: OK
Credit Card successfully validated
{
"transactionId": "190828124101219812",
"acquirerAuthorizationCode": "124101"
}
400: Bad Request
Credit Card Expired
{
"error": {
"code": "EXPIRED_CARD",
"message": "expired card"
},
"transactionId": "191016104534077141",
"card": {}
}

In test mode, only test credit cards are allowed.

Examples

Request
Response Success
Response error
curl -X POST \
https://api.sandbox.datatrans.com/v1/transactions/validate \
-H 'Authorization: Basic MTAwMDAwMTExMTpwWUU4bFE2TlBiM2thRXpR' \
-H 'Content-Type: application/json; charset=UTF-8' \
-d '{
"currency": "CHF",
"refno": "vptJ07xyr",
"card": {
"alias": "424242SKMPRI4242",
"expiryMonth": "12",
"expiryYear": "21"
}
}'
{
"transactionId": "191016104224286267",
"acquirerAuthorizationCode": "104224",
"card": {
"masked": "424242xxxxxx4242"
}
}
{
"error": {
"code": "EXPIRED_CARD",
"message": "expired card"
},
"transactionId": "191016104534077141",
}

Error table

"UNKNOWN_ERROR", "UNRECOGNIZED_PROPERTY", "INVALID_PROPERTY", "INVALID_TRANSACTION_STATUS", "TRANSACTION_NOT_FOUND", "INVALID_JSON_PAYLOAD", "UNAUTHORIZED", "EXPIRED_CARD", "INVALID_CARD", "UNSUPPORTED_CARD", "DUPLICATED_REFNO", "DECLINED", "BLOCKED_BY_VELOCITY_CHECKER", "CLIENT_ERROR" , "SERVER_ERROR"