{"openapi":"3.1.0","info":{"title":"InstantCore Digital Goods & Reseller API","version":"5.1.0","description":"Automated instant and async-assisted B2B fulfillment API for digital subscriptions, activation links, license keys, workspace invites, ready-made accounts, and gift vouchers. Supports zero-side-effect ic_test_ sandbox keys, inbound SSE event streaming (GET /orders/stream), and 0%-fee BSC BEP-20 USDT funding via https://instantcore.store/developers/ or @InstantCoreBot. All digital deliverables carry a 24-hour conditional activation guarantee."},"servers":[{"url":"https://api.instantcore.store","description":"InstantCore Production API"}],"components":{"securitySchemes":{"ApiKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Live (ic_live_...) or free sandbox (ic_test_...) API key generated at https://instantcore.store/developers/ or in @InstantCoreBot (/api)."},"BearerAuth":{"type":"http","scheme":"bearer","description":"Optional Authorization: Bearer <api_key> alternative to X-API-Key."}}},"paths":{"/health":{"get":{"summary":"Service health check","description":"Public liveness endpoint. Also mounted at /api/v1/reseller/health.","responses":{"200":{"description":"Service is healthy","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"service":{"type":"string"},"version":{"type":"string"}}}}}}}}},"/catalog":{"get":{"summary":"List live in-stock digital catalog","description":"Public read-only catalog of live-routable activation links, license keys, API keys, workspace invite slots, gift cards, and ready-made accounts. Pass include_assisted=1 to include async assisted-delivery SKUs. Provide X-API-Key or Bearer token (ic_live_ or ic_test_) to personalize your wholesale tier pricing. Also mounted at /api/v1/reseller/catalog.","parameters":[{"name":"include_assisted","in":"query","required":false,"schema":{"type":"string","enum":["0","1"]},"description":"Pass 1 to include async assisted-delivery SKUs in catalog output."}],"responses":{"200":{"description":"Live catalog list","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"authenticated":{"type":"boolean"},"tier":{"type":"integer"},"your_tier":{"type":"string"},"currency":{"type":"string"},"payment_rail":{"type":"string"},"warranty_policy":{"type":"string"},"count":{"type":"integer"},"catalog":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"title":{"type":"string"},"category":{"type":"string"},"delivery_model":{"type":"string"},"delivery_speed":{"type":"string","enum":["instant","auto_jit","assisted"]},"estimated_delivery_minutes":{"type":"string","enum":["0-1","1-3","5-15"]},"requires_target_email":{"type":"boolean"},"warranty_days":{"type":"integer"},"warranty_policy":{"type":"string"},"stock":{"type":"integer"},"retail_price_usd":{"type":"number"},"vip_tier2_price_usd":{"type":"number"},"wholesale_tier3_price_usd":{"type":"number"},"your_unit_price_usd":{"type":"number"}}}}}}}}},"401":{"description":"Invalid API key supplied"},"429":{"description":"Rate limit exceeded"}}}},"/me":{"get":{"summary":"Get authenticated wallet balance and wholesale tier","description":"Returns your BEP-20 USDT funded USD balance and wholesale tier (or simulated $1,000 T3 profile with ic_test_). Also mounted at /balance, /api/v1/reseller/me, and /api/v1/reseller/balance.","security":[{"ApiKeyHeader":[]},{"BearerAuth":[]}],"responses":{"200":{"description":"Wallet profile and tier","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"sandbox":{"type":"boolean"},"account_id":{"type":"string"},"telegram_id":{"type":"string"},"tier":{"type":"integer"},"tier_name":{"type":"string"},"cumulative_deposits_usd":{"type":"number"},"balance_usd":{"type":"number"},"currency":{"type":"string"}}}}}},"401":{"description":"Missing or invalid API key"}}}},"/order":{"post":{"summary":"Place an instant or async-assisted digital order","description":"Atomically reserves funds from your BEP-20 USDT wallet balance and fulfills the SKU. Pass allow_assisted: true to queue assisted SKUs (returns 202 PROCESSING; stream completion via GET /orders/stream or poll GET /order/{orderId}). Pass Idempotency-Key (or X-Idempotency-Key) to make retries safe. Sandbox ic_test_ keys simulate delivery with zero balance or database mutations. Also mounted at /orders, /api/v1/reseller/order, and /api/v1/reseller/orders.","security":[{"ApiKeyHeader":[]},{"BearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"},"description":"Unique caller-generated key to guarantee idempotent order creation and live status refresh."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sku"],"properties":{"sku":{"type":"string","description":"Catalog SKU identifier from GET /catalog."},"qty":{"type":"integer","minimum":1,"maximum":20,"default":1},"target_email":{"type":"string","format":"email","description":"Required when requires_target_email is true (family/workspace invite slots)."},"allow_assisted":{"type":"boolean","default":false,"description":"Pass true to accept asynchronous 202 PROCESSING fulfillment for assisted SKUs."},"idempotency_key":{"type":"string"}}}}}},"responses":{"200":{"description":"Order fulfilled and delivered (or partially delivered with automatic pro-rata refund)"},"202":{"description":"Order accepted and queued (PROCESSING); watch GET /orders/stream or poll GET /order/{orderId}"},"400":{"description":"Validation error or missing target_email"},"401":{"description":"Unauthorized"},"402":{"description":"Insufficient wallet balance"},"404":{"description":"SKU not found or inactive"},"409":{"description":"Insufficient stock, assisted SKU without allow_assisted, or idempotency conflict"},"502":{"description":"Upstream fulfillment failed; wallet balance refunded automatically"}}}},"/orders":{"get":{"summary":"List recent API orders (cursor-paginated)","description":"Returns your recent orders in descending order. Also mounted at /api/v1/reseller/orders.","security":[{"ApiKeyHeader":[]},{"BearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Paginated order list"},"401":{"description":"Unauthorized"}}}},"/order/{orderId}":{"get":{"summary":"Retrieve a single order and its credentials","description":"Also mounted at /orders/{orderId}, /api/v1/reseller/order/{orderId}, and /api/v1/reseller/orders/{orderId}.","security":[{"ApiKeyHeader":[]},{"BearerAuth":[]}],"parameters":[{"name":"orderId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Order receipt and delivered credentials"},"401":{"description":"Unauthorized"},"404":{"description":"Order not found"}}}},"/orders/stream":{"get":{"summary":"Inbound Server-Sent Events (SSE) order lifecycle stream","description":"Real-time inbound SSE push for order.processing, order.delivered, and order.refunded events. Supports Last-Event-ID replay and 20s keepalives (max 3 streams per account). Never sends outbound webhooks. Also mounted at /api/v1/reseller/orders/stream.","security":[{"ApiKeyHeader":[]},{"BearerAuth":[]}],"parameters":[{"name":"Last-Event-ID","in":"header","required":false,"schema":{"type":"integer"},"description":"Replay persisted events strictly after this sequence ID."}],"responses":{"200":{"description":"text/event-stream real-time order updates"},"401":{"description":"Unauthorized"},"429":{"description":"Concurrent SSE stream cap exceeded"}}}},"/v1/web/pow-challenge":{"get":{"summary":"Issue a stateless HMAC Proof-of-Work challenge","description":"Returns a 10-minute stateless HMAC-SHA256 Proof-of-Work challenge (difficulty: 15 leading zero bits of SHA-256(\"${challenge}:${nonce}\")) required before calling POST /v1/b2b/accounts or POST /v1/web/checkout. Public endpoint; no API key or query parameters required.","responses":{"200":{"description":"Signed Proof-of-Work challenge payload","content":{"application/json":{"schema":{"type":"object","required":["ok","challenge","difficulty","expires_at","sig"],"properties":{"ok":{"type":"boolean"},"challenge":{"type":"string","description":"32-character hex challenge seed."},"difficulty":{"type":"integer","description":"Required leading zero bits for SHA-256(\"${challenge}:${nonce}\") (currently 15)."},"expires_at":{"type":"integer","description":"Unix epoch timestamp in milliseconds when the challenge expires (10-minute TTL)."},"sig":{"type":"string","description":"64-character hex HMAC-SHA256 signature binding challenge, difficulty, and expires_at."}}}}}}}}},"/v1/b2b/accounts":{"post":{"summary":"Self-serve B2B vault and API key provisioning (HMAC PoW)","description":"Creates a standalone B2B reseller vault after verifying a client-solved Proof-of-Work challenge obtained from GET /v1/web/pow-challenge (rate-limited 6/hour per IP). Returns console_token (ic_b2b_...), free sandbox test_key (ic_test_...), and production live_key (ic_live_...).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["pow"],"properties":{"pow":{"type":"object","required":["challenge","expires_at","sig","nonce"],"description":"Solved HMAC Proof-of-Work payload obtained from GET /v1/web/pow-challenge.","properties":{"challenge":{"type":"string","description":"Hex challenge seed from GET /v1/web/pow-challenge."},"difficulty":{"type":"integer","description":"Optional difficulty echo (15)."},"expires_at":{"type":"integer","description":"Expiry epoch ms from GET /v1/web/pow-challenge."},"sig":{"type":"string","description":"HMAC-SHA256 signature from GET /v1/web/pow-challenge."},"nonce":{"type":"string","description":"Nonce string such that SHA-256(\"${challenge}:${nonce}\") has >= 15 leading zero bits."}}}}}}}},"responses":{"200":{"description":"B2B vault created with console_token, ic_test_ key, and ic_live_ key"},"400":{"description":"Missing or invalid PoW solution"},"429":{"description":"Per-IP account creation rate limit exceeded (max 6/hour)"}}}},"/api/v2":{"post":{"summary":"PerfectPanel / SMM-panel compatible reseller endpoint","description":"Form-encoded or JSON endpoint supporting action=services, balance, add, and status. By default action=services emits type: \"Package\", min: \"1\", max: \"1\", and rate: unitPrice.toFixed(4) to prevent 1000x SMM divisor undercharging; pass rate_scale=1000 for type: \"Default\" with rate: (unitPrice * 1000).toFixed(4) and max: min(20, stock), or panel_mode=unit for type: \"Default\" with unit rate. Annotates delivery_mode (\"email_invite\" or \"credentials_in_status\"). Accepts read-only demo key key=ic_demo_readonly (20 req/min/IP) for action=services only. Supports client_order_id/external_id idempotency on action=add and treats omitted quantity as 1.","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["key","action"],"properties":{"key":{"type":"string","description":"ic_live_..., ic_test_..., or read-only ic_demo_readonly (action=services only)."},"action":{"type":"string","enum":["services","balance","add","status"]},"rate_scale":{"type":"integer","enum":[1,1000],"description":"Pass 1000 to emit Default 1000x panel rates."},"panel_mode":{"type":"string","enum":["package","unit"],"description":"Pass unit for Default unit-priced rates."},"service":{"type":"string","description":"Numeric service ID or SKU for action=add."},"quantity":{"type":"integer","minimum":1,"maximum":20,"default":1,"description":"Optional; defaults to 1."},"link":{"type":"string","description":"Target email when delivery_mode is email_invite."},"client_order_id":{"type":"string","description":"Optional idempotency key for action=add (alias: external_id)."},"order":{"type":"string","description":"Single order ID for action=status."},"orders":{"type":"string","description":"Comma-separated order IDs (up to 100) for action=status."}}}},"application/json":{"schema":{"type":"object","required":["key","action"],"properties":{"key":{"type":"string"},"action":{"type":"string","enum":["services","balance","add","status"]}}}}}},"responses":{"200":{"description":"PerfectPanel v2 JSON response (array for services, or object with order/balance/status/error)"}}}},"/v1/bott/webhook":{"post":{"summary":"Native Bot-T.com digital goods fulfillment webhook","description":"Accepts JSON or form-encoded digital order webhooks from Bot-T.com. Authenticate via X-API-Key header or body token/secretKey/key (supports ic_test_ sandbox with $1,000.00 simulated balance and mock credentials). Enforces live stock/margin guards, idempotency via order_id/external_id, SSE order events, and ND-13 outbound sanitization.","security":[{"ApiKeyHeader":[]},{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sku"],"properties":{"token":{"type":"string","description":"Optional API key fallback if X-API-Key header is not sent (aliases: secretKey, key)."},"sku":{"type":"string","description":"Catalog SKU or numeric service ID (alias: product_id)."},"count":{"type":"integer","minimum":1,"maximum":20,"default":1,"description":"Unit count 1..20 (alias: quantity)."},"email":{"type":"string","format":"email","description":"Required for invite-slot SKUs (alias: link)."},"order_id":{"type":"string","description":"Optional caller idempotency identifier (alias: external_id)."}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"token":{"type":"string"},"sku":{"type":"string"},"count":{"type":"integer","minimum":1,"maximum":20,"default":1},"email":{"type":"string"},"order_id":{"type":"string"}}}}}},"responses":{"200":{"description":"{\"result\": true, \"order_id\": ..., \"data\": {\"items\": [...], \"credentials\": \"...\"}}"},"202":{"description":"Order queued/processing; returns result: true with status PROCESSING"},"400":{"description":"{\"result\": false, \"message\": \"...\"} validation error"},"401":{"description":"{\"result\": false, \"message\": \"...\"} invalid API key"},"402":{"description":"{\"result\": false, \"message\": \"...\"} insufficient balance"},"404":{"description":"{\"result\": false, \"message\": \"...\"} SKU not found or unavailable"},"409":{"description":"{\"result\": false, \"message\": \"...\"} stock, margin guard, or in-flight conflict"},"502":{"description":"{\"result\": false, \"message\": \"...\"} upstream failure; wallet refunded"}}}}}}