{
  "info": {
    "name": "GateProxy API",
    "description": "GateProxy Ordering API + Balance API.\n\nSet collection variables `live_key` (gpk_live_…) and `test_key` (gpk_test_…) — generate both in the Telegram bot with /api.\n\n- Ordering API: https://api.gateproxy.store/v1\n- Balance API: https://balance.gateproxy.store/v1\n- Sandbox: use the test key — orders are simulated, nothing is charged.\n\nDocs: https://docs.gateproxy.store",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {"type": "bearer", "bearer": [{"key": "token", "value": "{{live_key}}", "type": "string"}]},
  "variable": [
    {"key": "base_url", "value": "https://api.gateproxy.store/v1"},
    {"key": "balance_url", "value": "https://balance.gateproxy.store/v1"},
    {"key": "live_key", "value": "gpk_live_REPLACE_ME"},
    {"key": "test_key", "value": "gpk_test_REPLACE_ME"},
    {"key": "product", "value": "dataimpulse"},
    {"key": "plan", "value": "1"},
    {"key": "username", "value": "abc123_cr.ye"},
    {"key": "order_id", "value": "ord_xxxxxxxxxxxx"}
  ],
  "item": [
    {
      "name": "Ordering API",
      "item": [
        {"name": "Health", "request": {"auth": {"type": "noauth"}, "method": "GET", "url": {"raw": "{{base_url}}/health", "host": ["{{base_url}}"], "path": ["health"]}}},
        {"name": "Me (account + balance)", "request": {"method": "GET", "url": {"raw": "{{base_url}}/me", "host": ["{{base_url}}"], "path": ["me"]}}},
        {"name": "Balance", "request": {"method": "GET", "url": {"raw": "{{base_url}}/balance", "host": ["{{base_url}}"], "path": ["balance"]}}},
        {"name": "List products", "request": {"method": "GET", "url": {"raw": "{{base_url}}/products", "host": ["{{base_url}}"], "path": ["products"]}}},
        {"name": "Get product", "request": {"method": "GET", "url": {"raw": "{{base_url}}/products/{{product}}", "host": ["{{base_url}}"], "path": ["products", "{{product}}"]}}},
        {"name": "Create order",
         "request": {
           "method": "POST",
           "header": [{"key": "Content-Type", "value": "application/json"}, {"key": "Idempotency-Key", "value": "order-{{$guid}}"}],
           "body": {"mode": "raw", "raw": "{\n  \"product\": \"{{product}}\",\n  \"plan\": \"{{plan}}\"\n}"},
           "url": {"raw": "{{base_url}}/orders", "host": ["{{base_url}}"], "path": ["orders"]}
         }},
        {"name": "List orders", "request": {"method": "GET", "url": {"raw": "{{base_url}}/orders?limit=20", "host": ["{{base_url}}"], "path": ["orders"], "query": [{"key": "limit", "value": "20"}, {"key": "status", "value": "completed", "disabled": true}]}}},
        {"name": "Get order", "request": {"method": "GET", "url": {"raw": "{{base_url}}/orders/{{order_id}}", "host": ["{{base_url}}"], "path": ["orders", "{{order_id}}"]}}}
      ]
    },
    {
      "name": "Balance API",
      "item": [
        {"name": "Health", "request": {"auth": {"type": "noauth"}, "method": "GET", "url": {"raw": "{{balance_url}}/health", "host": ["{{balance_url}}"], "path": ["health"]}}},
        {"name": "Supported products", "request": {"method": "GET", "url": {"raw": "{{balance_url}}/products", "host": ["{{balance_url}}"], "path": ["products"]}}},
        {"name": "Check usage", "request": {"method": "GET", "url": {"raw": "{{balance_url}}/usage?product={{product}}&username={{username}}", "host": ["{{balance_url}}"], "path": ["usage"], "query": [{"key": "product", "value": "{{product}}"}, {"key": "username", "value": "{{username}}"}]}}}
      ]
    },
    {
      "name": "Sandbox (test key)",
      "description": "Same endpoints, but authenticated with the test key — orders are simulated, nothing is charged.",
      "auth": {"type": "bearer", "bearer": [{"key": "token", "value": "{{test_key}}", "type": "string"}]},
      "item": [
        {"name": "Me (sandbox)", "request": {"auth": {"type": "bearer", "bearer": [{"key": "token", "value": "{{test_key}}"}]}, "method": "GET", "url": {"raw": "{{base_url}}/me", "host": ["{{base_url}}"], "path": ["me"]}}},
        {"name": "Create order (sandbox)",
         "request": {
           "auth": {"type": "bearer", "bearer": [{"key": "token", "value": "{{test_key}}"}]},
           "method": "POST",
           "header": [{"key": "Content-Type", "value": "application/json"}, {"key": "Idempotency-Key", "value": "sandbox-{{$guid}}"}],
           "body": {"mode": "raw", "raw": "{\n  \"product\": \"{{product}}\",\n  \"plan\": \"{{plan}}\"\n}"},
           "url": {"raw": "{{base_url}}/orders", "host": ["{{base_url}}"], "path": ["orders"]}
         }},
        {"name": "Check usage (sandbox)", "request": {"auth": {"type": "bearer", "bearer": [{"key": "token", "value": "{{test_key}}"}]}, "method": "GET", "url": {"raw": "{{balance_url}}/usage?product={{product}}&username={{username}}", "host": ["{{balance_url}}"], "path": ["usage"], "query": [{"key": "product", "value": "{{product}}"}, {"key": "username", "value": "{{username}}"}]}}}
      ]
    }
  ]
}
