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.

1

Create Your Account

Register at reseller_register.php. You'll receive your unique API key instantly. Free, no approval needed.

2

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.

3

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.

4

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.

5

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):

MethodExampleRecommended
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
Example: cURL with API Key
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

  1. Log into your Reseller Dashboard
  2. Enter the amount you want to deposit (minimum: $5.00 USDT)
  3. Choose your payment network:
NetworkSpeedFeeNotes
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
}
GET https://digetalhube.com/reseller_api.php?action=balance

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

FieldTypeDescription
availableNumberYour current spendable balance in USDT
total_depositedNumberTotal amount you have deposited since account creation
total_spentNumberTotal amount spent on orders
total_ordersIntegerTotal number of orders placed
currencyStringAlways "USDT"
Response Example
{
  "success": true,
  "balance": {
    "available": 47.50,
    "total_deposited": 100.00,
    "total_spent": 52.50,
    "total_orders": 15,
    "currency": "USDT"
  },
  "timestamp": 1711368000
}
GET https://digetalhube.com/reseller_api.php?action=products

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

ParameterTypeDescription
category_id OptionalIntegerFilter products by category ID
in_stock OptionalBooleanSet to 1 or true to only show products that are currently in stock

Response Fields (per product)

FieldTypeDescription
idIntegerUnique product ID (use this in create_order)
titleStringProduct name (e.g., "PUBG Mobile 60 UC")
descriptionStringProduct description
price_usdtNumberPrice in USDT (this is what will be deducted from your balance)
stockIntegerCurrent stock quantity
in_stockBooleanWhether the product is available for purchase
category_idIntegerCategory ID
category_nameStringCategory name (e.g., "PUBG Mobile")
Response Example
{
  "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
}
POST https://digetalhube.com/reseller_api.php?action=create_order

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)

FieldTypeDescription
product_id RequiredIntegerThe product ID from the /products endpoint
quantity OptionalIntegerNumber of codes to purchase (1-10, default: 1)
Request Example
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

FieldTypeDescription
order.order_idStringUnique order ID (use this to check status)
order.product_nameStringName of the product ordered
order.total_amountNumberTotal cost deducted from your balance
order.statusStringAlways processing for new orders
balance.previousNumberYour balance before this order
balance.deductedNumberAmount deducted for this order
balance.remainingNumberYour balance after this order
tracking.check_status_urlStringFull URL to poll for order status
Response Example
{
  "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.

GET https://digetalhube.com/reseller_api.php?action=order_status&order_id={id}

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

ParameterTypeDescription
order_id RequiredStringThe order ID returned from create_order
Response Example (Processing)
{
  "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
}
Response Example (Completed - with codes)
{
  "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
}
Response Example (Error - with auto-refund)
{
  "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
}
GET https://digetalhube.com/reseller_api.php?action=my_orders

Retrieve a paginated history of all your orders, including their status and codes for completed orders.

Authentication

API Key Required

Query Parameters

ParameterTypeDescription
limit OptionalIntegerNumber of orders to return (1-100, default: 50)
offset OptionalIntegerNumber of orders to skip for pagination (default: 0)
Response Example
{
  "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:

StatusMeaningWhat 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:

StepDescription
startedOrder received, preparing to purchase
checking_balanceChecking supplier account balance
creating_invoicePreparing payment to supplier
transferringSending payment to supplier
waiting_depositWaiting for supplier to confirm receipt
purchasingPurchasing 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.

Error Response Format
{
  "success": false,
  "error": {
    "code": "INSUFFICIENT_BALANCE",
    "message": "Insufficient balance. Required: $10.50, Available: $5.00. Please deposit more USDT."
  },
  "timestamp": 1711368000
}

All Error Codes

HTTPCodeDescription
400BAD_REQUESTGeneral bad request (missing or invalid parameters)
400MISSING_FIELDA required field is missing (e.g., product_id, order_id)
400INVALID_QUANTITYQuantity must be between 1 and 10
400INSUFFICIENT_STOCKNot enough stock available for the requested quantity
400INSUFFICIENT_BALANCEYour balance is too low. Deposit more USDT via the dashboard.
400INVALID_ACTIONThe action parameter is not recognized
401UNAUTHORIZEDNo API key was provided
401INVALID_API_KEYThe API key is invalid, expired, or the account is disabled
404PRODUCT_NOT_FOUNDThe requested product ID does not exist
404ORDER_NOT_FOUNDThe order ID does not exist or does not belong to your account
405METHOD_NOT_ALLOWEDWrong HTTP method (e.g., GET instead of POST for create_order)
429RATE_LIMITEDToo many requests. Wait and try again.
500ORDER_CREATION_FAILEDInternal error while creating the order. Try again.
502UPSTREAM_ERRORSupplier API is temporarily unavailable
503SERVICE_ERRORDatabase or service is temporarily unavailable

Rate Limits

To ensure fair usage and system stability, the API enforces rate limits per API key:

EndpointLimitWindow
All authenticated endpoints60 requestsPer minute
GET /products (public)30 requestsPer 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