Developer API

Build Payment Integrations. Zero Fees.

Add MoMo payment verification to your app in minutes. REST API, real-time webhooks, and automatic payment verification with HPN codes. No transaction fees.

0% transaction fees
Real-time webhooks
MTN, Telecel, AT
API Features

Everything you need to accept payments

From payment creation to verification, Harpoon handles the complexity so you can focus on building.

Payment Verification API

Verify MoMo payments programmatically. Create payment requests, check status, and verify transactions via REST API.

HPN Code System

Generate unique reference codes that automatically verify payments for orders. No manual reconciliation needed.

Real-time Webhooks

Receive instant notifications when payments are verified. Configure endpoints with automatic retry and signature verification.

Multi-Number Support

Accept payments on multiple MoMo lines. Aggregate all payment notifications into a single webhook endpoint.

Transaction Parsing

Automatic extraction from MTN MoMo, Telecel Cash, and AT Money. Amount, sender, reference, balance - all structured JSON.

Secure API Keys

Scoped API keys with granular permissions. IP whitelisting, rate limiting, and audit logs for enterprise security.

Quickstart

Accept payments in 3 API calls

Create a payment request, customer pays, webhook verifies. That's it.

1

Create Payment

POST /v1/transactions/initialize

{"amount": "150.00",
 "phone_number": "0244123456",
 "description": "Order #1234",
 "webhook_url": "https://..."}

Returns HPN code and checkout URL for your customer.

2

Customer Pays

MTN

Send to: 024 XXX XXXX

Reference: KXRT5M2P

Customer sends MoMo to your number with the HPN code as reference.

Webhook Fires

// Your webhook receives:
{"event": "transaction.completed",
 "data": {
   "hpn_code": "KXRT5M2P",
   "actual_amount": "150.00",
   "status": "SUCCESS"
 }
}

Harpoon verifies and sends webhook. Fulfill the order.

Webhooks

Real-time payment notifications

Configure a webhook URL and receive instant notifications when payments are verified. Each payload includes amount, sender, reference, and transaction details.

HTTPS with automatic retry on failure
HMAC signature verification
Webhook logs and replay from dashboard
Filter by event type or amount threshold
webhook_handler.py
from flask import Flask, request
import hmac

app = Flask(__name__)

@app.route('/webhook/payment', methods=['POST'])
def handle_payment():
    # Verify signature
    signature = request.headers.get('X-Harpoon-Signature')
    if not verify_signature(request.data, signature):
        return {'error': 'Invalid signature'}, 401

    data = request.json

    if data['event'] == 'transaction.completed':
        hpn_code = data['data']['hpn_code']
        amount = data['data']['actual_amount']

        # Update your order
        order = Order.find_by_hpn_code(hpn_code)
        order.mark_as_paid(amount)

    return {'status': 'ok'}
REST API

Full payment API

Create payments, check status, query transactions, and manage your integration programmatically.

Payment API Endpoints
# Create a payment request
POST /v1/transactions/initialize
Authorization: Bearer hpn_live_sk_xxx

# Get payment status
GET  /v1/transactions/{reference}

# List recent payments
GET  /v1/transactions?status=SUCCESS&per_page=50

# Manual reconciliation with SMS text
POST /v1/transactions/{reference}/reconcile

# Webhook management
GET  /v1/webhooks
POST /v1/webhooks
DEL  /v1/webhooks/{id}
200 OK Payment Created Response
{
  "success": true,
  "data": {
    "reference": "ref_abc123xyz789",
    "hpn_code": "KXRT5M2PA3",
    "amount": "150.00",
    "currency": "GHS",
    "status": "PENDING",
    "expires_at": "2024-01-09T12:00:00Z",
    "checkout_url": "https://harpoonsms.com/pay/KXRT5M2PA3",
    "payer_sms_sent": true
  }
}
Use Cases

What developers are building

E-commerce Checkout

Generate HPN code at checkout, customer pays with reference, webhook verifies payment, order ships automatically.

Subscription Billing

Send payment links for recurring billing. Track payment status and activate subscriptions via webhook.

Invoice Payments

Embed payment links in invoices. Auto-reconcile when customers pay and update your accounting system.

POS Integration

Integrate Harpoon into your point-of-sale system. Verify payments in real-time before completing sales.

Coming Soon

SDKs for your stack

Python, JavaScript/TypeScript, and PHP SDKs are in development. Join the waitlist to get early access.

Ready to integrate?

Create an account to get your API keys. Start accepting payments with zero transaction fees.

Free tier available
0% transaction fees
No credit card required