Skip to content

Wallet-based withdrawal (V1)

POST
/api/v2/withdraw
curl -X POST "https://api.payhero.africa/api/v2/withdraw" \
-u "API_USERNAME:API_PASSWORD" \
-H "Content-Type: application/json" \
-d '{
"external_reference": "TX1234ABCre55AH",
"account_id": 63,
"amount": 10,
"phone_number": "0712345678",
"account_number": "0712345678",
"network_code": "63902",
"channel": "phone",
"recipient_type": "MSISDN",
"callback_url": "https://payhero-dev.free.beeceptor.com"
}'

Legacy V1 withdrawal endpoint. Disburse to a phone number, paybill, or till. Use recipient_type (MSISDN or PAYBILL) plus short_code / account_number to target the destination.

Media typeapplication/json
object
external_reference
required
string
account_id
required
integer
amount
required
number
phone_number
required
string
account_number

Destination account number.

string
network_code
string
channel
required
string
recipient_type
required

MSISDN for phone, PAYBILL for paybill/till.

string
Allowed values: MSISDN PAYBILL
short_code

Paybill or till number (required for PAYBILL).

string
callback_url
string format: uri
Examples

Withdraw to phone number

{
"external_reference": "TX1234ABCre55AH",
"account_id": 63,
"amount": 10,
"phone_number": "0712345678",
"account_number": "0712345678",
"network_code": "63902",
"channel": "phone",
"recipient_type": "MSISDN",
"callback_url": "https://payhero-dev.free.beeceptor.com"
}

Withdrawal queued.

Media typeapplication/json
object
status
string
merchant_reference
string
checkout_request_id
string
response_code
string
conversation_id
string
external_reference
string
Example
{
"status": "QUEUED",
"merchant_reference": "UFD003742176.eO",
"checkout_request_id": "0aaef9ef-15a6-4ff6-ba9e-35c9d33eb560",
"response_code": "200",
"conversation_id": "UFD003742176.eO",
"external_reference": "TX1234ABCre55AH"
}

Missing or invalid Basic auth credentials.

Media typeapplication/json
object
error_code
string
error_message
string
status_code
integer
Example
{
"error_code": "invalid_argument",
"error_message": "the transaction amount is insufficient as it wont cater for cost: (4.62)",
"status_code": 400
}