Reseller API Documentation
Integrate DigetalHube into your platform. Deposit USDT, purchase gift cards via API, and receive codes instantly. Fully automated, no manual intervention needed.
How It Works
Our API uses a balance-based system. You deposit USDT to your account first, then use your balance to purchase gift card codes instantly through the API. No waiting for blockchain confirmations on each order.
Create Your Account
Register at reseller_register.php. You'll receive your unique API key instantly. Free, no approval needed.
Deposit USDT to Your Balance
Log into your Dashboard, click "Deposit", choose an amount and payment network (BEP20, TRC20, or Binance Pay). Send the USDT and your balance is credited automatically once the payment is detected on the blockchain.
Purchase Codes via API
Send a POST /create_order request with your API key. The cost is deducted from your balance instantly and the order is sent to our supplier for fulfillment.
Poll for Completion
Poll GET /order_status every 10 seconds. The system purchases the code from the supplier automatically. Typical delivery time is 1-3 minutes.
Receive Your Codes
Once the status changes to completed, the gift card codes are included in the response. Deliver them to your customers however you like.
Why Balance-Based?
With a pre-loaded balance, each order is processed instantly without waiting for blockchain confirmations. This means faster delivery for your customers and a simpler integration for you.
Authentication
All API endpoints (except GET /products) require authentication using your API key. You can find your API key in your Reseller Dashboard.
Sending Your API Key
You can send the API key in one of three ways (in order of preference):
| Method | Example | Recommended |
|---|---|---|
| X-API-Key Header | X-API-Key: YOUR_API_KEY |
Yes |
| Authorization Header | Authorization: Bearer YOUR_API_KEY |
OK |
| Query Parameter | ?api_key=YOUR_API_KEY |
Not recommended |
curl -H "X-API-Key: YOUR_API_KEY" \
"https://digetalhube.com/reseller_api.php?action=balance"
Keep Your API Key Secret
Never expose your API key in client-side code, public repositories, or URLs. If your key is compromised, log into your dashboard and regenerate it.
Depositing USDT
Before you can purchase codes via the API, you need to deposit USDT to your account balance. Deposits are made through the Reseller Dashboard (not via API).
How to Deposit
- Log into your Reseller Dashboard
- Enter the amount you want to deposit (minimum: $5.00 USDT)
- Choose your payment network:
| Network | Speed | Fee | Notes |
|---|---|---|---|
| Binance Pay | Instant | Zero fees | Recommended. Send via Binance app using the Pay ID shown. |
| BEP20 (BSC) | 1-3 minutes | ~$0.10 | Send USDT on BNB Smart Chain to the wallet address shown. |
| TRC20 (Tron) | 1-3 minutes | ~$1.00 | Send USDT on Tron network to the wallet address shown. |
Automatic Detection
Our system automatically monitors the blockchain for your payment. Once detected and confirmed, your balance is credited instantly. You will see the updated balance in your dashboard and via the GET /balance API endpoint.
Important Rules
1. Send the exact amount shown on the deposit page. Sending a different amount may cause detection to fail.
2. Send on the correct network. Sending USDT on the wrong network will result in permanent loss of funds.
3. Each deposit request has a 30-minute timeout. If payment is not detected within 30 minutes, the deposit expires and you need to create a new one.
Checking Your Balance via API
After depositing, you can verify your balance using the API:
curl -H "X-API-Key: YOUR_API_KEY" \
"https://digetalhube.com/reseller_api.php?action=balance"
// Response:
{
"success": true,
"balance": {
"available": 50.00,
"total_deposited": 100.00,
"total_spent": 50.00,
"total_orders": 12,
"currency": "USDT"
},
"timestamp": 1711368000
}
Returns your current account balance, total deposits, total spent, and order count. Use this to check if you have enough balance before placing an order.
Authentication
API Key Required
Response Fields
| Field | Type | Description |
|---|---|---|
| available | Number | Your current spendable balance in USDT |
| total_deposited | Number | Total amount you have deposited since account creation |
| total_spent | Number | Total amount spent on orders |
| total_orders | Integer | Total number of orders placed |
| currency | String | Always "USDT" |
{
"success": true,
"balance": {
"available": 47.50,
"total_deposited": 100.00,
"total_spent": 52.50,
"total_orders": 15,
"currency": "USDT"
},
"timestamp": 1711368000
}
Returns all available products with their prices, stock levels, and categories. This is the only public endpoint that does not require an API key.
Authentication
None required (public endpoint). Rate limited to 30 requests/minute per IP.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| category_id Optional | Integer | Filter products by category ID |
| in_stock Optional | Boolean | Set to 1 or true to only show products that are currently in stock |
Response Fields (per product)
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique product ID (use this in create_order) |
| title | String | Product name (e.g., "PUBG Mobile 60 UC") |
| description | String | Product description |
| price_usdt | Number | Price in USDT (this is what will be deducted from your balance) |
| stock | Integer | Current stock quantity |
| in_stock | Boolean | Whether the product is available for purchase |
| category_id | Integer | Category ID |
| category_name | String | Category name (e.g., "PUBG Mobile") |
{
"success": true,
"products": [
{
"id": 123,
"title": "PUBG Mobile 60 UC",
"description": "Global PIN",
"price_usdt": 1.05,
"stock": 50,
"in_stock": true,
"category_id": 1,
"category_name": "PUBG Mobile"
},
{
"id": 456,
"title": "iTunes $10 USA",
"description": "US Region",
"price_usdt": 10.50,
"stock": 25,
"in_stock": true,
"category_id": 5,
"category_name": "iTunes"
}
],
"total": 2,
"categories": [
{ "id": 1, "name": "PUBG Mobile" },
{ "id": 5, "name": "iTunes" }
],
"timestamp": 1711368000
}
Creates a new order by deducting the total cost from your balance and sending the purchase request to our supplier. The order is processed automatically and typically completes within 1-3 minutes.
Instant Balance Deduction
Unlike traditional payment-per-order systems, your balance is deducted immediately when you create an order. No blockchain waiting. If the order fails for any reason, your balance is automatically refunded.
Authentication
API Key Required
Request Body (JSON)
| Field | Type | Description |
|---|---|---|
| product_id Required | Integer | The product ID from the /products endpoint |
| quantity Optional | Integer | Number of codes to purchase (1-10, default: 1) |
curl -X POST \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"product_id": 123, "quantity": 1}' \
"https://digetalhube.com/reseller_api.php?action=create_order"
Response Fields
| Field | Type | Description |
|---|---|---|
| order.order_id | String | Unique order ID (use this to check status) |
| order.product_name | String | Name of the product ordered |
| order.total_amount | Number | Total cost deducted from your balance |
| order.status | String | Always processing for new orders |
| balance.previous | Number | Your balance before this order |
| balance.deducted | Number | Amount deducted for this order |
| balance.remaining | Number | Your balance after this order |
| tracking.check_status_url | String | Full URL to poll for order status |
{
"success": true,
"order": {
"order_id": "API-A1B2C3D4E5F6-1711368000",
"product_id": 123,
"product_name": "PUBG Mobile 60 UC",
"quantity": 1,
"price_per_unit": 1.05,
"total_amount": 1.05,
"currency": "USDT",
"status": "processing",
"created_at": 1711368000,
"message": "Order created! Balance deducted. Your code is being purchased from the supplier."
},
"balance": {
"previous": 50.00,
"deducted": 1.05,
"remaining": 48.95
},
"tracking": {
"check_status_url": "https://digetalhube.com/reseller_api.php?action=order_status&order_id=API-A1B2C3D4E5F6-1711368000",
"poll_interval_seconds": 10,
"note": "Poll the check_status_url every 10 seconds. Status will change from processing to completed (with codes)."
},
"timestamp": 1711368000
}
Insufficient Balance?
If your balance is less than the total cost, the API returns error code INSUFFICIENT_BALANCE with a message showing the required and available amounts. Deposit more USDT via your dashboard to continue.
Check the current status of an order and retrieve the gift card codes once the order is completed. You should poll this endpoint every 10 seconds after creating an order.
Authentication
API Key Required
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| order_id Required | String | The order ID returned from create_order |
{
"success": true,
"order": {
"order_id": "API-A1B2C3D4E5F6-1711368000",
"product_id": 123,
"product_name": "PUBG Mobile 60 UC",
"quantity": 1,
"amount": 1.05,
"currency": "USDT",
"status": "processing",
"status_detail": "processing",
"message": "Purchasing your product...",
"processing_step": "purchasing"
},
"timestamp": 1711368050
}
{
"success": true,
"order": {
"order_id": "API-A1B2C3D4E5F6-1711368000",
"product_id": 123,
"product_name": "PUBG Mobile 60 UC",
"quantity": 1,
"amount": 1.05,
"currency": "USDT",
"status": "completed",
"status_detail": "completed",
"message": "Order completed! Your codes are ready.",
"codes": ["XXXX-YYYY-ZZZZ-1234"]
},
"timestamp": 1711368120
}
{
"success": true,
"order": {
"order_id": "API-A1B2C3D4E5F6-1711368000",
"status": "error",
"message": "Product out of stock. Your balance has been refunded.",
"refunded": true,
"refund_amount": 1.05
},
"timestamp": 1711368120
}
Retrieve a paginated history of all your orders, including their status and codes for completed orders.
Authentication
API Key Required
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| limit Optional | Integer | Number of orders to return (1-100, default: 50) |
| offset Optional | Integer | Number of orders to skip for pagination (default: 0) |
{
"success": true,
"orders": [
{
"order_id": "API-A1B2C3D4E5F6-1711368000",
"product_id": 123,
"product_name": "PUBG Mobile 60 UC",
"quantity": 1,
"amount": 1.05,
"currency": "USDT",
"status": "completed",
"created_at": "2026-03-25 12:00:00",
"codes": ["XXXX-YYYY-ZZZZ-1234"]
}
],
"total": 1,
"limit": 50,
"offset": 0,
"timestamp": 1711368000
}
Order Lifecycle
Every order goes through a defined set of statuses. Here is the complete lifecycle:
| Status | Meaning | What to Do |
|---|---|---|
| processing | Balance deducted, order sent to supplier for fulfillment | Keep polling order_status every 10 seconds |
| completed | Code(s) purchased successfully and ready for delivery | Read the codes array from the response |
| error | Something went wrong during fulfillment (e.g., out of stock at supplier) | Balance is automatically refunded. Check refunded and refund_amount fields. |
Processing Steps
While an order is in processing status, the processing_step field shows the current step:
| Step | Description |
|---|---|
started | Order received, preparing to purchase |
checking_balance | Checking supplier account balance |
creating_invoice | Preparing payment to supplier |
transferring | Sending payment to supplier |
waiting_deposit | Waiting for supplier to confirm receipt |
purchasing | Purchasing the product from supplier |
Automatic Refunds
If an order fails at any step, your balance is automatically refunded. You never lose money on failed orders. The refund is instant and reflected in both the order_status response and your balance endpoint.
Error Codes
When an API request fails, the response includes an error object with a machine-readable code and a human-readable message.
{
"success": false,
"error": {
"code": "INSUFFICIENT_BALANCE",
"message": "Insufficient balance. Required: $10.50, Available: $5.00. Please deposit more USDT."
},
"timestamp": 1711368000
}
All Error Codes
| HTTP | Code | Description |
|---|---|---|
| 400 | BAD_REQUEST | General bad request (missing or invalid parameters) |
| 400 | MISSING_FIELD | A required field is missing (e.g., product_id, order_id) |
| 400 | INVALID_QUANTITY | Quantity must be between 1 and 10 |
| 400 | INSUFFICIENT_STOCK | Not enough stock available for the requested quantity |
| 400 | INSUFFICIENT_BALANCE | Your balance is too low. Deposit more USDT via the dashboard. |
| 400 | INVALID_ACTION | The action parameter is not recognized |
| 401 | UNAUTHORIZED | No API key was provided |
| 401 | INVALID_API_KEY | The API key is invalid, expired, or the account is disabled |
| 404 | PRODUCT_NOT_FOUND | The requested product ID does not exist |
| 404 | ORDER_NOT_FOUND | The order ID does not exist or does not belong to your account |
| 405 | METHOD_NOT_ALLOWED | Wrong HTTP method (e.g., GET instead of POST for create_order) |
| 429 | RATE_LIMITED | Too many requests. Wait and try again. |
| 500 | ORDER_CREATION_FAILED | Internal error while creating the order. Try again. |
| 502 | UPSTREAM_ERROR | Supplier API is temporarily unavailable |
| 503 | SERVICE_ERROR | Database or service is temporarily unavailable |
Rate Limits
To ensure fair usage and system stability, the API enforces rate limits per API key:
| Endpoint | Limit | Window |
|---|---|---|
| All authenticated endpoints | 60 requests | Per minute |
| GET /products (public) | 30 requests | Per minute (per IP) |
If you exceed the rate limit, the API returns HTTP 429 with error code RATE_LIMITED. Wait a few seconds and retry.
Full Integration Examples
Complete working examples showing the full flow: check balance, list products, create an order, and poll for the code.
import requests
import time
API_KEY = "YOUR_API_KEY"
BASE = "https://digetalhube.com/reseller_api.php"
HEADERS = {"X-API-Key": API_KEY, "Content-Type": "application/json"}
# 1. Check balance
balance = requests.get(f"{BASE}?action=balance", headers=HEADERS).json()
print(f"Balance: ${balance['balance']['available']}")
# 2. List products (filter by in_stock)
products = requests.get(f"{BASE}?action=products&in_stock=1").json()
for p in products["products"][:5]:
print(f" [{p['id']}] {p['title']} - ${p['price_usdt']} ({p['stock']} in stock)")
# 3. Create an order
order_resp = requests.post(
f"{BASE}?action=create_order",
headers=HEADERS,
json={"product_id": 123, "quantity": 1}
).json()
if not order_resp["success"]:
print(f"Error: {order_resp['error']['message']}")
exit()
order_id = order_resp["order"]["order_id"]
print(f"Order created: {order_id}")
print(f"Balance remaining: ${order_resp['balance']['remaining']}")
# 4. Poll for completion (every 10 seconds)
while True:
status = requests.get(
f"{BASE}?action=order_status&order_id={order_id}",
headers=HEADERS
).json()
current = status["order"]["status"]
print(f"Status: {current} - {status['order'].get('message', '')}")
if current == "completed":
codes = status["order"]["codes"]
print(f"Codes received: {codes}")
break
elif current == "error":
print(f"Order failed. Refunded: ${status['order'].get('refund_amount', 0)}")
break
time.sleep(10)
<?php
$apiKey = "YOUR_API_KEY";
$baseUrl = "https://digetalhube.com/reseller_api.php";
function apiCall($url, $method = "GET", $data = null, $apiKey = null) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
$headers = ["Content-Type: application/json"];
if ($apiKey) $headers[] = "X-API-Key: " . $apiKey;
if ($method === "POST") {
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
}
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
// 1. Check balance
$balance = apiCall("$baseUrl?action=balance", "GET", null, $apiKey);
echo "Balance: $" . $balance['balance']['available'] . "\n";
// 2. Create order
$order = apiCall("$baseUrl?action=create_order", "POST",
["product_id" => 123, "quantity" => 1], $apiKey);
if (!$order['success']) {
die("Error: " . $order['error']['message'] . "\n");
}
$orderId = $order['order']['order_id'];
echo "Order created: $orderId\n";
echo "Remaining balance: $" . $order['balance']['remaining'] . "\n";
// 3. Poll for completion
while (true) {
$status = apiCall("$baseUrl?action=order_status&order_id=$orderId",
"GET", null, $apiKey);
$current = $status['order']['status'];
echo "Status: $current\n";
if ($current === "completed") {
$codes = $status['order']['codes'];
echo "Codes: " . implode(", ", $codes) . "\n";
break;
} elseif ($current === "error") {
echo "Failed. Refunded: $" . ($status['order']['refund_amount'] ?? 0) . "\n";
break;
}
sleep(10);
}
const API_KEY = "YOUR_API_KEY";
const BASE = "https://digetalhube.com/reseller_api.php";
async function api(action, method = "GET", body = null) {
const opts = {
method,
headers: { "X-API-Key": API_KEY, "Content-Type": "application/json" }
};
if (body) opts.body = JSON.stringify(body);
const res = await fetch(`${BASE}?action=${action}`, opts);
return res.json();
}
async function main() {
// 1. Check balance
const bal = await api("balance");
console.log(`Balance: $${bal.balance.available}`);
// 2. Create order
const order = await api("create_order", "POST", {
product_id: 123,
quantity: 1
});
if (!order.success) {
console.error(`Error: ${order.error.message}`);
return;
}
const orderId = order.order.order_id;
console.log(`Order: ${orderId} | Remaining: $${order.balance.remaining}`);
// 3. Poll for completion
while (true) {
const status = await api(`order_status&order_id=${orderId}`);
const s = status.order.status;
console.log(`Status: ${s} - ${status.order.message || ""}`);
if (s === "completed") {
console.log("Codes:", status.order.codes);
break;
} else if (s === "error") {
console.log(`Failed. Refunded: $${status.order.refund_amount || 0}`);
break;
}
await new Promise(r => setTimeout(r, 10000));
}
}
main();
# 1. Check your balance curl -H "X-API-Key: YOUR_API_KEY" \ "https://digetalhube.com/reseller_api.php?action=balance" # 2. List products in stock curl "https://digetalhube.com/reseller_api.php?action=products&in_stock=1" # 3. Create an order (deducts from balance) curl -X POST \ -H "X-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"product_id": 123, "quantity": 1}' \ "https://digetalhube.com/reseller_api.php?action=create_order" # 4. Check order status (repeat every 10 seconds) curl -H "X-API-Key: YOUR_API_KEY" \ "https://digetalhube.com/reseller_api.php?action=order_status&order_id=API-XXXX-1711368000" # 5. List all your orders curl -H "X-API-Key: YOUR_API_KEY" \ "https://digetalhube.com/reseller_api.php?action=my_orders&limit=10"
DigetalHube Reseller API v2.0 · Create Account · Dashboard · Reseller Program