Subscriptions
Define a billing plan once, subscribe customers to it, and NamibraPay charges their momo wallet on schedule — notifying you on every successful or failed renewal.
Mobile money only
Recurring debits run over the momo rails (MTN, Telecel, AirtelTigo) — the customer approves the first charge and subsequent renewals debit the same wallet on schedule.
1. Create a plan
POST
/api/v1/merchant/plansAuthenticates with your API keys.
Body parameters
| Parameter | Description | |
|---|---|---|
name | required | stringPlan name shown to customers, e.g. “Gold monthly”. |
amount | required | integerCharge amount in minor units (pesewas). |
interval | required | stringBilling interval: daily, weekly, monthly, quarterly or annually. |
curl -X POST "https://api.namibrapay.com/api/v1/merchant/plans" \
-H "X-API-Key: pk_test_xxxxxxxxxxxxxxxx" \
-H "X-API-Secret: sk_test_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"name": "Gold monthly",
"amount": 5000,
"interval": "monthly"
}'2. Subscribe a customer
POST
/api/v1/merchant/subscriptionsAuthenticates with your API keys.
Body parameters
| Parameter | Description | |
|---|---|---|
planId | required | stringID of the plan to subscribe to. |
channel | required | stringmtn_momo, telecel_cash or airteltigo_money. |
payerIdentifier | required | stringThe customer's momo number (+233…). |
curl -X POST "https://api.namibrapay.com/api/v1/merchant/subscriptions" \
-H "X-API-Key: pk_test_xxxxxxxxxxxxxxxx" \
-H "X-API-Secret: sk_test_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"planId": "plan_9dka21fj",
"channel": "mtn_momo",
"payerIdentifier": "+233241234567"
}'Each billing run fires subscription.charged on success or subscription.payment_failed when the debit bounces — handle both in your webhook handler to manage access.
3. Managing subscriptions
GET
/api/v1/merchant/subscriptionsList subscriptions and their current state.
Authenticates with your API keys.
POST
/api/v1/merchant/subscriptions/{id}/cancelCancel a subscription — no further charges are attempted.
Authenticates with your API keys.