Extract specific fields
Once scanning completes, BlinkCard returns a result object with the extracted card data. This guide shows how to read the most common fields on web, Android, and iOS.
The result object
Whether you scan via camera or from a static image, you get back a BlinkCardScanningResult.
Card account data (number, CVV, expiry) lives in the cardAccounts array, while the cardholder name and IBAN are top-level fields:
- Web (JS)
- Android (Kotlin)
- iOS (Swift)
blinkCard.addOnResultCallback((result) => {
const account = result.cardAccounts[0];
const cardNumber = account.cardNumber;
const cvv = account.cvv;
const cardholderName = result.cardholderName;
const iban = result.iban;
const issuingNetwork = result.issuingNetwork; // e.g. "visa", "mastercard"
});
val account = result.cardAccounts[0]
val cardNumber = account.cardNumber
val cvv = account.cvv
val cardholderName = result.cardholderName
val iban = result.iban
val issuingNetwork = result.issuingNetwork // e.g. "visa", "mastercard"
let account = result.cardAccounts[0]
let cardNumber = account.cardNumber
let cvv = account.cvv
let cardholderName = result.cardholderName
let iban = result.iban
let issuingNetwork = result.issuingNetwork // e.g. "visa", "mastercard"
A card can expose more than one payment account, so cardAccounts is an array.
For a standard single-account card, read the first entry.
Card number
The card number is always extracted from the first side. Each account also reports whether the number passed Luhn checksum validation:
- Web (JS)
- Android (Kotlin)
- iOS (Swift)
const account = result.cardAccounts[0];
console.log("Card number:", account.cardNumber);
console.log("Passes checksum:", account.cardNumberValid);
val account = result.cardAccounts[0]
Log.d("BlinkCard", "Card number: ${account.cardNumber}")
Log.d("BlinkCard", "Passes checksum: ${account.cardNumberValid}")
let account = result.cardAccounts[0]
print("Card number:", account.cardNumber)
print("Passes checksum:", account.cardNumberValid)
Expiry date
The expiry date is a structured DateResult.
Read the parsed month and year, or use originalString for the raw text as printed on the card:
- Web (JS)
- Android (Kotlin)
- iOS (Swift)
const expiry = result.cardAccounts[0].expiryDate;
console.log("Month:", expiry.month);
console.log("Year:", expiry.year);
console.log("As printed:", expiry.originalString);
val expiry = result.cardAccounts[0].expiryDate
Log.d("BlinkCard", "Month: ${expiry.month}")
Log.d("BlinkCard", "Year: ${expiry.year}")
Log.d("BlinkCard", "As printed: ${expiry.originalString}")
On iOS, expiryDate is optional (DateResult?), so unwrap it before reading the parsed values:
if let expiry = result.cardAccounts[0].expiryDate {
print("Month:", expiry.month)
print("Year:", expiry.year)
print("As printed:", expiry.originalString)
}
CVV
The CVV is usually printed on the back of the card, so it is only present after the second side is scanned:
- Web (JS)
- Android (Kotlin)
- iOS (Swift)
const cvv = result.cardAccounts[0].cvv;
val cvv = result.cardAccounts[0].cvv
let cvv = result.cardAccounts.first?.cvv
Cardholder name and IBAN
These are top-level fields and may be empty if the card does not contain them or extraction was disabled:
- Web (JS)
- Android (Kotlin)
- iOS (Swift)
console.log("Cardholder:", result.cardholderName);
console.log("IBAN:", result.iban);
Log.d("BlinkCard", "Cardholder: ${result.cardholderName}")
Log.d("BlinkCard", "IBAN: ${result.iban}")
print("Cardholder:", result.cardholderName ?? "")
print("IBAN:", result.iban ?? "")
Disable fields you don't need
By default, BlinkCard extracts all supported fields. If your integration only needs some of them, disable the rest so the SDK can finish scanning sooner (it concludes after a single side once all requested data is captured).