Get Your API Key
Generate API Keys
Go to Settings → API Section → Generate API KeyYou’ll receive two keys:
- Sandbox: Test without real transactions
- Production: Live transactions
Secure Your Keys
Store keys securely in environment variables. Never expose them in client-side code or version control.
Always start with Sandbox mode to test your integration safely.
Verify Your API Key
Test your API key with the validate endpoint:
curl https://api.oneclickdz.com/v3/validate \
-H "X-Access-Token: YOUR_API_KEY"
Response:
{
"success": true,
"data": {
"username": "+213665983439",
"apiKey": {
"type": "SANDBOX",
"scope": "READ-WRITE",
"isEnabled": true
}
}
}
If you see "success": true, your API key is working correctly!
Step 1: Send a Mobile Top-Up
Send a 500 DZD top-up to a Djezzy number:
curl https://api.oneclickdz.com/v3/mobile/send \
-X POST \
-H "Content-Type: application/json" \
-H "X-Access-Token: YOUR_API_KEY" \
-d '{
"plan_code": "PREPAID_DJEZZY",
"MSSIDN": "0778037340",
"amount": 500,
"ref": "order-001"
}'
Response:
{
"success": true,
"data": {
"topupId": "6901616fe9e88196b4eb64b0",
"topupRef": "order-001"
}
}
Step 2: Check Top-Up Status
Check the status of your top-up using the reference:
curl https://api.oneclickdz.com/v3/mobile/check-ref/order-001 \
-H "X-Access-Token: YOUR_API_KEY"
Response:
{
"success": true,
"data": {
"status": "FULFILLED",
"MSSIDN": "0778037340",
"topup_amount": 500
}
}
Status flow: PENDING (5s) → HANDLING (15s) → FULFILLED ✅
Step 3: Try Internet Top-Up
Recharge an ADSL line with a 1000 DZD card:
curl https://api.oneclickdz.com/v3/internet/send \
-X POST \
-H "Content-Type: application/json" \
-H "X-Access-Token: YOUR_API_KEY" \
-d '{
"type": "ADSL",
"number": "036362608",
"value": 1000,
"ref": "internet-001"
}'
Response:
{
"success": true,
"data": {
"topupId": "6901616fe9e88196b4eb64b1",
"topupRef": "internet-001"
}
}
Check the internet top-up status:
curl https://api.oneclickdz.com/v3/internet/check-ref/internet-001 \
-H "X-Access-Token: YOUR_API_KEY"
Response:
{
"success": true,
"data": {
"status": "FULFILLED",
"card_code": "123456789012",
"num_trans": "AT-2025-001"
}
}
Step 4: Explore Gift Cards
Get the product catalog to see available gift cards:
curl https://api.oneclickdz.com/v3/gift-cards/catalog \
-H "X-Access-Token: YOUR_API_KEY"
Place a gift card order:
curl https://api.oneclickdz.com/v3/gift-cards/placeOrder \
-X POST \
-H "Content-Type: application/json" \
-H "X-Access-Token: YOUR_API_KEY" \
-d '{
"productId": "PRODUCT_ID",
"typeId": "TYPE_ID",
"quantity": 1
}'
Response:
{
"success": true,
"data": {
"orderId": "6901616fe9e88196b4eb64c0"
}
}
Retrieve gift card codes by checking order status:
curl https://api.oneclickdz.com/v3/gift-cards/checkOrder/6901616fe9e88196b4eb64c0 \
-H "X-Access-Token: YOUR_API_KEY"
Response when fulfilled:
{
"success": true,
"data": {
"status": "FULFILLED",
"cards": [
{
"value": "XXXX-XXXX-XXXX-XXXX",
"serial": "123456789"
}
]
}
}
Card codes are retrieved from the cards array when status is FULFILLED
Sandbox Testing
In sandbox mode, test these special scenarios with mobile top-ups:
| Phone Number | Behavior | Purpose |
Any normal number (e.g., 0778037340) | Success: PENDING → HANDLING → FULFILLED | Test successful transactions |
0600000001 | REFUNDED with error message | Test refund handling |
0600000002 | REFUNDED with suggested alternative plans | Test plan mismatch |
0600000003 | UNKNOWN_ERROR status | Test uncertain state handling |
Each workflow guide includes comprehensive sandbox testing instructions and examples.
All API responses follow this structure:
{
"success": true, // Operation status
"data": { ... }, // Response data
"meta": { // Metadata
"timestamp": "...",
"pagination": { ... } // If applicable
},
"requestId": "..." // Unique request identifier
}
Learn about Response Format →
Next Steps