Create a Tokenized Charge
curl --request POST \
--url https://api.flutterwave.com/v3/tokenized-charges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"token": "flw-t1nf-c25d14a3a6b5afaf8022fe88212a3eaa-k3n",
"currency": "NGN",
"amount": 100,
"email": "Johndoe@gmail.com",
"tx_ref": "YOUR_UNIQUE_REFERENCE"
}
'import requests
url = "https://api.flutterwave.com/v3/tokenized-charges"
payload = {
"token": "flw-t1nf-c25d14a3a6b5afaf8022fe88212a3eaa-k3n",
"currency": "NGN",
"amount": 100,
"email": "Johndoe@gmail.com",
"tx_ref": "YOUR_UNIQUE_REFERENCE"
}
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({
token: 'flw-t1nf-c25d14a3a6b5afaf8022fe88212a3eaa-k3n',
currency: 'NGN',
amount: 100,
email: 'Johndoe@gmail.com',
tx_ref: 'YOUR_UNIQUE_REFERENCE'
})
};
fetch('https://api.flutterwave.com/v3/tokenized-charges', 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/tokenized-charges",
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([
'token' => 'flw-t1nf-c25d14a3a6b5afaf8022fe88212a3eaa-k3n',
'currency' => 'NGN',
'amount' => 100,
'email' => 'Johndoe@gmail.com',
'tx_ref' => 'YOUR_UNIQUE_REFERENCE'
]),
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/tokenized-charges"
payload := strings.NewReader("{\n \"token\": \"flw-t1nf-c25d14a3a6b5afaf8022fe88212a3eaa-k3n\",\n \"currency\": \"NGN\",\n \"amount\": 100,\n \"email\": \"Johndoe@gmail.com\",\n \"tx_ref\": \"YOUR_UNIQUE_REFERENCE\"\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/tokenized-charges")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"token\": \"flw-t1nf-c25d14a3a6b5afaf8022fe88212a3eaa-k3n\",\n \"currency\": \"NGN\",\n \"amount\": 100,\n \"email\": \"Johndoe@gmail.com\",\n \"tx_ref\": \"YOUR_UNIQUE_REFERENCE\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flutterwave.com/v3/tokenized-charges")
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 \"token\": \"flw-t1nf-c25d14a3a6b5afaf8022fe88212a3eaa-k3n\",\n \"currency\": \"NGN\",\n \"amount\": 100,\n \"email\": \"Johndoe@gmail.com\",\n \"tx_ref\": \"YOUR_UNIQUE_REFERENCE\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Charge successful",
"data": {
"id": 1163077,
"tx_ref": "akhlm-pstmn-23452",
"flw_ref": "FLW-M03K-781621ccfe976c03515bcd07a39f3db8",
"redirect_url": "http://127.0.0",
"device_fingerprint": "N/A",
"amount": 30300,
"charged_amount": 30300,
"app_fee": 11741.9,
"merchant_fee": 0,
"processor_response": "Approved",
"auth_model": "noauth",
"currency": "NGN",
"ip": "pstmn",
"narration": "pstmn charge",
"status": "successful",
"payment_type": "card",
"created_at": "2020-03-11T19:33:20.000Z",
"account_id": 73362,
"customer": {
"id": 252759,
"phone_number": "0813XXXXXXX",
"name": "Kendrick Graham",
"email": "user@example.com",
"created_at": "2020-01-15T13:26:24.000Z"
},
"card": {
"first_6digits": "553188",
"last_4digits": "2950",
"issuer": "MASTERCARD CREDIT",
"country": "NG",
"type": "MASTERCARD",
"expiry": "09/22",
"token": "flw-t0-d0185c6edad078c9e8304c4f78b8cd5b-m03k"
}
}
}{
"status": "error",
"message": "Wrong token or email passed",
"data": null
}Tokenized Charges
Create a Tokenized Charge
Initiate a card payment using a tokenized customer’s card
POST
/
tokenized-charges
Create a Tokenized Charge
curl --request POST \
--url https://api.flutterwave.com/v3/tokenized-charges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"token": "flw-t1nf-c25d14a3a6b5afaf8022fe88212a3eaa-k3n",
"currency": "NGN",
"amount": 100,
"email": "Johndoe@gmail.com",
"tx_ref": "YOUR_UNIQUE_REFERENCE"
}
'import requests
url = "https://api.flutterwave.com/v3/tokenized-charges"
payload = {
"token": "flw-t1nf-c25d14a3a6b5afaf8022fe88212a3eaa-k3n",
"currency": "NGN",
"amount": 100,
"email": "Johndoe@gmail.com",
"tx_ref": "YOUR_UNIQUE_REFERENCE"
}
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({
token: 'flw-t1nf-c25d14a3a6b5afaf8022fe88212a3eaa-k3n',
currency: 'NGN',
amount: 100,
email: 'Johndoe@gmail.com',
tx_ref: 'YOUR_UNIQUE_REFERENCE'
})
};
fetch('https://api.flutterwave.com/v3/tokenized-charges', 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/tokenized-charges",
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([
'token' => 'flw-t1nf-c25d14a3a6b5afaf8022fe88212a3eaa-k3n',
'currency' => 'NGN',
'amount' => 100,
'email' => 'Johndoe@gmail.com',
'tx_ref' => 'YOUR_UNIQUE_REFERENCE'
]),
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/tokenized-charges"
payload := strings.NewReader("{\n \"token\": \"flw-t1nf-c25d14a3a6b5afaf8022fe88212a3eaa-k3n\",\n \"currency\": \"NGN\",\n \"amount\": 100,\n \"email\": \"Johndoe@gmail.com\",\n \"tx_ref\": \"YOUR_UNIQUE_REFERENCE\"\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/tokenized-charges")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"token\": \"flw-t1nf-c25d14a3a6b5afaf8022fe88212a3eaa-k3n\",\n \"currency\": \"NGN\",\n \"amount\": 100,\n \"email\": \"Johndoe@gmail.com\",\n \"tx_ref\": \"YOUR_UNIQUE_REFERENCE\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flutterwave.com/v3/tokenized-charges")
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 \"token\": \"flw-t1nf-c25d14a3a6b5afaf8022fe88212a3eaa-k3n\",\n \"currency\": \"NGN\",\n \"amount\": 100,\n \"email\": \"Johndoe@gmail.com\",\n \"tx_ref\": \"YOUR_UNIQUE_REFERENCE\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Charge successful",
"data": {
"id": 1163077,
"tx_ref": "akhlm-pstmn-23452",
"flw_ref": "FLW-M03K-781621ccfe976c03515bcd07a39f3db8",
"redirect_url": "http://127.0.0",
"device_fingerprint": "N/A",
"amount": 30300,
"charged_amount": 30300,
"app_fee": 11741.9,
"merchant_fee": 0,
"processor_response": "Approved",
"auth_model": "noauth",
"currency": "NGN",
"ip": "pstmn",
"narration": "pstmn charge",
"status": "successful",
"payment_type": "card",
"created_at": "2020-03-11T19:33:20.000Z",
"account_id": 73362,
"customer": {
"id": 252759,
"phone_number": "0813XXXXXXX",
"name": "Kendrick Graham",
"email": "user@example.com",
"created_at": "2020-01-15T13:26:24.000Z"
},
"card": {
"first_6digits": "553188",
"last_4digits": "2950",
"issuer": "MASTERCARD CREDIT",
"country": "NG",
"type": "MASTERCARD",
"expiry": "09/22",
"token": "flw-t0-d0185c6edad078c9e8304c4f78b8cd5b-m03k"
}
}
}{
"status": "error",
"message": "Wrong token or email passed",
"data": null
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
OK
Show child attributes
Show child attributes
Example:
{
"id": 1163077,
"tx_ref": "akhlm-pstmn-23452",
"flw_ref": "FLW-M03K-781621ccfe976c03515bcd07a39f3db8",
"redirect_url": "http://127.0.0",
"device_fingerprint": "N/A",
"amount": 30300,
"charged_amount": 30300,
"app_fee": 11741.9,
"merchant_fee": 0,
"processor_response": "Approved",
"auth_model": "noauth",
"currency": "NGN",
"ip": "pstmn",
"narration": "pstmn charge",
"status": "successful",
"payment_type": "card",
"created_at": "2020-03-11T19:33:20.000Z",
"account_id": 73362,
"customer": {
"id": 252759,
"phone_number": "0813XXXXXXX",
"name": "Kendrick Graham",
"email": "user@example.com",
"created_at": "2020-01-15T13:26:24.000Z"
},
"card": {
"first_6digits": "553188",
"last_4digits": "2950",
"issuer": "MASTERCARD CREDIT",
"country": "NG",
"type": "MASTERCARD",
"expiry": "09/22",
"token": "flw-t0-d0185c6edad078c9e8304c4f78b8cd5b-m03k"
}
}
Was this page helpful?
⌘I