Error Handling

The Bitnob Payouts API is designed for reliability, but various error scenarios can occur during the lifecycle of a payout, especially in a dynamic, cross-asset system like On-the-Fly settlements.

Properly handling errors ensures:

Clean user experience,

Faster operational recovery,

Better financial reconciliation,

Reduced support cases.

This section documents the key error types and how you should respond to them.


1. Expired Quotes

What Happens:

A quote expires before the customer funds the payment address.

No asset is received.

No payout is initiated.

API Behavior:

If customer tries to use an expired quoteId, API will return a 400 Bad Request with reason quote_expired.

Trip is not fully created or remains in an "expired" incomplete state.

Webhook Event:

event
meaning
payouts.withdrawal.expired
Quote expired. No payment detected. Payout canceled automatically.

Developer Action:

Inform the customer to restart the process by requesting a new quote.

Always check if expiresAt has passed before showing payment options.


2. Underpayment (Partial Funding)

What Happens:

Customer sends less than the amount specified in the quote.

Bitnob detects asset arrival but amount is insufficient.

System Behavior:

Payout still processes.

The fiat amount delivered is pro-rated based on amount actually received.

Difference is automatically calculated at the original quoted FX rate (within allowed margin).

Webhook Event:

event
meaning
payouts.asset.received
Asset received. Funding may be partial.
payouts.withdrawal.processing
Processing payout with adjusted fiat amount.
payouts.withdrawal.success
Payout delivered (adjusted for underpayment).

Developer Action:

Always listen for the actual amountReceived field in webhook payloads.

Show users the final delivered amount post-processing if underpayment happens.

Optionally notify the user that "partial payment received, adjusted payout delivered."


3. Overpayment (Excess Funding)

What Happens:

Customer sends more than the amount quoted.

System Behavior:

Bitnob processes the original intended fiat payout amount.

Extra funds are credited to the customer's internal balance (or future refund workflow).

Developer Action:

No user action required — payout proceeds.

Track excess amounts internally for reporting or refund offers.


4. Payment Sent After Expiry

What Happens:

Payment is received on-chain, but after the quote expiry window.

System Behavior:

Bitnob may auto-refund depending on configuration,

Or credit the amount to customer’s internal balance,

Or require manual support ticket for resolution.

Developer Action:

Always encourage users to pay immediately.

Handle webhook events like payouts.withdrawal.expired carefully — double-check if an asset eventually arrives after expiry and reconcile manually if needed.


5. Funding Transaction Stuck or Delayed on Blockchain

What Happens:

Customer’s payment takes too long to confirm due to low mining fee.

System Behavior:

Asset detection (assetReceivedAt) may happen but assetConfirmedAt is delayed.

Payout is not initiated until blockchain confirmation thresholds are satisfied.

Developer Action:

Inform users about minimum recommended Bitcoin/USDT gas fees.

Show clear UI for "awaiting confirmations" if payment is detected but not yet usable.


6. Payout Delivery Failure

What Happens:

Funding is successful,

Payout is initiated,

Bank or Mobile Money operator rejects the payout (e.g., invalid account, service downtime).

Webhook Event:

event
meaning
payouts.withdrawal.failed
Payout rejected at delivery phase.

Developer Action:

Listen for payouts.withdrawal.failed.

Retrieve failureReason from webhook or API fetch call.

Display clear messages to users (e.g., "Payment rejected due to invalid account number.").

Work with Bitnob support or retry payout after correcting beneficiary details (where allowed).


7. Webhook Delivery Failures

What Happens:

Your webhook server is down or responds with non-200 status codes.

System Behavior:

Bitnob retries webhook delivery:

Immediate retry on first failure,

Exponential backoff (e.g., retry after 1 min, 5 min, 15 min),

Retried up to a maximum threshold (e.g., 24 hours).

Developer Action:

Always build idempotent webhook handlers.

Log all received webhook payloads.

Ensure fast 200 OK responses even if you need to process asynchronously.

Consider implementing manual reconciliation fallback via GET /payouts/fetch/:reference and GET /payouts/trips/:tripId.


8. Compliance or Risk Rejection

What Happens:

After funding, payout is rejected for compliance reasons (e.g., flagged recipient, country restrictions).

Webhook Event:

event
meaning
payouts.withdrawal.rejected
Payout blocked at compliance/risk phase.

Developer Action:

Capture failureReason from webhook.

Alert your internal compliance or ops teams for review.

Engage Bitnob account managers where necessary to resolve.


Error Recovery Best Practices

Always track by tripId to see full status timeline.

Listen for both funding events (asset.received) and payout events (withdrawal.processing, withdrawal.success, withdrawal.failed).

Build alerting for payout delays beyond expected SLA windows.

Educate users on fast payment behavior (to prevent expiry or stuck payments).

Pre-validate beneficiary bank accounts or wallets where possible.


Summary

In a real-time payout system:

Payments can be late, partial, or excess.

Blockchain can delay confirmations.

Banks and Mobile Money systems can intermittently fail.

Compliance systems may block payouts.

Your application must be event-driven, resilient, and transparent to users.

Proper error handling isn't just a technical feature, it's part of the user experience, trust, and brand you are building.


Share on
Share on FacebookShare on XShare on LinkedIn
Did you find this page useful?