Skip to main content

Overview

Niobi’s Unified Payments API allows your application to disburse funds to recipients across Africa through a single standardized integration. Whether disbursing via Mobile Money (M-Pesa, MTN, Airtel, Orange, Wave), Bank Transfers, Business Paybills, or Till Numbers, you send a signed request to the unified payments endpoint: Endpoint: POST /api/v4/niobi-unified-payments Disbursements follow an asynchronous lifecycle:
Step 1Request Initiation
payment_step: 1
  1. Your backend signs the request envelope (SHA-256) and sends POST /api/v4/niobi-unified-payments.
  2. Niobi validates the signature and params, and checks your merchant wallet balance.
  3. Niobi returns the initial HTTP response to the request when it’s successful, confirming the payout was accepted and dispatched upstream.
Step 2Terminal Outcome
payment_step: 2
  1. Niobi submits the payout to the recipient’s telco or banking switch.
  2. The switch credits the recipient’s wallet or bank account, then reports settlement back to Niobi.
  3. Niobi sends an asynchronous callback to your client_callback_url with the final status.

API Environments & Base URLs

Niobi provides separate environments for sandbox testing and live disbursement processing: All payout endpoints referenced throughout this documentation are relative to your chosen environment’s base URL.

Understanding Payment Steps (payment_step)

Like collections, disbursements operate on a two-step lifecycle:
Step 1Request Initiation
payment_step: 1

Initial HTTP response to the request when it’s successful, confirming the payout was validated and dispatched to the destination telco/bank switch.

Step 2Terminal Outcome
payment_step: 2

Asynchronous callback delivering the final settlement outcome (success or failed).

1. payment_step: 1 (Initial API Response)

  • Delivery: Synchronous HTTP response returned immediately when calling POST /api/v4/niobi-unified-payments.
  • Meaning: The request passed signature validation, parameter formatting was accepted, merchant wallet balance was confirmed, and the disbursement instruction was dispatched to the destination telco or banking switch.
  • Important: This confirms that the transfer has been initiated, not that funds have settled in the recipient’s wallet or account.
Absence of payment_step on Initiation Failures:
If a disbursement request fails during initial submission (for example, due to invalid recipient details, unsupported corridor, insufficient merchant wallet balance, or immediate processor rejection returning status_code: "000005"), the "payment_step" field is not present in the response. Your backend must inspect status_code ("000000" vs "000005") rather than assuming payment_step is always returned.

2. payment_step: 2 (Terminal Callback)

  • Delivery: Asynchronous callback POST request sent to the client_callback_url passed under params.client_callback_url in your request.
  • Meaning: The transaction has reached its final terminal state. Funds have either been credited to the recipient or the payout was rejected/refunded by the banking/telco switch.
  • Action: When "payment_step": 2 is present in the params object of the callback, update your internal ledger and record the outcome based on status: "success" (status_code: "000000") or status: "failed" (status_code: "000005"). Full details are covered in Payout Callbacks.
Rules of Transaction Settlement (Disbursement Lifecycle):
  • payment_step: 1 = Payout Dispatched (Funds In Transit)
    Confirms that Niobi validated your signature, confirmed sufficient merchant wallet balance, and dispatched the payout instruction to the destination telco/bank switch.
    CRITICAL RULE: Funds are in transit across banking/mobile money networks. Do NOT treat the transfer as settled or cleared at this stage.
  • payment_step: 2 = Terminal Outcome (Delivered via Webhook Callback)
    Delivered asynchronously to your client_callback_url. Inspect both status and statusCode (or status_code):
    • Success (status: "success", statusCode: "000000"): The recipient’s bank account or mobile wallet has officially confirmed receipt of the funds. Update your ledger and notify the recipient.
    • Failed (status: "failed", statusCode: "000005"): The transfer failed or was rejected by the switch (e.g. invalid account number, inactive wallet, bank network offline). Niobi automatically refunds/unlocks the held wallet balance. Mark the payout as failed in your ledger.
  • Missing or Delayed Webhook?
    If a callback hasn’t arrived after a reasonable wait, query the Get Transaction Status API (POST /api/v3/get-unified-transaction-status) to reconcile in-doubt payouts before re-attempting or failing a transfer.

Request Parameters

The unified payments endpoint accepts standard parameters wrapped in the signed envelope:

Root Envelope Fields

Parameters (params Object)

Channel-Specific Parameter Objects (params)

Depending on your selected payment_method_type, supply the matching nested array inside params:
Best Practice: Generate Unique References & Enable Uniqueness Checks:
We strongly recommend generating payment_reference and third_party_reference_1 on your server before sending the payout request (for example, using an internal transfer ID like PAYOUT-2026-001 or TX-DISB-9901).
To guarantee that duplicate transactions are never processed:
  • Enable Uniqueness Enforcement: Pass "is_third_party_reference_1_unique": 1 in params. If a payout with the same reference has already been created, Niobi immediately rejects the duplicate with "Duplicate third_party_reference_1 was found!".
  • Instant Webhook Reconciliation: When Niobi sends the terminal callback (payment_step: 2), it includes your exact reference keys so your ledger updates automatically.
  • Direct Status Lookups: Allows you to query the Get Transaction Status API using your own internal ID at any time.

3-Step Direct Payout Integration Walkthrough

1

1. Initiate Disbursement Request

Your backend server signs the payload and dispatches a POST request to /api/v4/niobi-unified-payments.

Sample Request: Mobile Money Payout (Kenya M-Pesa)

Sample Initial API Responses (Synchronous)

Understanding the Two Success Indicators:
  • Outer "success": true (Root level): Indicates the HTTP request was valid, authenticated, and received by Niobi (Request Successfully Initiated).
  • Inner "status": "success" (Inside data): Indicates the payout instruction was accepted and dispatched to the upstream network switch. It does not signify final delivery to the recipient.
2

2. Upstream Processing by Telco / Banking Switch

Niobi routes the disbursement to the local payment provider or mobile network operator. The switch processes the transfer and deposits funds into the recipient’s wallet or bank account.
3

3. Handle Final Disbursement Outcome

When settlement concludes, Niobi dispatches an asynchronous callback containing "payment_step": 2 to the client_callback_url passed under params.client_callback_url in your disbursement request.

Sample Terminal Callbacks (payment_step: 2)

Determine Outcome Using status and statusCode:
When "payment_step": 2 arrives, inspect both params.status and params.statusCode inside the payload:
See our Transaction Status Codes Guide for the complete list of system status codes.
On-Demand Status Verification:
If you ever need to independently verify the status of a payout on demand, call the Get Transaction Status API (POST /api/v3/get-unified-transaction-status) passing "type": "payout" and your transaction reference in "id".

Next Steps

Follow these guides in order to complete your disbursement integration:
Step 1

Payout Methods

Explore supported channels: Mobile Money, Paybill, Till Numbers, PesaLink, and Bank Transfers.

Step 2

Payout Callbacks

Handle terminal payment_step: 2 callbacks, verify signatures, and reconcile outcomes.

Step 3

Payout Best Practices

Wallet balance monitoring, phone number validation, idempotency, and error handling.