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.
https://wdgzone.tech/api/v1Authentication
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.
X-API-Key: wdg_live_your_private_key
Quick start
Verify your credentials and wallet with one request.
/meAUTHcurl https://wdgzone.tech/api/v1/me \ -H "X-API-Key: wdg_live_your_private_key"
{
"success": true,
"data": {
"account_id": 42,
"name": "My Reseller Store",
"balance": 125.750,
"currency": "USD"
}
}/catalogAUTHVoucher or Top Up
Start every catalogue journey here. The customer first selects voucher or topup, then follows categories until has_children becomes false.
Returns Voucher Products and Top Up Products.
Send parent_id to load the selected category's children.
If has_children=true, continue loading categories.
Products are returned only after a leaf category is selected.
{
"success": true,
"data": {
"catalog": "voucher",
"categories": [{
"id": 120,
"name": "Steam Wallet",
"has_children": true,
"next": "categories"
}]
}
}/categoriesAUTHCategories
Returns the active category and subcategory tree shown in WDG. Use parent_id to build nested menus.
{
"success": true,
"data": [{
"id": 120,
"parent_id": null,
"name": "Steam Wallet",
"type": "voucher",
"product_count": 165,
"in_stock_products": 142
}]
}/productsAUTHProducts and live stock
Fetch current WDG selling prices immediately before checkout. Internal supplier information is never included.
Filter one category.
Filter product type.
Only purchasable products.
Paginate the catalog.
/products/{id}AUTH{
"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
}
}/products/{id}/purchaseAUTHPurchase 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.
X-Idempotency-Key with a unique value up to 100 characters. Reuse the same value only when retrying the same order.Between 1 and 100.
Required when requires_player_id is true.
Receive signed terminal order events.
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"}'{
"success": true,
"data": {
"order_id": 1024,
"status": "completed",
"delivery_items": ["AAAA-BBBB-CCCC"],
"total": 10.475
}
}/ordersAUTHOrders
Paginated reseller order history, newest first. Use /orders/{id} for one complete order.
/orders/{id}AUTH/orders/{id}/deliveryAUTHDelivery polling
Pending order? Poll every 2–5 seconds. Stop on 200 or 410.
your callback_urlHMAC SIGNEDOrder 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.
Example: order.completed.
Use it to ignore duplicate deliveries.
HMAC-SHA256 of the exact raw 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
}
}$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);X-WDG-Event-ID./transactionsAUTHTransactions
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.
{
"success": false,
"error": {
"code": "OUT_OF_STOCK",
"message": "Requested quantity is not available",
"available_stock": 0
}
}| HTTP | Code | Meaning |
|---|---|---|
| 401 | UNAUTHORIZED | API key missing or invalid |
| 403 | ACCOUNT_SUSPENDED | Reseller account disabled |
| 404 | NOT_FOUND | Endpoint, product or order not found |
| 409 | OUT_OF_STOCK | Requested stock unavailable |
| 422 | INVALID_REQUEST | Input, wallet or player information invalid |
| 429 | RATE_LIMITED | Per-key limit exceeded |