K
KIJUMBE SmartDevelopers
REST API · v1

Build on transparent Upatu.

Register members, run rotating savings groups, collect mobile-money contributions, approve payouts and read the ledger. Every error is bilingual and every financial mutation is auditable.

Start with curl Download Postman collection Production · api.kijumbesmart.co.tz

Bearer authentication

Short-lived HMAC-signed tokens from /v1/auth/login. Send Authorization: Bearer … on every protected call.

Money is integer TZS

Amounts are whole shillings as integers. No floats, no rounding. The ledger is append-only and balances are derived.

Bilingual errors

Every error carries English and Swahili: {"error":{"code","message","message_sw"}}.

Idempotent money

Payment intents take an idempotency_key. Provider references and ledger entries are unique by database index.

Quick start

Base URL: https://api.kijumbesmart.co.tz/v1. The same API is reachable at /api/v1 for the web app and provider callbacks.

# 1. Sign in (returns access_token + user)
curl -X POST https://api.kijumbesmart.co.tz/v1/auth/login \
  -H 'Content-Type: application/json' \
  -d '{"phone":"0700000001","password":"YOUR_PASSWORD"}'

# 2. Who am I?
curl https://api.kijumbesmart.co.tz/v1/me \
  -H "Authorization: Bearer $TOKEN"

# 3. Open groups, and a member's groups
curl 'https://api.kijumbesmart.co.tz/v1/games?q=' -H "Authorization: Bearer $TOKEN"
curl https://api.kijumbesmart.co.tz/v1/me/games -H "Authorization: Bearer $TOKEN"

# 4. Start a contribution (member)
curl -X POST https://api.kijumbesmart.co.tz/v1/payments/intents \
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"obligation_id":"obl_…","idempotency_key":"cycle-1-member-1"}'

Core endpoints

Method + pathWhoPurpose
POST /auth/registerpublicCreate a member (E.164-normalized Tanzanian phone)
POST /auth/loginpublicExchange phone + password for a bearer token
GET /metapublicDev flag, active provider, websocket URL
GET /gamessigned inDiscover open groups by name or code
POST /games/:id/membershipsmemberJoin after accepting accept_rules_version
POST /games/:id/startkijumbeFix payout order and create N×N obligations
POST /payments/intentsmemberUSSD/STK push; confirmed only by a provider callback
GET /games/:id/schedulemember / kijumbePayout order, pot and who has paid
POST /games/:id/payoutskijumbeRequest the next cycle's payout
POST /payouts/:id/approvedifferent adminMaker-checker approval, then durable release
GET /reports/games/:idmember / kijumbeObligations, collections, payouts, pool, ledger
GET /reports/games/:id/ledger.csvkijumbeAppend-only ledger export

The full surface (claims, KYC, penalties, deposits, reliability, admin, integrations) is in the Postman collection.

Provider callbacks

Selcom → KIJUMBE

POST /api/v1/payments/webhook/selcom/<token>
The URL token is generated in Admin → Integrations. The unsigned body is never trusted: the API calls Selcom order-status before counting a payment.

Generic provider

POST /api/v1/payments/provider-webhook
JSON body in the normalized callback shape, signed with hex(HMAC-SHA256(secret, body)) in X-Signature.

Contributions are never marked paid by a client. A valid callback, a matching amount, a single-use provider reference and the ledger all have to agree.

Postman

Collection

Every request, with variables and example bodies.

Download JSON →

Local environment

Point it at http://localhost:8080 while developing.

Download JSON →

Staging environment

Replace the base URL with your staging API host.

Download JSON →

Health

Uptime probe used by the deploy pipeline.

GET /healthz →