const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchantTransactionId: 'b2b_4521',
amount: 2500000,
accountNumber: '1234567',
accountNumberType: 'paybill',
beneficiary: 'INV-12345',
narration: 'Restock float'
})
};
fetch('https://api.fingopay.io/v1/mpesa/b2b', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"status": "success",
"message": "Transaction initiated successfully",
"data": {
"merchantTransactionId": "mtx_123",
"transactionId": "txn_01j7b6f9p5y9h"
}
}Send funds to another M-Pesa till or paybill number. The transfer will be processed asynchronously. Optional fields are advanced; send only required fields unless your integration needs this behavior.
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
merchantTransactionId: 'b2b_4521',
amount: 2500000,
accountNumber: '1234567',
accountNumberType: 'paybill',
beneficiary: 'INV-12345',
narration: 'Restock float'
})
};
fetch('https://api.fingopay.io/v1/mpesa/b2b', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"status": "success",
"message": "Transaction initiated successfully",
"data": {
"merchantTransactionId": "mtx_123",
"transactionId": "txn_01j7b6f9p5y9h"
}
}Use your API key as a Bearer token. Example: Authorization: Bearer sk_live_...
Unique key to safely retry POST without duplicates. Required in live environment.
Merchant-side reference used for reconciliation. Accepts 1-64 characters (letters, numbers, dot, underscore, or hyphen).
1 - 64^[A-Za-z0-9._-]{1,64}$"b2b_4521"
Amount in smallest currency unit (cents). Range 1-15,000,000 (KES 0.01-150,000.00).
1 <= x <= 150000002500000
Destination till or paybill number.
"1234567"
Destination M-Pesa account type.
till, paybill "paybill"
Account reference required when accountNumberType is paybill. Can be blank for till transfers.
"INV-12345"
Optional narration displayed to the beneficiary. Maximum 140 characters.
140"Restock float"
Override webhook destination for this transfer.
"https://merchant.example/webhooks/fingo"
[Enterprise] Optional shortcode to use for this B2B transfer.
"600123"
[Enterprise] Optional internal sub-merchant identifier configured under your organization.
"SM-NAIROBI-001"
Accepted — final result will be delivered via webhook.
Was this page helpful?