Create M-PESA Payment
POST /api/payments/mpesa-payment
Initiate M-PESA payment for a balance
Header Parameters
- api-key string required
- api-secret string required
- application/json
Request Body required
- amount double required
Amount being sent
- phoneNumber string required
Phone number of receiver
- balanceId int64 required
Balance Id of the account to send from
- reference string required
Reference
- recipient string required
Recipient Name
Responses
- 201
- 401
M-PESA payment was initiated successfully
- */*
- Schema
- Example (from schema)
Schema
- paymentId uuid required
Unique identifier for the payment
- success boolean required
Was the payment successful?
- detail string required
Details of the payment
- reference string required
Reference provided for the payment
{
"paymentId": "f9eb1b23-4f78-495c-968c-9dfdfc89a16d",
"success": true,
"detail": "Payment processed successfully",
"reference": "TESTREF1"
}
API keys not valid
- */*
- Schema
- Example (from schema)
Schema
- detail string
Detail of the message.
- status string
Possible values: [
SUCCESS,FAILED,API_KEYS_INVALID,INSUFFICIENT_FUNDS,NOT_FOUND,MALFORMED_URL,INTERNAL_ERROR,NOT_SUPPORTED,CURRENCY_NOT_SUPPORTED,MOBILE_MONEY_NOT_WHOLE_NUMBER,BALANCE_NOT_FOUND,BALANCE_NOT_AUTHORISED,BALANCE_NOT_NUMERIC,WEB_HOOK_NOT_SPECIFIED_FOR_OTP]
{
"detail": "API key not valid or Insufficient funds",
"status": "SUCCESS"
}
Loading...