Virtual cards

A virtual card is a temporary prepaid card for making online payments. They're like physical bank cards, but you can get them in seconds and use them to pay anywhere on the Internet. Virtual cards can be either dollar cards or naira cards. You can see and manage all virtual cards in your account on the Cards page of your dashboard.

Virtual cards and virtual accounts are unrelated

Virtual accounts allow you to receive payments into your Flutterwave wallet via bank transfer, while virtual cards allow you to make online payments.

Why use a virtual card?

Virtual cards are for easy online payments. Like physical cards, they're issued by a card issuer (such as VISA or MasterCard), but they open up more opportunities—you can get a dollar card with a US billing address in seconds without leaving your home.

Naira virtual card limitations

While dollar cards can be used globally, naira virtual cards can only be used on platforms that use Flutterwave as a payment processor.

Virtual cards are also useful for isolating expenses. You can create a card for employee expenses, one for cloud payments, one for shopping on Amazon and so on. With our API, you can fund, cancel, or view transactions for each card separately.

Even better, they can power your business. If you're building an app with a wallet system, you can issue cards to your users so they can make external payments with their funds in your app. Flutterwave makes this easy: sign up as a merchant and you can create virtual cards for your account, which you then pass on to your users.

Creating a virtual card

Approval required

To create virtual cards in Live Mode, your Flutterwave account needs to be approved. Visit your dashboard and upload the necessary documents to get started.

New or restricted accounts may also encounter problems creating cards in Test Mode. If you get an error that says, You cannot create cards at this time, please reach out to our support.

You can create a virtual card with the create card endpoint, which is supported in some of our backend SDKs. At the very least, you'll need to specify the card currency, the name on the card (which would be your user's name), and the amount to fund the card with (from your Flutterwave wallet):

// Install with: npm i flutterwave-node-v3

const Flutterwave = require('flutterwave-node-v3');
const flw = new Flutterwave(process.env.FLW_PUBLIC_KEY, process.env.FLW_SECRET_KEY);
const userName = "Omotayo Chigozie";
const details = {
    currency: "USD",
    amount: 1725,
    billing_name: userName,
};
flw.VirtualCard.create(details)
    .then(response => console.log(response));
// Install with: composer require flutterwavedev/flutterwave-v3

$flw = new \Flutterwave\Rave(getenv('FLW_SECRET_KEY')); // Set `PUBLIC_KEY` as an environment variable
$virtualCardsService = new \Flutterwave\VirtualCard();
$userName = "Omotayo Chigozie";
$details = [
    "currency" => "USD",
    "amount" => 1725,
    "billing_name" => $userName,
];
$response = $virtualCardsService->createCard($details);
# Install with: gem install flutterwave_sdk

require 'flutterwave_sdk'

flw = Flutterwave.new(ENV["FLW_PUBLIC_KEY"], ENV["FLW_SECRET_KEY"], ENV["FLW_ENCRYPTION_KEY"])
virtual_card = VirtualCard.new(flw)
user_name = "Omotayo Chigozie"
details = {
    currency: "USD",
    amount: 1725,
    billing_name: user_name,
}
response = virtual_card.create_virtual_card details
print response
# Install with: pip install rave_python

import os
from rave_python import Rave

rave = Rave(os.getenv("FLW_PUBLIC_KEY"), os.getenv("FLW_SECRET_KEY")
res = rave.VirtualCard.create({
    "currency": "NGN",
    "amount": "100",
    "billing_name": "Flutterwave Developers",
    "billing_address": "8, Providence Street",
    "billing_city": "Lekki",
    "billing_state": "Lagos",
    "billing_postal_code": "100001",
    "billing_country": "NG",
 })
print(res)
// Add the dependency com.flutterwave:Rave-Java:1.04 to your project

import com.flutterwave.rave.java.service.virtualcardServices;
import com.flutterwave.rave.java.payload.virtualcardpayload;

virtualcardServices virtualCards = new virtualcardServices();
virtualcardpayload payload = new virtualcardpayload():
payload.setCurrency("USD");
payload.setAmount(1725);
payload.setBilling_name("Omotayo Chigozie");
payload.setSecret_Key(System.getEnv("FLW_SECRET_KEY"));

String response = virtualCards.dovirtualcardcreate(payload);
curl --request POST 'https://api.flutterwave.com/v3/virtual-cards' \
  --header 'Authorization: Bearer YOUR_SECRET_KEY'\
  --header 'Content-Type: application/json'\
  --data-raw '{
    "currency": "USD",
    "amount": 1725,
    "billing_name": "Omotayo Chigozie"
}'
Pricing

See our Pricing page for details on the charges and funding restrictions for virtual cards.

If all goes well, you'll have a new virtual card, and you can pass on the card details (card number and billing address details) to your user.

{
  "status": "success",
  "message": "Card created successfully",
  "data": {
    "id": "43ec6e92-9eb7-48ad-91c8-7bee425a33cf",
    "account_id": 65637,
    "amount": "1725",
    "currency": "USD",
    "card_hash": "43ec6e92-9eb7-48ad-91c8-7bee425a33cf",
    "card_pan": "1234456789101112",
    "masked_pan": "123445*******1112",
    "city": "San Francisco",
    "state": "CA",
    "address_1": "333 Fremont Street",
    "address_2": null,
    "zip_code": "94105",
    "cvv": "134",
    "expiration": "2023-01",
    "send_to": null,
    "bin_check_name": null,
    "card_type": "visa",
    "name_on_card": "Omotayo Chigozie",
    "created_at": "2020-01-17T18:33:29.0130255+00:00",
    "is_active": true,
    "callback_url": null
  }
}
{
  "status": "error",
  "message": "One or more field failed validation.",
  "data": null
}

You can even create a cool card UI in your app, to display the details to your user😀:

Managing virtual cards

Now that you've created a card, your user can use it to pay online, and you can manage it from your dashboard or with our API:

Card events

When creating a card, you can specify a callback_url, where you'll be notified of any events that happen on the card, such as funding, purchases, card freezes, and termination.

Here's an example of the payload sent to a callback URL for a card termination:

{
  "transactionId": 777,
  "merchantName": "APPLE/ITUNES",
  "description": "Termination",
  "status": "Successful",
  "balance": 10.0,
  "amount": 10.0,
  "type": "Termination",
  "cardId": "1a4664-***-3838382-***-sd399",
  "maskedPan": "405640******1123"
}
Getting card OTPs

For MasterCard virtual cards, Flutterwave would send you OTPs via your callback_url. If you do not specify this when creating the card, We would send the notifications to your account email.

Got questions?

If you've got a question about virtual cards, check out the API reference. If you still can't find an answer, go ahead and ask your question on our developer forum.

Loading...