Deposits (C2B)
Transactions
Deposits (C2B)
Initiate a customer-to-business deposit transaction
POST
Deposits (C2B)
Endpoint
Description
Initiates a fund transfer on behalf of the user. The transaction flow works as follows:Sufficient Balance
If balance is sufficient, the transfer is processed immediately and response is returned
Insufficient Balance
If balance is insufficient:
- Payment Provider Check: Verifies whether
payment_provideris specified in the request - No Provider Specified: Returns “insufficient balance” response
- Provider Specified: Initiates a deposit transaction through the specified payment provider, returns “transaction pending” response, and once the deposit is successful, funds are transferred to the merchant account
Headers
Merchant API key for authentication
Bearer token of the authenticated userFormat:
Bearer {token}Body Parameters
Merchant-provided unique identifier for tracking
Description of the deposit transaction
Payment provider to use (e.g., “mpesa”, “airtel”)Must be one of the providers returned by the Get Payment Providers endpoint
Amount to deposit
Currency code (e.g., “USD”)
URL to receive transaction completion notification
Response
Unique identifier for the transaction
Merchant-provided reference ID (if provided)
Current status of the transaction (e.g., “pending”)
Amount of the transaction
Currency code
Example Request
Example Response
200 OK
When the transaction completes, you’ll receive a webhook notification with the final transaction status and additional details.
Error Codes
| Code | Message |
|---|---|
missing_api_key | please provide an api key |
invalid_api_key | api key does not exist |
authorization_token_not_found | please provide a bearer authorization token |
invalid_currency | invalid currency |
invalid_webhook_url | invalid url format |
application_not_authorized | application not authorized |
user_not_active | user account is not active |
user_balance_not_found | user balance not found |
merchant_not_active | merchant account is not active |
merchant_balance_not_found | merchant balance not found |
invalid_amount | invalid amount |
insufficient_balance | insufficient balance |
provider_not_found | payment provider not found |
psp_currency_balance_not_found | payment provider currency balance not found |
invalid_provider_name | invalid payment provider name |
psp_error | payment provider error |
reference_already_used | a transaction with the reference id exists |
internal_server_error | internal server error |