B2Pochi Payments
Send money to M-Pesa customer business wallets (Pochi la Biashara). Uses B2C rates for fees. Funds are deducted from your payment wallet.
/v3/pochi/
POST
/v3/pochi/
Auth Required
Service: b2pochi_payments
Send B2Pochi Payment
Transfer money from your payment wallet to a customer's Pochi la Biashara (business wallet). The recipient must have an active Pochi la Biashara account.
Headers
| Header | Value |
|---|---|
Authorization |
Bearer YOUR_API_KEY |
Content-Type |
application/json |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
amount |
number | Yes | Amount in KES (min 10, max 70000 per transaction) |
phone_number |
string | Yes | Recipient phone number linked to Pochi la Biashara (254XXXXXXXXX or 07XXXXXXXX) |
external_reference |
string | No | Your unique reference (auto-generated if omitted) |
command_id |
string | No | BusinessPayToPochi (default and only valid option) |
remarks |
string | No | Transaction remarks (2-100 chars) |
occassion |
string | No | Occasion/reason for payment (1-100 chars, API uses double "s") |
occasion |
string | No | Alias for occassion (single "s") |
callback_url |
string | No | URL to receive payment result callback |
Example Response
JSON
{
"success": true,
"status": "INITIATED",
"message": "B2Pochi payment initiated successfully",
"reference": "B2POCHI-abc123",
"transaction_id": 795,
"identifiers": {
"originatorConversationID": "12345-67890-1",
"conversationID": "AG_20241231_...",
"responseCode": "0",
"responseDescription": "Accept the service request successfully."
},
"payment_details": {
"amount_sent": 1000,
"withdrawal_fee": 15,
"phone_number": "2547****5678",
"command_id": "BusinessPayToPochi",
"remarks": "B2Pochi Payment Transfer",
"occassion": "Payment"
},
"wallet_balances": {
"payment_wallet": 4000,
"service_wallet": 835
}
}
cURL Example
bash
curl -X POST 'https://swiftwallet.co.ke/v3/pochi/' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"amount": 1000,
"phone_number": "254705912645",
"external_reference": "POCHI-PAY-001",
"remarks": "Supplier payment to Pochi",
"callback_url": "https://yoursite.com/b2pochi-callback"
}'
Callback Payload
After M-Pesa processes the B2Pochi transaction, SwiftWallet sends a POST request to your callback_url with the result. Internal M-Pesa account balance snapshots are intentionally excluded.
POST to your callback_url
{
"success": true,
"transaction_id": 795,
"external_reference": "POCHI-PAY-001",
"originatorConversationID": "12345-67890-1",
"conversationID": "AG_20241231_...",
"transactionID": "SG632NMUAB",
"status": "completed",
"timestamp": "2024-12-31T12:30:00+03:00",
"service_fee": 15,
"withdrawal_fee": 15,
"result": {
"ResultCode": 0,
"ResultDesc": "The service request is processed successfully.",
"TransactionAmount": 1000,
"TransactionReceipt": "SG632NMUAB",
"RecipientIsRegistered": "Y",
"TransactionCompletedDateTime": "31.12.2024 12:30:00",
"ReceiverPublicName": "254705912645 - JOHN DOE"
},
"transaction_info": {
"phone_number": "254705912645",
"amount": 1000,
"currency": "KES",
"transaction_type": "B2Pochi"
}
}
Verify callbacks by checking the transaction_id and originatorConversationID against your records.
Notes
- Funds are immediately deducted from your payment wallet upon initiation
- If the B2Pochi request fails at M-Pesa, funds are automatically reversed to your wallet
- Withdrawal fees are charged from your service wallet using B2C rates
- The recipient must have an active Pochi la Biashara (customer business wallet)
- Maximum single transaction is KES 70,000 (daily limit may also apply)
- Requires the b2pochi_payments service to be enabled on your API key