API Reference

Complete reference for all Pesastream API endpoints

POST/charge

Initiate an M-Pesa payment charge

Parameters

amount - number - Amount in KES
currency - string - ISO currency code
phone - string - Phone number with country code
description - string (optional) - Transaction description

Response

transactionId - string
status - string (pending, completed, failed)
amount - number
GET/transaction/:id

Retrieve transaction details and status

Parameters

id - string - Transaction ID from charge response

Response

id - string
status - string
amount - number
phone - string
createdAt - ISO timestamp
POST/payout

Send M-Pesa payout to a beneficiary

Parameters

amount - number - Amount to send
phone - string - Recipient phone number
reference - string - Unique reference identifier

Response

payoutId - string
status - string
amount - number
GET/balance

Get your account balance

Response

balance - number
currency - string
lastUpdated - ISO timestamp