UK bank account charge

Hey👋. We recommend checking out the overview to understand the basics of direct charge first. This guide assumes you've read that.

Charging bank accounts

Direct account charge allows you to collect payments directly from your customers' bank accounts.

There are three "flavours" of direct bank account charge, depending on the bank account's currency/country:

  1. Direct debit (for Nigerian accounts): The customer authorizes the payment with their bank, and the money is debited from their account.
  2. UK (GBP) accounts: The customer logs in to their bank's Internet/mobile banking and makes a transfer to a generated bank account.
  3. ACH payment (for USD and ZAR accounts)

This guide covers UK accounts. See the guides for NG accounts and ACH payments.

Approval required

To receive payments from UK accounts, your merchant account needs to be approved. Contact us at hi@flutterwavego.com for approval.

Process

To charge a UK bank account:

  1. You send the payment details to the charge endpoint.
  2. The customer then makes the transfer from their bank's Internet banking platform, and we notify you when it's done.
  3. You can then call our API to verify that the payment was successful before giving value (the verify transaction endpoint).

Initiating the payment

First, you'll need the customer's bank account details:

  • their account_number, and
  • their account_bank, the code for their bank

Combine those with the rest of the payment details to create the payload. You'll need to specify amount, currency, email, fullname, and a unique tx_ref. You can also specify more details, such as the customer's phone_number and custom meta information. See the [reference documentation] for details.

The currency you specify must match the account's currency (GBP).

Next, you'll send these payment details to the charge UK account endpoint. Here are some examples with our SDKs:

// 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 payload = {
    account_bank: "00340",
    account_number: "0690000037",
    amount: 250,
    currency: 'GBP',
    email: 'twista@rove.press',
    tx_ref: this.generateTransactionReference(),
}
await flw.Charge.uk(payload);
// Install with: composer require flutterwavedev/flutterwave-v3

$flw = new \Flutterwave\Rave(getenv('FLW_SECRET_KEY'));
// Set `PUBLIC_KEY` as an environment variable
$accountChargeService = new \Flutterwave\Account();
$payload = [
    "type" => "debit_uk_account",
    "account_bank" => "00340",
    "account_number" => "0690000037",
    "amount" => 250,
    "currency" => 'GBP',
    "email" => 'twista@rove.press',
    "tx_ref" => $this->generateTransactionReference(),
];
$response = $accountChargeService->accountCharge($payload);
# Install with: gem install flutterwave_sdk

require 'flutterwave_sdk'

flw = Flutterwave.new(ENV["FLW_PUBLIC_KEY"], ENV["FLW_SECRET_KEY"], ENV["FLW_ENCRYPTION_KEY"])
account_payment = AccountPayment.new(flw)
payload = {
    account_bank: "00340",
    account_number: "0690000037",
    amount: 250,
    currency: 'GBP',
    email: 'twista@rove.press',
    tx_ref: generate_transaction_reference,
}
# Automatically uses the right endpoint based on the currency
response = account_payment.initiate_charge payload
# UK account
curl --request POST \
   --url https://api.flutterwave.com/v3/charges?type=debit_uk_account \
   --header 'Authorization: Bearer YOUR_SECRET_KEY' \
   --header 'content-type: application/json' \
   --data '{
     "account_bank": "00340",
     "account_number": "0690000037",
     "amount": 250,
     "currency": "GBP",
     "email": "twista@rove.press",
     "tx_ref": "BJUYU399fcd43"
}'

Handling the response

If all goes well, you'll get a response that looks like this:

{
  "status": "success",
  "message": "Charge initiated",
  "data": {
    "amount": "250.00",
    "type": "paymentcode",
    "redirect": false,
    "created_at": "2020-03-27T11:20:00.777",
    "order_ref": "URF_1585304398140_8642835",
    "flw_ref": "ACH378551585304400779",
    "redirect_url": null,
+   "payment_code": "GBPBEDF2CC",
    "type_data": "GBPBEDF2CC",
    "meta": {
      "authorization": {
+       "account_number": "43271228",
+       "sort_code": "040053"
      }
    }
  }
}

Note that this response is a bit different from the typical "initiate charge" response. For instance, there's no data.status field. That's because no transaction has been created yet.

However, there's a meta.authorization, which contains the important details to complete the payment. This object contains an account number and sort code, which you'll pass on to your customer, along with the payment_code, so they can make the transfer from their bank.

Completing the payment

To complete the payment, the customer makes the transfer, typically from their bank's Internet banking platform.

When the payment is completed, we'll send you a webhook notification. Here's what that looks like:

In your webhook handler, you can then verify the payment and credit your customer with whatever they paid for. See our guide to transaction verification for details.

Loading...