v1.0.0

Developer Documentation

ParsePesa is the "Stripe for M-Pesa SMS" — a high-reliability API that converts raw M-Pesa transaction messages into structured JSON.

01. Getting Started

1

Create Account

Sign up on our platform to get access to your dashboard.

2

Generate Key

Go to API Keys and create your secret Live or Test key.

3

Top Up

Top up via Paystack. Each successful parse costs KES 0.50.

02. Authentication

All API requests must be authenticated using your secret API key. Include the key in the Authorization header as a Bearer token.

Authorization: Bearer pp_live_your_secret_key_here

03. API Reference

POST/v1/parse

Request Body

{
  "raw_text": "Q1A2B3C4D5 Confirmed. Ksh500.00 sent to...",
  "sender_id": "MPESA"
}

Response Object

{
  "success": true,
  "confidence": 1.0,
  "data": {
    "transactionId": "Q1A2B3C4D5",
    "type": "send_money",
    "amount": 500.0,
    "counterparty": "Naivas Supermarket",
    "balance": 1200.0,
    "timestamp": "2026-05-07T20:33:00.000"
  }
}
curl -X POST https://api.parsepesa.co/v1/parse \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "raw_text": "Confirmed. Ksh500.00 sent to..."
  }'

Webhooks & Security

Every webhook request includes an X-ParsePesa-Signature header. You must verify this signature on your server to ensure the request is genuine.

// Node.js Verification Example

const crypto = require('crypto');

function verifyWebhook(payload, signature, secret) {
  const hmac = crypto.createHmac('sha256', secret);
  const digest = hmac.update(payload).digest('hex');
  return signature === digest;
}

🏪 Merchant Support

ParsePesa is uniquely optimized for merchants. We support the Confirmed.on format used when merchants receive payments from customers.

  • Automatic distinction between Customer-side and Merchant-side notifications.
  • Instant Customer ID (Name/Phone) extraction from incoming merchant messages.

Supported Transaction Types

Send Money
Till Payments
Paybill Payments
Bank-to-Mpesa
Merchant Transfers
Loan Repayments
Withdrawals
Airtime Purchase
Incoming Money
Agent Deposits
Fuliza/M-Shwari

Pricing

Flat Rate

KES 0.50 per successful parse. No failed charges.

AI Fallback

Powered by Gemini 1.5. Included in standard rate.

Official SDKs

flutter pub add parsepesanpm install parsepesapip install parsepesacomposer require parsepesa/parsepesa-php
© 2026 ParsePesa. Nexora Creative Solutions. All rights reserved.