API Operational
OpenAPI JSON
DIGITAL PRODUCTS, ONE API

Build your reseller business with WDG API

Sell vouchers, gift cards and instant game top-ups through a clean, versioned JSON API. Live catalog, wallet charging, idempotent orders and delivery polling are included.

BASE URLhttps://wdgzone.tech/api/v1
✓ USD pricing✓ Live stock✓ Idempotent orders✓ Supplier-neutral

Authentication

Send your private reseller key in the X-API-Key header. API keys are connected to your WDG wallet and must only be used from your backend.

Keep it secretNever expose an API key in frontend JavaScript, a mobile application, a public repository or Telegram messages.
HTTP HEADER
X-API-Key: wdg_live_your_private_key

Quick start

Verify your credentials and wallet with one request.

GET/meAUTH
REQUEST
curl https://wdgzone.tech/api/v1/me \
  -H "X-API-Key: wdg_live_your_private_key"
200 OK
{
  "success": true,
  "data": {
    "account_id": 42,
    "name": "My Reseller Store",
    "balance": 125.750,
    "currency": "USD"
  }
}
GET/catalogAUTH

Voucher or Top Up

Start every catalogue journey here. The customer first selects voucher or topup, then follows categories until has_children becomes false.

1. Choose catalogueGET /catalog

Returns Voucher Products and Top Up Products.

2. Load categoriesGET /catalog/{type}/categories

Send parent_id to load the selected category's children.

3. Select subcategoryhas_children / next

If has_children=true, continue loading categories.

4. Load productsGET /catalog/{type}/categories/{id}/products

Products are returned only after a leaf category is selected.

200 OK
{
  "success": true,
  "data": {
    "catalog": "voucher",
    "categories": [{
      "id": 120,
      "name": "Steam Wallet",
      "has_children": true,
      "next": "categories"
    }]
  }
}
GET/categoriesAUTH

Categories

Returns the active category and subcategory tree shown in WDG. Use parent_id to build nested menus.

200 OK
{
  "success": true,
  "data": [{
    "id": 120,
    "parent_id": null,
    "name": "Steam Wallet",
    "type": "voucher",
    "product_count": 165,
    "in_stock_products": 142
  }]
}
GET/productsAUTH

Products and live stock

Fetch current WDG selling prices immediately before checkout. Internal supplier information is never included.

category_idinteger · optional

Filter one category.

typevoucher | topup | manual

Filter product type.

in_stock1 · optional

Only purchasable products.

page / limitmax 100

Paginate the catalog.

GET/products/{id}AUTH
200 OK
{
  "success": true,
  "data": {
    "id": 8451,
    "name": "Steam Wallet 10 USD",
    "category_id": 124,
    "category": "USA / USD",
    "type": "voucher",
    "price": 10.475,
    "currency": "USD",
    "stock": 48,
    "available": true,
    "requires_player_id": false
  }
}
POST/products/{id}/purchaseAUTH

Purchase a product

Wallet balance and stock are reserved atomically. Every request requires a unique idempotency key, so network retries cannot charge the same order twice.

Idempotency requiredSend X-Idempotency-Key with a unique value up to 100 characters. Reuse the same value only when retrying the same order.
quantityinteger · required

Between 1 and 100.

player_idstring · conditional

Required when requires_player_id is true.

callback_urlHTTPS URL · optional

Receive signed terminal order events.

cURL
curl -X POST https://wdgzone.tech/api/v1/products/8451/purchase \
  -H "X-API-Key: wdg_live_your_private_key" \
  -H "X-Idempotency-Key: order-2026-00001" \
  -H "Content-Type: application/json" \
  -d '{"quantity":1,"callback_url":"https://store.example.com/webhooks/wdg"}'
201 CREATED
{
  "success": true,
  "data": {
    "order_id": 1024,
    "status": "completed",
    "delivery_items": ["AAAA-BBBB-CCCC"],
    "total": 10.475
  }
}
GET/ordersAUTH

Orders

Paginated reseller order history, newest first. Use /orders/{id} for one complete order.

GET/orders/{id}AUTH
GET/orders/{id}/deliveryAUTH

Delivery polling

Pending order? Poll every 2–5 seconds. Stop on 200 or 410.

200Delivery is ready
202Still processing
410Failed and refunded
404Order not found
POSTyour callback_urlHMAC SIGNED

Order webhooks

When an API order reaches a terminal state, WDG sends order.completed, order.failed or order.refunded. Return any 2xx response within 8 seconds.

X-WDG-Eventevent type

Example: order.completed.

X-WDG-Event-IDUUID

Use it to ignore duplicate deliveries.

X-WDG-Signaturesha256=...

HMAC-SHA256 of the exact raw body.

WEBHOOK BODY
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "event": "order.completed",
  "created_at": "2026-08-07T12:30:00Z",
  "data": {
    "order_id": 1024,
    "product_id": 8451,
    "quantity": 1,
    "total": 10.475,
    "currency": "USD",
    "status": "COMPLETED",
    "delivery_items": ["AAAA-BBBB-CCCC"],
    "refunded": false
  }
}
PHP SIGNATURE VERIFICATION
$raw = file_get_contents('php://input');
$secret = hash('sha256', getenv('WDG_API_KEY'));
$expected = 'sha256=' . hash_hmac('sha256', $raw, $secret);
$received = $_SERVER['HTTP_X_WDG_SIGNATURE'] ?? '';

if (!hash_equals($expected, $received)) {
    http_response_code(401);
    exit;
}

http_response_code(204);
Automatic retriesFailed deliveries are retried up to 6 times with exponential backoff. Always process events idempotently using X-WDG-Event-ID.
GET/transactionsAUTH

Transactions

Returns deposits, purchases, refunds and adjustments recorded against your wallet.

Errors and limits

Every error has a stable machine-readable code and a human-readable message.

ERROR
{
  "success": false,
  "error": {
    "code": "OUT_OF_STOCK",
    "message": "Requested quantity is not available",
    "available_stock": 0
  }
}
HTTPCodeMeaning
401UNAUTHORIZEDAPI key missing or invalid
403ACCOUNT_SUSPENDEDReseller account disabled
404NOT_FOUNDEndpoint, product or order not found
409OUT_OF_STOCKRequested stock unavailable
422INVALID_REQUESTInput, wallet or player information invalid
429RATE_LIMITEDPer-key limit exceeded