Complete guide to querying on-demand transaction status for collections and disbursements, interpreting terminal outcomes, and executing safe automated reconciliation.
While asynchronous webhook callbacks (payment_step: 2) are Niobi’s primary real-time notification mechanism, the Get Transaction Status API provides an authoritative on-demand verification endpoint.Use this endpoint to:
Resolve In-Doubt Transactions: Check transaction outcomes if a temporary network disruption delayed your incoming callback.
Execute Double-Verification: Reconcile mission-critical payments (such as high-value payouts or instant digital wallet top-ups) by confirming webhook data against an independent status query.
Audit & Recover: Safely query historical or batch transaction records during automated ledger closeouts.
When querying transaction status, inspect both data.status and data.status_code:
Status Code
Status String
State Type
Meaning
Developer Action
000000
"success"
Terminal
Transaction completed and settled. Funds credited to recipient/merchant.
Fulfill the customer order, update user wallet balance, or mark payout as complete.
000001
"pending"
Non-Terminal
Authorization or upstream network switch processing is in progress.
Do NOT act on this state. Do not fulfill orders, retry transfers, or mark as failed. Wait for callback or re-query after a delay.
000005
"failed"
Terminal
Transaction was declined, rejected, or reversed by the upstream provider.
Mark order/payout as failed. Inspect failureReason for specific provider diagnostics.
000006
"timeout"
Non-Terminal
Collection prompt session timed out before the customer completed authorization. (Collections/deposits only)
Check status again after 2 to 3 minutes before taking further action.
Strict Rule on pending (000001):
Never release value, credit user wallets, fulfill goods, or retry payments while a transaction is in pending status. A pending status indicates the transaction is in-flight across banking or telecommunication switches. Always wait for a terminal status (000000 or 000005).
For platforms managing high financial volume, automated payroll, or instant digital withdrawals, implement Niobi’s recommended double-verification recipe:
Inbound Signature Verification: Validate incoming webhook signatures using your Secret Key before parsing data.
Concurrency Control: Use database row-level locking (SELECT ... FOR UPDATE or optimistic locking on third_party_reference_1) to ensure duplicate callbacks or simultaneous polling queries do not process twice.
Triple-Point Match: Confirm that statusCode, amount, currency, and third_party_reference_1 match your internal order record exactly.
Atomic Settlement: Update your internal ledger to SETTLED inside a single atomic database transaction.
To ensure optimal performance and avoid hitting rate limits:
Rely on Webhooks First: Use callbacks as your primary notification channel.
Avoid Tight Polling Loops: Never poll the status API immediately in rapid loops (e.g. every second).
Use Spaced Backoff Intervals: If you must poll for a pending transaction, use progressive spaced intervals (for example: wait 5 seconds after initiation, then 15 seconds, then 30 seconds, then 60 seconds).
Idempotency Keys: Always query using the same third_party_reference_1 or reference originally assigned to the transaction.