Skip to main content

Overview

Once you’ve validated all inputs, you’re ready to send the top-up request to the OneClickDz API. This guide covers submitting requests, handling responses, and managing your reference system.

API Reference

View complete API documentation for POST /v3/mobile/send endpoint

Basic Top-Up Request

Simple Example

Success Response

Generating Unique References

Always provide unique references to prevent duplicates and enable tracking:

Checking Balance Before Sending

Always verify sufficient balance to prevent failed requests:

Balance API Reference

Learn more about GET /v3/account/balance endpoint

Error Handling

Handle common API errors:
ERR_VALIDATION or INSUFFICIENT_BALANCE from /v3/mobile/send means the top-up was not created and nothing was charged — refund your customer immediately. Never refund on DUPLICATED_REF: that ref belongs to an existing order, check its status instead. ERR_VALIDATION is not always your fault: it is also returned when a plan or operator is disabled, the operator network is unavailable, or the offer type is not enabled for your account. Show message (often in Arabic) to your customer.
See the Error Handling Reference for complete error codes and handling strategies.

Database Integration

Store orders before and after API calls:

Async Processing

For better performance, process top-ups asynchronously:

Retry Logic

Implement retry for network errors:
On a timeout or network error, retry with the same ref. If the retry answers DUPLICATED_REF, your first request was received — do not send again with a new ref; check its status with GET /v3/mobile/check-ref/{ref}.

Best Practices

Generate unique ref for each request to prevent duplicates and enable tracking.
Verify sufficient balance before sending to avoid failed requests.
Wrap order creation and balance deduction in transactions for data consistency.
Use queues for better performance and user experience.
Retry network errors with exponential backoff, but not validation errors.
Log all requests and responses for debugging and auditing.

Next Steps

Step 4: Status Polling

Learn how to poll and track top-up status

Check Status by Ref API

API docs for GET /v3/mobile/check-ref/:ref

Check Status by ID API

API docs for GET /v3/mobile/check-id/:id

Error Handling Reference

Complete error handling and recovery guide

Webhooks Setup

Set up real-time status notifications

Polling Strategies

Optimize your polling implementation

Transaction History API

View your transaction history

Balance API

Check account balance endpoint