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
Every API request requires your unique secret API Key to be passed via the X-API-Key HTTP header or as a Bearer token.
Keep your API key secret. Generate or rotate your key anytime via the Telegram Bot using /api.
Rate Limits
Standard rate limit is 3 req/sec per API Key with burst capacity.
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 '{
"service_id": "S_01",
"quantity": 1
}'
import requests
url = "https://digioffers.xyz/api/v1/order"
headers = {
"X-API-Key": "AK_YOUR_SECRET_KEY",
"Content-Type": "application/json"
}
payload = {
"service_id": "S_01",
"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', {
service_id: 'S_01',
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([
'service_id' => 'S_01',
'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, assigned tier level, and real-time wallet balance.
Example Response (200 OK)
{
"success": true,
"chat_id": 123456789,
"first_name": "Alex Reseller",
"wallet_balance": 250.00,
"reseller_tier": "VIP Gold",
"discount_pct": 15.0
}
/api/v1/products
List all available products on the platform, along with real-time stock levels, base retail prices, and wholesale tiered discount rates.
Example Response (200 OK)
{
"success": true,
"services": [
{
"service_id": "S_01",
"name": "Gemini Pro 1 Month",
"price": 10.0,
"tier1_price": 10.0,
"tier2_price": 8.50,
"tier3_price": 7.00,
"stock": 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
{
"service_id": "S_01",
"quantity": 1
}
Success Response (200 OK)
{
"success": true,
"order_id": "API_ORD_89410A",
"service_id": "S_01",
"quantity": 1,
"total_price": 10.0,
"delivered_products": [
"LICENSE-KEY-XXXX-YYYY-ZZZZ"
],
"remaining_balance": 240.00
}
Error Response (402 Payment Required)
{
"success": false,
"error": "Insufficient wallet balance. Please top up via Telegram."
}
/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": "delivered",
"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": "delivered",
"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- Filter from start timestamp (e.g.2026-07-01-10:00-AM)end- Filter to end timestamp (e.g.2026-07-09-02:00-PM)
Example Response (200 OK)
{
"success": true,
"deposits": {
"today": 25.0,
"7d": 150.0,
"30d": 650.0,
"all_time": 2500.0
},
"sales": {
"today": 20.0,
"7d": 120.0,
"30d": 510.0,
"all_time": 2100.0
},
"products_breakdown": [
{
"service_id": "S_01",
"name": "Gemini Pro 1 Month",
"quantity_sold": 35,
"revenue": 350.0
}
]
}
/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": "Webhook endpoint configured 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,
"message": "Test webhook dispatched successfully",
"status_code": 200,
"round_trip_ms": 48
}
Interactive API Playground
Test live requests against Perfect Deal
Stored securely in your local browser session only.
Click "Send Request" to run live call.