Quickstart Guide

Integrate HavenPay and accept your first payment in under 10 minutes. Supports M-Pesa, Airtel Money, Flutterwave, Equity Jenga, KCB Buni, Co-op, Absa, PesaLink, PayPal, and Paystack.

Get API Key
Create an account and generate your key from the dashboard
Trigger a payment
One API call triggers a payment prompt on your customer's phone or bank
Listen for webhook
Receive a signed event when the payment completes
1
Get your API key

Log in to your HavenPay dashboard, go to API Keys, and create a new key with the stk_push scope. Save the key — it's shown only once.

# Your key will look like this:
sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2
Trigger an STK Push

Send a POST request to initiate a payment prompt. Supports M-Pesa (default), Airtel Money, KCB Buni, Co-op, Equity Jenga, Flutterwave, PayPal, and Paystack — all via the same endpoint.

curl -X POST https://havenways-pay-production.up.railway.app/v1/payments/stk-push \
  -H "Authorization: Bearer sk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "phone":              "0712345678",
    "amount":             500,
    "external_reference": "ORDER-001",
    "description":        "Order payment"
  }'
3
Receive the webhook

When the customer pays, HavenPay POSTs a signed event to your webhook URL regardless of provider. Configure it under Settings → Webhooks.

// Webhook payload (same shape for all providers)
{
  "event":          "transaction.completed",
  "transaction_id": "uuid",
  "status":         "completed",
  "amount":         500,
  "receipt_number": "QKE3XXXXX",  // M-Pesa / provider reference
  "provider":       "daraja",     // or airtel_money, flutterwave, etc.
  "timestamp":      "2024-01-15T12:00:00Z"
}
You're all set!
That's everything needed to accept payments. For multi-provider setup (Airtel, Equity, KCB, Co-op, Absa, PesaLink, Flutterwave), see the Payment Providers section. For WiFi hotspot billing, see WiFi Billing. For ISP or Rental management, see those sections.