Skip to main content
POST
/
api
/
v3
/
withdraw
/
lipa-na-mpesa
Withdraw via Lipa na M-Pesa (Kenya)
curl --request POST \
  --url https://sandbox-api.kotanipay.com/api/v3/api/v3/withdraw/lipa-na-mpesa \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount": 100,
  "walletId": "5f9b2c7b9c9d6b0017b4e6b1",
  "lipaNaMpesaDetails": {
    "businessShortcode": "174379",
    "accountReference": "ORDER123",
    "transactionDesc": "Payment for goods",
    "phoneNumber": "+254712345678"
  },
  "callbackUrl": "https://example.com/callback",
  "referenceId": "LIPA-001"
}
'
{
  "success": true,
  "message": "Lipa na M-Pesa withdrawal has been successfully created.",
  "data": {
    "id": "<string>",
    "message": "<string>",
    "referenceId": "<string>",
    "referenceNumber": 123
  }
}
Send money from integrator wallet to customer via Lipa na M-Pesa STK Push or to a business shortcode.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
amount
number
required

Amount to pay

Example:

100

walletId
string
required

Wallet ID to debit from

Example:

"5f9b2c7b9c9d6b0017b4e6b1"

lipaNaMpesaDetails
object
required

Lipa na M-Pesa payment details

callbackUrl
string

Callback URL for status updates

Example:

"https://example.com/callback"

referenceId
string

Your reference ID

Example:

"LIPA-001"

Response

success
boolean
Example:

true

message
string
Example:

"Lipa na M-Pesa withdrawal has been successfully created."

data
object