DigetalHube API
Resell gift cards and vouchers straight from your own code. Plain JSON over HTTPS, no SDK to install. Orders are idempotent, and anything that fails is refunded automatically.
Introduction
Every request goes to the versioned base URL below. Register for a reseller account to get an API key and fund your balance — there is no separate approval step.
How a purchase flows
| 1 | Browse /category and /products to find what to sell. |
| 2 | Read the fresh unit_price from /products/:id. |
| 3 | Call /products/:id/purchase. Your balance is charged. |
| 4 | Poll the returned poll_url until it returns 200 with codes. |
| 5 | Reconcile against /transactions, which records every balance change. |
unit_price from the product endpoint immediately
before you charge your own customer, rather than caching it.
Authentication
Protected endpoints expect your secret key in an X-API-Key header. An
Authorization: Bearer header works too. Catalog endpoints
(/category, /products) are public and need no key.
X-API-Key: your_api_key_here
curl -X GET https://digetalhube.com/v1/getMe \ -H "X-API-Key: your_api_key_here"
Current user
Returns the profile and live wallet balance for the key holder. Call it on boot to confirm credentials and check available funds before charging.
{
"success": true,
"reseller_id": 12,
"username": "mystore",
"email": "you@example.com",
"balance": 248.6000,
"total_deposited": 1000.0000,
"total_spent": 751.4000,
"total_orders": 312,
"rate_limit": 60,
"currency": "USDT"
}
Categories
List every category, or pass an :id to get the products inside one.
Each category carries a live product_count and how many are in stock.
{
"success": true,
"categories": [
{ "id": 3, "title": "iTunes USA", "product_count": 25, "in_stock": 22 },
{ "id": 4, "title": "Razer Gold", "product_count": 18, "in_stock": 18 }
]
}
Products
Every product with its current unit_price, the printed
face_value (null when not set) and live stock.
Fetch the single-product route before a purchase so you charge against the freshest
price.
Query parameters
| Parameter | Type | Description |
|---|---|---|
| category_idoptional | integer | Return one category only. |
| in_stockoptional | boolean | 1 or true for available products only. |
curl "https://digetalhube.com/v1/products?in_stock=1"
{
"success": true,
"products": [
{
"id": 29,
"title": "Itunes 500$ US GiftCard",
"description": "",
"category_id": 3,
"category_title": "iTunes USA",
"unit_price": 486.75,
"face_value": 500,
"stock": 14
}
],
"total": 939
}
Buy a product
Charges your wallet and queues the purchase. Returns 201 with the order
id and a poll_url to follow until the codes are ready.
Body
| Field | Type | Description |
|---|---|---|
| quantityoptional | integer | 1 to 10. Defaults to 1. |
X-Idempotency-Key to dedupe retries — the same key
within a 30-minute window returns the original response instead of charging
twice. The key must be a 36-character UUID. Omit the header to skip it.
curl -X POST https://digetalhube.com/v1/products/29/purchase \
-H "X-API-Key: your_api_key_here" \
-H "X-Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \
-H "Content-Type: application/json" \
-d '{"quantity": 2}'
{
"success": true,
"order_id": "API-845138F83CBB-1787792999",
"product_id": 29,
"product_title": "Itunes 500$ US GiftCard",
"quantity": 2,
"unit_price": 486.75,
"total_price": 973.50,
"currency": "USDT",
"status": "PENDING",
"delivery_items": null,
"poll_url": "/v1/orders/API-845138F83CBB-1787792999/delivery",
"balance": { "before": 1222.10, "after": 248.60 }
}
Orders
Paginated order history, newest first. Pass page and limit
(max 100), or fetch a single order by id.
curl -X GET "https://digetalhube.com/v1/orders?page=1&limit=50" \ -H "X-API-Key: your_api_key_here"
{
"success": true,
"orders": [
{
"order_id": "API-845138F83CBB-1787792999",
"product_id": 29,
"product_title": "Itunes 500$ US GiftCard",
"quantity": 2,
"total_price": 973.50,
"currency": "USDT",
"status": "COMPLETED",
"delivery_items": ["XXXX-XXXX-XXXX", "YYYY-YYYY-YYYY"],
"created_at": "2026-08-24 21:00:00"
}
],
"pagination": { "page": 1, "limit": 50, "total": 120, "total_pages": 3 }
}
Delivery polling
For pending orders, poll this every 5–10 seconds. The HTTP status tells you where things stand without parsing the body:
| Code | Meaning |
|---|---|
| 200 | Codes are ready in delivery_items. |
| 202 | Still PROCESSING — try again shortly. |
| 410 | Terminal failure — auto-refunded. |
| 404 | Order not found, or not yours. |
Stop polling on any 200 or 410.
{
"success": true,
"order_id": "API-845138F83CBB-1787792999",
"product_id": 29,
"product_title": "Itunes 500$ US GiftCard",
"quantity": 2,
"status": "COMPLETED",
"delivery_items": ["XXXX-XXXX-XXXX", "YYYY-YYYY-YYYY"]
}
{
"success": true,
"order_id": "API-845138F83CBB-1787792999",
"status": "PROCESSING",
"message": "Order is still being fulfilled. Try again shortly."
}
{
"success": false,
"order_id": "API-845138F83CBB-1787792999",
"status": "REFUNDED",
"refunded": true,
"message": "Order failed and was refunded automatically."
}
Transactions
The ledger behind your wallet — every charge and top-up with
balance_before and balance_after, so reconciliation is
exact. Paginated like orders.
| Type | Meaning |
|---|---|
| add_balance | Balance added — deposit or refund. |
| charge_balance | Balance deducted — a purchase. |
{
"success": true,
"data": [
{
"id": 45,
"transaction_type": "charge_balance",
"amount": 973.5000,
"balance_before": 1222.1000,
"balance_after": 248.6000,
"status": "success",
"reference_id": "API-845138F83CBB-1787792999",
"description": "Purchase Itunes 500$ US GiftCard",
"created_at": "2026-08-24 21:00:00"
}
],
"pagination": { "page": 1, "limit": 50, "total": 200, "total_pages": 4 }
}
Idempotency
A timeout after the server already processed an order looks identical to one that
never arrived. Retrying blindly risks buying twice. Send an
X-Idempotency-Key on a purchase and the retry is safe.
How it behaves
| Situation | Result |
|---|---|
| First request | 201, order created, balance charged. |
| Repeat, same body | Original response replayed with X-Idempotent-Replay: true. No second charge. |
| Repeat, different body | 422 — key already used with different parameters. |
| Repeat while processing | 409 — wait and retry. |
| Key not a UUID | 400. |
| After 30 minutes | Key expires and is treated as new. |
Rules
| Format | 36-character UUID. Generate a fresh one per order. |
| Window | 30 minutes from the first request. |
| Scope | Per API key. Two resellers can use the same UUID without collision. |
| Failures | Only successful orders are stored, so a failed order can be retried with the same key. |
| Optional | Omit the header and the endpoint behaves as before. |
Status & limits
Standard HTTP semantics throughout — the body always carries a success
boolean and a human message on errors.
| Limit | Value |
|---|---|
| Rate limit | 60 requests / minute per key |
| Idempotency window | 30 minutes |
| Pending poll cadence | every 5–10 seconds |
| Typical completion | under 60 seconds |
| Max quantity | 10 units per order |
| Page size | max 100 items |
HTTP status codes
| Code | Meaning |
|---|---|
| 200 | OK — request successful. |
| 201 | Created — order accepted, balance charged. |
| 202 | Accepted — still processing, poll again. |
| 400 | Bad request — invalid format or parameters. |
| 401 | Unauthorized — auth failed or key invalid. |
| 404 | Not found — resource does not exist. |
| 409 | Conflict — an identical request is still in flight. |
| 410 | Gone — failed, refunded or cancelled (terminal). |
| 422 | Idempotency key reused with different parameters. |
| 429 | Too many requests — rate limit exceeded. |
| 500 | Internal server error. |
| 503 | Catalogue temporarily unavailable. |
{
"success": false,
"message": "Insufficient balance. Required: 973.50 USDT, available: 248.60"
}