- You act as an aggregator, managing payments for different entities in exchange for a commission.
- You run a marketplace where different vendors provide services while you handle payments and collect a commission for each transaction.
Creating Subaccounts
You can create subaccounts easily from your dashboard. Alternatively, you can use the create subaccount endpoint. You’ll need to supply the following details:When in Test Mode, you can use any of our test account
numbers for your subaccount.
| Parameters | Functions |
|---|---|
account_bank and account_number | The bank account details for this subaccount. The acccount_bank is the bank code (which you can get from the get banks endpoint). |
country | The country the bank account is in. |
business_name and business_mobile | Details about the vendor/merchant the subaccount is for. |
split_type | The type of split you want to use with this subaccount. |
"percentage" | If you want to get a percentage of each transaction. |
"flat" | If you want to get a flat fee from each transaction, while the subaccount gets the rest. |
split_value | The amount you want to get as a commission on each transaction. This goes with the split_type. |
- to collect 9% from each transaction,
split_typewill be"percentage"andsplit_valuewill be0.09. - to collect 600 naira from each transaction,
split_typewill be “flat” andsplit_valuewill be600.
The
split_type and split_value are the default rules for splitting
payments into this subaccount, but you can also override them for each
transaction.We’ll use “naira(NGN)” in this article, but subaccounts work the same
regardless of the currency the transaction is in.
Country-specific RequirementsFor certain countries, you’ll also need to include a
meta object containing
additional information about the bank account. If the account is in the US,
you’ll need to supply a Swift code and routing number. If it’s in Ghana,
Tanzania, Rwanda, Uganda, or Tanzania, you’ll need to supply a branch code.data.subaccount_id. You’ll use this when you want to split payments into that subaccount.
Using Subaccounts
Now that you’ve created a subaccount, you can split payments with it by specifying the ID whenever you’re collecting payments. This applies across our different integration options, including Flutterwave Inline, Standard, HTML checkout, and direct card charge. To specify how the payment should be split across subaccounts, define asubaccounts field. The subaccounts field holds an array of objects, each containing the ID of the subaccount returned from the create subaccount call or as displayed on your dashboard.
Overriding the Default
When collecting payment, you can override the defaultsplit_type and split_value you set when creating the subaccount by specifying these fields in the subaccounts item:
transaction_charge_type: The type of commission to charge for this transaction:"flat_subaccount"if you want the subaccount to get a flat fee from this transaction while you get the rest."flat"if you want to get a flat fee while the subaccount gets the rest or"percentage"if you want to get a percentage of the settlement amount.
transaction_charge: The amount to charge as commission on the transaction. This should match with thetransaction_charge_type, for example:- to collect a 9% commission,
transaction_charge_typewill be"percentage"andtransaction_chargewill be0.09 - to collect a 600 naira commission,
transaction_charge_typewill be"flat"andtransaction_chargewill be600 - to give the subaccount 4200 naira from this transaction while you get whatever’s left,
transaction_charge_typewill be"flat_subaccount"andtransaction_chargewill be4200/
- to collect a 9% commission,
Splitting Across Multiple Subaccounts
If you’re splitting payment between multiple subaccounts, you can specify atransaction_split_ratio that defines how the money (excluding your commission and Flutterwave fees) is shared proportionally.
For example: If you are splitting a payment between 3 vendors. Let’s say you want a commission of 300 naira, and the vendors should share what’s left:
- vendor A should get 20% of the payment
- vendor B should get 30% of the payment
- vendor C should get the remaining 50%
2:3:5. So your subaccounts array would look like this:
- You’ll get 300 naira (100 naira flat commission from each subaccount)
- The settlement amount (the amount the subaccounts will split) is 15,500 (
16000 - 200 - 300)- vendor A will get 3,100 (
2/(2+3+5) * 15500) - vendor A will get 4,650 (
3/(2+3+5) * 15500) - vendor A will get 7,750 (
5/(2+3+5) * 15500)
- vendor A will get 3,100 (