Validate Charge
curl --request POST \
--url https://api.flutterwave.com/v3/validate-charge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"otp": "12345",
"flw_ref": "FLW-MOCK-f7a221903f699288569465135f357022"
}
'import requests
url = "https://api.flutterwave.com/v3/validate-charge"
payload = {
"otp": "12345",
"flw_ref": "FLW-MOCK-f7a221903f699288569465135f357022"
}
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({otp: '12345', flw_ref: 'FLW-MOCK-f7a221903f699288569465135f357022'})
};
fetch('https://api.flutterwave.com/v3/validate-charge', 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/validate-charge",
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([
'otp' => '12345',
'flw_ref' => 'FLW-MOCK-f7a221903f699288569465135f357022'
]),
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/validate-charge"
payload := strings.NewReader("{\n \"otp\": \"12345\",\n \"flw_ref\": \"FLW-MOCK-f7a221903f699288569465135f357022\"\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/validate-charge")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"otp\": \"12345\",\n \"flw_ref\": \"FLW-MOCK-f7a221903f699288569465135f357022\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flutterwave.com/v3/validate-charge")
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 \"otp\": \"12345\",\n \"flw_ref\": \"FLW-MOCK-f7a221903f699288569465135f357022\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Charge validated",
"data": {
"id": 4981392,
"tx_ref": "MC-3243ff00440011pu00",
"flw_ref": "FLW-MOCK-f7a221903f699288569465135f357022",
"device_fingerprint": "N/A",
"amount": 100,
"charged_amount": 100,
"app_fee": 1.4,
"merchant_fee": 0,
"processor_response": "successful",
"auth_model": "PIN",
"currency": "NGN",
"ip": "52.209.154.143",
"narration": "CARD Transaction ",
"status": "successful",
"auth_url": "N/A",
"payment_type": "card",
"plan": null,
"fraud_status": "ok",
"charge_type": "normal",
"created_at": "2024-03-21T22:16:28.000Z",
"account_id": 20937,
"customer": {
"id": 2376560,
"phone_number": null,
"name": "John Doe",
"email": "Johndoe@gmail.com",
"created_at": "2024-03-21T22:16:28.000Z"
},
"card": {
"first_6digits": "539983",
"last_4digits": "8381",
"issuer": "MASTERCARD GUARANTY TRUST BANK Mastercard Naira Debit Card",
"country": "NG",
"type": "MASTERCARD",
"expiry": "10/31"
}
}
}{
"status": "error",
"message": "Invalid transaction attempt. No REF Cache",
"data": null
}Charges
Validate Charge
To validate a card charge
POST
/
validate-charge
Validate Charge
curl --request POST \
--url https://api.flutterwave.com/v3/validate-charge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"otp": "12345",
"flw_ref": "FLW-MOCK-f7a221903f699288569465135f357022"
}
'import requests
url = "https://api.flutterwave.com/v3/validate-charge"
payload = {
"otp": "12345",
"flw_ref": "FLW-MOCK-f7a221903f699288569465135f357022"
}
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({otp: '12345', flw_ref: 'FLW-MOCK-f7a221903f699288569465135f357022'})
};
fetch('https://api.flutterwave.com/v3/validate-charge', 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/validate-charge",
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([
'otp' => '12345',
'flw_ref' => 'FLW-MOCK-f7a221903f699288569465135f357022'
]),
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/validate-charge"
payload := strings.NewReader("{\n \"otp\": \"12345\",\n \"flw_ref\": \"FLW-MOCK-f7a221903f699288569465135f357022\"\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/validate-charge")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"otp\": \"12345\",\n \"flw_ref\": \"FLW-MOCK-f7a221903f699288569465135f357022\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flutterwave.com/v3/validate-charge")
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 \"otp\": \"12345\",\n \"flw_ref\": \"FLW-MOCK-f7a221903f699288569465135f357022\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Charge validated",
"data": {
"id": 4981392,
"tx_ref": "MC-3243ff00440011pu00",
"flw_ref": "FLW-MOCK-f7a221903f699288569465135f357022",
"device_fingerprint": "N/A",
"amount": 100,
"charged_amount": 100,
"app_fee": 1.4,
"merchant_fee": 0,
"processor_response": "successful",
"auth_model": "PIN",
"currency": "NGN",
"ip": "52.209.154.143",
"narration": "CARD Transaction ",
"status": "successful",
"auth_url": "N/A",
"payment_type": "card",
"plan": null,
"fraud_status": "ok",
"charge_type": "normal",
"created_at": "2024-03-21T22:16:28.000Z",
"account_id": 20937,
"customer": {
"id": 2376560,
"phone_number": null,
"name": "John Doe",
"email": "Johndoe@gmail.com",
"created_at": "2024-03-21T22:16:28.000Z"
},
"card": {
"first_6digits": "539983",
"last_4digits": "8381",
"issuer": "MASTERCARD GUARANTY TRUST BANK Mastercard Naira Debit Card",
"country": "NG",
"type": "MASTERCARD",
"expiry": "10/31"
}
}
}{
"status": "error",
"message": "Invalid transaction attempt. No REF Cache",
"data": null
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
OK
Show child attributes
Show child attributes
Example:
{ "id": 4973065, "tx_ref": "YOUR_UNIQUE_REFERENCE", "flw_ref": "FLW-MOCK-2477a2b9d7845b31976cd50c0af890f1", "device_fingerprint": "N/A", "amount": 100, "charged_amount": 100, "app_fee": 1.4, "merchant_fee": 0, "processor_response": "Please enter the OTP sent to your mobile number 080****** and email te**@rave**.com", "auth_model": "NOAUTH", "currency": "NGN", "ip": "52.209.154.143", "narration": "CARD Transaction ", "status": "successful", "auth_url": "https://ravesandboxapi.flutterwave.com/mockvbvpage?ref=FLW-MOCK-2477a2b9d7845b31976cd50c0af890f1&code=00&message=Approved.%20Successful&receiptno=RN1710749806478", "payment_type": "card", "plan": null, "fraud_status": "ok", "charge_type": "normal", "created_at": "2024-03-18T08:16:46.000Z", "account_id": 20937, "customer": { "id": 2373734, "phone_number": null, "name": "Anonymous customer", "email": "developers@flutterwavego.com", "created_at": "2024-03-18T08:16:46.000Z" }, "card": { "first_6digits": "553188", "last_4digits": "2950", "issuer": "MASTERCARD CREDIT", "country": "NG", "type": "MASTERCARD", "expiry": "09/32" } }
Was this page helpful?
⌘I