{
  "info": {
    "name": "FBMarket API v1",
    "description": "Wholesale API for FBMarket. Auth: X-API-Key header. Rate-limit: 60 req/min/key. Docs: https://fbmarket.pro/ru/api/docs",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {"key": "BASE", "value": "https://fbmarket.pro/api/v1"},
    {"key": "KEY", "value": "YOUR_API_KEY"}
  ],
  "item": [
    {
      "name": "GET /health — Validate key + uptime",
      "request": {
        "method": "GET",
        "header": [{"key": "X-API-Key", "value": "{{KEY}}"}],
        "url": {"raw": "{{BASE}}/health", "host": ["{{BASE}}"], "path": ["health"]}
      }
    },
    {
      "name": "GET /products — Catalog with filters",
      "request": {
        "method": "GET",
        "header": [{"key": "X-API-Key", "value": "{{KEY}}"}],
        "url": {"raw": "{{BASE}}/products?min_price=1&page_size=50",
                "host": ["{{BASE}}"], "path": ["products"],
                "query": [
                  {"key": "category", "value": "", "disabled": true, "description": "filter by category"},
                  {"key": "source_site", "value": "", "disabled": true},
                  {"key": "min_price", "value": "1", "description": "USDT"},
                  {"key": "max_price", "value": "", "disabled": true},
                  {"key": "min_qty", "value": "1"},
                  {"key": "page", "value": "1"},
                  {"key": "page_size", "value": "50", "description": "max 200"}
                ]}
      }
    },
    {
      "name": "GET /products/{id} — Single product",
      "request": {
        "method": "GET",
        "header": [{"key": "X-API-Key", "value": "{{KEY}}"}],
        "url": {"raw": "{{BASE}}/products/12345", "host": ["{{BASE}}"], "path": ["products", "12345"]}
      }
    },
    {
      "name": "GET /categories — Category list",
      "request": {
        "method": "GET",
        "header": [{"key": "X-API-Key", "value": "{{KEY}}"}],
        "url": {"raw": "{{BASE}}/categories", "host": ["{{BASE}}"], "path": ["categories"]}
      }
    },
    {
      "name": "GET /balance — Current balance + spent/topup/refunded",
      "request": {
        "method": "GET",
        "header": [{"key": "X-API-Key", "value": "{{KEY}}"}],
        "url": {"raw": "{{BASE}}/balance", "host": ["{{BASE}}"], "path": ["balance"]}
      }
    },
    {
      "name": "POST /balance/topup — Generate USDT address",
      "request": {
        "method": "POST",
        "header": [
          {"key": "X-API-Key", "value": "{{KEY}}"},
          {"key": "Content-Type", "value": "application/json"}
        ],
        "body": {"mode": "raw", "raw": "{\n  \"amount_usdt\": 100,\n  \"network\": \"usdt_trc_20\"\n}"},
        "url": {"raw": "{{BASE}}/balance/topup", "host": ["{{BASE}}"], "path": ["balance", "topup"]}
      }
    },
    {
      "name": "POST /orders — Create order (balance-debit)",
      "request": {
        "method": "POST",
        "header": [
          {"key": "X-API-Key", "value": "{{KEY}}"},
          {"key": "Content-Type", "value": "application/json"}
        ],
        "body": {"mode": "raw", "raw": "{\n  \"product_id\": 12345,\n  \"quantity\": 1,\n  \"payment_method\": \"balance\",\n  \"webhook_url\": \"https://your.app/cb\"\n}"},
        "url": {"raw": "{{BASE}}/orders", "host": ["{{BASE}}"], "path": ["orders"]}
      }
    },
    {
      "name": "GET /orders/{id} — Order status + items[]",
      "request": {
        "method": "GET",
        "header": [{"key": "X-API-Key", "value": "{{KEY}}"}],
        "url": {"raw": "{{BASE}}/orders/789", "host": ["{{BASE}}"], "path": ["orders", "789"]}
      }
    },
    {
      "name": "GET /usage — Per-key metrics",
      "request": {
        "method": "GET",
        "header": [{"key": "X-API-Key", "value": "{{KEY}}"}],
        "url": {"raw": "{{BASE}}/usage", "host": ["{{BASE}}"], "path": ["usage"]}
      }
    }
  ]
}
