API Reference Documentation
Integrate seamlessly with the Perfect Deal platform. Use our high-concurrency RESTful endpoints to query live account balances, monitor catalog stock in real-time, execute automated bulk orders, verify webhooks, and sync your external storefront.
Authentication
Account and order requests require your unique secret API Key in the X-API-Key HTTP header or as a Bearer token. The product catalog is public.
Keep your API key secret. Generate or rotate your key anytime via the Telegram Bot using /api.
Rate Limits
Authenticated requests are limited to 60 reads and 10 writes per minute per API key, counted per web worker.
Exceeding returns status code 429 Too Many Requests.
Base Endpoint URL
All requests use standard HTTPS:
Automatic Wholesale Tier Discounts
Volume discounts are applied automatically at checkout when ordering via /api/v1/order:
Webhook HMAC-SHA256 Verification
X-Webhook-Signature
Incoming webhooks contain the header X-Webhook-Signature. Compute the HMAC-SHA256 hex digest of the raw request payload using your configured secret to verify payload authenticity:
import hmac, hashlib
def verify_signature(raw_body_bytes, signature_header, secret):
expected = hmac.new(secret.encode(), raw_body_bytes, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, signature_header)
Automated Ordering Code Examples
Integrate automated purchase execution directly into your billing system or backend in seconds.
curl -X POST https://digioffers.xyz/api/v1/order \
-H "X-API-Key: AK_YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"product_id": 123,
"quantity": 1
}'
import requests
url = "https://digioffers.xyz/api/v1/order"
headers = {
"X-API-Key": "AK_YOUR_SECRET_KEY",
"Content-Type": "application/json"
}
payload = {
"product_id": 123,
"quantity": 1
}
response = requests.post(url, json=payload, headers=headers)
data = response.json()
print(data)
const axios = require('axios');
axios.post('https://digioffers.xyz/api/v1/order', {
product_id: 123,
quantity: 1
}, {
headers: {
'X-API-Key': 'AK_YOUR_SECRET_KEY',
'Content-Type': 'application/json'
}
})
.then(response => console.log(response.data))
.catch(error => console.error(error.response ? error.response.data : error.message));
<?php
$ch = curl_init('https://digioffers.xyz/api/v1/order');
$payload = json_encode([
'product_id' => 123,
'quantity' => 1
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'X-API-Key: AK_YOUR_SECRET_KEY'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
echo $result;
?>
API Endpoints Reference
8 Endpoints/api/v1/me
Fetch your authenticated account profile, Telegram identity, and real-time wallet balance.
Example Response (200 OK)
{
"success": true,
"user": {
"telegram_id": 123456789,
"username": "alex",
"wallet_balance": 250.00,
"total_deposited": 300.00,
"total_spent": 50.00,
"referral_code": "ALEX123",
"referral_earnings": 0.00
}
}
/api/v1/products
List all available products on the platform, along with real-time stock levels, base retail prices, and wholesale tiered discount rates. No API key is required.
Example Response (200 OK)
{
"success": true,
"count": 1,
"products": [
{
"id": 123,
"name": "Gemini Pro 1 Month",
"price": 10.0,
"tier1_price": 10.0,
"tier2_price": 8.50,
"tier3_price": 7.00,
"stock_count": 142
}
]
}
/api/v1/order
Place an instant automated order. Funds are deducted directly from your account balance, and licenses or credentials are returned in the response.
Stock Protection: If a minimum stock buffer is configured, orders can only consume stock available above the reserve threshold to protect active retail buyers.
Request Payload
{
"product_id": 123,
"quantity": 1,
"request_id": "cart-89410"
}
Use a unique request_id for each purchase and reuse it when retrying a timed-out request. A finished retry returns the original success or error response without a second charge. Use a new ID for a new attempt after changing conditions such as your balance. Reusing an ID with different order details, or while an attempt needs reconciliation, returns 409. Some products also require a note; a voucher_code may be supplied when available.
Success Response (201 Created)
{
"success": true,
"order_id": 89410,
"order_code": "API_ORD_89410A",
"product_name": "Gemini Pro 1 Month",
"quantity": 1,
"unit_price": 10.0,
"total_paid": 10.0,
"status": "completed",
"deliverables": [
"LICENSE-KEY-XXXX-YYYY-ZZZZ"
],
"raw_delivery": "LICENSE-KEY-XXXX-YYYY-ZZZZ",
"download_url": "https://digioffers.xyz/download/API_ORD_89410A?k=<signed-token>"
}
Error Response (400 Bad Request)
{
"error": "Insufficient wallet balance"
}
/api/v1/orders
Fetch your complete order history with pagination support using page and limit parameters (default 50, maximum 200).
Example Request
GET https://digioffers.xyz/api/v1/orders?page=1&limit=50
Example Response (200 OK)
{
"success": true,
"page": 1,
"limit": 50,
"total_orders": 120,
"total_pages": 3,
"orders": [
{
"order_id": "API_ORD_89410A",
"service": "Gemini Pro 1 Month",
"quantity": 1,
"amount": 10.0,
"status": "success",
"delivered_products": ["LICENSE-KEY-XXXX-YYYY-ZZZZ"],
"created_at": "2026-07-09T08:00:00"
}
]
}
/api/v1/order/{id}
Retrieve exact details and delivered license items for a specific past order using its order_id.
Example Response (200 OK)
{
"success": true,
"order": {
"order_id": "API_ORD_89410A",
"service": "Gemini Pro 1 Month",
"quantity": 1,
"amount": 10.0,
"status": "success",
"delivered_products": ["LICENSE-KEY-XXXX-YYYY-ZZZZ"],
"created_at": "2026-07-09T08:00:00"
}
}
/api/v1/stats
Fetch comprehensive financial metrics for your reseller account, including cumulative deposits, sales, volume totals, and a per-product item breakdown.
Optional Date Filters
start- Inclusive ISO 8601 timestamp with timezone (e.g.2026-07-01T10:00:00Z)end- Inclusive ISO 8601 timestamp with timezone (e.g.2026-07-09T14:00:00Z)
Supplying either bound adds selected_range with deposits, sales, and product breakdown for that range. The fixed-period totals remain unchanged. Invalid dates return 400.
Example Response (200 OK)
{
"success": true,
"deposits": {
"today": 25.0,
"7d": 150.0,
"30d": 650.0,
"365d": 2500.0,
"all_time": 2500.0
},
"sales": {
"today": 20.0,
"7d": 120.0,
"30d": 510.0,
"365d": 2100.0,
"all_time": 2100.0
},
"products_breakdown": [
{
"service_id": "S_01",
"name": "Gemini Pro 1 Month",
"quantity_sold": 35,
"revenue": 350.0
}
],
"selected_range": {
"start": "2026-07-01T10:00:00Z",
"end": "2026-07-09T14:00:00Z",
"deposits": 150.0,
"sales": 120.0,
"products_breakdown": []
}
}
/api/v1/reseller/webhook
Read your configured callback URL and whether a signing secret is set. The secret itself is never returned.
{
"success": true,
"webhook_url": "https://myshop.com/api/store-callback",
"has_secret": true
}
/api/v1/reseller/webhook
Register or update your webhook URL and HMAC shared secret. When events occur (order completed, balance topup), Perfect Deal delivers immediate signed HTTP notifications to your endpoint.
Request Payload
{
"webhook_url": "https://myshop.com/api/store-callback",
"webhook_secret": "whsec_89fba901c03e"
}
Success Response (200 OK)
{
"success": true,
"message": "Reseller webhook configuration saved successfully",
"webhook_url": "https://myshop.com/api/store-callback"
}
/api/v1/reseller/webhook/test
Trigger an immediate simulated ping test to your registered webhook URL to verify reachability, SSL handshake, and HMAC-SHA256 signature verification.
Example Response (200 OK)
{
"success": true,
"status_code": 200
}
Interactive API Playground
Test live requests against Perfect Deal
Stored securely in your local browser session only.
Click "Send Request" to run live call.