Infinity Africa

Getting Started

REST API Overview

The Infinity Africa API lets you accept mobile money collections, generate payment links and invoices, and send disbursements — from a website, a mobile app, an ecommerce platform, or your own backend. It's a predictable, versioned REST API: JSON in, JSON out, one response shape everywhere.

Base URL

Every endpoint in these docs is relative to your environment's base URL:

text
Production   https://api.infinityafrica.net
Sandbox      https://sandbox.infinityafrica.net
Local dev    http://localhost:8000

The response envelope

Every response — success or error, single object or paginated list — has the same top-level shape, so you only need to write one response parser:

json — success
{
  "success": true,
  "data": { "...": "..." },
  "meta": null
}
json — paginated list
{
  "success": true,
  "data": [ { "...": "..." } ],
  "meta": { "page": 1, "page_size": 20, "total": 42, "total_pages": 3 }
}
json — error
{
  "success": false,
  "error": {
    "code": "insufficient_balance",
    "message": "Insufficient balance: available TZS 100,000, requested TZS 5,000,000",
    "details": null
  }
}

List endpoints accept ?page=1&page_size=20 (page_size caps at 100). See Error Codes for the full list of error.code values.

Authentication

Server-to-server requests — from your backend, not a browser — authenticate with an API key generated in the Merchant Portal, sent as an Authorization: Bearer header (or the equivalent X-API-Key header). Full detail, including scopes, sandbox vs. live keys, and key rotation, is in API Key Authentication.

http
Authorization: Bearer inf_live_51HbXxxxxxxxxxxxxxxxxxxxxxxx

Idempotency

Every endpoint that moves money — creating a payment link, initiating a collection, requesting a disbursement, or a customer completing a checkout — requires an Idempotency-Key header (any unique string, e.g. a UUID you generate per attempt). Retrying the same key with the same request body replays the original response instead of double-processing; reusing the key with a different body is rejected with 409 idempotency_key_reused.

info

Always generate a fresh key per user action, not per HTTP request

If your client retries a failed request automatically (a timeout, a dropped connection), reuse the same idempotency key for those retries — that's exactly the safety net it's for. Generate a new key only when the customer initiates a genuinely new payment.

API resources

Rate limits

Each merchant API key is limited to 120 requests per minute by default. Responses include no special rate-limit headers yet — if you need a higher limit for a high-volume integration, contact us.

Who this API is for

The same REST API powers every kind of integration — a checkout flow on a website, a native mobile app, an ecommerce plugin, or an internal web app calling Infinity Africa from your own backend. There's no platform-specific SDK required: any language or framework that can make an HTTPS request and parse JSON can integrate. See cURL, JavaScript, and Python examples to get started in your stack.