Journal
Billing in Tanzania5 min read

How TZS credits and mobile-money top-ups fit together

A top-up starts a payment request; it doesn't mean the payment has completed. Ngamia records model usage and payments in a workspace ledger, while mobile-money confirmation arrives asynchronously.

A Tanzanian entrepreneur checking a payment on a phone beside a paper ledger
Field note 01

Start the payment with an idempotency key

The top-up endpoint uses your account session and an amount in TZS. Send an Idempotency-Key so retrying the same request doesn't accidentally create a second payment. A verified phone number is required for the payment flow.

POST https://api.ngamia.cc/v1/payments/topup
Idempotency-Key: <unique-request-id>

{ "amount_tzs": 5000 }
Field note 02

Wait for the provider confirmation

The response begins as pending while the customer approves the mobile-money prompt. Credits are added only after the payment provider confirms completion. Show the pending state in your UI and check payment status or balance after approval.

Field note 03

Read usage from the workspace ledger

Model requests create usage records and debit credits according to current model pricing. Keep the balance visible and link users to transaction history when they ask where credits went. Read current prices from the catalog rather than promising a fixed rate on a marketing page.