{
  "name": "HSC Shop Reseller API",
  "purpose": "Reseller-facing HTTP API for provisioning HSC accounts (OnlyFans balance-loaded accounts, HSC Bomber license keys, ExpressVPN credentials) from your own storefront. Server-to-server only — never expose the API key in browser or client-side code.",
  "base_url": "https://api.hotschool.club/v1",
  "auth": {
    "type": "header",
    "header": "X-API-Key",
    "value_format": "hsc_<random>",
    "get_key_at": "https://hotschool.club/dashboard → API tab",
    "warning": "Anyone with the key can drain your balance."
  },
  "conventions": {
    "encoding": "application/json (in and out)",
    "times": "UTC ISO-8601",
    "money": "USD",
    "order_ids": "8-hex string, e.g. a1b2c3d4"
  },
  "endpoints": [
    {
      "op":      "POST /generate",
      "purpose": "Fire an OnlyFans balance-loaded account order (async).",
      "body":    { "amount": "10 | 20 | 50 | 100 | 200 | 400 (USD)" },
      "returns": { "order_id": "string", "status": "processing" },
      "then":    "Poll GET /order/{order_id} every ~3s until status=completed or failed."
    },
    {
      "op":      "GET /order/{id}",
      "purpose": "Poll for a delivered account.",
      "returns_completed": { "status": "completed", "result": { "email": "string", "password": "string", "balance": "number" } },
      "returns_failed":    { "status": "failed", "error": "string (cost auto-refunded to balance)" }
    },
    { "op": "GET /balance",  "returns": { "balance": "number" } },
    { "op": "GET /prices",   "returns": "{ '10': 0.98, '20': 1.49, '50': 2.49, '100': 3.98, '200': 8.98, '400': 14.98 }" },
    { "op": "GET /stock",    "returns": "{ stock: { of_10: 'Unlimited Stock', ..., of_400: 'Temporary Unavailable' } }" },
    { "op": "GET /history",  "returns": "Object keyed by order_id → full Order records." },
    {
      "op":      "POST /replacement",
      "purpose": "Warranty replacement for a delivered OF order.",
      "body":    { "order_id": "string" },
      "rules":   "10-min cooldown from delivery · 120-min warranty window · streak cap 2/tier · single-use per original",
      "returns": "processing (new_order_id to poll) OR stock_out_credited (credit refunded to balance)"
    },
    {
      "op":      "POST /misc/buy",
      "purpose": "Buy an HSC Bomber key or ExpressVPN account (instant).",
      "body":    { "product_id": "emailbomber | expressvpn", "variant_id": "1day|7days|30days|lifetime (bomber) OR 1m|6m|1y|lifetime (vpn)", "qty": "int (default 1)" },
      "returns": { "order_id": "string", "status": "completed", "account": "string (license key or email:pass|meta)" }
    },
    { "op": "GET /misc/stock",  "returns": "Bomber + VPN per-variant availability" },
    { "op": "GET /misc/prices", "returns": "Bomber + VPN per-variant prices" }
  ],
  "errors": [
    { "code": 401, "meaning": "Missing / invalid X-API-Key" },
    { "code": 402, "meaning": "Insufficient balance — response body carries current balance" },
    { "code": 409, "meaning": "Temporarily out of stock — retry later" },
    { "code": 429, "meaning": "Rate limit / warranty cooldown / streak cap" },
    { "code": 404, "meaning": "Order id not yours or missing" }
  ],
  "sample_workflow": [
    "1. POST /generate {amount: 100} → order_id",
    "2. Loop every 3s: GET /order/{order_id}",
    "3. On status=completed → email your customer result.email + result.password",
    "4. On status=failed → cost is already refunded to your balance; tell your customer to retry"
  ],
  "storefront_notes": [
    "OF orders time out at 40 min with automatic refund. Don't retry aggressively — one call fires the pipeline.",
    "Poll no faster than 1/s to stay under the rate limiter.",
    "Bomber + VPN deliver in the create response (no polling)."
  ]
}
