Create a Virtual Card
curl --request POST \
--url https://api.flutterwave.com/v3/virtual-cards \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"currency": "USD",
"amount": 5,
"debit_currency": "NGN",
"billing_name": "Flutterwave Developers",
"billing_address": "333, Fremont Street",
"billing_city": "San Francisco",
"billing_state": "CA",
"billing_postal_code": "94105",
"billing_country": "US"
}
'import requests
url = "https://api.flutterwave.com/v3/virtual-cards"
payload = {
"currency": "USD",
"amount": 5,
"debit_currency": "NGN",
"billing_name": "Flutterwave Developers",
"billing_address": "333, Fremont Street",
"billing_city": "San Francisco",
"billing_state": "CA",
"billing_postal_code": "94105",
"billing_country": "US"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
currency: 'USD',
amount: 5,
debit_currency: 'NGN',
billing_name: 'Flutterwave Developers',
billing_address: '333, Fremont Street',
billing_city: 'San Francisco',
billing_state: 'CA',
billing_postal_code: '94105',
billing_country: 'US'
})
};
fetch('https://api.flutterwave.com/v3/virtual-cards', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flutterwave.com/v3/virtual-cards",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'currency' => 'USD',
'amount' => 5,
'debit_currency' => 'NGN',
'billing_name' => 'Flutterwave Developers',
'billing_address' => '333, Fremont Street',
'billing_city' => 'San Francisco',
'billing_state' => 'CA',
'billing_postal_code' => '94105',
'billing_country' => 'US'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.flutterwave.com/v3/virtual-cards"
payload := strings.NewReader("{\n \"currency\": \"USD\",\n \"amount\": 5,\n \"debit_currency\": \"NGN\",\n \"billing_name\": \"Flutterwave Developers\",\n \"billing_address\": \"333, Fremont Street\",\n \"billing_city\": \"San Francisco\",\n \"billing_state\": \"CA\",\n \"billing_postal_code\": \"94105\",\n \"billing_country\": \"US\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.flutterwave.com/v3/virtual-cards")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"currency\": \"USD\",\n \"amount\": 5,\n \"debit_currency\": \"NGN\",\n \"billing_name\": \"Flutterwave Developers\",\n \"billing_address\": \"333, Fremont Street\",\n \"billing_city\": \"San Francisco\",\n \"billing_state\": \"CA\",\n \"billing_postal_code\": \"94105\",\n \"billing_country\": \"US\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flutterwave.com/v3/virtual-cards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"currency\": \"USD\",\n \"amount\": 5,\n \"debit_currency\": \"NGN\",\n \"billing_name\": \"Flutterwave Developers\",\n \"billing_address\": \"333, Fremont Street\",\n \"billing_city\": \"San Francisco\",\n \"billing_state\": \"CA\",\n \"billing_postal_code\": \"94105\",\n \"billing_country\": \"US\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Card created successfully",
"data": {
"id": "43ec6e92-9eb7-48ad-91c8-7bee425a33cf",
"account_id": 65637,
"amount": "20,000.00",
"currency": "NGN",
"card_hash": "43ec6e92-9eb7-48ad-91c8-7bee425a33cf",
"card_pan": "5366130699778900",
"masked_pan": "536613*******8900",
"city": "Lekki",
"state": "Lagos",
"address_1": "19, Olubunmi Rotimi",
"address_2": null,
"zip_code": "23401",
"cvv": "134",
"expiration": "2023-01",
"send_to": null,
"bin_check_name": null,
"card_type": "mastercard",
"name_on_card": "Jermaine Graham",
"created_at": "2020-01-17T18:33:29.0130255+00:00",
"is_active": true,
"callback_url": null
}
}Virtual Cards
Create a Virtual Card
Create a new virtual card
POST
/
virtual-cards
Create a Virtual Card
curl --request POST \
--url https://api.flutterwave.com/v3/virtual-cards \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"currency": "USD",
"amount": 5,
"debit_currency": "NGN",
"billing_name": "Flutterwave Developers",
"billing_address": "333, Fremont Street",
"billing_city": "San Francisco",
"billing_state": "CA",
"billing_postal_code": "94105",
"billing_country": "US"
}
'import requests
url = "https://api.flutterwave.com/v3/virtual-cards"
payload = {
"currency": "USD",
"amount": 5,
"debit_currency": "NGN",
"billing_name": "Flutterwave Developers",
"billing_address": "333, Fremont Street",
"billing_city": "San Francisco",
"billing_state": "CA",
"billing_postal_code": "94105",
"billing_country": "US"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
currency: 'USD',
amount: 5,
debit_currency: 'NGN',
billing_name: 'Flutterwave Developers',
billing_address: '333, Fremont Street',
billing_city: 'San Francisco',
billing_state: 'CA',
billing_postal_code: '94105',
billing_country: 'US'
})
};
fetch('https://api.flutterwave.com/v3/virtual-cards', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flutterwave.com/v3/virtual-cards",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'currency' => 'USD',
'amount' => 5,
'debit_currency' => 'NGN',
'billing_name' => 'Flutterwave Developers',
'billing_address' => '333, Fremont Street',
'billing_city' => 'San Francisco',
'billing_state' => 'CA',
'billing_postal_code' => '94105',
'billing_country' => 'US'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.flutterwave.com/v3/virtual-cards"
payload := strings.NewReader("{\n \"currency\": \"USD\",\n \"amount\": 5,\n \"debit_currency\": \"NGN\",\n \"billing_name\": \"Flutterwave Developers\",\n \"billing_address\": \"333, Fremont Street\",\n \"billing_city\": \"San Francisco\",\n \"billing_state\": \"CA\",\n \"billing_postal_code\": \"94105\",\n \"billing_country\": \"US\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.flutterwave.com/v3/virtual-cards")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"currency\": \"USD\",\n \"amount\": 5,\n \"debit_currency\": \"NGN\",\n \"billing_name\": \"Flutterwave Developers\",\n \"billing_address\": \"333, Fremont Street\",\n \"billing_city\": \"San Francisco\",\n \"billing_state\": \"CA\",\n \"billing_postal_code\": \"94105\",\n \"billing_country\": \"US\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flutterwave.com/v3/virtual-cards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"currency\": \"USD\",\n \"amount\": 5,\n \"debit_currency\": \"NGN\",\n \"billing_name\": \"Flutterwave Developers\",\n \"billing_address\": \"333, Fremont Street\",\n \"billing_city\": \"San Francisco\",\n \"billing_state\": \"CA\",\n \"billing_postal_code\": \"94105\",\n \"billing_country\": \"US\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Card created successfully",
"data": {
"id": "43ec6e92-9eb7-48ad-91c8-7bee425a33cf",
"account_id": 65637,
"amount": "20,000.00",
"currency": "NGN",
"card_hash": "43ec6e92-9eb7-48ad-91c8-7bee425a33cf",
"card_pan": "5366130699778900",
"masked_pan": "536613*******8900",
"city": "Lekki",
"state": "Lagos",
"address_1": "19, Olubunmi Rotimi",
"address_2": null,
"zip_code": "23401",
"cvv": "134",
"expiration": "2023-01",
"send_to": null,
"bin_check_name": null,
"card_type": "mastercard",
"name_on_card": "Jermaine Graham",
"created_at": "2020-01-17T18:33:29.0130255+00:00",
"is_active": true,
"callback_url": null
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
200 - application/json; charset=utf-8
OK
Show child attributes
Show child attributes
Example:
{
"id": "43ec6e92-9eb7-48ad-91c8-7bee425a33cf",
"account_id": 65637,
"amount": "20,000.00",
"currency": "NGN",
"card_hash": "43ec6e92-9eb7-48ad-91c8-7bee425a33cf",
"card_pan": "5366130699778900",
"masked_pan": "536613*******8900",
"city": "Lekki",
"state": "Lagos",
"address_1": "19, Olubunmi Rotimi",
"address_2": null,
"zip_code": "23401",
"cvv": "134",
"expiration": "2023-01",
"send_to": null,
"bin_check_name": null,
"card_type": "mastercard",
"name_on_card": "Jermaine Graham",
"created_at": "2020-01-17T18:33:29.0130255+00:00",
"is_active": true,
"callback_url": null
}
Was this page helpful?
⌘I