Overview
Kotani Pay uses a comprehensive set of status codes to track the lifecycle of different transaction types. Understanding these statuses is crucial for building robust integrations and handling transaction states correctly.Status Categories
Terminal Statuses
Terminal statuses indicate that a transaction has reached its final state and will not change further. You should stop polling for updates once a transaction reaches a terminal status. Terminal statuses include:SUCCESSFUL/SUCCESSFAILEDCANCELLEDEXPIREDDECLINEDPERMANENTLY_FAILEDREVERSED
Intermediate Statuses
Intermediate statuses indicate that a transaction is still being processed. You should continue polling or wait for webhooks when a transaction is in an intermediate status. Intermediate statuses include:PENDINGINITIATEDIN_PROGRESSPROCESSINGRETRY
Special Statuses
Special statuses are used for specific scenarios:DUPLICATE- Transaction is a duplicate of an existing oneERROR_OCCURRED- An error occurred during processingREQUIRE_REVIEW- Transaction requires manual reviewNOT_INITIATED- Transaction has not been initiated yet
Deposit Transaction Statuses
Used for mobile money deposits, bank deposits, and card deposits.Initial status. Payment request has been created but not yet sent to the provider.
Payment request has been sent to the provider and is awaiting customer action.
Customer has initiated payment and it’s being processed by the provider.
Terminal Status - Payment completed successfully. Funds have been credited to your fiat wallet.
Terminal Status - Alternative success status used by some providers.
Terminal Status - Payment failed. Common reasons include insufficient funds, network errors, or provider issues.
Terminal Status - Payment request expired before customer completed payment (typically 30 minutes timeout).
Terminal Status - Payment was cancelled by customer or system.
Terminal Status - Payment was declined by the provider or payment network.
Terminal Status - Payment was reversed/refunded.
Duplicate transaction detected (same reference ID already exists).
An unexpected error occurred during processing.
Transaction flagged for manual review.
Transaction is being retried after a temporary failure.
Terminal Status - Transaction failed permanently after all retry attempts exhausted.
Withdrawal Transaction Statuses
Used for mobile money withdrawals and bank withdrawals.Withdrawal request created but not yet sent to provider.
Withdrawal request queued for processing.
Withdrawal request sent to provider.
Provider has initiated the withdrawal transaction.
Withdrawal is being processed by the provider.
Terminal Status - Withdrawal completed successfully. Funds have been sent to the recipient.
Terminal Status - Withdrawal failed.
Terminal Status - Withdrawal was cancelled.
Terminal Status - Withdrawal was declined by provider.
Terminal Status - Withdrawal request expired.
Terminal Status - Withdrawal was reversed.
An error occurred during withdrawal processing.
Withdrawal requires manual review.
Withdrawal is being retried.
Provider is retrying the withdrawal transaction.
Terminal Status - Retry attempt was successful.
Terminal Status - Retry attempt failed.
Onramp Transaction Statuses
Onramp transactions use two separate status fields:depositStatus
Tracks the fiat payment status (mobile money/bank deposit). Uses the same statuses as Deposit Transaction Statuses.
onchainStatus
Tracks the crypto transfer status (sending crypto to external wallet).
Crypto transfer is pending. Waiting for deposit to complete first.
Crypto transfer is being processed on the blockchain.
Terminal Status - Crypto successfully sent to recipient address. Transaction hash available.
Terminal Status - Crypto transfer failed.
Terminal Status - Crypto transfer cancelled (usually because deposit failed).
Payment Link Transaction Statuses
Used for payment link transactions.Payment link created but no payment attempted yet.
Customer is completing the payment.
Terminal Status - Payment completed successfully.
Terminal Status - Payment failed.
Terminal Status - Payment cancelled by customer or expired.
Terminal Status - Payment link expired before payment was completed.
Callback Statuses
Internal statuses tracking callback delivery to your webhook URL.Callback delivered successfully to your webhook.
Callback waiting to be sent.
Callback is being sent.
Callback delivery failed (will retry).
Callback delivery permanently failed after all retries.
Best Practices
When to stop polling
When to stop polling
Stop polling when a transaction reaches any terminal status:
SUCCESSFUL/SUCCESSFAILEDCANCELLEDEXPIREDDECLINEDPERMANENTLY_FAILEDREVERSED
Handling failures
Handling failures
Different failure statuses indicate different scenarios:
FAILED- Temporary failure, user can retry creating a new transactionDECLINED- Provider declined the transaction (insufficient funds, limits, etc.)EXPIRED- Timeout, user can create a new transactionCANCELLED- User or system cancelled, no action neededPERMANENTLY_FAILED- Unrecoverable failure, investigate the error
Using webhooks vs polling
Using webhooks vs polling
Recommended: Use webhooks for real-time status updates instead of polling.Configure webhook URLs in your integration to receive automatic notifications when transaction statuses change.See Webhooks documentation for setup instructions.
Onramp status tracking
Onramp status tracking
For onramp transactions, monitor BOTH statuses:
depositStatus- Tracks if customer paid (mobile money/bank)onchainStatus- Tracks if crypto was sent
SUCCESSFULCommon flow:Error handling
Error handling
When you receive
ERROR_OCCURRED or REQUIRE_REVIEW:- Check the
errororerrorMessagefield in the response for details - Log the full transaction details for support
- Contact support if the issue persists
- Do not retry automatically - these statuses often require manual intervention
Common Status Flows
Successful Deposit Flow
Failed Deposit Flow
Expired Deposit Flow
Successful Withdrawal Flow
Successful Onramp Flow
Failed Onramp Flow (Deposit Fails)
Failed Onramp Flow (Crypto Transfer Fails)
Note: If deposit succeeds but crypto transfer fails, your fiat wallet is still credited. The crypto transfer will be automatically retried or can be manually retried via support.