{
  "openapi": "3.1.0",
  "info": {
    "title": "QuietHarborLabs Base USDC Receipt Verifier",
    "version": "1.0.0",
    "description": "Read-only verification of a Base mainnet USDC transfer in a transaction receipt.",
    "x-guidance": "Call GET /verify with a Base mainnet transaction hash, recipient address, and exact USDC amount (up to six decimal places). With no query parameters, the API returns a paid demo result for a known public transaction and sets demo=true. The paid response reports whether an official Base USDC Transfer event matches and has at least 12 confirmations. Malformed supplied inputs and upstream RPC failures are rejected before payment."
  },
  "servers": [{ "url": "https://quiet-harbor-verifier.vercel.app" }],
  "paths": {
    "/verify": {
      "get": {
        "operationId": "verifyBaseUsdcTransfer",
        "summary": "Verify one Base USDC transfer receipt",
        "description": "Checks transaction success, the official Base USDC contract, exact recipient and amount, and at least 12 confirmations. Omit all query parameters for the known-transaction demo result.",
        "tags": ["USDC", "Base", "payment verification"],
        "parameters": [
          { "name": "txHash", "in": "query", "required": false, "description": "Base mainnet transaction hash; supply with recipient and amount, or omit all three for the demo", "schema": { "type": "string", "pattern": "^0x[0-9a-fA-F]{64}$" }, "example": "0x7fc51de31042bdb90c27e4d5c094d50a1b33cda66836df82f5991118dc6d4e4b" },
          { "name": "recipient", "in": "query", "required": false, "description": "Expected receiving address; supply with txHash and amount", "schema": { "type": "string", "pattern": "^0x[0-9a-fA-F]{40}$" }, "example": "0xa34520e2a4D3B529d92F9376d4689CD163e37825" },
          { "name": "amount", "in": "query", "required": false, "description": "Exact amount of USDC as a decimal string; supply with txHash and recipient", "schema": { "type": "string", "pattern": "^(0|[1-9][0-9]*)(\\.[0-9]{1,6})?$" }, "example": "0.5" }
        ],
        "x-payment-info": {
          "price": { "mode": "fixed", "currency": "USD", "amount": "0.002" },
          "protocols": [{ "x402": {} }]
        },
        "responses": {
          "200": {
            "description": "Verification result after x402 payment",
            "content": { "application/json": { "schema": {
              "type": "object",
              "properties": {
                "verified": { "type": "boolean" },
                "demo": { "type": "boolean" },
                "reason": { "type": "string", "enum": ["exact_transfer_confirmed", "transaction_not_mined", "transaction_reverted", "insufficient_confirmations", "no_exact_transfer"] },
                "chainId": { "type": "integer", "const": 8453 },
                "token": { "type": "string" },
                "transactionHash": { "type": "string" },
                "recipient": { "type": "string" },
                "amount": { "type": "string" },
                "amountAtomic": { "type": "string" },
                "confirmations": { "type": "string" },
                "blockNumber": { "type": "string" },
                "logIndex": { "type": ["string", "null"] },
                "checkedAt": { "type": "string", "format": "date-time" }
              },
              "required": ["verified", "reason"]
            } } }
          },
          "400": { "description": "Invalid input; no charge" },
          "402": { "description": "Payment Required" },
          "429": { "description": "Rate limited; no charge" },
          "503": { "description": "Base RPC unavailable; no charge" }
        }
      }
    }
  }
}
