{
  "service": "ProofGate",
  "version": "1.1.0",
  "summary": "Server-side USDT-TRC20 payment verification on a Cloudflare Worker.",
  "price_usdt_lifetime": 10,
  "treasury": {
    "network": "TRC20",
    "token": "USDT",
    "contract": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
    "address": "TM2deFM4byG1rVvhA15fTJD7gLaE9xvSid"
  },
  "free_tier": {
    "inspector_lookups_per_ip_per_day": 5
  },
  "api_key": {
    "header": "X-API-Key",
    "prefix": "pg_live_",
    "quota_per_day": 5000
  },
  "widget_attributes": {
    "data-to": "Tron address that receives USDT",
    "data-amount": "amount in USDT",
    "data-theme": "auto (default), light or dark",
    "data-accent": "optional hex colour for the button and accents",
    "data-label": "optional button text"
  },
  "acceptable_use": {
    "prohibited": [
      "fraud",
      "phishing",
      "unlawful activity",
      "deception of payment senders"
    ],
    "enforcement": "A key may be revoked without refund when an abuse report is received.",
    "revoked_response": {
      "status": 403,
      "body": {
        "error": "API key revoked due to acceptable use violation"
      }
    },
    "report_to": {
      "email": "mailto:alexcompute123nab@gmail.com?subject=ProofGate%20abuse%20report",
      "issues": "https://github.com/alexcompute123nab-debug/proofgate/issues/new"
    }
  },
  "endpoints": [
    {
      "method": "POST",
      "path": "/v1/inspect",
      "auth": false,
      "body": {
        "txid": "<64 hex>"
      },
      "desc": "Read a USDT-TRC20 transfer from TronGrid. 5 free lookups per IP per day. Manual inspection only, no API key, widget, webhooks or replay protection."
    },
    {
      "method": "POST",
      "path": "/v1/order",
      "auth": false,
      "body": {
        "email": "you@example.com"
      },
      "desc": "Create a key order with a unique amount. Returns order_id, pay and instructions. Send X-API-Key to attach that key's webhooks."
    },
    {
      "method": "POST",
      "path": "/v1/claim",
      "auth": false,
      "body": {
        "order_id": "<order id>"
      },
      "desc": "Scan the treasury for the order amount. Returns status pending or paid, plus api_key when paid."
    },
    {
      "method": "POST",
      "path": "/v1/verify",
      "auth": true,
      "headers": {
        "X-API-Key": "pg_live_..."
      },
      "body": {
        "txid": "<64 hex>",
        "to": "T...",
        "amount": 1
      },
      "desc": "Verify a USDT-TRC20 payment. Replay-protected for 30 days."
    },
    {
      "method": "POST",
      "path": "/v1/widget/order",
      "auth": false,
      "body": {
        "to": "T...",
        "amount": 10,
        "label": "Optional label"
      },
      "desc": "Create a widget order with a unique amount. The to address receives the transfer. Send X-API-Key to attach that key's webhooks."
    },
    {
      "method": "POST",
      "path": "/v1/widget/status",
      "auth": false,
      "body": {
        "order_id": "<order id>"
      },
      "desc": "Poll a widget order. Returns pending or paid, plus txid when paid."
    },
    {
      "method": "GET",
      "path": "/v1/webhooks",
      "auth": true,
      "desc": "List the webhooks registered for the key."
    },
    {
      "method": "POST",
      "path": "/v1/webhooks",
      "auth": true,
      "body": {
        "url": "https://example.com/hook",
        "event": "payment.confirmed"
      },
      "desc": "Register a webhook. HTTPS only, except http on localhost. Up to five per key."
    },
    {
      "method": "DELETE",
      "path": "/v1/webhooks",
      "auth": true,
      "body": {
        "id": "<webhook id>"
      },
      "desc": "Remove a webhook by id."
    },
    {
      "method": "GET",
      "path": "/v1/qr",
      "auth": false,
      "query": {
        "text": "tron:..."
      },
      "desc": "Render a QR code as SVG. The text must be 134 bytes or less."
    },
    {
      "method": "GET",
      "path": "/widget.js",
      "auth": false,
      "desc": "Embeddable payment button. Reads data-to, data-amount and optional data-theme (auto, light, dark), data-accent (hex) and data-label from the script tag."
    }
  ],
  "webhook_payload": {
    "event": "payment.confirmed",
    "order_id": "<order id>",
    "amount": 10.123456,
    "api_key_hint": "pg_live_abcd...",
    "txid": "<64 hex>"
  },
  "headers": {
    "X-ProofGate-Event": "payment.confirmed",
    "User-Agent": "ProofGate-Webhook/1"
  },
  "notes": [
    "Amounts are decimal USDT, not base units.",
    "Keys do not expire. Each key has a 5,000 call daily quota.",
    "A transaction that verified once cannot verify again for 30 days.",
    "The inspector reads any USDT-TRC20 transfer on Tron, not only treasury payments. It is manual viewing only: no API key, widget, webhooks or replay protection, so it cannot accept payments on a website.",
    "A revoked key receives HTTP 403 on /v1/verify, /v1/order, /v1/widget/order and /v1/webhooks."
  ]
}