Initiate a Payout
Disburse funds directly to a customer's mobile money wallet or bank account. Payouts are processed asynchronously â the API queues the disbursement and notifies your server via webhook once the funds are settled.
How It Works
Before initiating a payout, you may need to look up reference IDs depending on your disbursement method. Both flows share the same endpoint â only the request body differs.
Fetch Prerequisites
For mobile money, call
GET /v1/countriesto get thecountry_id. For bank transfers, also callGET /v1/banksto get thebank_id.Initiate the Payout
POST to
/v1/payment/payout/processwith the amount, destination, and transfer method. Vesicash queues the disbursement and returns a payout reference.Receive Webhook Vesicash sends a POST notification to your
webhook_urlwhen the payout status changes to successful or failed.
POST: /v1/payment/payouts/process
Headers
secret-key
string
Your Vesicash secret key
public-key
string
Your Vesicash public key
Request Body â Common Parameters
These parameters apply to all payout types regardless of transfer_to value.
amount (number): The amount to disburse.
countryId (string): The unique identifier for the country in which the transaction is being processed. To retrieve a valid
countryId, call the Get Countries endpoint and use thecountryIdfield from the matching country object in the response.transfer_to (string): The disbursement method. Determines which additional fields are required.
mobile_number,bankwebhook_url (string):A publicly accessible HTTPS URL where Vesicash will POST the payout status notification.
reason (string): The reason for the refund.
Additional Parameters by Transfer Type
The fields below are required depending on the value of transfer_to.
momo_phone_number (string): The mobile money phone number to receive the payout. Provide the full number in E.164 format â country code followed by the subscriber number, with no +, spaces, or dashes. E.g. 260999993000 instead of +260999993000
bank_id (string): The unique Vesicash identifier for the destination bank. Call GET /v1/banks to retrieve the list of supported banks and their IDs for the selected country.
account_number (string): The recipient's bank account number. Must be a valid account number at the specified bank.
Request
For example, you can make a post request to the endpoint above and pass in the raw json data below to refund a successful transaction.
Response
Response Fields
status
string
Top-level outcome of the API call. success or error.
code
number
HTTP status code mirror. 200 on success.
data.reference
string
Unique payout reference assigned by Vesicash. Prefixed with PY_. Use this to query the payout status endpoint or match incoming webhook events.
message
string
Human-readable summary of the API response.
data.status
string
Current payout status. One of: processing successful failed
data.amount
string
The disbursement amount as received by Vesicash.
Webhook Notification
Once the payout is processed, Vesicash sends a POST request to your webhook_url with the final payout outcome. Use this event â not the initial API response â to update your system's refund state.
Error Codes
400
payout amount is less that 0
The amount is zero, negative, or not a valid number.
400
payment not found
The payment_reference does not match any transaction in your account.
400
Insufficient funds or wallet error preventing refund processing
I
400
Payout Provider service returned an error
The momo_phone_number is not a valid E.164 formatted mobile money number.
Last updated