Split Payment

The Payant's Inline API can be extended to allow split payments. This allows you to invoice your customers and split the payment between several wallets.

Rules

  1. Split type must either be flat or percentage.

  2. When spliting by flat amount, the total values in the receivers array must equal the total invoice amount.

  3. When spliting by percentage, the total values in the receivers array must equal 100%.

  4. Split transactions must have atleast 2 receivers and at most 6 receivers.

  5. One of the receivers must always be marked primary.

Fee Bearer

Fees are applied to split transactions the same way fees are applied to normal transactions on Payant. The only difference is that when the fee_bearer of the invoice is account, you can specify who bearers the fees in the split transaction. You can either spread the transaction fees across the receivers or choose a single receiver to bear the fees. When the selected receivers settlement value is less than the fees, we would automatically spread fees across all receivers.

Client Pays The following illustration shows how fees are paid when client bears the fees.

Account Pays The following illustration shows how fees are paid when account bears the fees. The first illustration shows fees distributed across all receivers and the second illustration shows fees paid by a single receiver.

options
Split payment

Request
Response
Headers
optional
string
Body Parameters
key
required
string
API Public key
reference_code
required
string
Invoice refence code if it already exists
client
required
object
Client Data
company_name
required
string
Client's company name
first_name
required
string
Client's first name
last_name
required
string
Client's last name
email
required
string
Client's email
phone
required
string
Client's number
address
optional
string
Client's address
type
optional
string
Client's type, customer, staff or vendor
settlement_bank
optional
string
Client's settlement bank
account_number
optional
string
Client's account number
client_id
required
string
Client ID
due_date
required
string
Invice Due date MM/DD/YYYY
fee_bearer
required
string
Invoice fee bearer, account or client
items
required
array
Invoice items
item
optional
string
Item's name
description
required
string
Item's description
unit_cost
required
string
Item's unit cost
quantity
required
string
Item's quantity
tokenize
optional
string
Tokenize card, True or false, default is false
payment_methods
optional
array
Payment method to show on checkout can be a combination of card, bank, phone and QR. Example ["card", "phone"] for card and phone payments only.
split_details
optional
object
Split details
type
optional
string
Split type percentage or flat
fee_bearer
required
string
Fee bearer client, each_receiver or primary_receiver
receivers
required
array
Split Receivers
wallet_reference_code
required
string
Waller Refrence code
value
optional
string
Value
primary
required
string
Primary true or false
200: OK
<form>
<script src="https://api.payant.ng/assets/js/inline.min.js"></script>
<button type="button" onclick="payWithPayant()"> Pay </button>
</form>
<script>
function payWithPayant() {
var handler = Payant.invoice({
"key": "e47aa44e4a320ae2a2b6b8804a4d2fa1b74437ab",
"client": {
"first_name": "Albert",
"last_name": "Jane",
"email": "jane@alberthospital.com",
"phone": "+2348012345678"
},
"due_date": "12/30/2016",
"fee_bearer": "account",
"items": [
{
"item": ".Com Domain Name Registration",
"description": "alberthostpital.com",
"unit_cost": "2500.00",
"quantity": "1"
}
],
"split_details": {
"type": "percentage",
"fee_bearer": "each_receiver",
"receivers": [
{
"wallet_reference_code": "xVKsW9vnpI",
"value": "30",
"primary": "true"
},
{
"wallet_reference_code": "9vnpIxVKsW",
"value": "70",
"primary": "false"
}
]
},
callback: function(response) {
console.log(response);
},
onClose: function() {
console.log('Window Closed.');
}
});
handler.openIframe();
}
</script>Sp

Heads up!

Only one of client or client_id is required per invoice object. The client parameter will allow you to add a new customer while invoicing on the fly in case you don't have a client_id. Client will not be added if already exist. All fields are not required if reference_code is available.