NamibraPay

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/plans

Authenticates with your API keys.

Body parameters

ParameterDescription
namerequiredstringPlan name shown to customers, e.g. “Gold monthly”.
amountrequiredintegerCharge amount in minor units (pesewas).
intervalrequiredstringBilling 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/subscriptions

Authenticates with your API keys.

Body parameters

ParameterDescription
planIdrequiredstringID of the plan to subscribe to.
channelrequiredstringmtn_momo, telecel_cash or airteltigo_money.
payerIdentifierrequiredstringThe 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/subscriptions
List subscriptions and their current state.

Authenticates with your API keys.

POST/api/v1/merchant/subscriptions/{id}/cancel
Cancel a subscription — no further charges are attempted.

Authenticates with your API keys.