IMEI Locks Reseller API
Automate purchases of digital products from your bot, panel or script: real-time catalogue and stock, exact price quotes, atomic wallet settlement, instant code delivery, signed webhooks. Base URL: https://api.imeilocks.com
๐ Getting a key: open @Gemini_resellerapibot on Telegram โ API key โ Generate. The same bot shows your balance, lets you buy in chat, and handles top-ups.
HTTP headers
Authentication
Every request requires your confidential API secret in the X-API-Key header. Treat your API key as a password: it is stored hashed on our side and is shown exactly once when issued.
| Header | Type | Description |
|---|---|---|
X-API-KeyREQUIRED | string | Your secret reseller API key (sk_live_โฆ, or sk_test_โฆ for the sandbox). |
curl -H "X-API-Key: sk_live_your_secret_key" \
https://api.imeilocks.com/api/v1/me
Quota headers
Rate limits & live quota
Requests are limited to 60 requests per minute per API key. Live budget headers are returned on every response.
| Header | Description |
|---|---|
X-RateLimit-Limit | Allowed requests per 60-second window (60). |
X-RateLimit-Remaining | Remaining requests in the current window. |
X-RateLimit-Reset | Unix epoch timestamp when your quota refills. |
HTTP/1.1 200 OK
Content-Type: application/json
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 59
X-RateLimit-Reset: 1788944424
Guarantees
Atomic settlement & zero-debit idempotency
BEGIN IMMEDIATE โฆ COMMIT). If anything fails, funds roll back. You are never debited without an order.external_order_id. If your connection drops and your bot retries, the API returns the original order with "idempotent_replay": true โ zero duplicate debits, zero duplicate orders.order.delivered. A queued order we cannot fulfil is cancelled with a full refund and order.failed.Simulator
Price calculator
Pricing is a flat unit price per product: final_total = unit_price ร quantity. Preview any order with GET /quote or below (needs a sandbox or live key from the console).
Endpoints
GET/api/v1/products โ List available products
Returns the live catalogue with available stock per product. custom_pricing is true when the product is at or below its low-stock buffer (orders that dip into the buffer must send accept_normal_price: true).
curl -X GET "https://api.imeilocks.com/api/v1/products" \
-H "X-API-Key: YOUR_API_KEY"
import requests
r = requests.get("https://api.imeilocks.com/api/v1/products",
headers={"X-API-Key": "YOUR_API_KEY"}, timeout=15)
print(r.json())
const r = await fetch("https://api.imeilocks.com/api/v1/products",
{ headers: { "X-API-Key": "YOUR_API_KEY" } });
console.log(await r.json());
Response (200 OK)
{
"currency": "USD",
"rate": "1 USD = 100 INR (fixed)",
"products": [
{
"service_id": "gemini_pro_1m",
"name": "Gemini Pro 1 Month",
"description": "",
"stock": 482,
"custom_pricing": false,
"unit_price": 0.5,
"pricing_tiers": [{ "min": 1, "max": null, "price": 0.5 }],
"bulk_discounts": []
}
]
}
GET/api/v1/me โ Account profile & balance
Returns your account name, Telegram chat id (if linked) and active wallet balance in USD.
curl -H "X-API-Key: YOUR_API_KEY" https://api.imeilocks.com/api/v1/me
{ "chat_id": 123456789, "name": "My Bot", "balance": 145.5, "currency": "USD", "mode": "live", "key_created_at": "2026-09-15T10:00:00Z" }
GET/api/v1/quote โ Price quote preview
Validates the exact financials before submission: unit price, total, stock situation and whether your balance is sufficient. Nothing is committed.
| Query param | Type | Description |
|---|---|---|
service_idREQUIRED | string | Product identifier. |
quantityREQUIRED | integer | Desired units. |
curl -H "X-API-Key: YOUR_API_KEY" \
"https://api.imeilocks.com/api/v1/quote?service_id=gemini_pro_1m&quantity=500"
{
"service_id": "gemini_pro_1m",
"service_name": "Gemini Pro 1 Month",
"quantity": 500,
"stock": 482,
"stock_warning": "Only 482 in stock. The order will be queued and fulfilled automatically once restocked.",
"currency": "USD",
"pricing": {
"unit_price": 0.5, "slab_range": "1+", "base_total": 250.0,
"bulk_discount_pct": 0, "bulk_discount_amount": 0.0,
"final_total": 250.0, "price_source": "normal"
},
"fx": { "code": "INR", "rate": 100, "final_total": 25000.0 },
"your_balance": 350.0,
"sufficient_balance": true
}
POST/api/v1/order โ Place automated order
Executes an atomic balance deduction and immediate digital product delivery. Always pass external_order_id for safe zero-duplicate retries.
| Body field | Type | Description |
|---|---|---|
service_idREQUIRED | string | Target product id. |
quantityREQUIRED | integer | Number of units to purchase. |
external_order_idOPTIONAL | string | Your internal idempotency key (โค128 chars) to prevent double debiting. |
accept_normal_priceOPTIONAL | boolean | Set true to override the low-stock buffer protection (409). |
curl -X POST "https://api.imeilocks.com/api/v1/order" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"service_id": "gemini_pro_1m", "quantity": 2, "external_order_id": "bot_order_99812"}'
import requests
r = requests.post("https://api.imeilocks.com/api/v1/order",
headers={"X-API-Key": "YOUR_API_KEY"},
json={"service_id": "gemini_pro_1m", "quantity": 2, "external_order_id": "bot_order_99812"},
timeout=30)
data = r.json()
if r.status_code in (200, 201):
print(data["order_id"], data["status"], data["products"])
else:
print("error:", data["error"], data["message"])
const r = await fetch("https://api.imeilocks.com/api/v1/order", {
method: "POST",
headers: { "X-API-Key": "YOUR_API_KEY", "Content-Type": "application/json" },
body: JSON.stringify({ service_id: "gemini_pro_1m", quantity: 2, external_order_id: "bot_order_99812" })
});
const data = await r.json();
Response (201 Created) โ a replay of an existing external_order_id returns 200 with "idempotent_replay": true. Queued orders return "status": "queued" with an empty products array.
{
"success": true,
"order_id": "IL7K3M9QX2",
"external_order_id": "bot_order_99812",
"service_id": "gemini_pro_1m",
"service_name": "Gemini Pro 1 Month",
"quantity": 2,
"status": "delivered",
"total_cost": 1.0,
"new_balance": 144.5,
"currency": "USD",
"price_breakdown": { "unit_price": 0.5, "slab_range": "1+", "base_total": 1.0, "bulk_discount_pct": 0, "bulk_discount_amount": 0.0, "final_total": 1.0, "price_source": "normal" },
"created_at": "2026-09-15T10:00:00Z",
"delivered_at": "2026-09-15T10:00:00Z",
"products": ["KEY-GEMINI-A1904-8842", "KEY-GEMINI-B8912-7719"],
"idempotent_replay": false
}
GET/api/v1/stats โ Reseller account analytics
Order counts and USD spend for today, 7d, 30d and all-time, plus a per-product breakdown. Optional start / end (ISO 8601) add a range block and filter the breakdown.
curl -H "X-API-Key: YOUR_API_KEY" "https://api.imeilocks.com/api/v1/stats?start=2026-09-01&end=2026-09-30"
{
"orders": { "today": 4, "7d": 28, "30d": 142, "all_time": 680 },
"spending": { "today": 2.8, "7d": 18.2, "30d": 84.5, "all_time": 395.0 },
"currency": "USD",
"balance": 145.5,
"range": { "start": "2026-09-01T00:00:00Z", "end": "2026-09-30T00:00:00Z", "orders": 140, "spending": 83.0 },
"products_breakdown": [
{ "service_id": "gemini_pro_1m", "name": "Gemini Pro 1 Month", "orders": 120, "quantity_ordered": 540, "total_spent": 243.0 }
]
}
GET/api/v1/order/{order_id} โ Single order status & codes
Fetches status, timestamps and delivered codes for any previous order by its order_id (your external_order_id is accepted too).
curl -H "X-API-Key: YOUR_API_KEY" https://api.imeilocks.com/api/v1/order/IL7K3M9QX2
{
"order_id": "IL7K3M9QX2", "external_order_id": "bot_order_99812",
"service_id": "gemini_pro_1m", "service_name": "Gemini Pro 1 Month",
"quantity": 2, "status": "delivered", "total_cost": 1.0, "currency": "USD",
"price_breakdown": { โฆ },
"created_at": "2026-09-15T10:00:00Z", "delivered_at": "2026-09-15T10:00:00Z",
"products": ["KEY-GEMINI-A1904-8842", "KEY-GEMINI-B8912-7719"]
}
Statuses: delivered (codes assigned), queued (charged, awaiting restock), failed (cancelled and fully refunded; see failed_reason).
GET/api/v1/orders โ Paginated order history
| Query param | Type | Default | Description |
|---|---|---|---|
pageOPTIONAL | integer | 1 | Page number. |
limitOPTIONAL | integer | 20 | Orders per page (up to 50). |
statusOPTIONAL | string | โ | Filter: delivered / queued / failed. |
curl -H "X-API-Key: YOUR_API_KEY" "https://api.imeilocks.com/api/v1/orders?page=1&limit=20"
{
"page": 1, "limit": 20, "total": 1, "has_more": false, "currency": "USD",
"orders": [
{ "order_id": "IL7K3M9QX2", "external_order_id": "bot_order_99812", "service_id": "gemini_pro_1m",
"service_name": "Gemini Pro 1 Month", "quantity": 2, "total_cost": 1.0, "status": "delivered",
"created_at": "2026-09-15T10:00:00Z", "delivered_at": "2026-09-15T10:00:00Z" }
]
}
GET/api/v1/orders/export โ Bulk order export (CSV / JSON)
| Query param | Type | Description |
|---|---|---|
formatOPTIONAL | string | csv or json (default json). |
startOPTIONAL | string | ISO 8601 start timestamp. |
endOPTIONAL | string | ISO 8601 end timestamp. |
curl -H "X-API-Key: YOUR_API_KEY" \
"https://api.imeilocks.com/api/v1/orders/export?format=csv" -o orders_export.csv
POST/api/v1/keys/rotate โ Self-service key rotation
Instantly revokes your existing key and issues a new secret. The previous key stops working immediately.
curl -X POST "https://api.imeilocks.com/api/v1/keys/rotate" -H "X-API-Key: YOUR_OLD_API_KEY"
{ "success": true, "new_api_key": "sk_live_9f83a04b12c8e9fโฆ", "message": "Your old key has been revoked. Store this new key securely." }
Real-time webhooks
Architecture & cryptographic verification
Webhooks remove polling. Whenever an order is delivered, queued or fails, we push a signed HTTPS POST to your endpoint (retried with backoff for up to 6 attempts: 1 m, 5 m, 30 m, 2 h, 6 h).
products.failed_reason).Payload
{ "event": "order.delivered", "delivery_id": 41, "created_at": "2026-09-15T10:00:01Z",
"data": { "order_id": "IL7K3M9QX2", "external_order_id": "bot_order_99812", "status": "delivered", "quantity": 2,
"total_cost": 1.0, "products": ["KEY-โฆ", "KEY-โฆ"], โฆ } }
HMAC-SHA256 signature verification. Every delivery carries X-Webhook-Signature: sha256=<hex> (plus X-Webhook-Event and X-Webhook-Delivery). Verify with your webhook secret over the raw request body:
import hmac, hashlib
def verify_webhook(raw_payload_bytes, signature_header, webhook_secret):
expected = "sha256=" + hmac.new(webhook_secret.encode(), raw_payload_bytes, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, signature_header)
const crypto = require("crypto");
function verifyWebhook(rawBody, signatureHeader, secret) {
const expected = "sha256=" + crypto.createHmac("sha256", secret).update(rawBody).digest("hex");
return crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(signatureHeader));
}
$raw = file_get_contents('php://input');
$expected = 'sha256=' . hash_hmac('sha256', $raw, $secret);
$ok = hash_equals($expected, $_SERVER['HTTP_X_WEBHOOK_SIGNATURE'] ?? '');
Respond with any 2xx status within 10 seconds. Anything else is retried.
POST/api/v1/webhooks โ Register webhook endpoint
| Field | Type | Description |
|---|---|---|
urlREQUIRED | string | Your HTTPS listener URL (public host; private/loopback addresses are rejected). |
eventsREQUIRED | array | Any of order.delivered, order.queued, order.failed. |
curl -X POST "https://api.imeilocks.com/api/v1/webhooks" \
-H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{"url": "https://mybot.com/webhooks/orders", "events": ["order.delivered", "order.queued"]}'
{ "id": 1, "url": "https://mybot.com/webhooks/orders", "events": ["order.delivered", "order.queued"],
"created_at": "2026-09-15T10:00:00Z", "active": true,
"secret": "9a38f7b2c01824d67e89ab32c10f8231e57c6โฆ",
"note": "Store this secret securely โ use it to verify webhook signatures (X-Webhook-Signature)." }
GET/api/v1/webhooks โ List registered webhooks
curl -H "X-API-Key: YOUR_API_KEY" https://api.imeilocks.com/api/v1/webhooks
DELETE/api/v1/webhooks/{id} โ Delete webhook endpoint
curl -X DELETE "https://api.imeilocks.com/api/v1/webhooks/1" -H "X-API-Key: YOUR_API_KEY"
{ "deleted": true, "id": 1 }
POST/api/v1/webhooks/test โ Test delivery ping
Sends an instant signed test event to all your registered webhooks and returns the HTTP status each returned.
curl -X POST "https://api.imeilocks.com/api/v1/webhooks/test" \
-H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" -d '{"event": "order.delivered"}'
{ "event": "order.delivered", "test_results": [ { "webhook_id": 1, "url": "https://mybot.com/webhooks/orders", "status": 200, "success": true } ] }
Interactive developer console
Execute real and simulated requests
The sandbox gives you a free sk_test_ key with a $50.00 wallet: orders deliver SANDBOX-* codes and never touch live stock. Switch to live and paste your own key to hit production.
Status codes
Error reference catalog
Errors are JSON: {"error": "<key>", "message": "<human text>"}.
| Code | Error key | Cause & remediation |
|---|---|---|
| 400 | invalid_json | Malformed request body. Ensure a valid JSON payload. |
| 400 | missing_parameter | Missing mandatory fields such as service_id or quantity. |
| 400 | invalid_parameter | A field has the wrong type or range (e.g. quantity not a positive integer). |
| 400 | invalid_url | Webhook URL is not an absolute public http(s) URL. |
| 401 | missing_api_key | The X-API-Key header was omitted. |
| 401 | invalid_api_key | The key was revoked, disabled, or does not exist. |
| 402 | insufficient_balance | Wallet balance is below the order total. Top up to proceed (required and balance are included). |
| 404 | unknown_service | Requested service_id is not in the catalogue. |
| 404 | unknown_order / unknown_webhook | No such resource belongs to this account. |
| 409 | buffer_stock_conflict | Quantity crosses the low-stock buffer. Resend with "accept_normal_price": true. |
| 429 | rate_limited | 60 requests/min exceeded. Back off until X-RateLimit-Reset. |
| 500 | internal_error | Atomic rollback executed safely. Zero balance was lost. Retry the request (with the same external_order_id). |
Releases
API changelog
v1.0.0 โ Production release (September 2026)
- Catalogue, account, quote, order, order status, paginated history, CSV/JSON export, analytics.
- Single-commit atomic settlement and
external_order_ididempotent replays. - Queued orders with automatic FIFO fulfilment on restock; cancellation with full refund.
- Webhooks engine (register, list, delete, test ping) with HMAC-SHA256 signatures and retry backoff.
- Self-service key rotation, live
X-RateLimit-*headers, free sandbox environment.