Back to Capital One questions
CodingSoftware Engineer

Virtual Card Number Validation

Frequency: Reported


Similar to credit card numbers, the digits in virtual card numbers and associated transaction numbers carry meaning. When a Capital One Virtual Credit Card is used, validate the data against the following business rules to reach a spend decision.

Each transaction made with a virtual card number has a unique eight-digit transaction ID.

Transaction ID rules

Digit position (0-7)PurposeRule
7Online transaction indicator1 = true; 0 = false
6Authorization/charge indicator0 = authorization; 1 = charge

An authorization is a hold on funds, such as when checking into a hotel. A charge is the bill or balance due, such as when checking out.

Virtual card number rules

Digit position (0-15)PurposeRule
15Merchant-bound indicator1 = true; 0 = false
14Card type0 = Visa; 1 = Mastercard
13Multi-use indicator1 = true; 0 = false

Merchant-bound virtual card numbers may be used only at a specified merchant. Multi-use virtual card numbers may be used for online or offline card-not-present transactions.

Visa transactions are valid when the virtual card number is merchant-bound and not multi-use. A Visa transaction can still be valid when it is online and under $100, provided that it is not an authorization.

Mastercard transactions are valid when the amount is under $100, the purchase is online or in person, and the virtual card number is not merchant-bound. A Mastercard transaction can still be valid and merchant-bound when the amount is over $100.

Test cases

For each test case, determine the expected response from the rules:

vcnNumbertransactionIdtransactionAmountExpected response
123456789101200112345101$50T
123456789101201112345110$150T
123456789101211012345101$50T
123456789101210012345111$50T
123456789101210012345101$50F