Bank Transfer
Learn how to accept payments with bank transfers.
Getting Started
We recommend checking out the introductory section to understand the basics of direct charge first. This guide assumes you’ve read that.
Direct charge via bank transfer allows you to generate account details (account number and bank) on demand to receive payments from customers via bank transfer.
Bank Transfer Support
Bank transfer is currently only supported for NGN transactions.
The Process
Collecting payments via bank transfer charge is straightforward:
- You call the bank transfer charge endpoint to create a charge and generate account details for the customer to pay into.
- The customer transfers to the generated account.
- We send you a webhook notifying you that we've received the payment.
- You verify the payment and complete the customer's order.
Initiating the Charge
To initiate the charge, you'll call the bank transfer charge endpoint, which is supported in some of our backend SDKs. You'll need to specify:
tx_ref
: A unique reference code that you'll generate for each transaction.amount
: The amount to be charged for the transaction.currency
: The currency to be used for the charge (currently always "NGN").email
: The customer's email address.
// 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 details = {
tx_ref: 'UNIQUE_TRANSACTION_REFERENCE',
amount: '1500',
currency: 'NGN',
email: '[email protected]',
fullname: 'Flutterwave Developers',
phone_number: '+2349012345678',
};
const response = await flw.Charge.bank_transfer(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"])
charge_transfer = BankTransfer.new(flw)
payload = {
"tx_ref" => "UNIQUE_TRANSACTION_REFERENCE",
"amount" => "1500",
"currency" => "NGN",
"email" => "[email protected]",
"fullname": "Flutterwave Developers",
"phone_number" => "+2349012345678"
}
response = charge_transfer.initiate_charge(payload)
curl --request POST \
--url https://api.flutterwave.com/v3/charges?type=bank_transfer \
--header 'Authorization: Bearer FLW_SECRET_KEY' \
--header 'content-type: application/json' \
--data '{
"tx_ref": "UNIQUE_TRANSACTION_REFERENCE",
"amount": "1500",
"currency": "NGN"
"email": "[email protected]",
"fullname": "Flutterwave Developers",
"phone_number": "+2349012345678"
}'
Integration Tip
You can also specify a list of subaccounts to split the payment into. See split payments for details.
There are more options available when initiating a bank transfer charge, such as the payment expiry, customer's phone_number
and additional meta
. See the endpoint docs for details.
{
"tx_ref": "UNIQUE_TRANSACTION_REFERENCE",
"amount": "1500",
"currency": "NGN",
"email": "[email protected]",
"fullname": "Flutterwave Developers",
"phone_number": "+2349012345678",
"subaccounts": [
{
"id": "RS_D87A9EE339AE28BFA2AE86041C6DE70E"
}
]
}
{
"tx_ref": "UNIQUE_TRANSACTION_REFERENCE",
"amount": "1500",
"currency": "NGN",
"email": "[email protected]",
"fullname": "Flutterwave Developers",
"phone_number": "+2349012345678",
"bank_transfer_options": {
"expires": 3600
}
}
If the charge is created successfully, you'll get a successful response containing the generated account details.
{
"status": "success",
"message": "Charge initiated",
"meta": {
"authorization": {
"transfer_reference": "N/A",
"transfer_account": "7825397990",
"transfer_bank": "WEMA BANK",
"account_expiration": "N/A",
"transfer_note": "N/A",
"transfer_amount": 1500,
"mode": "banktransfer"
}
}
}
Completing the Payment
The meta.authorization
object contains the account details for the transfer: the bank name (transfer_bank
), account number (transfer_account
), and amount (transfer_amount
). Pass the details on to your customer, and they can make a transfer into the account (for instance, from their bank app).
Testing Tip
In Test Mode, all bank transfers will automatically be paid after a few seconds.
Webhooks
When payment is made, we'll send you a webhook with a payload like this:
{
"event": "charge.completed",
"data": {
"id": 407347576,
"tx_ref": "UNIQUE_TRANSACTION_REFERENCE",
"flw_ref": "000016210415121239000082517439",
"device_fingerprint": "N/A",
"amount": 1500,
"currency": "NGN",
"charged_amount": 1500,
"app_fee": 21,
"merchant_fee": 0,
"processor_response": "success",
"auth_model": "AUTH",
"ip": "N/A",
"narration": "Flutterwave Developers",
"status": "successful",
"payment_type": "bank_transfer",
"created_at": "2021-04-15T11:13:10.000Z",
"account_id": 82913,
"customer": {
"id": 254967086,
"fullname": "Flutterwave Developers",
"phone_number": "2349012345678",
"email": "[email protected]",
"created_at": "2021-04-14T16:39:17.000Z"
}
}
}
Now, your webhook endpoint can handle the event and complete the customer's order. For help setting up webhooks, see our guide to webhooks.
In your webhook handler, you can then verify the payment and credit your customers with whatever they paid for. See our guide to transaction verification for details.
Updated about 1 month ago