{
  "openapi": "3.1.0",
  "info": {
    "title": "AiFinPay API",
    "version": "5.3.0",
    "description": "HTTP 402 payment gate where autonomous AI agents authenticate with Ed25519 signatures and pay on Polygon and Solana. This document is generated from backend/routes/*.js — do not hand-edit. Regenerate with `node backend/scripts/build-openapi.mjs`."
  },
  "servers": [
    {
      "url": "https://api.aifinpay.io",
      "description": "Production (api)"
    },
    {
      "url": "https://bridge.aifinpay.io",
      "description": "Production (bridge)"
    }
  ],
  "tags": [
    {
      "name": "admin_api",
      "description": "admin-api router — see backend/routes/admin-api.js"
    },
    {
      "name": "admin_views",
      "description": "admin-views router — see backend/routes/admin-views.js"
    },
    {
      "name": "admin",
      "description": "admin router — see backend/routes/admin.js"
    },
    {
      "name": "agent_public",
      "description": "agent-public router — see backend/routes/agent-public.js"
    },
    {
      "name": "agent_transactions",
      "description": "agent-transactions router — see backend/routes/agent-transactions.js"
    },
    {
      "name": "agents",
      "description": "agents router — see backend/routes/agents.js"
    },
    {
      "name": "aifp",
      "description": "aifp router — see backend/routes/aifp.js"
    },
    {
      "name": "b2b",
      "description": "b2b router — see backend/routes/b2b.js"
    },
    {
      "name": "cross_chain",
      "description": "cross-chain router — see backend/routes/cross-chain.js"
    },
    {
      "name": "dashboard",
      "description": "dashboard router — see backend/routes/dashboard.js"
    },
    {
      "name": "discovery",
      "description": "discovery router — see backend/routes/discovery.js"
    },
    {
      "name": "dns_control",
      "description": "dns-control router — see backend/routes/dns-control.js"
    },
    {
      "name": "founding_offer",
      "description": "founding-offer router — see backend/routes/founding-offer.js"
    },
    {
      "name": "health",
      "description": "health router — see backend/routes/health.js"
    },
    {
      "name": "internal",
      "description": "internal router — see backend/routes/internal.js"
    },
    {
      "name": "invoices",
      "description": "invoices router — see backend/routes/invoices.js"
    },
    {
      "name": "me_agents",
      "description": "me-agents router — see backend/routes/me-agents.js"
    },
    {
      "name": "me_auth",
      "description": "me-auth router — see backend/routes/me-auth.js"
    },
    {
      "name": "me_merchants",
      "description": "me-merchants router — see backend/routes/me-merchants.js"
    },
    {
      "name": "merchant_config",
      "description": "merchant-config router — see backend/routes/merchant-config.js"
    },
    {
      "name": "network_agents",
      "description": "network-agents router — see backend/routes/network-agents.js"
    },
    {
      "name": "network_stats",
      "description": "network-stats router — see backend/routes/network-stats.js"
    },
    {
      "name": "oauth",
      "description": "oauth router — see backend/routes/oauth.js"
    },
    {
      "name": "partner_agents",
      "description": "partner-agents router — see backend/routes/partner-agents.js"
    },
    {
      "name": "partner_applications",
      "description": "partner-applications router — see backend/routes/partner-applications.js"
    },
    {
      "name": "partner_auth",
      "description": "partner-auth router — see backend/routes/partner-auth.js"
    },
    {
      "name": "partners",
      "description": "partners router — see backend/routes/partners.js"
    },
    {
      "name": "passport",
      "description": "passport router — see backend/routes/passport.js"
    },
    {
      "name": "protocol",
      "description": "protocol router — see backend/routes/protocol.js"
    },
    {
      "name": "providers",
      "description": "providers router — see backend/routes/providers.js"
    },
    {
      "name": "reporting",
      "description": "reporting router — see backend/routes/reporting.js"
    },
    {
      "name": "seats",
      "description": "seats router — see backend/routes/seats.js"
    },
    {
      "name": "settlement",
      "description": "settlement router — see backend/routes/settlement.js"
    },
    {
      "name": "webhooks",
      "description": "webhooks router — see backend/routes/webhooks.js"
    }
  ],
  "paths": {
    "/admin/api/overview": {
      "get": {
        "tags": [
          "admin_api"
        ],
        "summary": "GET /admin/api/overview",
        "operationId": "get_admin_api_overview",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ]
      }
    },
    "/admin/api/merchants": {
      "get": {
        "tags": [
          "admin_api"
        ],
        "summary": "GET /admin/api/merchants",
        "operationId": "get_admin_api_merchants",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ]
      }
    },
    "/admin/api/merchants/{id}": {
      "get": {
        "tags": [
          "admin_api"
        ],
        "summary": "GET /admin/api/merchants/:id",
        "operationId": "get_admin_api_merchants_id",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/admin/api/agents": {
      "get": {
        "tags": [
          "admin_api"
        ],
        "summary": "GET /admin/api/agents",
        "operationId": "get_admin_api_agents",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ]
      }
    },
    "/admin/api/agents/{addr}": {
      "get": {
        "tags": [
          "admin_api"
        ],
        "summary": "GET /admin/api/agents/:addr",
        "operationId": "get_admin_api_agents_addr",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ],
        "parameters": [
          {
            "name": "addr",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/admin/api/transactions": {
      "get": {
        "tags": [
          "admin_api"
        ],
        "summary": "GET /admin/api/transactions",
        "operationId": "get_admin_api_transactions",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ]
      }
    },
    "/admin/api/search": {
      "get": {
        "tags": [
          "admin_api"
        ],
        "summary": "GET /admin/api/search",
        "operationId": "get_admin_api_search",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ]
      }
    },
    "/admin/api/marketplace": {
      "get": {
        "tags": [
          "admin_api"
        ],
        "summary": "GET /admin/api/marketplace",
        "operationId": "get_admin_api_marketplace",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ]
      }
    },
    "/admin/api/marketplace/{id}/approve": {
      "post": {
        "tags": [
          "admin_api"
        ],
        "summary": "POST /admin/api/marketplace/:id/approve",
        "operationId": "post_admin_api_marketplace_id_approve",
        "responses": {
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/admin/api/marketplace/{id}/reject": {
      "post": {
        "tags": [
          "admin_api"
        ],
        "summary": "POST /admin/api/marketplace/:id/reject",
        "operationId": "post_admin_api_marketplace_id_reject",
        "responses": {
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/admin/api/users": {
      "get": {
        "tags": [
          "admin_api"
        ],
        "summary": "GET /admin/api/users",
        "operationId": "get_admin_api_users",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ]
      }
    },
    "/admin/api/users/{id}": {
      "get": {
        "tags": [
          "admin_api"
        ],
        "summary": "GET /admin/api/users/:id",
        "operationId": "get_admin_api_users_id",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/admin/api/audit": {
      "get": {
        "tags": [
          "admin_api"
        ],
        "summary": "GET /admin/api/audit",
        "operationId": "get_admin_api_audit",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ]
      }
    },
    "/api/dashboard/failed": {
      "get": {
        "tags": [
          "admin_views"
        ],
        "summary": "GET /api/dashboard/failed",
        "operationId": "get_api_dashboard_failed",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ]
      }
    },
    "/api/dashboard/telemetry": {
      "get": {
        "tags": [
          "admin_views"
        ],
        "summary": "GET /api/dashboard/telemetry",
        "operationId": "get_api_dashboard_telemetry",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ]
      }
    },
    "/api/dashboard/x402": {
      "get": {
        "tags": [
          "admin_views"
        ],
        "summary": "GET /api/dashboard/x402",
        "operationId": "get_api_dashboard_x402",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ]
      }
    },
    "/api/dashboard/fees": {
      "get": {
        "tags": [
          "admin_views"
        ],
        "summary": "GET /api/dashboard/fees",
        "operationId": "get_api_dashboard_fees",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ]
      }
    },
    "/api/dashboard/webhooks": {
      "get": {
        "tags": [
          "admin_views"
        ],
        "summary": "GET /api/dashboard/webhooks",
        "operationId": "get_api_dashboard_webhooks",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ]
      }
    },
    "/api/dashboard/solana": {
      "get": {
        "tags": [
          "admin_views"
        ],
        "summary": "GET /api/dashboard/solana",
        "operationId": "get_api_dashboard_solana",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ]
      }
    },
    "/api/admin/login": {
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "POST /api/admin/login",
        "operationId": "post_api_admin_login",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "x-rate-limits": [
          {
            "middleware": "adminLoginLimiter",
            "note": "strict rate-limit on admin login (anti brute-force)"
          }
        ]
      }
    },
    "/api/admin/logout": {
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "POST /api/admin/logout",
        "operationId": "post_api_admin_logout",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/admin/me": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "GET /api/admin/me",
        "operationId": "get_api_admin_me",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ]
      }
    },
    "/api/admin/register-partner": {
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "POST /api/admin/register-partner",
        "operationId": "post_api_admin_register-partner",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ]
      }
    },
    "/api/admin/initialize-config": {
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "POST /api/admin/initialize-config",
        "operationId": "post_api_admin_initialize-config",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ]
      }
    },
    "/api/admin/pause": {
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "POST /api/admin/pause",
        "operationId": "post_api_admin_pause",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ]
      }
    },
    "/api/admin/unpause": {
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "POST /api/admin/unpause",
        "operationId": "post_api_admin_unpause",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ]
      }
    },
    "/api/metrics": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "GET /api/metrics",
        "operationId": "get_api_metrics",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ]
      }
    },
    "/api/agent/{address}/public-usage": {
      "get": {
        "tags": [
          "agent_public"
        ],
        "summary": "GET /api/agent/:address/public-usage",
        "operationId": "get_api_agent_address_public-usage",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Agent's on-chain address (EVM or Solana)"
            }
          }
        ],
        "x-rate-limits": [
          {
            "middleware": "publicLimiter",
            "note": "public-surface rate-limit (looser than authenticated)"
          }
        ]
      }
    },
    "/v1/agents/{address}/transactions": {
      "get": {
        "tags": [
          "agent_transactions"
        ],
        "summary": "GET /v1/agents/:address/transactions",
        "operationId": "get_v1_agents_address_transactions",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Agent's on-chain address (EVM or Solana)"
            }
          }
        ]
      }
    },
    "/api/agents/register": {
      "get": {
        "tags": [
          "agents"
        ],
        "summary": "GET /api/agents/register",
        "operationId": "get_api_agents_register",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/payment-capabilities": {
      "get": {
        "tags": [
          "aifp"
        ],
        "summary": "GET /api/payment-capabilities",
        "operationId": "get_api_payment-capabilities",
        "responses": {
          "200": {
            "description": "Actual backend payment and read capabilities",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "chains": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PaymentChainCapability"
                      }
                    }
                  },
                  "required": [
                    "chains"
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "x-aifinpay-contract": "payment-capabilities-v1",
        "description": "Read-only canonical network inventory with actual payment, balance-read and history coverage. Metadata does not activate settlement. Disabled networks remain informational."
      }
    },
    "/.well-known/jwks.json": {
      "get": {
        "tags": [
          "aifp"
        ],
        "summary": "GET /.well-known/jwks.json",
        "operationId": "get_.well-known_jwks.json",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/v1/merchants": {
      "post": {
        "tags": [
          "aifp"
        ],
        "summary": "POST /v1/merchants",
        "operationId": "post_v1_merchants",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "text/plain": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "x-rate-limits": [
          {
            "middleware": "registerLimiter",
            "note": "rate-limit on /v1/merchants registration"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "settlement_version": {
                    "type": "string",
                    "enum": [
                      "1.2",
                      "1.4"
                    ],
                    "description": "Explicit settlement generation. Omission defaults to 1.2 at registration and preserves the current selection on update. Selecting 1.4 does not enable operator deployment flags; quote-time readiness still applies."
                  },
                  "settlement_chain": {
                    "type": "string",
                    "description": "Canonical settlement network compatible with the merchant's immutable network_mode. Omission preserves the current selection (or its legacy default). This field does not change the payout wallet."
                  },
                  "name": {
                    "type": "string",
                    "description": "Merchant display name; server validates 3–80 trimmed characters."
                  },
                  "pay_to": {
                    "type": "object",
                    "properties": {
                      "evm": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "One EVM address shared across EVM networks; validated for checksum and known burn addresses."
                      },
                      "polygon": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Legacy alias for evm. Supplied aliases must identify the same EVM address."
                      },
                      "solana": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Base58-encoded 32-byte public Solana address."
                      },
                      "near": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "minLength": 2,
                        "maxLength": 64,
                        "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$(?![\\s\\S])",
                        "description": "Lowercase NEAR account ID. Format only, not account existence or ownership."
                      },
                      "aptos": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "oneOf": [
                          {
                            "type": "null"
                          },
                          {
                            "type": "string",
                            "minLength": 66,
                            "maxLength": 66,
                            "pattern": "^0x(?!0{64}$)[0-9a-fA-F]{64}$"
                          },
                          {
                            "type": "string",
                            "minLength": 3,
                            "maxLength": 3,
                            "pattern": "^0x[1-9a-fA-F]$"
                          }
                        ],
                        "description": "Nonzero Aptos address: full 32-byte 0x hex or a one-digit special notation. Stored as lowercase full 32-byte hex."
                      }
                    },
                    "additionalProperties": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "description": "Public merchant payout destinations, not payment instructions. At least one valid configured family is required. Recognized EVM network aliases may accompany the same EVM address; unknown keys are rejected. PATCH preserves omitted families; null clears only that family. Payout changes require owner step-up on the dashboard route. Stored NEAR/Aptos fields do not activate settlement or agent wallet claims."
                  }
                },
                "required": [
                  "name",
                  "pay_to"
                ]
              }
            }
          }
        }
      }
    },
    "/v1/merchants/{id}": {
      "get": {
        "tags": [
          "aifp"
        ],
        "summary": "GET /v1/merchants/:id",
        "operationId": "get_v1_merchants_id",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      },
      "patch": {
        "tags": [
          "aifp"
        ],
        "summary": "PATCH /v1/merchants/:id",
        "operationId": "patch_v1_merchants_id",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "settlement_version": {
                    "type": "string",
                    "enum": [
                      "1.2",
                      "1.4"
                    ],
                    "description": "Explicit settlement generation. Omission defaults to 1.2 at registration and preserves the current selection on update. Selecting 1.4 does not enable operator deployment flags; quote-time readiness still applies."
                  },
                  "settlement_chain": {
                    "type": "string",
                    "description": "Canonical settlement network compatible with the merchant's immutable network_mode. Omission preserves the current selection (or its legacy default). This field does not change the payout wallet."
                  },
                  "name": {
                    "type": "string",
                    "description": "Merchant display name; server validates 3–80 trimmed characters."
                  },
                  "pay_to": {
                    "type": "object",
                    "properties": {
                      "evm": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "One EVM address shared across EVM networks; validated for checksum and known burn addresses."
                      },
                      "polygon": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Legacy alias for evm. Supplied aliases must identify the same EVM address."
                      },
                      "solana": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Base58-encoded 32-byte public Solana address."
                      },
                      "near": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "minLength": 2,
                        "maxLength": 64,
                        "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$(?![\\s\\S])",
                        "description": "Lowercase NEAR account ID. Format only, not account existence or ownership."
                      },
                      "aptos": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "oneOf": [
                          {
                            "type": "null"
                          },
                          {
                            "type": "string",
                            "minLength": 66,
                            "maxLength": 66,
                            "pattern": "^0x(?!0{64}$)[0-9a-fA-F]{64}$"
                          },
                          {
                            "type": "string",
                            "minLength": 3,
                            "maxLength": 3,
                            "pattern": "^0x[1-9a-fA-F]$"
                          }
                        ],
                        "description": "Nonzero Aptos address: full 32-byte 0x hex or a one-digit special notation. Stored as lowercase full 32-byte hex."
                      }
                    },
                    "additionalProperties": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "description": "Public merchant payout destinations, not payment instructions. At least one valid configured family is required. Recognized EVM network aliases may accompany the same EVM address; unknown keys are rejected. PATCH preserves omitted families; null clears only that family. Payout changes require owner step-up on the dashboard route. Stored NEAR/Aptos fields do not activate settlement or agent wallet claims."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/merchants/{id}/gate-events": {
      "post": {
        "tags": [
          "aifp"
        ],
        "summary": "POST /v1/merchants/:id/gate-events",
        "operationId": "post_v1_merchants_id_gate-events",
        "responses": {
          "200": {
            "description": "Recorded atomically or already recorded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "accepted",
                    "duplicates"
                  ],
                  "properties": {
                    "accepted": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 50
                    },
                    "duplicates": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 50
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid batch or unregistered resource"
          },
          "403": {
            "description": "Invalid merchant secret"
          },
          "429": {
            "description": "IP or merchant batch limit exceeded"
          },
          "503": {
            "description": "Storage unavailable; retry unchanged event IDs"
          }
        },
        "security": [
          {
            "merchantSecret": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ],
        "description": "Server-side opt-in gate observations for registered canonical route patterns. Atomic merchant-scoped deduplication for 48 hours. These events affect request counters only, never payments, revenue or quota.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "events"
                ],
                "properties": {
                  "events": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 50,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "id",
                        "kind",
                        "resource",
                        "at"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "kind": {
                          "type": "string",
                          "enum": [
                            "402",
                            "serve"
                          ]
                        },
                        "resource": {
                          "type": "string",
                          "maxLength": 512,
                          "description": "Exact registered canonical route_pattern; no URL, query, customer-specific path or content."
                        },
                        "at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "UTC Z timestamp; no older than24h, at most5min ahead."
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/merchants/{id}/settlements": {
      "get": {
        "tags": [
          "aifp"
        ],
        "summary": "List recognized confirmed Polygon settlements",
        "operationId": "get_v1_merchants_id_settlements",
        "responses": {
          "200": {
            "description": "Page plus aggregate over ALL filtered snapshot rows before pagination.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettlementFeed"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or unsupported filter/cursor/scope; arbitrary wallet input is rejected."
          },
          "403": {
            "description": "Authentication required."
          },
          "404": {
            "description": "Merchant is absent or not currently owned; no existence disclosure."
          },
          "503": {
            "description": "Required accounting or ownership storage unavailable. Cache-Control: no-store; error=settlement_accounting_unavailable."
          }
        },
        "security": [
          {
            "merchantSecret": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "site"
              ],
              "default": "site"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Inclusive ISO UTC boundary; list defaults to last 30 days."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Exclusive ISO UTC boundary."
          },
          {
            "name": "chain",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "polygon"
              ]
            }
          },
          {
            "name": "asset",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-f]{40}$"
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^0x(?:[0-9a-fA-F]{40}|[0-9a-fA-F]{64})$"
            },
            "description": "Exact payer address or transaction hash."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 1024
            },
            "description": "Opaque versioned snapshot cursor bound to ownership, scope and filters. Reuse unchanged filters."
          }
        ],
        "description": "Authenticated immutable financial facts, independently of retained access receipts. Historical coverage is qualified, never certified lifetime. Exact base units and historically proven quoted gross USD; no current FX. Wallet scope uses only server-derived current and proven historical payouts, disclosing public facts for unknown site associations. No payment or receipt is created."
      }
    },
    "/v1/merchants/{id}/receipts": {
      "get": {
        "tags": [
          "aifp"
        ],
        "summary": "GET /v1/merchants/:id/receipts",
        "operationId": "get_v1_merchants_id_receipts",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/v1/merchants/{id}/activity": {
      "get": {
        "tags": [
          "aifp"
        ],
        "summary": "GET /v1/merchants/:id/activity",
        "operationId": "get_v1_merchants_id_activity",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/v1/merchants/{id}/stats": {
      "get": {
        "tags": [
          "aifp"
        ],
        "summary": "GET /v1/merchants/:id/stats",
        "operationId": "get_v1_merchants_id_stats",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/v1/merchants/{id}/webhook": {
      "put": {
        "tags": [
          "aifp"
        ],
        "summary": "PUT /v1/merchants/:id/webhook",
        "operationId": "put_v1_merchants_id_webhook",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/v1/merchants/{id}/resources": {
      "get": {
        "tags": [
          "aifp"
        ],
        "summary": "GET /v1/merchants/:id/resources",
        "operationId": "get_v1_merchants_id_resources",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      },
      "post": {
        "tags": [
          "aifp"
        ],
        "summary": "POST /v1/merchants/:id/resources",
        "operationId": "post_v1_merchants_id_resources",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ],
        "x-rate-limits": [
          {
            "middleware": "resourceWriteLimiter",
            "note": "rate-limit on /v1/merchants/:id/resources writes"
          }
        ]
      }
    },
    "/v1/merchants/{id}/resources/{rid}": {
      "get": {
        "tags": [
          "aifp"
        ],
        "summary": "GET /v1/merchants/:id/resources/:rid",
        "operationId": "get_v1_merchants_id_resources_rid",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          },
          {
            "name": "rid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Resource identifier",
              "pattern": "^res_[0-9a-f]{12}$"
            }
          }
        ]
      },
      "patch": {
        "tags": [
          "aifp"
        ],
        "summary": "PATCH /v1/merchants/:id/resources/:rid",
        "operationId": "patch_v1_merchants_id_resources_rid",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          },
          {
            "name": "rid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Resource identifier",
              "pattern": "^res_[0-9a-f]{12}$"
            }
          }
        ],
        "x-rate-limits": [
          {
            "middleware": "resourceWriteLimiter",
            "note": "rate-limit on /v1/merchants/:id/resources writes"
          }
        ]
      },
      "delete": {
        "tags": [
          "aifp"
        ],
        "summary": "DELETE /v1/merchants/:id/resources/:rid",
        "operationId": "delete_v1_merchants_id_resources_rid",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          },
          {
            "name": "rid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Resource identifier",
              "pattern": "^res_[0-9a-f]{12}$"
            }
          }
        ],
        "x-rate-limits": [
          {
            "middleware": "resourceWriteLimiter",
            "note": "rate-limit on /v1/merchants/:id/resources writes"
          }
        ]
      }
    },
    "/v1/admin/overview": {
      "get": {
        "tags": [
          "aifp"
        ],
        "summary": "GET /v1/admin/overview",
        "operationId": "get_v1_admin_overview",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/v1/quote": {
      "post": {
        "tags": [
          "aifp"
        ],
        "summary": "POST /v1/quote",
        "operationId": "post_v1_quote",
        "responses": {
          "200": {
            "description": "Payment quote. Payout destinations are not transaction targets.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "required": [
                    "pay_to",
                    "pay_to_note"
                  ],
                  "properties": {
                    "pay_to": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "Merchant payout destinations for display only; never transfer directly to these addresses."
                    },
                    "pay_to_note": {
                      "type": "string",
                      "description": "Payment safety instruction: use settlement_call matching the selected chain and asset. If absent, do not send funds."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/v1/pay": {
      "post": {
        "tags": [
          "aifp"
        ],
        "summary": "POST /v1/pay",
        "operationId": "post_v1_pay",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/v1/paid/data": {
      "get": {
        "tags": [
          "aifp"
        ],
        "summary": "GET /v1/paid/data",
        "operationId": "get_v1_paid_data",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/v1/dev/paid/data": {
      "get": {
        "tags": [
          "aifp"
        ],
        "summary": "GET /v1/dev/paid/data",
        "operationId": "get_v1_dev_paid_data",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/v1/agents/{address}/receipts": {
      "get": {
        "tags": [
          "aifp"
        ],
        "summary": "GET /v1/agents/:address/receipts",
        "operationId": "get_v1_agents_address_receipts",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Agent's on-chain address (EVM or Solana)"
            }
          }
        ]
      }
    },
    "/v1/agents/{address}/statement": {
      "get": {
        "tags": [
          "aifp"
        ],
        "summary": "GET /v1/agents/:address/statement",
        "operationId": "get_v1_agents_address_statement",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Agent's on-chain address (EVM or Solana)"
            }
          }
        ]
      }
    },
    "/v1/agents/{id}/actions": {
      "get": {
        "tags": [
          "aifp"
        ],
        "summary": "GET /v1/agents/:id/actions",
        "operationId": "get_v1_agents_id_actions",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/v1/payments/{id}": {
      "get": {
        "tags": [
          "aifp"
        ],
        "summary": "GET /v1/payments/:id",
        "operationId": "get_v1_payments_id",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/v1/receipt/{id}": {
      "get": {
        "tags": [
          "aifp"
        ],
        "summary": "GET /v1/receipt/:id",
        "operationId": "get_v1_receipt_id",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/b2b/pay": {
      "post": {
        "tags": [
          "b2b"
        ],
        "summary": "POST /api/b2b/pay",
        "operationId": "post_api_b2b_pay",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/b2b/quote-split": {
      "get": {
        "tags": [
          "b2b"
        ],
        "summary": "GET /api/b2b/quote-split",
        "operationId": "get_api_b2b_quote-split",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/b2b/pay-with-split": {
      "post": {
        "tags": [
          "b2b"
        ],
        "summary": "POST /api/b2b/pay-with-split",
        "operationId": "post_api_b2b_pay-with-split",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/partner/{wallet}": {
      "get": {
        "tags": [
          "b2b"
        ],
        "summary": "GET /api/partner/:wallet",
        "operationId": "get_api_partner_wallet",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "wallet",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "EVM or Solana wallet address"
            }
          }
        ]
      }
    },
    "/api/v1/cross-chain/quote": {
      "post": {
        "tags": [
          "cross_chain"
        ],
        "summary": "POST /api/v1/cross-chain/quote",
        "operationId": "post_api_v1_cross-chain_quote",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/v1/cross-chain/status": {
      "get": {
        "tags": [
          "cross_chain"
        ],
        "summary": "GET /api/v1/cross-chain/status",
        "operationId": "get_api_v1_cross-chain_status",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/v1/cross-chain/supported": {
      "get": {
        "tags": [
          "cross_chain"
        ],
        "summary": "GET /api/v1/cross-chain/supported",
        "operationId": "get_api_v1_cross-chain_supported",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/dashboard": {
      "get": {
        "tags": [
          "dashboard"
        ],
        "summary": "GET /api/dashboard",
        "operationId": "get_api_dashboard",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ]
      }
    },
    "/api/dashboard/public": {
      "get": {
        "tags": [
          "dashboard"
        ],
        "summary": "GET /api/dashboard/public",
        "operationId": "get_api_dashboard_public",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/manifesto.json": {
      "get": {
        "tags": [
          "discovery"
        ],
        "summary": "GET /manifesto.json",
        "operationId": "get_manifesto.json",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/nonce": {
      "get": {
        "tags": [
          "discovery"
        ],
        "summary": "GET /nonce",
        "operationId": "get_nonce",
        "responses": {
          "200": {
            "description": "Native-auth v1 migration diagnostics; no signable nonce is returned.",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "description": "Read-only native-auth migration diagnostics. It does not issue a usable nonce. Native v2 nonces are returned only by an unauthenticated 402 response for the exact canonical-origin request."
      }
    },
    "/idl.json": {
      "get": {
        "tags": [
          "discovery"
        ],
        "summary": "GET /idl.json",
        "operationId": "get_idl.json",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "text/plain": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/openapi.yaml": {
      "get": {
        "tags": [
          "discovery"
        ],
        "summary": "GET /openapi.yaml",
        "operationId": "get_openapi.yaml",
        "responses": {
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/openapi.json": {
      "get": {
        "tags": [
          "discovery"
        ],
        "summary": "GET /openapi.json",
        "operationId": "get_openapi.json",
        "responses": {
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/.well-known/openai-apps-challenge": {
      "get": {
        "tags": [
          "discovery"
        ],
        "summary": "GET /.well-known/openai-apps-challenge",
        "operationId": "get_.well-known_openai-apps-challenge",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "text/plain": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/.well-known/x402.json": {
      "get": {
        "tags": [
          "discovery"
        ],
        "summary": "GET /.well-known/x402.json",
        "operationId": "get_.well-known_x402.json",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/.well-known/payment-requirements": {
      "get": {
        "tags": [
          "discovery"
        ],
        "summary": "GET /.well-known/payment-requirements",
        "operationId": "get_.well-known_payment-requirements",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/.well-known/agent.json": {
      "get": {
        "tags": [
          "discovery"
        ],
        "summary": "GET /.well-known/agent.json",
        "operationId": "get_.well-known_agent.json",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/agent.json": {
      "get": {
        "tags": [
          "discovery"
        ],
        "summary": "GET /agent.json",
        "operationId": "get_agent.json",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/mcp": {
      "get": {
        "tags": [
          "discovery"
        ],
        "summary": "GET /mcp",
        "operationId": "get_mcp",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/me/merchants/{id}/gateways/{gateway}/proof": {
      "get": {
        "tags": [
          "dns_control"
        ],
        "summary": "GET /api/me/merchants/:id/gateways/:gateway/proof",
        "operationId": "get_api_me_merchants_id_gateways_gateway_proof",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          },
          {
            "name": "gateway",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/me/merchants/{id}/gateways/{gateway}/proof/check": {
      "post": {
        "tags": [
          "dns_control"
        ],
        "summary": "POST /api/me/merchants/:id/gateways/:gateway/proof/check",
        "operationId": "post_api_me_merchants_id_gateways_gateway_proof_check",
        "responses": {
          "202": {
            "description": "Successful response",
            "content": {
              "text/plain": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          },
          {
            "name": "gateway",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "generation"
                ],
                "properties": {
                  "generation": {
                    "type": "string"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/api/me/merchants/{id}/site/proof": {
      "get": {
        "tags": [
          "dns_control"
        ],
        "summary": "GET /api/me/merchants/:id/site/proof",
        "operationId": "get_api_me_merchants_id_site_proof",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/me/merchants/{id}/site/proof/check": {
      "post": {
        "tags": [
          "dns_control"
        ],
        "summary": "POST /api/me/merchants/:id/site/proof/check",
        "operationId": "post_api_me_merchants_id_site_proof_check",
        "responses": {
          "202": {
            "description": "Successful response",
            "content": {
              "text/plain": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "generation"
                ],
                "properties": {
                  "generation": {
                    "type": "string"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/api/me/merchants/{id}/notifications": {
      "get": {
        "tags": [
          "dns_control"
        ],
        "summary": "GET /api/me/merchants/:id/notifications",
        "operationId": "get_api_me_merchants_id_notifications",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/founding-offer": {
      "get": {
        "tags": [
          "founding_offer"
        ],
        "summary": "GET /api/founding-offer",
        "operationId": "get_api_founding-offer",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/health": {
      "get": {
        "tags": [
          "health"
        ],
        "summary": "GET /api/health",
        "operationId": "get_api_health",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/internal/bridge-event": {
      "post": {
        "tags": [
          "internal"
        ],
        "summary": "POST /api/internal/bridge-event",
        "operationId": "post_api_internal_bridge-event",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "ingestHmac": []
          }
        ],
        "x-rate-limits": [
          {
            "middleware": "internalWriteLimiter",
            "note": "rate-limit on internal/ingest writes"
          }
        ]
      }
    },
    "/api/telemetry": {
      "post": {
        "tags": [
          "internal"
        ],
        "summary": "POST /api/telemetry",
        "operationId": "post_api_telemetry",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "ingestHmac": []
          }
        ],
        "x-rate-limits": [
          {
            "middleware": "internalWriteLimiter",
            "note": "rate-limit on internal/ingest writes"
          }
        ]
      }
    },
    "/api/invoice": {
      "post": {
        "tags": [
          "invoices"
        ],
        "summary": "POST /api/invoice",
        "operationId": "post_api_invoice",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/invoice-spl": {
      "post": {
        "tags": [
          "invoices"
        ],
        "summary": "POST /api/invoice-spl",
        "operationId": "post_api_invoice-spl",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/topup": {
      "post": {
        "tags": [
          "invoices"
        ],
        "summary": "POST /api/topup",
        "operationId": "post_api_topup",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/me/agents": {
      "get": {
        "tags": [
          "me_agents"
        ],
        "summary": "GET /api/me/agents",
        "operationId": "get_api_me_agents",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ]
      }
    },
    "/api/me/agents/{address}/statement": {
      "get": {
        "tags": [
          "me_agents"
        ],
        "summary": "GET /api/me/agents/:address/statement",
        "operationId": "get_api_me_agents_address_statement",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Agent's on-chain address (EVM or Solana)"
            }
          }
        ]
      }
    },
    "/api/me/agents/overview": {
      "get": {
        "tags": [
          "me_agents"
        ],
        "summary": "GET /api/me/agents/overview",
        "operationId": "get_api_me_agents_overview",
        "responses": {
          "200": {
            "description": "Legacy address list by default; grouped logical-agent view when view=grouped",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "window": {
                          "type": "integer"
                        },
                        "agents": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/AgentWalletView"
                          }
                        }
                      },
                      "required": [
                        "window",
                        "agents"
                      ]
                    },
                    {
                      "$ref": "#/components/schemas/GroupedAgentOverview"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "x-aifinpay-grouped-overview": 1,
        "parameters": [
          {
            "name": "view",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "grouped"
              ]
            },
            "description": "Omit for the backward-compatible address list; grouped returns logical agents with verified child wallets."
          }
        ]
      }
    },
    "/api/me/summary": {
      "get": {
        "tags": [
          "me_agents"
        ],
        "summary": "GET /api/me/summary",
        "operationId": "get_api_me_summary",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ]
      }
    },
    "/api/me/wallet": {
      "get": {
        "tags": [
          "me_agents"
        ],
        "summary": "GET /api/me/wallet",
        "operationId": "get_api_me_wallet",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ]
      }
    },
    "/api/me/agents/{address}/receipts": {
      "get": {
        "tags": [
          "me_agents"
        ],
        "summary": "GET /api/me/agents/:address/receipts",
        "operationId": "get_api_me_agents_address_receipts",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Agent's on-chain address (EVM or Solana)"
            }
          }
        ]
      }
    },
    "/api/me/agents/{address}/telemetry": {
      "get": {
        "tags": [
          "me_agents"
        ],
        "summary": "GET /api/me/agents/:address/telemetry",
        "operationId": "get_api_me_agents_address_telemetry",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Agent's on-chain address (EVM or Solana)"
            }
          }
        ]
      }
    },
    "/api/me/agents/{address}/policy": {
      "get": {
        "tags": [
          "me_agents"
        ],
        "summary": "GET /api/me/agents/:address/policy",
        "operationId": "get_api_me_agents_address_policy",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Agent's on-chain address (EVM or Solana)"
            }
          }
        ]
      },
      "put": {
        "tags": [
          "me_agents"
        ],
        "summary": "PUT /api/me/agents/:address/policy",
        "operationId": "put_api_me_agents_address_policy",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Agent's on-chain address (EVM or Solana)"
            }
          }
        ]
      }
    },
    "/api/me/agent-groups/{agentId}": {
      "patch": {
        "tags": [
          "me_agents"
        ],
        "summary": "PATCH /api/me/agent-groups/:agentId",
        "operationId": "patch_api_me_agent-groups_agentId",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "delete": {
        "tags": [
          "me_agents"
        ],
        "summary": "DELETE /api/me/agent-groups/:agentId",
        "operationId": "delete_api_me_agent-groups_agentId",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/me/agent-groups/{agentId}/policy": {
      "get": {
        "tags": [
          "me_agents"
        ],
        "summary": "GET /api/me/agent-groups/:agentId/policy",
        "operationId": "get_api_me_agent-groups_agentId_policy",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "description": "Owner-only policy controls. Values apply separately to each verified child wallet; this is NOT a shared agent cap. Writes update all child policies atomically."
      },
      "put": {
        "tags": [
          "me_agents"
        ],
        "summary": "PUT /api/me/agent-groups/:agentId/policy",
        "operationId": "put_api_me_agent-groups_agentId_policy",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "description": "Owner-only policy controls. Values apply separately to each verified child wallet; this is NOT a shared agent cap. Writes update all child policies atomically."
      }
    },
    "/api/me/agents/challenge": {
      "post": {
        "tags": [
          "me_agents"
        ],
        "summary": "POST /api/me/agents/challenge",
        "operationId": "post_api_me_agents_challenge",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          },
          {
            "agentClaim": []
          }
        ],
        "description": "Start a signed wallet challenge. Optional agent_id selects an existing OWNED logical agent for a full owner session only. The target and verified claim-session identity are stored with the challenge and cannot be changed at signature submission.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string"
                  },
                  "chain": {
                    "type": "string"
                  },
                  "agent_id": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "address"
                ]
              }
            }
          }
        }
      }
    },
    "/api/me/agents/claim": {
      "post": {
        "tags": [
          "me_agents"
        ],
        "summary": "POST /api/me/agents/claim",
        "operationId": "post_api_me_agents_claim",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          },
          {
            "agentClaim": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "label"
                ],
                "properties": {
                  "label": {
                    "type": "string"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        }
      }
    },
    "/api/me/agents/{address}": {
      "patch": {
        "tags": [
          "me_agents"
        ],
        "summary": "PATCH /api/me/agents/:address",
        "operationId": "patch_api_me_agents_address",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Agent's on-chain address (EVM or Solana)"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "label",
                  "alert_email_on_daily_spend_usd",
                  "preferred_chain"
                ],
                "properties": {
                  "label": {
                    "type": "string"
                  },
                  "alert_email_on_daily_spend_usd": {
                    "type": "string"
                  },
                  "preferred_chain": {
                    "type": "string"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "me_agents"
        ],
        "summary": "DELETE /api/me/agents/:address",
        "operationId": "delete_api_me_agents_address",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Agent's on-chain address (EVM or Solana)"
            }
          }
        ]
      }
    },
    "/api/auth/request-link": {
      "post": {
        "tags": [
          "me_auth"
        ],
        "summary": "POST /api/auth/request-link",
        "operationId": "post_api_auth_request-link",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/auth/verify": {
      "get": {
        "tags": [
          "me_auth"
        ],
        "summary": "GET /api/auth/verify",
        "operationId": "get_api_auth_verify",
        "responses": {
          "302": {
            "description": "Redirect",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string",
                  "description": "Target URL"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      },
      "post": {
        "tags": [
          "me_auth"
        ],
        "summary": "`redirect` with a full navigation. */",
        "operationId": "post_api_auth_verify",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/auth/link-info": {
      "post": {
        "tags": [
          "me_auth"
        ],
        "summary": "link opens. The token is the proof of the mailbox, so its holder may see",
        "operationId": "post_api_auth_link-info",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/auth/logout": {
      "post": {
        "tags": [
          "me_auth"
        ],
        "summary": "POST /api/auth/logout",
        "operationId": "post_api_auth_logout",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/auth/signup": {
      "post": {
        "tags": [
          "me_auth"
        ],
        "summary": "POST /api/auth/signup",
        "operationId": "post_api_auth_signup",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/auth/login": {
      "post": {
        "tags": [
          "me_auth"
        ],
        "summary": "POST /api/auth/login",
        "operationId": "post_api_auth_login",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/auth/login/2fa": {
      "post": {
        "tags": [
          "me_auth"
        ],
        "summary": "POST /api/auth/login/2fa",
        "operationId": "post_api_auth_login_2fa",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/auth/resend-verification": {
      "post": {
        "tags": [
          "me_auth"
        ],
        "summary": "POST /api/auth/resend-verification",
        "operationId": "post_api_auth_resend-verification",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/me/claim-url": {
      "post": {
        "tags": [
          "me_auth"
        ],
        "summary": "POST /api/me/claim-url",
        "operationId": "post_api_me_claim-url",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ]
      }
    },
    "/api/me/persona": {
      "post": {
        "tags": [
          "me_auth"
        ],
        "summary": "Remember which side of the protocol this account works on.",
        "operationId": "post_api_me_persona",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ]
      }
    },
    "/api/me/password": {
      "post": {
        "tags": [
          "me_auth"
        ],
        "summary": "POST /api/me/password",
        "operationId": "post_api_me_password",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ]
      }
    },
    "/api/me/step-up/email-code": {
      "post": {
        "tags": [
          "me_auth"
        ],
        "summary": "POST /api/me/step-up/email-code",
        "operationId": "post_api_me_step-up_email-code",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ]
      }
    },
    "/api/me/sessions/revoke-all": {
      "post": {
        "tags": [
          "me_auth"
        ],
        "summary": "POST /api/me/sessions/revoke-all",
        "operationId": "post_api_me_sessions_revoke-all",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ]
      }
    },
    "/api/me/2fa/setup": {
      "post": {
        "tags": [
          "me_auth"
        ],
        "summary": "POST /api/me/2fa/setup",
        "operationId": "post_api_me_2fa_setup",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ]
      }
    },
    "/api/me/2fa/confirm": {
      "post": {
        "tags": [
          "me_auth"
        ],
        "summary": "POST /api/me/2fa/confirm",
        "operationId": "post_api_me_2fa_confirm",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ]
      }
    },
    "/api/me/2fa/disable": {
      "post": {
        "tags": [
          "me_auth"
        ],
        "summary": "POST /api/me/2fa/disable",
        "operationId": "post_api_me_2fa_disable",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ]
      }
    },
    "/api/me": {
      "get": {
        "tags": [
          "me_auth"
        ],
        "summary": "GET /api/me",
        "operationId": "get_api_me",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ]
      }
    },
    "/api/me/merchants": {
      "post": {
        "tags": [
          "me_merchants"
        ],
        "summary": "POST /api/me/merchants",
        "operationId": "post_api_me_merchants",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "text/plain": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "settlement_version": {
                    "type": "string",
                    "enum": [
                      "1.2",
                      "1.4"
                    ],
                    "description": "Explicit settlement generation. Omission defaults to 1.2 at registration and preserves the current selection on update. Selecting 1.4 does not enable operator deployment flags; quote-time readiness still applies."
                  },
                  "settlement_chain": {
                    "type": "string",
                    "description": "Canonical settlement network compatible with the merchant's immutable network_mode. Omission preserves the current selection (or its legacy default). This field does not change the payout wallet."
                  },
                  "name": {
                    "type": "string",
                    "description": "Merchant display name; server validates 3–80 trimmed characters."
                  },
                  "pay_to": {
                    "type": "object",
                    "properties": {
                      "evm": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "One EVM address shared across EVM networks; validated for checksum and known burn addresses."
                      },
                      "polygon": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Legacy alias for evm. Supplied aliases must identify the same EVM address."
                      },
                      "solana": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Base58-encoded 32-byte public Solana address."
                      },
                      "near": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "minLength": 2,
                        "maxLength": 64,
                        "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$(?![\\s\\S])",
                        "description": "Lowercase NEAR account ID. Format only, not account existence or ownership."
                      },
                      "aptos": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "oneOf": [
                          {
                            "type": "null"
                          },
                          {
                            "type": "string",
                            "minLength": 66,
                            "maxLength": 66,
                            "pattern": "^0x(?!0{64}$)[0-9a-fA-F]{64}$"
                          },
                          {
                            "type": "string",
                            "minLength": 3,
                            "maxLength": 3,
                            "pattern": "^0x[1-9a-fA-F]$"
                          }
                        ],
                        "description": "Nonzero Aptos address: full 32-byte 0x hex or a one-digit special notation. Stored as lowercase full 32-byte hex."
                      }
                    },
                    "additionalProperties": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "description": "Public merchant payout destinations, not payment instructions. At least one valid configured family is required. Recognized EVM network aliases may accompany the same EVM address; unknown keys are rejected. PATCH preserves omitted families; null clears only that family. Payout changes require owner step-up on the dashboard route. Stored NEAR/Aptos fields do not activate settlement or agent wallet claims."
                  }
                },
                "required": [
                  "name",
                  "pay_to"
                ]
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "me_merchants"
        ],
        "summary": "GET /api/me/merchants",
        "operationId": "get_api_me_merchants",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ]
      }
    },
    "/api/me/merchants/{id}/claim": {
      "post": {
        "tags": [
          "me_merchants"
        ],
        "summary": "POST /api/me/merchants/:id/claim",
        "operationId": "post_api_me_merchants_id_claim",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "merchant_secret"
                ],
                "properties": {
                  "merchant_secret": {
                    "type": "string"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "x-rate-limits": [
          {
            "middleware": "claimLimiter",
            "note": "rate-limit on /api/me/merchants/:id/claim"
          }
        ]
      }
    },
    "/api/me/merchants/{id}": {
      "get": {
        "tags": [
          "me_merchants"
        ],
        "summary": "GET /api/me/merchants/:id",
        "operationId": "get_api_me_merchants_id",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      },
      "patch": {
        "tags": [
          "me_merchants"
        ],
        "summary": "PATCH /api/me/merchants/:id",
        "operationId": "patch_api_me_merchants_id",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "settlement_version": {
                    "type": "string",
                    "enum": [
                      "1.2",
                      "1.4"
                    ],
                    "description": "Explicit settlement generation. Omission defaults to 1.2 at registration and preserves the current selection on update. Selecting 1.4 does not enable operator deployment flags; quote-time readiness still applies."
                  },
                  "settlement_chain": {
                    "type": "string",
                    "description": "Canonical settlement network compatible with the merchant's immutable network_mode. Omission preserves the current selection (or its legacy default). This field does not change the payout wallet."
                  },
                  "name": {
                    "type": "string",
                    "description": "Merchant display name; server validates 3–80 trimmed characters."
                  },
                  "pay_to": {
                    "type": "object",
                    "properties": {
                      "evm": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "One EVM address shared across EVM networks; validated for checksum and known burn addresses."
                      },
                      "polygon": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Legacy alias for evm. Supplied aliases must identify the same EVM address."
                      },
                      "solana": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "Base58-encoded 32-byte public Solana address."
                      },
                      "near": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "minLength": 2,
                        "maxLength": 64,
                        "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$(?![\\s\\S])",
                        "description": "Lowercase NEAR account ID. Format only, not account existence or ownership."
                      },
                      "aptos": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "oneOf": [
                          {
                            "type": "null"
                          },
                          {
                            "type": "string",
                            "minLength": 66,
                            "maxLength": 66,
                            "pattern": "^0x(?!0{64}$)[0-9a-fA-F]{64}$"
                          },
                          {
                            "type": "string",
                            "minLength": 3,
                            "maxLength": 3,
                            "pattern": "^0x[1-9a-fA-F]$"
                          }
                        ],
                        "description": "Nonzero Aptos address: full 32-byte 0x hex or a one-digit special notation. Stored as lowercase full 32-byte hex."
                      }
                    },
                    "additionalProperties": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "description": "Public merchant payout destinations, not payment instructions. At least one valid configured family is required. Recognized EVM network aliases may accompany the same EVM address; unknown keys are rejected. PATCH preserves omitted families; null clears only that family. Payout changes require owner step-up on the dashboard route. Stored NEAR/Aptos fields do not activate settlement or agent wallet claims."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/me/merchants/{id}/settlements": {
      "get": {
        "tags": [
          "me_merchants"
        ],
        "summary": "List recognized confirmed Polygon settlements",
        "operationId": "get_api_me_merchants_id_settlements",
        "responses": {
          "200": {
            "description": "Page plus aggregate over ALL filtered snapshot rows before pagination.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettlementFeed"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or unsupported filter/cursor/scope; arbitrary wallet input is rejected."
          },
          "401": {
            "description": "Authentication required."
          },
          "404": {
            "description": "Merchant is absent or not currently owned; no existence disclosure."
          },
          "503": {
            "description": "Required accounting or ownership storage unavailable. Cache-Control: no-store; error=settlement_accounting_unavailable."
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "site",
                "wallet"
              ],
              "default": "site"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Inclusive ISO UTC boundary; list defaults to last 30 days."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Exclusive ISO UTC boundary."
          },
          {
            "name": "chain",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "polygon"
              ]
            }
          },
          {
            "name": "asset",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-f]{40}$"
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^0x(?:[0-9a-fA-F]{40}|[0-9a-fA-F]{64})$"
            },
            "description": "Exact payer address or transaction hash."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 1024
            },
            "description": "Opaque versioned snapshot cursor bound to ownership, scope and filters. Reuse unchanged filters."
          }
        ],
        "description": "Authenticated immutable financial facts, independently of retained access receipts. Historical coverage is qualified, never certified lifetime. Exact base units and historically proven quoted gross USD; no current FX. Wallet scope uses only server-derived current and proven historical payouts, disclosing public facts for unknown site associations. No payment or receipt is created."
      }
    },
    "/api/me/merchants/{id}/settlements/summary": {
      "get": {
        "tags": [
          "me_merchants"
        ],
        "summary": "Summarize recognized confirmed Polygon settlements",
        "operationId": "get_api_me_merchants_id_settlements_summary",
        "responses": {
          "200": {
            "description": "UTC financial windows over all filtered snapshot rows.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettlementWindows"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or unsupported filter/cursor/scope; arbitrary wallet input is rejected."
          },
          "401": {
            "description": "Authentication required."
          },
          "404": {
            "description": "Merchant is absent or not currently owned; no existence disclosure."
          },
          "503": {
            "description": "Required accounting or ownership storage unavailable. Cache-Control: no-store; error=settlement_accounting_unavailable."
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "site",
                "wallet"
              ],
              "default": "site"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Inclusive ISO UTC boundary; list defaults to last 30 days."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Exclusive ISO UTC boundary."
          },
          {
            "name": "chain",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "polygon"
              ]
            }
          },
          {
            "name": "asset",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-f]{40}$"
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^0x(?:[0-9a-fA-F]{40}|[0-9a-fA-F]{64})$"
            },
            "description": "Exact payer address or transaction hash."
          }
        ],
        "description": "Authenticated immutable financial facts, independently of retained access receipts. Historical coverage is qualified, never certified lifetime. Exact base units and historically proven quoted gross USD; no current FX. Wallet scope uses only server-derived current and proven historical payouts, disclosing public facts for unknown site associations. No payment or receipt is created."
      }
    },
    "/api/me/settlements": {
      "get": {
        "tags": [
          "me_merchants"
        ],
        "summary": "List recognized confirmed Polygon settlements",
        "operationId": "get_api_me_settlements",
        "responses": {
          "200": {
            "description": "Page plus aggregate over ALL filtered snapshot rows before pagination.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettlementFeed"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or unsupported filter/cursor/scope; arbitrary wallet input is rejected."
          },
          "401": {
            "description": "Authentication required."
          },
          "404": {
            "description": "Merchant is absent or not currently owned; no existence disclosure."
          },
          "503": {
            "description": "Required accounting or ownership storage unavailable. Cache-Control: no-store; error=settlement_accounting_unavailable."
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "description": "Authenticated immutable financial facts, independently of retained access receipts. Historical coverage is qualified, never certified lifetime. Exact base units and historically proven quoted gross USD; no current FX. Wallet scope uses only server-derived current and proven historical payouts, disclosing public facts for unknown site associations. No payment or receipt is created.",
        "parameters": [
          {
            "name": "scope",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "account_wallet"
              ],
              "default": "account_wallet"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Inclusive ISO UTC boundary; list defaults to last 30 days."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Exclusive ISO UTC boundary."
          },
          {
            "name": "chain",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "polygon"
              ]
            }
          },
          {
            "name": "asset",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-f]{40}$"
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^0x(?:[0-9a-fA-F]{40}|[0-9a-fA-F]{64})$"
            },
            "description": "Exact payer address or transaction hash."
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 1024
            },
            "description": "Opaque versioned snapshot cursor bound to ownership, scope and filters. Reuse unchanged filters."
          }
        ]
      }
    },
    "/api/me/settlements/summary": {
      "get": {
        "tags": [
          "me_merchants"
        ],
        "summary": "Summarize recognized confirmed Polygon settlements",
        "operationId": "get_api_me_settlements_summary",
        "responses": {
          "200": {
            "description": "UTC financial windows over all filtered snapshot rows.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettlementWindows"
                }
              }
            }
          },
          "400": {
            "description": "Malformed or unsupported filter/cursor/scope; arbitrary wallet input is rejected."
          },
          "401": {
            "description": "Authentication required."
          },
          "404": {
            "description": "Merchant is absent or not currently owned; no existence disclosure."
          },
          "503": {
            "description": "Required accounting or ownership storage unavailable. Cache-Control: no-store; error=settlement_accounting_unavailable."
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "description": "Authenticated immutable financial facts, independently of retained access receipts. Historical coverage is qualified, never certified lifetime. Exact base units and historically proven quoted gross USD; no current FX. Wallet scope uses only server-derived current and proven historical payouts, disclosing public facts for unknown site associations. No payment or receipt is created.",
        "parameters": [
          {
            "name": "scope",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "account_wallet"
              ],
              "default": "account_wallet"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Inclusive ISO UTC boundary; list defaults to last 30 days."
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Exclusive ISO UTC boundary."
          },
          {
            "name": "chain",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "polygon"
              ]
            }
          },
          {
            "name": "asset",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^0x[0-9a-f]{40}$"
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^0x(?:[0-9a-fA-F]{40}|[0-9a-fA-F]{64})$"
            },
            "description": "Exact payer address or transaction hash."
          }
        ]
      }
    },
    "/api/me/merchants/{id}/stats": {
      "get": {
        "tags": [
          "me_merchants"
        ],
        "summary": "GET /api/me/merchants/:id/stats",
        "operationId": "get_api_me_merchants_id_stats",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/me/merchants/{id}/receipts": {
      "get": {
        "tags": [
          "me_merchants"
        ],
        "summary": "GET /api/me/merchants/:id/receipts",
        "operationId": "get_api_me_merchants_id_receipts",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/me/merchants/{id}/activity": {
      "get": {
        "tags": [
          "me_merchants"
        ],
        "summary": "GET /api/me/merchants/:id/activity",
        "operationId": "get_api_me_merchants_id_activity",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/me/merchants/{id}/resources": {
      "get": {
        "tags": [
          "me_merchants"
        ],
        "summary": "GET /api/me/merchants/:id/resources",
        "operationId": "get_api_me_merchants_id_resources",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      },
      "post": {
        "tags": [
          "me_merchants"
        ],
        "summary": "POST /api/me/merchants/:id/resources",
        "operationId": "post_api_me_merchants_id_resources",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "text/plain": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/me/merchants/{id}/resources/{rid}": {
      "patch": {
        "tags": [
          "me_merchants"
        ],
        "summary": "PATCH /api/me/merchants/:id/resources/:rid",
        "operationId": "patch_api_me_merchants_id_resources_rid",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          },
          {
            "name": "rid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Resource identifier",
              "pattern": "^res_[0-9a-f]{12}$"
            }
          }
        ]
      },
      "delete": {
        "tags": [
          "me_merchants"
        ],
        "summary": "DELETE /api/me/merchants/:id/resources/:rid",
        "operationId": "delete_api_me_merchants_id_resources_rid",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          },
          {
            "name": "rid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Resource identifier",
              "pattern": "^res_[0-9a-f]{12}$"
            }
          }
        ]
      }
    },
    "/api/me/merchants/{id}/policy": {
      "get": {
        "tags": [
          "me_merchants"
        ],
        "summary": "GET /api/me/merchants/:id/policy",
        "operationId": "get_api_me_merchants_id_policy",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      },
      "put": {
        "tags": [
          "me_merchants"
        ],
        "summary": "PUT /api/me/merchants/:id/policy",
        "operationId": "put_api_me_merchants_id_policy",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/me/merchants/{id}/gateway": {
      "get": {
        "tags": [
          "me_merchants"
        ],
        "summary": "GET /api/me/merchants/:id/gateway",
        "operationId": "get_api_me_merchants_id_gateway",
        "responses": {
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      },
      "put": {
        "tags": [
          "me_merchants"
        ],
        "summary": "PUT /api/me/merchants/:id/gateway",
        "operationId": "put_api_me_merchants_id_gateway",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/me/merchants/{id}/gateway/domain": {
      "get": {
        "tags": [
          "me_merchants"
        ],
        "summary": "GET /api/me/merchants/:id/gateway/domain",
        "operationId": "get_api_me_merchants_id_gateway_domain",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/me/merchants/{id}/gateway/domain/verify": {
      "post": {
        "tags": [
          "me_merchants"
        ],
        "summary": "POST /api/me/merchants/:id/gateway/domain/verify",
        "operationId": "post_api_me_merchants_id_gateway_domain_verify",
        "responses": {
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/me/merchants/{id}/gateway/rotate-origin-secret": {
      "post": {
        "tags": [
          "me_merchants"
        ],
        "summary": "POST /api/me/merchants/:id/gateway/rotate-origin-secret",
        "operationId": "post_api_me_merchants_id_gateway_rotate-origin-secret",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/me/merchants/{id}/gateway/verify-lock": {
      "post": {
        "tags": [
          "me_merchants"
        ],
        "summary": "POST /api/me/merchants/:id/gateway/verify-lock",
        "operationId": "post_api_me_merchants_id_gateway_verify-lock",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/me/merchants/{id}/actions": {
      "get": {
        "tags": [
          "me_merchants"
        ],
        "summary": "GET /api/me/merchants/:id/actions",
        "operationId": "get_api_me_merchants_id_actions",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/me/merchants/{id}/funnel": {
      "get": {
        "tags": [
          "me_merchants"
        ],
        "summary": "GET /api/me/merchants/:id/funnel",
        "operationId": "get_api_me_merchants_id_funnel",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/me/merchants/{id}/traffic": {
      "get": {
        "tags": [
          "me_merchants"
        ],
        "summary": "GET /api/me/merchants/:id/traffic",
        "operationId": "get_api_me_merchants_id_traffic",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/me/merchants/{id}/geo": {
      "get": {
        "tags": [
          "me_merchants"
        ],
        "summary": "GET /api/me/merchants/:id/geo",
        "operationId": "get_api_me_merchants_id_geo",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/me/merchants/{id}/ai-clients": {
      "get": {
        "tags": [
          "me_merchants"
        ],
        "summary": "GET /api/me/merchants/:id/ai-clients",
        "operationId": "get_api_me_merchants_id_ai-clients",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/me/merchants/{id}/marketplace-listing": {
      "post": {
        "tags": [
          "me_merchants"
        ],
        "summary": "POST /api/me/merchants/:id/marketplace-listing",
        "operationId": "post_api_me_merchants_id_marketplace-listing",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "text/plain": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/me/merchants/{id}/marketplace-listings": {
      "get": {
        "tags": [
          "me_merchants"
        ],
        "summary": "GET /api/me/merchants/:id/marketplace-listings",
        "operationId": "get_api_me_merchants_id_marketplace-listings",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/me/notifications": {
      "get": {
        "tags": [
          "me_merchants"
        ],
        "summary": "GET /api/me/notifications",
        "operationId": "get_api_me_notifications",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ]
      }
    },
    "/api/me/merchants/{id}/webhook": {
      "get": {
        "tags": [
          "me_merchants"
        ],
        "summary": "GET /api/me/merchants/:id/webhook",
        "operationId": "get_api_me_merchants_id_webhook",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      },
      "put": {
        "tags": [
          "me_merchants"
        ],
        "summary": "PUT /api/me/merchants/:id/webhook",
        "operationId": "put_api_me_merchants_id_webhook",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/me/merchants/{id}/webhook/deliveries": {
      "get": {
        "tags": [
          "me_merchants"
        ],
        "summary": "GET /api/me/merchants/:id/webhook/deliveries",
        "operationId": "get_api_me_merchants_id_webhook_deliveries",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/me/merchants/{id}/rotate-secret": {
      "post": {
        "tags": [
          "me_merchants"
        ],
        "summary": "POST /api/me/merchants/:id/rotate-secret",
        "operationId": "post_api_me_merchants_id_rotate-secret",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/me/merchants/{id}/config": {
      "get": {
        "tags": [
          "merchant_config"
        ],
        "summary": "GET /api/me/merchants/:id/config",
        "operationId": "get_api_me_merchants_id_config",
        "responses": {
          "200": {
            "description": "Owned authoritative sanitized result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigView"
                }
              }
            }
          },
          "400": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "401": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "description": "Absent or not currently owned; generic existence-safe response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "409": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "413": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "429": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "503": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ],
        "description": "Owned configuration control-plane. Fresh ownership, Cache-Control no-store. Strict raw UTF8 JSON <=1MiB/depth12/duplicate and unknown keys rejected. Preview does not probe DNS/HTTP. Atomic marker publication; ambiguous completion resolves by idempotency/owned operation lookup. No settlement/network activation."
      }
    },
    "/api/me/merchants/{id}/config/export": {
      "get": {
        "tags": [
          "merchant_config"
        ],
        "summary": "GET /api/me/merchants/:id/config/export",
        "operationId": "get_api_me_merchants_id_config_export",
        "responses": {
          "200": {
            "description": "Deterministic portable allowlist; no ownership, payout, credentials or proof values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigExport"
                }
              }
            }
          },
          "400": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "401": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "description": "Absent or not currently owned; generic existence-safe response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "409": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "413": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "429": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "503": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ],
        "description": "Owned configuration control-plane. Fresh ownership, Cache-Control no-store. Strict raw UTF8 JSON <=1MiB/depth12/duplicate and unknown keys rejected. Preview does not probe DNS/HTTP. Atomic marker publication; ambiguous completion resolves by idempotency/owned operation lookup. No settlement/network activation."
      }
    },
    "/api/me/merchants/{id}/config/preview": {
      "post": {
        "tags": [
          "merchant_config"
        ],
        "summary": "POST /api/me/merchants/:id/config/preview",
        "operationId": "post_api_me_merchants_id_config_preview",
        "responses": {
          "200": {
            "description": "Owned authoritative sanitized result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigPreview"
                }
              }
            }
          },
          "400": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "401": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "description": "Absent or not currently owned; generic existence-safe response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "409": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "413": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "429": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "503": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ],
        "description": "Owned configuration control-plane. Fresh ownership, Cache-Control no-store. Strict raw UTF8 JSON <=1MiB/depth12/duplicate and unknown keys rejected. Preview does not probe DNS/HTTP. Atomic marker publication; ambiguous completion resolves by idempotency/owned operation lookup. No settlement/network activation.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MerchantConfigImport"
              }
            }
          }
        }
      }
    },
    "/api/me/merchants/{id}/config/confirm": {
      "post": {
        "tags": [
          "merchant_config"
        ],
        "summary": "POST /api/me/merchants/:id/config/confirm",
        "operationId": "post_api_me_merchants_id_config_confirm",
        "responses": {
          "200": {
            "description": "Owned authoritative sanitized result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigCommitted"
                }
              }
            }
          },
          "400": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "401": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "description": "Absent or not currently owned; generic existence-safe response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "409": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "413": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "429": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "503": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ],
        "description": "Owned configuration control-plane. Fresh ownership, Cache-Control no-store. Strict raw UTF8 JSON <=1MiB/depth12/duplicate and unknown keys rejected. Preview does not probe DNS/HTTP. Atomic marker publication; ambiguous completion resolves by idempotency/owned operation lookup. No settlement/network activation.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MerchantConfigConfirmation"
              }
            }
          }
        }
      }
    },
    "/api/me/merchants/{id}/gateways": {
      "get": {
        "tags": [
          "merchant_config"
        ],
        "summary": "GET /api/me/merchants/:id/gateways",
        "operationId": "get_api_me_merchants_id_gateways",
        "responses": {
          "200": {
            "description": "Owned authoritative sanitized result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "revision",
                    "gateways",
                    "default_gateway_id",
                    "legacy_gateway_id"
                  ],
                  "properties": {
                    "revision": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128
                    },
                    "gateways": {
                      "type": "array",
                      "maxItems": 8,
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "id",
                          "name",
                          "slug",
                          "type",
                          "enabled_intent",
                          "priority",
                          "upstream_base_url",
                          "description",
                          "metadata",
                          "chains",
                          "payment_assets",
                          "resources",
                          "origin_secret_set",
                          "readiness"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 100
                          },
                          "name": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 80
                          },
                          "slug": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9-]{2,39}$"
                          },
                          "type": {
                            "type": "string",
                            "const": "hosted_x402"
                          },
                          "enabled_intent": {
                            "type": "boolean"
                          },
                          "priority": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 1000
                          },
                          "upstream_base_url": {
                            "type": "string",
                            "format": "uri",
                            "maxLength": 2048
                          },
                          "description": {
                            "type": "string",
                            "maxLength": 500
                          },
                          "metadata": {
                            "type": "object",
                            "maxProperties": 10,
                            "propertyNames": {
                              "minLength": 1,
                              "maxLength": 40
                            },
                            "additionalProperties": {
                              "type": "string",
                              "maxLength": 200
                            }
                          },
                          "chains": {
                            "type": "array",
                            "uniqueItems": true,
                            "items": {
                              "type": "string"
                            }
                          },
                          "payment_assets": {
                            "type": "array",
                            "uniqueItems": true,
                            "items": {
                              "type": "string"
                            }
                          },
                          "resources": {
                            "type": "array",
                            "maxItems": 500,
                            "items": {
                              "type": "object",
                              "additionalProperties": false,
                              "required": [
                                "id",
                                "route_pattern",
                                "type"
                              ],
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 100
                                },
                                "route_pattern": {
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 200
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "page",
                                    "api",
                                    "dataset",
                                    "mcp_tool",
                                    "product"
                                  ]
                                },
                                "name": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "maxLength": 60
                                },
                                "description": {
                                  "type": "string",
                                  "maxLength": 500
                                },
                                "active": {
                                  "type": "boolean"
                                },
                                "paywall_enabled": {
                                  "type": "boolean"
                                },
                                "currency": {
                                  "const": "USD",
                                  "type": "string"
                                },
                                "billing_unit": {
                                  "const": "request",
                                  "type": "string"
                                },
                                "unit_weight": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 100000
                                },
                                "price_usd": {
                                  "type": "string",
                                  "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,6})?$"
                                },
                                "tier": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "enum": [
                                    "standard",
                                    "complex",
                                    "premium",
                                    null
                                  ]
                                },
                                "chains": {
                                  "type": "array",
                                  "uniqueItems": true,
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "payment_assets": {
                                  "type": "array",
                                  "uniqueItems": true,
                                  "items": {
                                    "type": "string"
                                  }
                                },
                                "daily_unit_limit": {
                                  "type": [
                                    "integer",
                                    "null"
                                  ],
                                  "minimum": 1,
                                  "maximum": 100000000
                                },
                                "fallback_gateway_id": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "minLength": 1,
                                  "maxLength": 100
                                }
                              }
                            }
                          },
                          "origin_secret_set": {
                            "type": "boolean"
                          },
                          "readiness": {
                            "type": "object",
                            "additionalProperties": false,
                            "required": [
                              "ready",
                              "state"
                            ],
                            "properties": {
                              "ready": {
                                "type": "boolean"
                              },
                              "reason": {
                                "type": "string"
                              },
                              "state": {
                                "type": "string",
                                "enum": [
                                  "PENDING_DNS",
                                  "DNS_VALID",
                                  "DNS_INVALID",
                                  "REMOVED"
                                ]
                              }
                            }
                          }
                        }
                      }
                    },
                    "default_gateway_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "legacy_gateway_id": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "minLength": 1,
                      "maxLength": 100
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "401": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "description": "Absent or not currently owned; generic existence-safe response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "409": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "413": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "429": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "503": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ],
        "description": "Owned configuration control-plane. Fresh ownership, Cache-Control no-store. Strict raw UTF8 JSON <=1MiB/depth12/duplicate and unknown keys rejected. Preview does not probe DNS/HTTP. Atomic marker publication; ambiguous completion resolves by idempotency/owned operation lookup. No settlement/network activation."
      },
      "post": {
        "tags": [
          "merchant_config"
        ],
        "summary": "POST /api/me/merchants/:id/gateways",
        "operationId": "post_api_me_merchants_id_gateways",
        "responses": {
          "201": {
            "description": "Owned authoritative sanitized result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigCommitted"
                }
              }
            }
          },
          "400": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "401": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "description": "Absent or not currently owned; generic existence-safe response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "409": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "413": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "429": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "503": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ],
        "description": "Owned configuration control-plane. Fresh ownership, Cache-Control no-store. Strict raw UTF8 JSON <=1MiB/depth12/duplicate and unknown keys rejected. Preview does not probe DNS/HTTP. Atomic marker publication; ambiguous completion resolves by idempotency/owned operation lookup. No settlement/network activation.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "revision",
                  "context_revision",
                  "name",
                  "slug",
                  "type",
                  "enabled_intent",
                  "priority",
                  "upstream_base_url"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "slug": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9-]{2,39}$"
                  },
                  "type": {
                    "type": "string",
                    "const": "hosted_x402"
                  },
                  "enabled_intent": {
                    "type": "boolean"
                  },
                  "priority": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1000
                  },
                  "upstream_base_url": {
                    "type": "string",
                    "format": "uri",
                    "maxLength": 2048
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "metadata": {
                    "type": "object",
                    "maxProperties": 10,
                    "propertyNames": {
                      "minLength": 1,
                      "maxLength": 40
                    },
                    "additionalProperties": {
                      "type": "string",
                      "maxLength": 200
                    }
                  },
                  "chains": {
                    "type": "array",
                    "uniqueItems": true,
                    "items": {
                      "type": "string"
                    }
                  },
                  "payment_assets": {
                    "type": "array",
                    "uniqueItems": true,
                    "items": {
                      "type": "string"
                    }
                  },
                  "resources": {
                    "type": "array",
                    "maxItems": 500,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "id",
                        "route_pattern",
                        "type"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "route_pattern": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 200
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "page",
                            "api",
                            "dataset",
                            "mcp_tool",
                            "product"
                          ]
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 60
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 500
                        },
                        "active": {
                          "type": "boolean"
                        },
                        "paywall_enabled": {
                          "type": "boolean"
                        },
                        "currency": {
                          "const": "USD",
                          "type": "string"
                        },
                        "billing_unit": {
                          "const": "request",
                          "type": "string"
                        },
                        "unit_weight": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 100000
                        },
                        "price_usd": {
                          "type": "string",
                          "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,6})?$"
                        },
                        "tier": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "enum": [
                            "standard",
                            "complex",
                            "premium",
                            null
                          ]
                        },
                        "chains": {
                          "type": "array",
                          "uniqueItems": true,
                          "items": {
                            "type": "string"
                          }
                        },
                        "payment_assets": {
                          "type": "array",
                          "uniqueItems": true,
                          "items": {
                            "type": "string"
                          }
                        },
                        "daily_unit_limit": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "minimum": 1,
                          "maximum": 100000000
                        },
                        "fallback_gateway_id": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "minLength": 1,
                          "maxLength": 100
                        }
                      }
                    }
                  },
                  "revision": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "context_revision": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "default_gateway_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "legacy_gateway_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "minLength": 1,
                    "maxLength": 100
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/me/merchants/{id}/gateways/{gateway}": {
      "get": {
        "tags": [
          "merchant_config"
        ],
        "summary": "GET /api/me/merchants/:id/gateways/:gateway",
        "operationId": "get_api_me_merchants_id_gateways_gateway",
        "responses": {
          "200": {
            "description": "Owned authoritative sanitized result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "revision",
                    "gateway"
                  ],
                  "properties": {
                    "revision": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128
                    },
                    "gateway": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "id",
                        "name",
                        "slug",
                        "type",
                        "enabled_intent",
                        "priority",
                        "upstream_base_url",
                        "description",
                        "metadata",
                        "chains",
                        "payment_assets",
                        "resources",
                        "origin_secret_set",
                        "readiness"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 80
                        },
                        "slug": {
                          "type": "string",
                          "pattern": "^[a-z0-9][a-z0-9-]{2,39}$"
                        },
                        "type": {
                          "type": "string",
                          "const": "hosted_x402"
                        },
                        "enabled_intent": {
                          "type": "boolean"
                        },
                        "priority": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 1000
                        },
                        "upstream_base_url": {
                          "type": "string",
                          "format": "uri",
                          "maxLength": 2048
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 500
                        },
                        "metadata": {
                          "type": "object",
                          "maxProperties": 10,
                          "propertyNames": {
                            "minLength": 1,
                            "maxLength": 40
                          },
                          "additionalProperties": {
                            "type": "string",
                            "maxLength": 200
                          }
                        },
                        "chains": {
                          "type": "array",
                          "uniqueItems": true,
                          "items": {
                            "type": "string"
                          }
                        },
                        "payment_assets": {
                          "type": "array",
                          "uniqueItems": true,
                          "items": {
                            "type": "string"
                          }
                        },
                        "resources": {
                          "type": "array",
                          "maxItems": 500,
                          "items": {
                            "type": "object",
                            "additionalProperties": false,
                            "required": [
                              "id",
                              "route_pattern",
                              "type"
                            ],
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 100
                              },
                              "route_pattern": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 200
                              },
                              "type": {
                                "type": "string",
                                "enum": [
                                  "page",
                                  "api",
                                  "dataset",
                                  "mcp_tool",
                                  "product"
                                ]
                              },
                              "name": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "maxLength": 60
                              },
                              "description": {
                                "type": "string",
                                "maxLength": 500
                              },
                              "active": {
                                "type": "boolean"
                              },
                              "paywall_enabled": {
                                "type": "boolean"
                              },
                              "currency": {
                                "const": "USD",
                                "type": "string"
                              },
                              "billing_unit": {
                                "const": "request",
                                "type": "string"
                              },
                              "unit_weight": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 100000
                              },
                              "price_usd": {
                                "type": "string",
                                "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,6})?$"
                              },
                              "tier": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "enum": [
                                  "standard",
                                  "complex",
                                  "premium",
                                  null
                                ]
                              },
                              "chains": {
                                "type": "array",
                                "uniqueItems": true,
                                "items": {
                                  "type": "string"
                                }
                              },
                              "payment_assets": {
                                "type": "array",
                                "uniqueItems": true,
                                "items": {
                                  "type": "string"
                                }
                              },
                              "daily_unit_limit": {
                                "type": [
                                  "integer",
                                  "null"
                                ],
                                "minimum": 1,
                                "maximum": 100000000
                              },
                              "fallback_gateway_id": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "minLength": 1,
                                "maxLength": 100
                              }
                            }
                          }
                        },
                        "origin_secret_set": {
                          "type": "boolean"
                        },
                        "readiness": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "ready",
                            "state"
                          ],
                          "properties": {
                            "ready": {
                              "type": "boolean"
                            },
                            "reason": {
                              "type": "string"
                            },
                            "state": {
                              "type": "string",
                              "enum": [
                                "PENDING_DNS",
                                "DNS_VALID",
                                "DNS_INVALID",
                                "REMOVED"
                              ]
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "401": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "description": "Absent or not currently owned; generic existence-safe response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "409": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "413": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "429": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "503": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          },
          {
            "name": "gateway",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "description": "Owned configuration control-plane. Fresh ownership, Cache-Control no-store. Strict raw UTF8 JSON <=1MiB/depth12/duplicate and unknown keys rejected. Preview does not probe DNS/HTTP. Atomic marker publication; ambiguous completion resolves by idempotency/owned operation lookup. No settlement/network activation."
      },
      "patch": {
        "tags": [
          "merchant_config"
        ],
        "summary": "PATCH /api/me/merchants/:id/gateways/:gateway",
        "operationId": "patch_api_me_merchants_id_gateways_gateway",
        "responses": {
          "200": {
            "description": "Owned authoritative sanitized result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigCommitted"
                }
              }
            }
          },
          "400": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "401": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "description": "Absent or not currently owned; generic existence-safe response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "409": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "413": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "429": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "503": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          },
          {
            "name": "gateway",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "description": "Owned configuration control-plane. Fresh ownership, Cache-Control no-store. Strict raw UTF8 JSON <=1MiB/depth12/duplicate and unknown keys rejected. Preview does not probe DNS/HTTP. Atomic marker publication; ambiguous completion resolves by idempotency/owned operation lookup. No settlement/network activation.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "revision",
                  "context_revision"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "slug": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9-]{2,39}$"
                  },
                  "type": {
                    "type": "string",
                    "const": "hosted_x402"
                  },
                  "enabled_intent": {
                    "type": "boolean"
                  },
                  "priority": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1000
                  },
                  "upstream_base_url": {
                    "type": "string",
                    "format": "uri",
                    "maxLength": 2048
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "metadata": {
                    "type": "object",
                    "maxProperties": 10,
                    "propertyNames": {
                      "minLength": 1,
                      "maxLength": 40
                    },
                    "additionalProperties": {
                      "type": "string",
                      "maxLength": 200
                    }
                  },
                  "chains": {
                    "type": "array",
                    "uniqueItems": true,
                    "items": {
                      "type": "string"
                    }
                  },
                  "payment_assets": {
                    "type": "array",
                    "uniqueItems": true,
                    "items": {
                      "type": "string"
                    }
                  },
                  "resources": {
                    "type": "array",
                    "maxItems": 500,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "id",
                        "route_pattern",
                        "type"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "route_pattern": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 200
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "page",
                            "api",
                            "dataset",
                            "mcp_tool",
                            "product"
                          ]
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 60
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 500
                        },
                        "active": {
                          "type": "boolean"
                        },
                        "paywall_enabled": {
                          "type": "boolean"
                        },
                        "currency": {
                          "const": "USD",
                          "type": "string"
                        },
                        "billing_unit": {
                          "const": "request",
                          "type": "string"
                        },
                        "unit_weight": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 100000
                        },
                        "price_usd": {
                          "type": "string",
                          "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,6})?$"
                        },
                        "tier": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "enum": [
                            "standard",
                            "complex",
                            "premium",
                            null
                          ]
                        },
                        "chains": {
                          "type": "array",
                          "uniqueItems": true,
                          "items": {
                            "type": "string"
                          }
                        },
                        "payment_assets": {
                          "type": "array",
                          "uniqueItems": true,
                          "items": {
                            "type": "string"
                          }
                        },
                        "daily_unit_limit": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "minimum": 1,
                          "maximum": 100000000
                        },
                        "fallback_gateway_id": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "minLength": 1,
                          "maxLength": 100
                        }
                      }
                    }
                  },
                  "revision": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "context_revision": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "default_gateway_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "legacy_gateway_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "minLength": 1,
                    "maxLength": 100
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "merchant_config"
        ],
        "summary": "DELETE /api/me/merchants/:id/gateways/:gateway",
        "operationId": "delete_api_me_merchants_id_gateways_gateway",
        "responses": {
          "200": {
            "description": "Owned authoritative sanitized result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigCommitted"
                }
              }
            }
          },
          "400": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "401": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "description": "Absent or not currently owned; generic existence-safe response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "409": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "413": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "429": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "503": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          },
          {
            "name": "gateway",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "description": "Owned configuration control-plane. Fresh ownership, Cache-Control no-store. Strict raw UTF8 JSON <=1MiB/depth12/duplicate and unknown keys rejected. Preview does not probe DNS/HTTP. Atomic marker publication; ambiguous completion resolves by idempotency/owned operation lookup. No settlement/network activation.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "revision",
                  "context_revision"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "slug": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9-]{2,39}$"
                  },
                  "type": {
                    "type": "string",
                    "const": "hosted_x402"
                  },
                  "enabled_intent": {
                    "type": "boolean"
                  },
                  "priority": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1000
                  },
                  "upstream_base_url": {
                    "type": "string",
                    "format": "uri",
                    "maxLength": 2048
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "metadata": {
                    "type": "object",
                    "maxProperties": 10,
                    "propertyNames": {
                      "minLength": 1,
                      "maxLength": 40
                    },
                    "additionalProperties": {
                      "type": "string",
                      "maxLength": 200
                    }
                  },
                  "chains": {
                    "type": "array",
                    "uniqueItems": true,
                    "items": {
                      "type": "string"
                    }
                  },
                  "payment_assets": {
                    "type": "array",
                    "uniqueItems": true,
                    "items": {
                      "type": "string"
                    }
                  },
                  "resources": {
                    "type": "array",
                    "maxItems": 500,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "id",
                        "route_pattern",
                        "type"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "route_pattern": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 200
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "page",
                            "api",
                            "dataset",
                            "mcp_tool",
                            "product"
                          ]
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 60
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 500
                        },
                        "active": {
                          "type": "boolean"
                        },
                        "paywall_enabled": {
                          "type": "boolean"
                        },
                        "currency": {
                          "const": "USD",
                          "type": "string"
                        },
                        "billing_unit": {
                          "const": "request",
                          "type": "string"
                        },
                        "unit_weight": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 100000
                        },
                        "price_usd": {
                          "type": "string",
                          "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,6})?$"
                        },
                        "tier": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "enum": [
                            "standard",
                            "complex",
                            "premium",
                            null
                          ]
                        },
                        "chains": {
                          "type": "array",
                          "uniqueItems": true,
                          "items": {
                            "type": "string"
                          }
                        },
                        "payment_assets": {
                          "type": "array",
                          "uniqueItems": true,
                          "items": {
                            "type": "string"
                          }
                        },
                        "daily_unit_limit": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "minimum": 1,
                          "maximum": 100000000
                        },
                        "fallback_gateway_id": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "minLength": 1,
                          "maxLength": 100
                        }
                      }
                    }
                  },
                  "revision": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "context_revision": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "default_gateway_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "legacy_gateway_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "minLength": 1,
                    "maxLength": 100
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/me/merchants/{id}/gateways/{gateway}/resources": {
      "get": {
        "tags": [
          "merchant_config"
        ],
        "summary": "GET /api/me/merchants/:id/gateways/:gateway/resources",
        "operationId": "get_api_me_merchants_id_gateways_gateway_resources",
        "responses": {
          "200": {
            "description": "Owned authoritative sanitized result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "revision",
                    "resources"
                  ],
                  "properties": {
                    "revision": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128
                    },
                    "resources": {
                      "type": "array",
                      "maxItems": 500,
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "id",
                          "route_pattern",
                          "type"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 100
                          },
                          "route_pattern": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 200
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "page",
                              "api",
                              "dataset",
                              "mcp_tool",
                              "product"
                            ]
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 60
                          },
                          "description": {
                            "type": "string",
                            "maxLength": 500
                          },
                          "active": {
                            "type": "boolean"
                          },
                          "paywall_enabled": {
                            "type": "boolean"
                          },
                          "currency": {
                            "const": "USD",
                            "type": "string"
                          },
                          "billing_unit": {
                            "const": "request",
                            "type": "string"
                          },
                          "unit_weight": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100000
                          },
                          "price_usd": {
                            "type": "string",
                            "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,6})?$"
                          },
                          "tier": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "enum": [
                              "standard",
                              "complex",
                              "premium",
                              null
                            ]
                          },
                          "chains": {
                            "type": "array",
                            "uniqueItems": true,
                            "items": {
                              "type": "string"
                            }
                          },
                          "payment_assets": {
                            "type": "array",
                            "uniqueItems": true,
                            "items": {
                              "type": "string"
                            }
                          },
                          "daily_unit_limit": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "minimum": 1,
                            "maximum": 100000000
                          },
                          "fallback_gateway_id": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "minLength": 1,
                            "maxLength": 100
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "401": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "description": "Absent or not currently owned; generic existence-safe response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "409": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "413": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "429": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "503": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          },
          {
            "name": "gateway",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "description": "Owned configuration control-plane. Fresh ownership, Cache-Control no-store. Strict raw UTF8 JSON <=1MiB/depth12/duplicate and unknown keys rejected. Preview does not probe DNS/HTTP. Atomic marker publication; ambiguous completion resolves by idempotency/owned operation lookup. No settlement/network activation."
      },
      "post": {
        "tags": [
          "merchant_config"
        ],
        "summary": "POST /api/me/merchants/:id/gateways/:gateway/resources",
        "operationId": "post_api_me_merchants_id_gateways_gateway_resources",
        "responses": {
          "201": {
            "description": "Owned authoritative sanitized result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigCommitted"
                }
              }
            }
          },
          "400": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "401": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "description": "Absent or not currently owned; generic existence-safe response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "409": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "413": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "429": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "503": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          },
          {
            "name": "gateway",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "description": "Owned configuration control-plane. Fresh ownership, Cache-Control no-store. Strict raw UTF8 JSON <=1MiB/depth12/duplicate and unknown keys rejected. Preview does not probe DNS/HTTP. Atomic marker publication; ambiguous completion resolves by idempotency/owned operation lookup. No settlement/network activation.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "revision",
                  "context_revision",
                  "route_pattern",
                  "type"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "route_pattern": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "page",
                      "api",
                      "dataset",
                      "mcp_tool",
                      "product"
                    ]
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 60
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "active": {
                    "type": "boolean"
                  },
                  "paywall_enabled": {
                    "type": "boolean"
                  },
                  "currency": {
                    "const": "USD",
                    "type": "string"
                  },
                  "billing_unit": {
                    "const": "request",
                    "type": "string"
                  },
                  "unit_weight": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100000
                  },
                  "price_usd": {
                    "type": "string",
                    "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,6})?$"
                  },
                  "tier": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "standard",
                      "complex",
                      "premium",
                      null
                    ]
                  },
                  "chains": {
                    "type": "array",
                    "uniqueItems": true,
                    "items": {
                      "type": "string"
                    }
                  },
                  "payment_assets": {
                    "type": "array",
                    "uniqueItems": true,
                    "items": {
                      "type": "string"
                    }
                  },
                  "daily_unit_limit": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 1,
                    "maximum": 100000000
                  },
                  "fallback_gateway_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "revision": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "context_revision": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/me/merchants/{id}/gateways/{gateway}/resources/{resource}": {
      "get": {
        "tags": [
          "merchant_config"
        ],
        "summary": "GET /api/me/merchants/:id/gateways/:gateway/resources/:resource",
        "operationId": "get_api_me_merchants_id_gateways_gateway_resources_resource",
        "responses": {
          "200": {
            "description": "Owned authoritative sanitized result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "revision",
                    "resource"
                  ],
                  "properties": {
                    "revision": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128
                    },
                    "resource": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "id",
                        "route_pattern",
                        "type"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "route_pattern": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 200
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "page",
                            "api",
                            "dataset",
                            "mcp_tool",
                            "product"
                          ]
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "maxLength": 60
                        },
                        "description": {
                          "type": "string",
                          "maxLength": 500
                        },
                        "active": {
                          "type": "boolean"
                        },
                        "paywall_enabled": {
                          "type": "boolean"
                        },
                        "currency": {
                          "const": "USD",
                          "type": "string"
                        },
                        "billing_unit": {
                          "const": "request",
                          "type": "string"
                        },
                        "unit_weight": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 100000
                        },
                        "price_usd": {
                          "type": "string",
                          "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,6})?$"
                        },
                        "tier": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "enum": [
                            "standard",
                            "complex",
                            "premium",
                            null
                          ]
                        },
                        "chains": {
                          "type": "array",
                          "uniqueItems": true,
                          "items": {
                            "type": "string"
                          }
                        },
                        "payment_assets": {
                          "type": "array",
                          "uniqueItems": true,
                          "items": {
                            "type": "string"
                          }
                        },
                        "daily_unit_limit": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "minimum": 1,
                          "maximum": 100000000
                        },
                        "fallback_gateway_id": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "minLength": 1,
                          "maxLength": 100
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "401": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "description": "Absent or not currently owned; generic existence-safe response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "409": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "413": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "429": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "503": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          },
          {
            "name": "gateway",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resource",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "description": "Owned configuration control-plane. Fresh ownership, Cache-Control no-store. Strict raw UTF8 JSON <=1MiB/depth12/duplicate and unknown keys rejected. Preview does not probe DNS/HTTP. Atomic marker publication; ambiguous completion resolves by idempotency/owned operation lookup. No settlement/network activation."
      },
      "patch": {
        "tags": [
          "merchant_config"
        ],
        "summary": "PATCH /api/me/merchants/:id/gateways/:gateway/resources/:resource",
        "operationId": "patch_api_me_merchants_id_gateways_gateway_resources_resource",
        "responses": {
          "200": {
            "description": "Owned authoritative sanitized result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigCommitted"
                }
              }
            }
          },
          "400": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "401": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "description": "Absent or not currently owned; generic existence-safe response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "409": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "413": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "429": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "503": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          },
          {
            "name": "gateway",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resource",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "description": "Owned configuration control-plane. Fresh ownership, Cache-Control no-store. Strict raw UTF8 JSON <=1MiB/depth12/duplicate and unknown keys rejected. Preview does not probe DNS/HTTP. Atomic marker publication; ambiguous completion resolves by idempotency/owned operation lookup. No settlement/network activation.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "revision",
                  "context_revision"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "route_pattern": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "page",
                      "api",
                      "dataset",
                      "mcp_tool",
                      "product"
                    ]
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 60
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "active": {
                    "type": "boolean"
                  },
                  "paywall_enabled": {
                    "type": "boolean"
                  },
                  "currency": {
                    "const": "USD",
                    "type": "string"
                  },
                  "billing_unit": {
                    "const": "request",
                    "type": "string"
                  },
                  "unit_weight": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100000
                  },
                  "price_usd": {
                    "type": "string",
                    "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,6})?$"
                  },
                  "tier": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "standard",
                      "complex",
                      "premium",
                      null
                    ]
                  },
                  "chains": {
                    "type": "array",
                    "uniqueItems": true,
                    "items": {
                      "type": "string"
                    }
                  },
                  "payment_assets": {
                    "type": "array",
                    "uniqueItems": true,
                    "items": {
                      "type": "string"
                    }
                  },
                  "daily_unit_limit": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 1,
                    "maximum": 100000000
                  },
                  "fallback_gateway_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "revision": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "context_revision": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "merchant_config"
        ],
        "summary": "DELETE /api/me/merchants/:id/gateways/:gateway/resources/:resource",
        "operationId": "delete_api_me_merchants_id_gateways_gateway_resources_resource",
        "responses": {
          "200": {
            "description": "Owned authoritative sanitized result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigCommitted"
                }
              }
            }
          },
          "400": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "401": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "description": "Absent or not currently owned; generic existence-safe response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "409": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "413": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "429": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "503": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          },
          {
            "name": "gateway",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resource",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "description": "Owned configuration control-plane. Fresh ownership, Cache-Control no-store. Strict raw UTF8 JSON <=1MiB/depth12/duplicate and unknown keys rejected. Preview does not probe DNS/HTTP. Atomic marker publication; ambiguous completion resolves by idempotency/owned operation lookup. No settlement/network activation.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "revision",
                  "context_revision"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "route_pattern": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "page",
                      "api",
                      "dataset",
                      "mcp_tool",
                      "product"
                    ]
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 60
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "active": {
                    "type": "boolean"
                  },
                  "paywall_enabled": {
                    "type": "boolean"
                  },
                  "currency": {
                    "const": "USD",
                    "type": "string"
                  },
                  "billing_unit": {
                    "const": "request",
                    "type": "string"
                  },
                  "unit_weight": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100000
                  },
                  "price_usd": {
                    "type": "string",
                    "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,6})?$"
                  },
                  "tier": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "standard",
                      "complex",
                      "premium",
                      null
                    ]
                  },
                  "chains": {
                    "type": "array",
                    "uniqueItems": true,
                    "items": {
                      "type": "string"
                    }
                  },
                  "payment_assets": {
                    "type": "array",
                    "uniqueItems": true,
                    "items": {
                      "type": "string"
                    }
                  },
                  "daily_unit_limit": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 1,
                    "maximum": 100000000
                  },
                  "fallback_gateway_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "revision": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "context_revision": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/me/sites/batches/preview": {
      "post": {
        "tags": [
          "merchant_config"
        ],
        "summary": "POST /api/me/sites/batches/preview",
        "operationId": "post_api_me_sites_batches_preview",
        "responses": {
          "200": {
            "description": "Owned authoritative sanitized result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantSiteBatchPreview"
                }
              }
            }
          },
          "400": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "401": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "description": "Absent or not currently owned; generic existence-safe response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "409": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "413": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "429": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "503": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "description": "Owned configuration control-plane. Fresh ownership, Cache-Control no-store. Strict raw UTF8 JSON <=1MiB/depth12/duplicate and unknown keys rejected. Preview does not probe DNS/HTTP. Atomic marker publication; ambiguous completion resolves by idempotency/owned operation lookup. No settlement/network activation.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MerchantSiteBatch"
              }
            }
          }
        }
      }
    },
    "/api/me/sites/batches/confirm": {
      "post": {
        "tags": [
          "merchant_config"
        ],
        "summary": "POST /api/me/sites/batches/confirm",
        "operationId": "post_api_me_sites_batches_confirm",
        "responses": {
          "201": {
            "description": "Owned authoritative sanitized result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantSiteBatchCommitted"
                }
              }
            }
          },
          "400": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "401": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "description": "Absent or not currently owned; generic existence-safe response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "409": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "413": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "429": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "503": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "description": "Owned configuration control-plane. Fresh ownership, Cache-Control no-store. Strict raw UTF8 JSON <=1MiB/depth12/duplicate and unknown keys rejected. Preview does not probe DNS/HTTP. Atomic marker publication; ambiguous completion resolves by idempotency/owned operation lookup. No settlement/network activation.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MerchantConfigConfirmation"
              }
            }
          }
        }
      }
    },
    "/api/me/config-operations/{operation}": {
      "get": {
        "tags": [
          "merchant_config"
        ],
        "summary": "GET /api/me/config-operations/:operation",
        "operationId": "get_api_me_config-operations_operation",
        "responses": {
          "200": {
            "description": "Owned authoritative sanitized result.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/MerchantConfigCommitted"
                    },
                    {
                      "$ref": "#/components/schemas/MerchantSiteBatchCommitted"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "401": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "description": "Absent or not currently owned; generic existence-safe response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "409": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "413": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "429": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "503": {
            "description": "Safe failure without partial active configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantConfigError"
                }
              }
            }
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "userSession": []
          }
        ],
        "parameters": [
          {
            "name": "operation",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "description": "Owned configuration control-plane. Fresh ownership, Cache-Control no-store. Strict raw UTF8 JSON <=1MiB/depth12/duplicate and unknown keys rejected. Preview does not probe DNS/HTTP. Atomic marker publication; ambiguous completion resolves by idempotency/owned operation lookup. No settlement/network activation."
      }
    },
    "/api/network/settlements": {
      "get": {
        "tags": [
          "network_agents"
        ],
        "summary": "GET /api/network/settlements",
        "operationId": "get_api_network_settlements",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "x-rate-limits": [
          {
            "middleware": "readLimiter",
            "note": "per-IP read rate-limit on /api/network/*"
          }
        ]
      }
    },
    "/api/network/stats": {
      "get": {
        "tags": [
          "network_agents"
        ],
        "summary": "GET /api/network/stats",
        "operationId": "get_api_network_stats",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "x-rate-limits": [
          {
            "middleware": "readLimiter",
            "note": "per-IP read rate-limit on /api/network/*"
          }
        ]
      }
    },
    "/api/network/marketplace": {
      "get": {
        "tags": [
          "network_agents"
        ],
        "summary": "GET /api/network/marketplace",
        "operationId": "get_api_network_marketplace",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "x-rate-limits": [
          {
            "middleware": "readLimiter",
            "note": "per-IP read rate-limit on /api/network/*"
          }
        ]
      }
    },
    "/api/network/status": {
      "get": {
        "tags": [
          "network_agents"
        ],
        "summary": "GET /api/network/status",
        "operationId": "get_api_network_status",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "x-rate-limits": [
          {
            "middleware": "readLimiter",
            "note": "per-IP read rate-limit on /api/network/*"
          }
        ]
      }
    },
    "/api/network/nonce": {
      "get": {
        "tags": [
          "network_agents"
        ],
        "summary": "GET /api/network/nonce",
        "operationId": "get_api_network_nonce",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "x-rate-limits": [
          {
            "middleware": "readLimiter",
            "note": "per-IP read rate-limit on /api/network/*"
          }
        ]
      }
    },
    "/api/network/agents": {
      "get": {
        "tags": [
          "network_agents"
        ],
        "summary": "GET /api/network/agents",
        "operationId": "get_api_network_agents",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "x-rate-limits": [
          {
            "middleware": "readLimiter",
            "note": "per-IP read rate-limit on /api/network/*"
          }
        ]
      }
    },
    "/api/network/agents/{address}": {
      "get": {
        "tags": [
          "network_agents"
        ],
        "summary": "GET /api/network/agents/:address",
        "operationId": "get_api_network_agents_address",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Agent's on-chain address (EVM or Solana)"
            }
          }
        ],
        "x-rate-limits": [
          {
            "middleware": "readLimiter",
            "note": "per-IP read rate-limit on /api/network/*"
          }
        ]
      }
    },
    "/api/network/agents/{address}/publish": {
      "post": {
        "tags": [
          "network_agents"
        ],
        "summary": "POST /api/network/agents/:address/publish",
        "operationId": "post_api_network_agents_address_publish",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Agent's on-chain address (EVM or Solana)"
            }
          }
        ],
        "x-rate-limits": [
          {
            "middleware": "writeLimiter",
            "note": "per-IP write rate-limit on /api/network/*"
          }
        ]
      }
    },
    "/api/network/agents/{address}/unpublish": {
      "post": {
        "tags": [
          "network_agents"
        ],
        "summary": "POST /api/network/agents/:address/unpublish",
        "operationId": "post_api_network_agents_address_unpublish",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Agent's on-chain address (EVM or Solana)"
            }
          }
        ],
        "x-rate-limits": [
          {
            "middleware": "writeLimiter",
            "note": "per-IP write rate-limit on /api/network/*"
          }
        ]
      }
    },
    "/api/network-stats": {
      "get": {
        "tags": [
          "network_stats"
        ],
        "summary": "GET /api/network-stats",
        "operationId": "get_api_network-stats",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/price/native": {
      "get": {
        "tags": [
          "network_stats"
        ],
        "summary": "GET /api/price/native",
        "operationId": "get_api_price_native",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/auth/providers": {
      "get": {
        "tags": [
          "oauth"
        ],
        "summary": "GET /api/auth/providers",
        "operationId": "get_api_auth_providers",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/auth/oauth/{provider}/start": {
      "get": {
        "tags": [
          "oauth"
        ],
        "summary": "GET /api/auth/oauth/:provider/start",
        "operationId": "get_api_auth_oauth_provider_start",
        "responses": {
          "302": {
            "description": "Redirect",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string",
                  "description": "Target URL"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/auth/oauth/{provider}/callback": {
      "get": {
        "tags": [
          "oauth"
        ],
        "summary": "GET /api/auth/oauth/:provider/callback",
        "operationId": "get_api_auth_oauth_provider_callback",
        "responses": {
          "302": {
            "description": "Redirect",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string",
                  "description": "Target URL"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/partners/me/agents": {
      "post": {
        "tags": [
          "partner_agents"
        ],
        "summary": "POST /api/partners/me/agents",
        "operationId": "post_api_partners_me_agents",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "partnerSession": []
          }
        ]
      },
      "get": {
        "tags": [
          "partner_agents"
        ],
        "summary": "GET /api/partners/me/agents",
        "operationId": "get_api_partners_me_agents",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "partnerSession": []
          }
        ]
      }
    },
    "/api/partners/me/agents/{address}": {
      "get": {
        "tags": [
          "partner_agents"
        ],
        "summary": "GET /api/partners/me/agents/:address",
        "operationId": "get_api_partners_me_agents_address",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "partnerSession": []
          }
        ],
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Agent's on-chain address (EVM or Solana)"
            }
          }
        ]
      },
      "patch": {
        "tags": [
          "partner_agents"
        ],
        "summary": "PATCH /api/partners/me/agents/:address",
        "operationId": "patch_api_partners_me_agents_address",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "partnerSession": []
          }
        ],
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Agent's on-chain address (EVM or Solana)"
            }
          }
        ]
      },
      "delete": {
        "tags": [
          "partner_agents"
        ],
        "summary": "DELETE /api/partners/me/agents/:address",
        "operationId": "delete_api_partners_me_agents_address",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "partnerSession": []
          }
        ],
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Agent's on-chain address (EVM or Solana)"
            }
          }
        ]
      }
    },
    "/api/partners/applications": {
      "post": {
        "tags": [
          "partner_applications"
        ],
        "summary": "POST /api/partners/applications",
        "operationId": "post_api_partners_applications",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "text/plain": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "x-rate-limits": [
          {
            "middleware": "partnerAuthLimiter",
            "note": "login rate-limit on partner auth endpoints"
          }
        ]
      }
    },
    "/api/partners/applications/{id}": {
      "get": {
        "tags": [
          "partner_applications"
        ],
        "summary": "GET /api/partners/applications/:id",
        "operationId": "get_api_partners_applications_id",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/admin/applications": {
      "get": {
        "tags": [
          "partner_applications"
        ],
        "summary": "GET /api/admin/applications",
        "operationId": "get_api_admin_applications",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ]
      }
    },
    "/api/admin/applications/{id}": {
      "patch": {
        "tags": [
          "partner_applications"
        ],
        "summary": "PATCH /api/admin/applications/:id",
        "operationId": "patch_api_admin_applications_id",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/admin/applications/{id}/approve-and-deploy": {
      "post": {
        "tags": [
          "partner_applications"
        ],
        "summary": "POST /api/admin/applications/:id/approve-and-deploy",
        "operationId": "post_api_admin_applications_id_approve-and-deploy",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/partners/auth/register": {
      "post": {
        "tags": [
          "partner_auth"
        ],
        "summary": "POST /api/partners/auth/register",
        "operationId": "post_api_partners_auth_register",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "x-rate-limits": [
          {
            "middleware": "partnerRegisterLimiter",
            "note": "registration rate-limit on /api/partners/auth/register"
          }
        ]
      }
    },
    "/api/partners/me/profile": {
      "patch": {
        "tags": [
          "partner_auth"
        ],
        "summary": "PATCH /api/partners/me/profile",
        "operationId": "patch_api_partners_me_profile",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "partnerSession": []
          }
        ]
      }
    },
    "/api/partners/auth/login": {
      "post": {
        "tags": [
          "partner_auth"
        ],
        "summary": "POST /api/partners/auth/login",
        "operationId": "post_api_partners_auth_login",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "x-rate-limits": [
          {
            "middleware": "partnerAuthLimiter",
            "note": "login rate-limit on partner auth endpoints"
          }
        ]
      }
    },
    "/api/partners/auth/logout": {
      "post": {
        "tags": [
          "partner_auth"
        ],
        "summary": "POST /api/partners/auth/logout",
        "operationId": "post_api_partners_auth_logout",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/partners/auth/me": {
      "get": {
        "tags": [
          "partner_auth"
        ],
        "summary": "GET /api/partners/auth/me",
        "operationId": "get_api_partners_auth_me",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/partners/me/summary": {
      "get": {
        "tags": [
          "partner_auth"
        ],
        "summary": "GET /api/partners/me/summary",
        "operationId": "get_api_partners_me_summary",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "partnerSession": []
          }
        ]
      }
    },
    "/api/partners/me/transactions": {
      "get": {
        "tags": [
          "partner_auth"
        ],
        "summary": "GET /api/partners/me/transactions",
        "operationId": "get_api_partners_me_transactions",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "partnerSession": []
          }
        ]
      }
    },
    "/api/admin/partners": {
      "get": {
        "tags": [
          "partner_auth"
        ],
        "summary": "GET /api/admin/partners",
        "operationId": "get_api_admin_partners",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ]
      }
    },
    "/api/admin/partners/approve": {
      "post": {
        "tags": [
          "partner_auth"
        ],
        "summary": "POST /api/admin/partners/approve",
        "operationId": "post_api_admin_partners_approve",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ]
      }
    },
    "/api/admin/partners/{id}": {
      "patch": {
        "tags": [
          "partner_auth"
        ],
        "summary": "PATCH /api/admin/partners/:id",
        "operationId": "patch_api_admin_partners_id",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/feed/recent": {
      "get": {
        "tags": [
          "partners"
        ],
        "summary": "GET /api/feed/recent",
        "operationId": "get_api_feed_recent",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/partners/timeseries": {
      "get": {
        "tags": [
          "partners"
        ],
        "summary": "GET /api/partners/timeseries",
        "operationId": "get_api_partners_timeseries",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/partners/summary": {
      "get": {
        "tags": [
          "partners"
        ],
        "summary": "GET /api/partners/summary",
        "operationId": "get_api_partners_summary",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/agent/{address}/status": {
      "get": {
        "tags": [
          "passport"
        ],
        "summary": "GET /api/agent/:address/status",
        "operationId": "get_api_agent_address_status",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Agent's on-chain address (EVM or Solana)"
            }
          }
        ]
      }
    },
    "/api/passport/{pubkey}": {
      "get": {
        "tags": [
          "passport"
        ],
        "summary": "GET /api/passport/:pubkey",
        "operationId": "get_api_passport_pubkey",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "pubkey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Ed25519 public key, base58"
            }
          }
        ]
      }
    },
    "/api/passport/mint": {
      "post": {
        "tags": [
          "passport"
        ],
        "summary": "POST /api/passport/mint",
        "operationId": "post_api_passport_mint",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/stats": {
      "get": {
        "tags": [
          "protocol"
        ],
        "summary": "GET /api/stats",
        "operationId": "get_api_stats",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/protocol-docs": {
      "get": {
        "tags": [
          "protocol"
        ],
        "summary": "GET /api/protocol-docs",
        "operationId": "get_api_protocol-docs",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/providers": {
      "get": {
        "tags": [
          "providers"
        ],
        "summary": "GET /api/providers",
        "operationId": "get_api_providers",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/providers/status": {
      "get": {
        "tags": [
          "providers"
        ],
        "summary": "GET /api/providers/status",
        "operationId": "get_api_providers_status",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/registry": {
      "get": {
        "tags": [
          "providers"
        ],
        "summary": "GET /api/registry",
        "operationId": "get_api_registry",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/registry/coverage": {
      "get": {
        "tags": [
          "providers"
        ],
        "summary": "GET /api/registry/coverage",
        "operationId": "get_api_registry_coverage",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/registry/best": {
      "get": {
        "tags": [
          "providers"
        ],
        "summary": "GET /api/registry/best",
        "operationId": "get_api_registry_best",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/providers/{name}": {
      "get": {
        "tags": [
          "providers"
        ],
        "summary": "GET /api/providers/:name",
        "operationId": "get_api_providers_name",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/v2/merchants/{id}/reporting/flows": {
      "post": {
        "tags": [
          "reporting"
        ],
        "summary": "POST /v2/merchants/:id/reporting/flows",
        "operationId": "post_v2_merchants_id_reporting_flows",
        "responses": {
          "200": {
            "description": "Evidence-bound reporting response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingFlow"
                }
              }
            }
          },
          "400": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "401": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "403": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "404": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "409": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "410": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "413": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "422": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "429": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "503": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          }
        },
        "security": [
          {
            "merchantSecret": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ],
        "description": "Reporting v2: observations never authorize payments or access. Current scope and explicit coverage; no-store. Default-off operator flag; independent approval and deployment are separate.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportingFlowRequest"
              }
            }
          }
        }
      }
    },
    "/v2/merchants/{id}/gate-events": {
      "post": {
        "tags": [
          "reporting"
        ],
        "summary": "POST /v2/merchants/:id/gate-events",
        "operationId": "post_v2_merchants_id_gate-events",
        "responses": {
          "200": {
            "description": "Evidence-bound reporting response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingAck"
                }
              }
            }
          },
          "400": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "401": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "403": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "404": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "409": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "410": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "413": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "422": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "429": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "503": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          }
        },
        "security": [
          {
            "merchantSecret": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ],
        "description": "Reporting v2: observations never authorize payments or access. Current scope and explicit coverage; no-store. Default-off operator flag; independent approval and deployment are separate.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportingBatch"
              }
            }
          }
        }
      }
    },
    "/v2/merchants/{id}/reporting/health": {
      "post": {
        "tags": [
          "reporting"
        ],
        "summary": "POST /v2/merchants/:id/reporting/health",
        "operationId": "post_v2_merchants_id_reporting_health",
        "responses": {
          "200": {
            "description": "Evidence-bound reporting response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingHealthAck"
                }
              }
            }
          },
          "400": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "401": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "403": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "404": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "409": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "410": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "413": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "422": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "429": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "503": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          }
        },
        "security": [
          {
            "merchantSecret": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ],
        "description": "Reporting v2: observations never authorize payments or access. Current scope and explicit coverage; no-store. Default-off operator flag; independent approval and deployment are separate.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportingHealth"
              }
            }
          }
        }
      }
    },
    "/v2/merchants/{id}/reporting": {
      "get": {
        "tags": [
          "reporting"
        ],
        "summary": "GET /v2/merchants/:id/reporting",
        "operationId": "get_v2_merchants_id_reporting",
        "responses": {
          "200": {
            "description": "Evidence-bound reporting response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingSnapshot"
                }
              }
            }
          },
          "400": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "401": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "403": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "404": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "409": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "410": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "413": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "422": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "429": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "503": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          }
        },
        "security": [
          {
            "merchantSecret": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          },
          {
            "name": "snapshot_id",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
            }
          },
          {
            "name": "resource",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          },
          {
            "name": "channel",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "browser",
                "api",
                "unknown"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          },
          {
            "name": "network",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          },
          {
            "name": "mode",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "live",
                "test",
                "internal"
              ]
            }
          }
        ],
        "description": "Reporting v2: observations never authorize payments or access. Current scope and explicit coverage; no-store. Default-off operator flag; independent approval and deployment are separate."
      }
    },
    "/v2/reporting/observations": {
      "post": {
        "tags": [
          "reporting"
        ],
        "summary": "POST /v2/reporting/observations",
        "operationId": "post_v2_reporting_observations",
        "responses": {
          "200": {
            "description": "Evidence-bound reporting response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingAck"
                }
              }
            }
          },
          "400": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "401": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "403": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "404": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "409": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "410": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "413": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "422": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "429": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "503": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          }
        },
        "security": [
          {
            "reportingCapability": []
          }
        ],
        "description": "Reporting v2: observations never authorize payments or access. Current scope and explicit coverage; no-store. Capability is header-only; strict registered/first-party Origin checks also apply. Default-off operator flag; independent approval and deployment are separate.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportingBrowserEvent"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "description": "Exact current approved HTTPS origin; HTTPS transport also required. No credentials/wildcard."
          }
        ]
      }
    },
    "/v2/reporting/onboarding-flows": {
      "post": {
        "tags": [
          "reporting"
        ],
        "summary": "POST /v2/reporting/onboarding-flows",
        "operationId": "post_v2_reporting_onboarding-flows",
        "responses": {
          "200": {
            "description": "Evidence-bound reporting response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingFlow"
                }
              }
            }
          },
          "400": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "401": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "403": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "404": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "409": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "410": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "413": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "422": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "429": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "503": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          }
        },
        "security": [],
        "description": "Reporting v2: observations never authorize payments or access. Current scope and explicit coverage; no-store. Public mint requires approved first-party Origin and transient rate limits. Default-off operator flag; independent approval and deployment are separate.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportingOnboardingRequest"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "description": "Exact current approved HTTPS origin; HTTPS transport also required. No credentials/wildcard."
          }
        ]
      }
    },
    "/api/me/reporting/v2/snapshots": {
      "post": {
        "tags": [
          "reporting"
        ],
        "summary": "POST /api/me/reporting/v2/snapshots",
        "operationId": "post_api_me_reporting_v2_snapshots",
        "responses": {
          "200": {
            "description": "Evidence-bound reporting response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingSnapshot"
                }
              }
            }
          },
          "400": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "401": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "403": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "404": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "409": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "410": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "413": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "422": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "429": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "503": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          }
        },
        "security": [
          {
            "reportingOwnerSession": []
          }
        ],
        "description": "Reporting v2: observations never authorize payments or access. Current scope and explicit coverage; no-store. Default-off operator flag; independent approval and deployment are separate.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportingSnapshotRequest"
              }
            }
          }
        },
        "parameters": []
      }
    },
    "/api/me/reporting/v2/snapshots/{snapshot_id}.csv": {
      "get": {
        "tags": [
          "reporting"
        ],
        "summary": "GET /api/me/reporting/v2/snapshots/:snapshot_id.csv",
        "operationId": "get_api_me_reporting_v2_snapshots_snapshot_id.csv",
        "responses": {
          "200": {
            "description": "Frozen snapshot CSV, at most10000rows/10MiB; authorized before bytes. RFC4180 with formula/control-character protection.",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "AIFP-Reporting-Total-Rows": {
                "schema": {
                  "type": "string"
                },
                "required": true
              },
              "AIFP-Reporting-Exported-Rows": {
                "schema": {
                  "type": "string"
                },
                "required": true
              },
              "AIFP-Reporting-Truncated": {
                "schema": {
                  "type": "string"
                },
                "required": true
              },
              "AIFP-Reporting-As-Of": {
                "schema": {
                  "type": "string"
                },
                "required": true
              }
            }
          },
          "400": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "401": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "403": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "404": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "409": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "410": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "413": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "422": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "429": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "503": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          }
        },
        "security": [
          {
            "reportingOwnerSession": []
          }
        ],
        "parameters": [
          {
            "name": "snapshot_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "description": "Reporting v2: observations never authorize payments or access. Current scope and explicit coverage; no-store. Default-off operator flag; independent approval and deployment are separate."
      }
    },
    "/api/me/reporting/v2/snapshots/{snapshot_id}": {
      "get": {
        "tags": [
          "reporting"
        ],
        "summary": "GET /api/me/reporting/v2/snapshots/:snapshot_id",
        "operationId": "get_api_me_reporting_v2_snapshots_snapshot_id",
        "responses": {
          "200": {
            "description": "Evidence-bound reporting response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingSnapshot"
                }
              }
            }
          },
          "400": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "401": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "403": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "404": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "409": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "410": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "413": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "422": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "429": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "503": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          }
        },
        "security": [
          {
            "reportingOwnerSession": []
          }
        ],
        "parameters": [
          {
            "name": "snapshot_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          }
        ],
        "description": "Reporting v2: observations never authorize payments or access. Current scope and explicit coverage; no-store. Default-off operator flag; independent approval and deployment are separate."
      }
    },
    "/v2/reporting/identity": {
      "delete": {
        "tags": [
          "reporting"
        ],
        "summary": "DELETE /v2/reporting/identity",
        "operationId": "delete_v2_reporting_identity",
        "responses": {
          "204": {
            "description": "Idempotent erasure"
          },
          "400": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "401": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "403": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "404": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "409": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "410": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "413": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "422": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "429": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "503": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          }
        },
        "security": [
          {
            "reportingCapability": []
          }
        ],
        "description": "Reporting v2: observations never authorize payments or access. Current scope and explicit coverage; no-store. Capability is header-only; strict registered/first-party Origin checks also apply. Default-off operator flag; independent approval and deployment are separate.",
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            },
            "description": "Exact current approved HTTPS origin; HTTPS transport also required. No credentials/wildcard."
          }
        ]
      }
    },
    "/api/me/reporting/v2/identities/{identity_id}": {
      "delete": {
        "tags": [
          "reporting"
        ],
        "summary": "DELETE /api/me/reporting/v2/identities/:identity_id",
        "operationId": "delete_api_me_reporting_v2_identities_identity_id",
        "responses": {
          "204": {
            "description": "Idempotent erasure"
          },
          "400": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "401": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "403": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "404": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "409": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "410": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "413": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "422": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "429": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "503": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          }
        },
        "security": [
          {
            "reportingOwnerSession": []
          }
        ],
        "parameters": [
          {
            "name": "identity_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "merchant_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 2048
            },
            "description": "Exactly one currently owned merchant; no all-owner fallback."
          }
        ],
        "description": "Reporting v2: observations never authorize payments or access. Current scope and explicit coverage; no-store. Default-off operator flag; independent approval and deployment are separate."
      }
    },
    "/admin/api/reporting/v2": {
      "get": {
        "tags": [
          "reporting"
        ],
        "summary": "GET /admin/api/reporting/v2",
        "operationId": "get_admin_api_reporting_v2",
        "responses": {
          "200": {
            "description": "Evidence-bound reporting response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingSnapshot"
                }
              }
            }
          },
          "400": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "401": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "403": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "404": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "409": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "410": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "413": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "422": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "429": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          },
          "503": {
            "description": "Safe reporting error; no payload or credential echo",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportingError"
                }
              }
            }
          }
        },
        "security": [
          {
            "adminSession": []
          }
        ],
        "description": "Reporting v2: observations never authorize payments or access. Current scope and explicit coverage; no-store. Default-off operator flag; independent approval and deployment are separate. Admin role only; aggregate-only response with no evidence rows or cursor.",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
            }
          },
          {
            "name": "mode",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "live",
                "test",
                "internal"
              ]
            }
          }
        ]
      }
    },
    "/api/seat/{pubkey}": {
      "get": {
        "tags": [
          "seats"
        ],
        "summary": "GET /api/seat/:pubkey",
        "operationId": "get_api_seat_pubkey",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "pubkey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Ed25519 public key, base58"
            }
          }
        ]
      }
    },
    "/api/seat-status": {
      "post": {
        "tags": [
          "seats"
        ],
        "summary": "POST /api/seat-status",
        "operationId": "post_api_seat-status",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/leaderboard": {
      "get": {
        "tags": [
          "seats"
        ],
        "summary": "GET /api/leaderboard",
        "operationId": "get_api_leaderboard",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/v1/settlement/routes": {
      "get": {
        "tags": [
          "settlement"
        ],
        "summary": "List configured v1.3 settlement routes",
        "operationId": "get_v1_settlement_routes",
        "responses": {
          "200": {
            "description": "Configured routes; no settlement is enabled by this request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "routes"
                  ],
                  "properties": {
                    "routes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "route_class",
                          "profile",
                          "network",
                          "chain_id",
                          "testnet",
                          "name",
                          "native_asset",
                          "stable_assets",
                          "explorer",
                          "live",
                          "splitter",
                          "splitter_version",
                          "runtime_code_hash"
                        ],
                        "properties": {
                          "route_class": {
                            "type": "string",
                            "enum": [
                              "AIFP-1",
                              "AIFP-2"
                            ]
                          },
                          "profile": {
                            "type": "object",
                            "required": [
                              "route_class",
                              "settlement_semantics",
                              "treasury_bps",
                              "creator_bps",
                              "fee_on_top",
                              "required_splitter_version"
                            ],
                            "properties": {
                              "route_class": {
                                "type": "string",
                                "enum": [
                                  "AIFP-1",
                                  "AIFP-2"
                                ]
                              },
                              "settlement_semantics": {
                                "type": "string",
                                "const": "gross-inclusive"
                              },
                              "treasury_bps": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 10000
                              },
                              "creator_bps": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 10000
                              },
                              "fee_on_top": {
                                "type": "boolean",
                                "const": false
                              },
                              "required_splitter_version": {
                                "type": "string",
                                "const": "1.3"
                              }
                            }
                          },
                          "network": {
                            "type": "string"
                          },
                          "chain_id": {
                            "type": "integer"
                          },
                          "testnet": {
                            "type": "boolean",
                            "description": "True only for a canonical test network. Testnet settlement additionally requires explicit server dev mode."
                          },
                          "name": {
                            "type": "string"
                          },
                          "native_asset": {
                            "type": "string"
                          },
                          "stable_assets": {
                            "type": "object",
                            "additionalProperties": {
                              "type": "object",
                              "required": [
                                "address",
                                "decimals",
                                "issuer"
                              ],
                              "properties": {
                                "address": {
                                  "type": "string",
                                  "pattern": "^0x[0-9a-fA-F]{40}$"
                                },
                                "decimals": {
                                  "type": "integer",
                                  "const": 6
                                },
                                "issuer": {
                                  "type": "string"
                                }
                              }
                            }
                          },
                          "explorer": {
                            "type": "string",
                            "format": "uri"
                          },
                          "live": {
                            "type": "boolean",
                            "description": "Configured availability, including the registry flag, supersession and validity window. Not an RPC health or deployment attestation."
                          },
                          "splitter": {
                            "type": "string",
                            "pattern": "^0x[0-9a-fA-F]{40}$"
                          },
                          "splitter_version": {
                            "type": "string",
                            "const": "1.3"
                          },
                          "runtime_code_hash": {
                            "type": "string",
                            "pattern": "^0x[0-9a-fA-F]{64}$"
                          },
                          "disabled_reason": {
                            "type": "string",
                            "description": "Present when live is false."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "description": "Read-only registry discovery. Disabled routes remain visible with live=false and disabled_reason. Callers must independently verify the route before signing.",
        "parameters": [
          {
            "name": "route_class",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "AIFP-1",
                "AIFP-2"
              ]
            }
          }
        ]
      }
    },
    "/v1/settlement/invoice": {
      "post": {
        "tags": [
          "settlement"
        ],
        "summary": "Build a gross-inclusive v1.3 settlement instruction",
        "operationId": "post_v1_settlement_invoice",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "409": {
            "description": "Route is disabled, superseded, outside its validity window, unknown or not v1.3.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AifpError"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [],
        "description": "Requires a currently enabled canonical route. Rejects unknown assets, zero payout addresses, oversized orders and invalid expiry before returning calldata. The caller signs and submits from its own wallet.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "route_class",
                  "chain",
                  "asset",
                  "gross_amount",
                  "order_id"
                ],
                "anyOf": [
                  {
                    "required": [
                      "merchant_wallet"
                    ]
                  },
                  {
                    "required": [
                      "provider_wallet"
                    ]
                  }
                ],
                "properties": {
                  "route_class": {
                    "type": "string",
                    "enum": [
                      "AIFP-1",
                      "AIFP-2"
                    ]
                  },
                  "chain": {
                    "type": "string",
                    "description": "network returned by GET /v1/settlement/routes"
                  },
                  "asset": {
                    "type": "string",
                    "description": "The route's native_asset or one of its stable_assets keys; case insensitive."
                  },
                  "gross_amount": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]{0,77}$",
                    "description": "Positive decimal uint256 in atomic units, at most 2^256-1. Includes the protocol fee."
                  },
                  "merchant_wallet": {
                    "type": "string",
                    "pattern": "^0x(?!0{40}$)[0-9a-fA-F]{40}$"
                  },
                  "provider_wallet": {
                    "type": "string",
                    "pattern": "^0x(?!0{40}$)[0-9a-fA-F]{40}$"
                  },
                  "order_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256,
                    "description": "Nonblank, at most 256 UTF-8 bytes. Bytes are validated separately from character length."
                  },
                  "valid_until": {
                    "type": "integer",
                    "description": "Unix seconds, greater than the server's current time and no more than 1200 seconds ahead. Omit for 900 seconds; null is invalid."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/webhooks/events": {
      "get": {
        "tags": [
          "webhooks"
        ],
        "summary": "GET /api/webhooks/events",
        "operationId": "get_api_webhooks_events",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": []
      }
    },
    "/api/webhooks": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "summary": "POST /api/webhooks",
        "operationId": "post_api_webhooks",
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "text/plain": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "x402Payment": []
          }
        ]
      },
      "get": {
        "tags": [
          "webhooks"
        ],
        "summary": "GET /api/webhooks",
        "operationId": "get_api_webhooks",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "x402Payment": []
          }
        ]
      }
    },
    "/api/webhooks/{id}": {
      "delete": {
        "tags": [
          "webhooks"
        ],
        "summary": "DELETE /api/webhooks/:id",
        "operationId": "delete_api_webhooks_id",
        "responses": {
          "204": {
            "description": "Successful response",
            "content": {
              "text/plain": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "x402Payment": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    },
    "/api/webhooks/{id}/test": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "summary": "POST /api/webhooks/:id/test",
        "operationId": "post_api_webhooks_id_test",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AifpError"
          },
          "401": {
            "$ref": "#/components/responses/AifpError"
          },
          "403": {
            "$ref": "#/components/responses/AifpError"
          },
          "404": {
            "$ref": "#/components/responses/AifpError"
          },
          "429": {
            "$ref": "#/components/responses/AifpError"
          },
          "5XX": {
            "$ref": "#/components/responses/AifpError"
          }
        },
        "security": [
          {
            "x402Payment": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Server-issued identifier"
            }
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "reportingCapability": {
        "type": "apiKey",
        "in": "header",
        "name": "AIFP-Reporting-Token",
        "description": "Observation/identity-removal capability only; no spending, access or ownership authority."
      },
      "reportingOwnerSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__aifinpay_user_session",
        "description": "Existing owner session, current tenant/site and session-epoch validation. Browser writes also require CSRF Origin checks."
      },
      "agentEd25519": {
        "type": "apiKey",
        "in": "header",
        "name": "x-agent-pubkey",
        "description": "Ed25519-signed native-auth v2 request. Companion headers: x-nonce, x-signature, x-aifinpay-auth-version. The proof binds canonical origin, method, resource, body hash, and expiry. GET /nonce provides migration diagnostics only; start with an unauthenticated request to receive a v2 challenge."
      },
      "x402Payment": {
        "type": "apiKey",
        "in": "header",
        "name": "X-PAYMENT-RESPONSE",
        "description": "x402 payment proof, base64 JSON envelope. Issued by the paying agent's wallet after broadcasting the on-chain tx. See /.well-known/x402.json."
      },
      "userSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "aifinpay_session",
        "description": "Browser session cookie for /api/me/* — sameSite=Lax, CSRF-guarded."
      },
      "agentClaim": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__aifinpay_agent_claim",
        "description": "Set by redeeming a one-time claim link (POST /api/me/claim-url). Valid 10 minutes, accepted only by /api/me/agents/challenge and /api/me/agents/claim."
      },
      "adminSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "aifinpay_admin_session",
        "description": "Admin session cookie. ADMIN_ALLOWED_IPS allowlist in effect."
      },
      "partnerSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "aifinpay_partner_session",
        "description": "Partner session cookie for /api/partners/me/*."
      },
      "merchantSecret": {
        "type": "apiKey",
        "in": "header",
        "name": "AIFP-Merchant-Secret",
        "description": "Per-merchant API key for /v1/merchants/* writes."
      },
      "ingestHmac": {
        "type": "apiKey",
        "in": "header",
        "name": "x-ingest-signature",
        "description": "HMAC signature for /api/internal/* and /api/telemetry."
      }
    },
    "responses": {
      "AifpError": {
        "description": "AIFP-* error envelope. See backend/server.js safe error handler.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AifpError"
            }
          }
        }
      }
    },
    "schemas": {
      "ReportingFlowRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "const": 2
          },
          "request_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^[0-9a-f-]{36}$"
          },
          "resource": {
            "type": "string",
            "maxLength": 512
          },
          "channel": {
            "type": "string",
            "enum": [
              "browser",
              "api",
              "unknown"
            ]
          },
          "consent": {
            "type": "string",
            "enum": [
              "granted",
              "denied",
              "unknown"
            ]
          },
          "client_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^[0-9a-f-]{36}$"
          }
        },
        "required": [
          "version",
          "request_id",
          "resource",
          "channel",
          "consent"
        ]
      },
      "ReportingOnboardingRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "const": 2
          },
          "request_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^[0-9a-f-]{36}$"
          },
          "consent": {
            "type": "string",
            "enum": [
              "granted",
              "denied",
              "unknown"
            ]
          }
        },
        "required": [
          "version",
          "request_id",
          "consent"
        ]
      },
      "ReportingFlow": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "const": 2
          },
          "flow_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^[0-9a-f-]{36}$"
          },
          "reporting_token": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$",
            "description": "Observation capability. Header/memory only; never persist or log."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
          },
          "mode": {
            "type": "string",
            "enum": [
              "live",
              "test",
              "internal"
            ]
          },
          "resource": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          }
        },
        "required": [
          "version",
          "flow_id",
          "reporting_token",
          "expires_at",
          "mode",
          "resource"
        ]
      },
      "ReportingEvent": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^[0-9a-f-]{36}$"
          },
          "name": {
            "type": "string",
            "enum": [
              "access_challenged",
              "access_admitted",
              "resource_response_completed"
            ]
          },
          "resource": {
            "type": "string",
            "maxLength": 512
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
          },
          "channel": {
            "type": "string",
            "enum": [
              "browser",
              "api",
              "unknown"
            ]
          },
          "consent": {
            "type": "string",
            "enum": [
              "granted",
              "denied",
              "unknown"
            ]
          },
          "client_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^[0-9a-f-]{36}$"
          },
          "reporting_token": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$",
            "description": "Observation capability. Header/memory only; never persist or log."
          },
          "outcome": {
            "type": "string",
            "enum": [
              "success",
              "redirect",
              "error",
              "abort"
            ]
          },
          "status": {
            "type": "integer",
            "minimum": 100,
            "maximum": 599
          },
          "reason": {
            "type": "string",
            "enum": [
              "receipt_missing",
              "receipt_rejected",
              "quota_exhausted",
              "upstream_error",
              "client_abort",
              "unknown"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "resource",
          "at",
          "channel",
          "consent"
        ]
      },
      "ReportingBatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "const": 2
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportingEvent"
            },
            "maxItems": 50,
            "minItems": 1
          }
        },
        "required": [
          "version",
          "events"
        ]
      },
      "ReportingBrowserEvent": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "const": 2
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^[0-9a-f-]{36}$"
          },
          "name": {
            "type": "string",
            "enum": [
              "paywall_viewed",
              "payment_link_opened",
              "merchant_onboarding_opened"
            ]
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
          }
        },
        "required": [
          "version",
          "id",
          "name",
          "at"
        ]
      },
      "ReportingHealth": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "const": 2
          },
          "producer_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^[0-9a-f-]{36}$"
          },
          "sequence": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,19})$"
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
          },
          "supported": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "access_challenged",
                "access_admitted",
                "resource_response_completed"
              ]
            },
            "maxItems": 3,
            "uniqueItems": true
          },
          "pending": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          "dropped": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,19})$"
          },
          "retries": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]{0,19})$"
          },
          "last_error": {
            "type": "string",
            "enum": [
              "none",
              "network",
              "timeout",
              "auth",
              "rejected",
              "storage",
              "queue_full",
              "retry_exhausted"
            ]
          }
        },
        "required": [
          "version",
          "producer_id",
          "sequence",
          "at",
          "supported",
          "pending",
          "dropped",
          "retries",
          "last_error"
        ]
      },
      "ReportingAck": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "const": 2
          },
          "accepted": {
            "type": "integer",
            "minimum": 0,
            "maximum": 50
          },
          "duplicates": {
            "type": "integer",
            "minimum": 0,
            "maximum": 50
          },
          "received_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
          }
        },
        "required": [
          "version",
          "accepted",
          "duplicates",
          "received_at"
        ]
      },
      "ReportingHealthAck": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "const": 2
          },
          "duplicate": {
            "type": "boolean"
          }
        },
        "required": [
          "version",
          "duplicate"
        ]
      },
      "ReportingError": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "const": 2
          },
          "error": {
            "type": "string",
            "enum": [
              "invalid_request",
              "invalid_reporting_token",
              "event_conflict",
              "rate_limited",
              "reporting_unavailable",
              "snapshot_expired",
              "report_too_large"
            ]
          },
          "retryable": {
            "type": "boolean"
          }
        },
        "required": [
          "version",
          "error",
          "retryable"
        ]
      },
      "ReportingFilters": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "funnel": {
            "type": "string",
            "enum": [
              "access",
              "onboarding",
              "sites"
            ]
          },
          "merchant_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 2048
            },
            "maxItems": 50,
            "uniqueItems": true
          },
          "from": {
            "type": "string",
            "format": "date-time",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
          },
          "resource": {
            "type": "string",
            "maxLength": 512
          },
          "channel": {
            "type": "string",
            "enum": [
              "browser",
              "api",
              "unknown"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "hosted",
              "partner",
              "browser"
            ]
          },
          "network": {
            "type": "string",
            "maxLength": 2048
          },
          "mode": {
            "type": "string",
            "enum": [
              "live",
              "test",
              "internal"
            ]
          }
        },
        "required": [
          "funnel",
          "merchant_ids",
          "from",
          "to"
        ]
      },
      "ReportingSnapshotRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "const": 2
          },
          "filters": {
            "$ref": "#/components/schemas/ReportingFilters"
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          }
        },
        "required": [
          "version",
          "filters"
        ]
      },
      "ReportingSummary": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "events": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "observed_unique_clients": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "unknown_identity_events": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "linked_payments": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "unlinked_payments": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "unique_paying_wallets": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "financial": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "assigned_payments": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "valued_payments": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "gross_usd_micros": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "status": {
                "type": "string",
                "enum": [
                  "empty",
                  "valued",
                  "unpriced",
                  "partial",
                  "unsupported",
                  "unavailable"
                ]
              }
            },
            "required": [
              "assigned_payments",
              "valued_payments",
              "gross_usd_micros",
              "status"
            ]
          },
          "merchants": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "registered_sites": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "reported_sites": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "verified_sites": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "first_paid_sites": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^(0|[1-9][0-9]*)$"
              }
            },
            "required": [
              "registered_sites",
              "reported_sites",
              "verified_sites",
              "first_paid_sites"
            ]
          }
        },
        "required": [
          "events",
          "observed_unique_clients",
          "unknown_identity_events",
          "linked_payments",
          "unlinked_payments",
          "unique_paying_wallets",
          "financial"
        ]
      },
      "ReportingStage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "enum": [
              "access_challenged",
              "access_admitted",
              "resource_response_completed",
              "paywall_viewed",
              "payment_link_opened",
              "merchant_onboarding_opened",
              "quote_created",
              "payment_confirmed",
              "merchant_signup_completed",
              "merchant_site_created",
              "merchant_integration_reported",
              "merchant_integration_verified",
              "merchant_first_payment_confirmed"
            ]
          },
          "count": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "unit": {
            "type": "string",
            "enum": [
              "event",
              "flow",
              "site",
              "account",
              "quote",
              "settlement"
            ]
          },
          "trust": {
            "type": "string",
            "enum": [
              "observed",
              "authoritative",
              "ledger"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "supported",
              "partial",
              "not_instrumented",
              "not_applicable",
              "unavailable",
              "suppressed"
            ]
          },
          "tracking_start": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "last_received": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
          }
        },
        "required": [
          "name",
          "count",
          "unit",
          "trust",
          "status",
          "tracking_start",
          "source"
        ]
      },
      "ReportingCohort": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "pair": {
            "type": "string",
            "maxLength": 2048
          },
          "unit": {
            "type": "string",
            "enum": [
              "flow",
              "site"
            ]
          },
          "denominator": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "numerator": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "channel": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "browser",
              "api",
              "unknown",
              null
            ]
          },
          "rate": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 1
          },
          "window_seconds": {
            "type": "integer",
            "const": 604800
          },
          "maturity": {
            "type": "string",
            "enum": [
              "mature",
              "immature"
            ]
          },
          "quality": {
            "type": "string",
            "maxLength": 2048
          }
        },
        "required": [
          "pair",
          "unit",
          "denominator",
          "numerator",
          "channel",
          "rate",
          "window_seconds",
          "maturity",
          "quality"
        ]
      },
      "ReportingRow": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "row_id": {
            "type": "string",
            "maxLength": 2048
          },
          "identity_type": {
            "type": "string",
            "enum": [
              "unknown",
              "observed_client",
              "confirmed_payer",
              "merchant_owner"
            ]
          },
          "identity_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "pattern": "^[0-9a-f-]{36}$"
          },
          "flow_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "pattern": "^[0-9a-f-]{36}$"
          },
          "merchant_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "resource": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "stage": {
            "type": "string",
            "enum": [
              "access_challenged",
              "access_admitted",
              "resource_response_completed",
              "paywall_viewed",
              "payment_link_opened",
              "merchant_onboarding_opened",
              "quote_created",
              "payment_confirmed",
              "merchant_signup_completed",
              "merchant_site_created",
              "merchant_integration_reported",
              "merchant_integration_verified",
              "merchant_first_payment_confirmed"
            ]
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
          },
          "received_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
          },
          "source": {
            "type": "string",
            "maxLength": 2048
          },
          "trust": {
            "type": "string",
            "enum": [
              "observed",
              "authoritative",
              "ledger"
            ]
          },
          "channel": {
            "type": "string",
            "enum": [
              "browser",
              "api",
              "unknown"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "live",
              "test",
              "internal"
            ]
          },
          "outcome": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "success",
              "redirect",
              "error",
              "abort",
              null
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "evidence_ref": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "quote_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "settlement_ref": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "asset": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "base_units": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "decimals": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^(0|[1-9][0-9]{0,2})$"
          },
          "usd_micros": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^(0|[1-9][0-9]*)$"
          }
        },
        "required": [
          "row_id",
          "identity_type",
          "identity_id",
          "flow_id",
          "merchant_id",
          "resource",
          "stage",
          "occurred_at",
          "received_at",
          "source",
          "trust",
          "channel",
          "mode",
          "outcome",
          "reason",
          "evidence_ref",
          "quote_id",
          "settlement_ref",
          "asset",
          "base_units",
          "decimals",
          "usd_micros"
        ]
      },
      "ReportingCoverage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "raw_from": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
          },
          "projection_lag_seconds": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "pending": {
            "anyOf": [
              {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000
              }
            ]
          },
          "dropped": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "interruptions": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Bounded source coverage intervals; not request payloads."
            }
          },
          "integration_status": {
            "type": "string",
            "maxLength": 2048
          },
          "integration_reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048
          },
          "stage_coverage": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "source_coverage": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "verifications": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "merchant_id": {
                  "type": "string",
                  "maxLength": 2048
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "verified",
                    "incomplete"
                  ]
                },
                "reason": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 2048
                },
                "last_checked_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
                },
                "current_revision": {
                  "type": "string",
                  "maxLength": 2048
                },
                "verified_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
                },
                "checks": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "name": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "passed": {
                        "type": "boolean"
                      },
                      "evidence_ref": {
                        "type": "string",
                        "maxLength": 2048
                      }
                    },
                    "required": [
                      "name",
                      "passed",
                      "evidence_ref"
                    ]
                  },
                  "maxItems": 6
                }
              },
              "required": [
                "merchant_id",
                "status",
                "reason",
                "last_checked_at",
                "current_revision",
                "verified_at",
                "checks"
              ]
            },
            "maxItems": 50
          },
          "supported_stages": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "access_challenged",
                "access_admitted",
                "resource_response_completed",
                "paywall_viewed",
                "payment_link_opened",
                "merchant_onboarding_opened",
                "quote_created",
                "payment_confirmed",
                "merchant_signup_completed",
                "merchant_site_created",
                "merchant_integration_reported",
                "merchant_integration_verified",
                "merchant_first_payment_confirmed"
              ]
            },
            "maxItems": 13
          },
          "last_received": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
            }
          },
          "tracking_start": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
            }
          },
          "producer_status": {
            "type": "string",
            "enum": [
              "unknown",
              "gap",
              "reported"
            ]
          },
          "producers": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "producer_id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^[0-9a-f-]{36}$"
                },
                "sequence": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^(0|[1-9][0-9]*)$"
                },
                "pending": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^(0|[1-9][0-9]*)$"
                },
                "dropped": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^(0|[1-9][0-9]*)$"
                },
                "retries": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^(0|[1-9][0-9]*)$"
                },
                "last_error": {
                  "type": "string",
                  "maxLength": 2048
                },
                "at": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
                },
                "supported": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "access_challenged",
                      "access_admitted",
                      "resource_response_completed"
                    ]
                  },
                  "maxItems": 3
                }
              },
              "required": [
                "producer_id",
                "sequence",
                "pending",
                "dropped",
                "retries",
                "last_error",
                "at",
                "supported"
              ]
            }
          },
          "financial_status": {
            "type": "string",
            "enum": [
              "empty",
              "valued",
              "unpriced",
              "partial",
              "unsupported",
              "unavailable"
            ]
          },
          "attribution": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "linked": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "eligible": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "ratio": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0,
                "maximum": 1
              }
            },
            "required": [
              "linked",
              "eligible",
              "ratio"
            ]
          }
        },
        "required": [
          "raw_from",
          "projection_lag_seconds",
          "pending",
          "dropped",
          "interruptions",
          "integration_status",
          "integration_reason"
        ]
      },
      "ReportingSnapshot": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "const": 2
          },
          "contract": {
            "type": "string",
            "const": "reporting.v2.20261009"
          },
          "snapshot_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^[0-9a-f-]{36}$"
          },
          "as_of": {
            "type": "string",
            "format": "date-time",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
          },
          "filters": {
            "$ref": "#/components/schemas/ReportingFilters"
          },
          "summary": {
            "$ref": "#/components/schemas/ReportingSummary"
          },
          "stages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportingStage"
            },
            "maxItems": 13
          },
          "cohorts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportingCohort"
            }
          },
          "coverage": {
            "$ref": "#/components/schemas/ReportingCoverage"
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportingRow"
            },
            "maxItems": 200
          },
          "page": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "total_rows": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "exported_rows": {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000
              },
              "truncated": {
                "type": "boolean"
              },
              "next_cursor": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 2048
              }
            },
            "required": [
              "total_rows",
              "exported_rows",
              "truncated",
              "next_cursor"
            ]
          },
          "merchants": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "registered_sites": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "reported_sites": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "verified_sites": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "first_paid_sites": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^(0|[1-9][0-9]*)$"
              }
            },
            "required": [
              "registered_sites",
              "reported_sites",
              "verified_sites",
              "first_paid_sites"
            ]
          }
        },
        "required": [
          "version",
          "contract",
          "snapshot_id",
          "as_of",
          "expires_at",
          "filters",
          "summary",
          "stages",
          "cohorts",
          "coverage",
          "rows",
          "page"
        ]
      },
      "SettlementRow": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "event_id",
          "chain",
          "network_mode",
          "tx_ref",
          "log_index",
          "block_number",
          "block_ts",
          "payer",
          "payout_address",
          "asset",
          "amounts",
          "gross_usd_micros",
          "attribution",
          "receipt",
          "provenance"
        ],
        "properties": {
          "event_id": {
            "type": "string"
          },
          "chain": {
            "type": "string",
            "const": "polygon"
          },
          "network_mode": {
            "type": "string",
            "const": "live"
          },
          "tx_ref": {
            "type": "string",
            "pattern": "^0x[0-9a-f]{64}$"
          },
          "log_index": {
            "type": "integer",
            "minimum": 0
          },
          "block_number": {
            "type": "string",
            "pattern": "^[0-9]{1,78}$"
          },
          "block_ts": {
            "type": "string",
            "format": "date-time"
          },
          "payer": {
            "type": "string",
            "pattern": "^0x[0-9a-f]{40}$"
          },
          "payout_address": {
            "type": "string",
            "pattern": "^0x[0-9a-f]{40}$"
          },
          "asset": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "address",
              "symbol",
              "decimals"
            ],
            "properties": {
              "address": {
                "type": "string",
                "pattern": "^0x[0-9a-f]{40}$"
              },
              "symbol": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "decimals": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 36
              }
            }
          },
          "amounts": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "gross_base_units",
              "merchant_base_units",
              "treasury_base_units",
              "creator_base_units"
            ],
            "properties": {
              "gross_base_units": {
                "type": "string",
                "pattern": "^[0-9]{1,78}$"
              },
              "merchant_base_units": {
                "type": "string",
                "pattern": "^[0-9]{1,78}$"
              },
              "treasury_base_units": {
                "type": "string",
                "pattern": "^[0-9]{1,78}$"
              },
              "creator_base_units": {
                "type": "string",
                "pattern": "^[0-9]{1,78}$"
              }
            }
          },
          "gross_usd_micros": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9]{1,78}$"
          },
          "attribution": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "state"
            ],
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "assigned",
                  "unknown"
                ]
              },
              "merchant_id": {
                "type": "string"
              },
              "merchant_name": {
                "type": "string"
              },
              "resource": {
                "type": "string"
              }
            }
          },
          "receipt": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "state"
            ],
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "linked",
                  "unknown"
                ]
              },
              "receipt_id": {
                "type": "string"
              }
            }
          },
          "provenance": {
            "type": "string",
            "enum": [
              "indexer",
              "legacy_receipt",
              "legacy_unresolved"
            ]
          }
        }
      },
      "SettlementSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "count",
          "assets",
          "known_gross_usd_micros",
          "valued_count",
          "unknown_valuation_count"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "assets": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "chain",
                "token_address",
                "symbol",
                "decimals",
                "gross_base_units",
                "merchant_base_units",
                "treasury_base_units",
                "creator_base_units"
              ],
              "properties": {
                "chain": {
                  "type": "string",
                  "const": "polygon"
                },
                "token_address": {
                  "type": "string",
                  "pattern": "^0x[0-9a-f]{40}$"
                },
                "symbol": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "decimals": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0,
                  "maximum": 36
                },
                "gross_base_units": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "merchant_base_units": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "treasury_base_units": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                },
                "creator_base_units": {
                  "type": "string",
                  "pattern": "^[0-9]+$"
                }
              }
            }
          },
          "known_gross_usd_micros": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9]+$"
          },
          "valued_count": {
            "type": "integer",
            "minimum": 0
          },
          "unknown_valuation_count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "SettlementCoverage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ledger",
          "sources",
          "receipt",
          "history_complete",
          "unsupported_chains"
        ],
        "properties": {
          "ledger": {
            "type": "string",
            "enum": [
              "partial",
              "current",
              "degraded"
            ]
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "source",
                "from_block",
                "through_block",
                "as_of",
                "status"
              ],
              "properties": {
                "source": {
                  "type": "string"
                },
                "from_block": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^[0-9]{1,78}$"
                },
                "through_block": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^[0-9]{1,78}$"
                },
                "as_of": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "partial",
                    "current",
                    "degraded"
                  ]
                }
              }
            }
          },
          "receipt": {
            "type": "string",
            "enum": [
              "available",
              "partial",
              "unavailable"
            ]
          },
          "history_complete": {
            "type": "boolean",
            "const": false
          },
          "unsupported_chains": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "SettlementFeed": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "scope",
          "rows",
          "page",
          "summary",
          "coverage"
        ],
        "properties": {
          "scope": {
            "type": "string",
            "enum": [
              "site",
              "wallet",
              "account_wallet"
            ]
          },
          "rows": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SettlementRow"
            }
          },
          "page": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "next_cursor",
              "as_of"
            ],
            "properties": {
              "next_cursor": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 1024
              },
              "as_of": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "summary": {
            "$ref": "#/components/schemas/SettlementSummary"
          },
          "coverage": {
            "$ref": "#/components/schemas/SettlementCoverage"
          }
        }
      },
      "SettlementWindows": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "scope",
          "as_of",
          "timezone",
          "coverage",
          "windows"
        ],
        "properties": {
          "scope": {
            "type": "string",
            "enum": [
              "site",
              "wallet",
              "account_wallet"
            ]
          },
          "as_of": {
            "type": "string",
            "format": "date-time"
          },
          "timezone": {
            "type": "string",
            "const": "UTC"
          },
          "coverage": {
            "$ref": "#/components/schemas/SettlementCoverage"
          },
          "windows": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "today",
              "yesterday",
              "this_month",
              "d7",
              "d30",
              "observed"
            ],
            "properties": {
              "today": {
                "$ref": "#/components/schemas/SettlementSummary"
              },
              "yesterday": {
                "$ref": "#/components/schemas/SettlementSummary"
              },
              "this_month": {
                "$ref": "#/components/schemas/SettlementSummary"
              },
              "d7": {
                "$ref": "#/components/schemas/SettlementSummary"
              },
              "d30": {
                "$ref": "#/components/schemas/SettlementSummary"
              },
              "observed": {
                "$ref": "#/components/schemas/SettlementSummary"
              }
            }
          }
        }
      },
      "MerchantConfigResource": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "route_pattern",
          "type"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "route_pattern": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "type": {
            "type": "string",
            "enum": [
              "page",
              "api",
              "dataset",
              "mcp_tool",
              "product"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 60
          },
          "description": {
            "type": "string",
            "maxLength": 500
          },
          "active": {
            "type": "boolean"
          },
          "paywall_enabled": {
            "type": "boolean"
          },
          "currency": {
            "const": "USD",
            "type": "string"
          },
          "billing_unit": {
            "const": "request",
            "type": "string"
          },
          "unit_weight": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100000
          },
          "price_usd": {
            "type": "string",
            "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,6})?$"
          },
          "tier": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "standard",
              "complex",
              "premium",
              null
            ]
          },
          "chains": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          },
          "payment_assets": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          },
          "daily_unit_limit": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 100000000
          },
          "fallback_gateway_id": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 100
          }
        }
      },
      "MerchantConfigView": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "format",
          "version",
          "revision",
          "router_slug",
          "default_gateway_id",
          "legacy_gateway_id",
          "gateways",
          "context_revision",
          "capabilities"
        ],
        "properties": {
          "format": {
            "const": "aifinpay-merchant-config",
            "type": "string"
          },
          "version": {
            "const": 1,
            "type": "integer"
          },
          "revision": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "router_slug": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 100
          },
          "default_gateway_id": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 100
          },
          "legacy_gateway_id": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 100
          },
          "gateways": {
            "type": "array",
            "maxItems": 8,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "name",
                "slug",
                "type",
                "enabled_intent",
                "priority",
                "upstream_base_url",
                "description",
                "metadata",
                "chains",
                "payment_assets",
                "resources",
                "origin_secret_set",
                "readiness"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "slug": {
                  "type": "string",
                  "pattern": "^[a-z0-9][a-z0-9-]{2,39}$"
                },
                "type": {
                  "type": "string",
                  "const": "hosted_x402"
                },
                "enabled_intent": {
                  "type": "boolean"
                },
                "priority": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 1000
                },
                "upstream_base_url": {
                  "type": "string",
                  "format": "uri",
                  "maxLength": 2048
                },
                "description": {
                  "type": "string",
                  "maxLength": 500
                },
                "metadata": {
                  "type": "object",
                  "maxProperties": 10,
                  "propertyNames": {
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "additionalProperties": {
                    "type": "string",
                    "maxLength": 200
                  }
                },
                "chains": {
                  "type": "array",
                  "uniqueItems": true,
                  "items": {
                    "type": "string"
                  }
                },
                "payment_assets": {
                  "type": "array",
                  "uniqueItems": true,
                  "items": {
                    "type": "string"
                  }
                },
                "resources": {
                  "type": "array",
                  "maxItems": 500,
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "id",
                      "route_pattern",
                      "type"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "route_pattern": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "page",
                          "api",
                          "dataset",
                          "mcp_tool",
                          "product"
                        ]
                      },
                      "name": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 60
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "active": {
                        "type": "boolean"
                      },
                      "paywall_enabled": {
                        "type": "boolean"
                      },
                      "currency": {
                        "const": "USD",
                        "type": "string"
                      },
                      "billing_unit": {
                        "const": "request",
                        "type": "string"
                      },
                      "unit_weight": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100000
                      },
                      "price_usd": {
                        "type": "string",
                        "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,6})?$"
                      },
                      "tier": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "enum": [
                          "standard",
                          "complex",
                          "premium",
                          null
                        ]
                      },
                      "chains": {
                        "type": "array",
                        "uniqueItems": true,
                        "items": {
                          "type": "string"
                        }
                      },
                      "payment_assets": {
                        "type": "array",
                        "uniqueItems": true,
                        "items": {
                          "type": "string"
                        }
                      },
                      "daily_unit_limit": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "minimum": 1,
                        "maximum": 100000000
                      },
                      "fallback_gateway_id": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "minLength": 1,
                        "maxLength": 100
                      }
                    }
                  }
                },
                "origin_secret_set": {
                  "type": "boolean"
                },
                "readiness": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "ready",
                    "state"
                  ],
                  "properties": {
                    "ready": {
                      "type": "boolean"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "PENDING_DNS",
                        "DNS_VALID",
                        "DNS_INVALID",
                        "REMOVED"
                      ]
                    }
                  }
                }
              }
            }
          },
          "context_revision": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "capabilities": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "chains",
              "payment_assets"
            ],
            "properties": {
              "chains": {
                "type": "array",
                "uniqueItems": true,
                "items": {
                  "type": "string"
                }
              },
              "payment_assets": {
                "type": "array",
                "uniqueItems": true,
                "items": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "MerchantConfigPreview": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "preview_id",
          "digest",
          "expires_at",
          "base_revision",
          "context_revision",
          "changes",
          "errors",
          "can_confirm",
          "id_map",
          "config"
        ],
        "properties": {
          "preview_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "digest": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "base_revision": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "context_revision": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "changes": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "action",
                "kind",
                "summary"
              ],
              "properties": {
                "action": {
                  "type": "string"
                },
                "kind": {
                  "type": "string"
                },
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "gateway_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "summary": {
                  "type": "string"
                }
              }
            }
          },
          "errors": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "path",
                "code",
                "message"
              ],
              "properties": {
                "path": {
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          },
          "can_confirm": {
            "type": "boolean"
          },
          "id_map": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "config": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "format",
              "version",
              "revision",
              "router_slug",
              "default_gateway_id",
              "legacy_gateway_id",
              "gateways"
            ],
            "properties": {
              "format": {
                "const": "aifinpay-merchant-config",
                "type": "string"
              },
              "version": {
                "const": 1,
                "type": "integer"
              },
              "revision": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "router_slug": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "maxLength": 100
              },
              "default_gateway_id": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "maxLength": 100
              },
              "legacy_gateway_id": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "maxLength": 100
              },
              "gateways": {
                "type": "array",
                "maxItems": 8,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "name",
                    "slug",
                    "type",
                    "enabled_intent",
                    "priority",
                    "upstream_base_url"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "slug": {
                      "type": "string",
                      "pattern": "^[a-z0-9][a-z0-9-]{2,39}$"
                    },
                    "type": {
                      "type": "string",
                      "const": "hosted_x402"
                    },
                    "enabled_intent": {
                      "type": "boolean"
                    },
                    "priority": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1000
                    },
                    "upstream_base_url": {
                      "type": "string",
                      "format": "uri",
                      "maxLength": 2048
                    },
                    "description": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "metadata": {
                      "type": "object",
                      "maxProperties": 10,
                      "propertyNames": {
                        "minLength": 1,
                        "maxLength": 40
                      },
                      "additionalProperties": {
                        "type": "string",
                        "maxLength": 200
                      }
                    },
                    "chains": {
                      "type": "array",
                      "uniqueItems": true,
                      "items": {
                        "type": "string"
                      }
                    },
                    "payment_assets": {
                      "type": "array",
                      "uniqueItems": true,
                      "items": {
                        "type": "string"
                      }
                    },
                    "resources": {
                      "type": "array",
                      "maxItems": 500,
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "id",
                          "route_pattern",
                          "type"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 100
                          },
                          "route_pattern": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 200
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "page",
                              "api",
                              "dataset",
                              "mcp_tool",
                              "product"
                            ]
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 60
                          },
                          "description": {
                            "type": "string",
                            "maxLength": 500
                          },
                          "active": {
                            "type": "boolean"
                          },
                          "paywall_enabled": {
                            "type": "boolean"
                          },
                          "currency": {
                            "const": "USD",
                            "type": "string"
                          },
                          "billing_unit": {
                            "const": "request",
                            "type": "string"
                          },
                          "unit_weight": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100000
                          },
                          "price_usd": {
                            "type": "string",
                            "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,6})?$"
                          },
                          "tier": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "enum": [
                              "standard",
                              "complex",
                              "premium",
                              null
                            ]
                          },
                          "chains": {
                            "type": "array",
                            "uniqueItems": true,
                            "items": {
                              "type": "string"
                            }
                          },
                          "payment_assets": {
                            "type": "array",
                            "uniqueItems": true,
                            "items": {
                              "type": "string"
                            }
                          },
                          "daily_unit_limit": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "minimum": 1,
                            "maximum": 100000000
                          },
                          "fallback_gateway_id": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "minLength": 1,
                            "maxLength": 100
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "MerchantSiteBatchPreview": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "preview_id",
          "digest",
          "expires_at",
          "base_revision",
          "context_revision",
          "changes",
          "errors",
          "can_confirm",
          "id_map",
          "sites"
        ],
        "properties": {
          "preview_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "digest": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "base_revision": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "context_revision": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "changes": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "action",
                "kind",
                "summary"
              ],
              "properties": {
                "action": {
                  "type": "string"
                },
                "kind": {
                  "type": "string"
                },
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "gateway_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "summary": {
                  "type": "string"
                }
              }
            }
          },
          "errors": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "path",
                "code",
                "message"
              ],
              "properties": {
                "path": {
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          },
          "can_confirm": {
            "type": "boolean"
          },
          "id_map": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "merchant_id",
                "gateway_id",
                "resource_ids"
              ],
              "properties": {
                "merchant_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "gateway_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "resource_ids": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                }
              }
            }
          },
          "sites": {
            "type": "array",
            "minItems": 1,
            "maxItems": 50,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "client_row_id",
                "name",
                "site_url",
                "upstream_base_url",
                "gateway_slug",
                "enabled_intent",
                "network_mode",
                "settlement_chain",
                "settlement_version",
                "pay_to",
                "merchant_id",
                "gateway_id",
                "proof_state"
              ],
              "properties": {
                "client_row_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                },
                "name": {
                  "type": "string",
                  "minLength": 3,
                  "maxLength": 80
                },
                "site_url": {
                  "type": "string",
                  "format": "uri",
                  "maxLength": 200
                },
                "upstream_base_url": {
                  "type": "string",
                  "format": "uri",
                  "maxLength": 2048
                },
                "gateway_slug": {
                  "type": "string",
                  "pattern": "^[a-z0-9][a-z0-9-]{2,39}$"
                },
                "enabled_intent": {
                  "type": "boolean"
                },
                "network_mode": {
                  "type": "string",
                  "enum": [
                    "live",
                    "test"
                  ]
                },
                "settlement_chain": {
                  "type": "string"
                },
                "settlement_version": {
                  "type": "string",
                  "enum": [
                    "1.2",
                    "1.4"
                  ]
                },
                "pay_to": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [],
                  "properties": {
                    "evm": {
                      "type": "string",
                      "pattern": "^0x[0-9a-fA-F]{40}$"
                    },
                    "polygon": {
                      "type": "string",
                      "pattern": "^0x[0-9a-fA-F]{40}$"
                    },
                    "solana": {
                      "type": "string",
                      "minLength": 32,
                      "maxLength": 44
                    }
                  }
                },
                "resources": {
                  "type": "array",
                  "maxItems": 500,
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "id",
                      "route_pattern",
                      "type"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "route_pattern": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "page",
                          "api",
                          "dataset",
                          "mcp_tool",
                          "product"
                        ]
                      },
                      "name": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 60
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "active": {
                        "type": "boolean"
                      },
                      "paywall_enabled": {
                        "type": "boolean"
                      },
                      "currency": {
                        "const": "USD",
                        "type": "string"
                      },
                      "billing_unit": {
                        "const": "request",
                        "type": "string"
                      },
                      "unit_weight": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100000
                      },
                      "price_usd": {
                        "type": "string",
                        "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,6})?$"
                      },
                      "tier": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "enum": [
                          "standard",
                          "complex",
                          "premium",
                          null
                        ]
                      },
                      "chains": {
                        "type": "array",
                        "uniqueItems": true,
                        "items": {
                          "type": "string"
                        }
                      },
                      "payment_assets": {
                        "type": "array",
                        "uniqueItems": true,
                        "items": {
                          "type": "string"
                        }
                      },
                      "daily_unit_limit": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "minimum": 1,
                        "maximum": 100000000
                      },
                      "fallback_gateway_id": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "minLength": 1,
                        "maxLength": 100
                      }
                    }
                  }
                },
                "merchant_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "gateway_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "proof_state": {
                  "type": "string",
                  "const": "PENDING_DNS"
                }
              }
            }
          }
        }
      },
      "MerchantConfigCommitted": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "operation_id",
          "revision",
          "config"
        ],
        "properties": {
          "operation_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "revision": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "config": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "format",
              "version",
              "revision",
              "router_slug",
              "default_gateway_id",
              "legacy_gateway_id",
              "gateways",
              "context_revision",
              "capabilities"
            ],
            "properties": {
              "format": {
                "const": "aifinpay-merchant-config",
                "type": "string"
              },
              "version": {
                "const": 1,
                "type": "integer"
              },
              "revision": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "router_slug": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "maxLength": 100
              },
              "default_gateway_id": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "maxLength": 100
              },
              "legacy_gateway_id": {
                "type": [
                  "string",
                  "null"
                ],
                "minLength": 1,
                "maxLength": 100
              },
              "gateways": {
                "type": "array",
                "maxItems": 8,
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "name",
                    "slug",
                    "type",
                    "enabled_intent",
                    "priority",
                    "upstream_base_url",
                    "description",
                    "metadata",
                    "chains",
                    "payment_assets",
                    "resources",
                    "origin_secret_set",
                    "readiness"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    },
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "slug": {
                      "type": "string",
                      "pattern": "^[a-z0-9][a-z0-9-]{2,39}$"
                    },
                    "type": {
                      "type": "string",
                      "const": "hosted_x402"
                    },
                    "enabled_intent": {
                      "type": "boolean"
                    },
                    "priority": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1000
                    },
                    "upstream_base_url": {
                      "type": "string",
                      "format": "uri",
                      "maxLength": 2048
                    },
                    "description": {
                      "type": "string",
                      "maxLength": 500
                    },
                    "metadata": {
                      "type": "object",
                      "maxProperties": 10,
                      "propertyNames": {
                        "minLength": 1,
                        "maxLength": 40
                      },
                      "additionalProperties": {
                        "type": "string",
                        "maxLength": 200
                      }
                    },
                    "chains": {
                      "type": "array",
                      "uniqueItems": true,
                      "items": {
                        "type": "string"
                      }
                    },
                    "payment_assets": {
                      "type": "array",
                      "uniqueItems": true,
                      "items": {
                        "type": "string"
                      }
                    },
                    "resources": {
                      "type": "array",
                      "maxItems": 500,
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "id",
                          "route_pattern",
                          "type"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 100
                          },
                          "route_pattern": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 200
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "page",
                              "api",
                              "dataset",
                              "mcp_tool",
                              "product"
                            ]
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "maxLength": 60
                          },
                          "description": {
                            "type": "string",
                            "maxLength": 500
                          },
                          "active": {
                            "type": "boolean"
                          },
                          "paywall_enabled": {
                            "type": "boolean"
                          },
                          "currency": {
                            "const": "USD",
                            "type": "string"
                          },
                          "billing_unit": {
                            "const": "request",
                            "type": "string"
                          },
                          "unit_weight": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100000
                          },
                          "price_usd": {
                            "type": "string",
                            "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,6})?$"
                          },
                          "tier": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "enum": [
                              "standard",
                              "complex",
                              "premium",
                              null
                            ]
                          },
                          "chains": {
                            "type": "array",
                            "uniqueItems": true,
                            "items": {
                              "type": "string"
                            }
                          },
                          "payment_assets": {
                            "type": "array",
                            "uniqueItems": true,
                            "items": {
                              "type": "string"
                            }
                          },
                          "daily_unit_limit": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "minimum": 1,
                            "maximum": 100000000
                          },
                          "fallback_gateway_id": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "minLength": 1,
                            "maxLength": 100
                          }
                        }
                      }
                    },
                    "origin_secret_set": {
                      "type": "boolean"
                    },
                    "readiness": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "ready",
                        "state"
                      ],
                      "properties": {
                        "ready": {
                          "type": "boolean"
                        },
                        "reason": {
                          "type": "string"
                        },
                        "state": {
                          "type": "string",
                          "enum": [
                            "PENDING_DNS",
                            "DNS_VALID",
                            "DNS_INVALID",
                            "REMOVED"
                          ]
                        }
                      }
                    }
                  }
                }
              },
              "context_revision": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "capabilities": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "chains",
                  "payment_assets"
                ],
                "properties": {
                  "chains": {
                    "type": "array",
                    "uniqueItems": true,
                    "items": {
                      "type": "string"
                    }
                  },
                  "payment_assets": {
                    "type": "array",
                    "uniqueItems": true,
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "MerchantSiteBatchCommitted": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "operation_id",
          "revision",
          "merchant_ids",
          "sites"
        ],
        "properties": {
          "operation_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "revision": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "merchant_ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 50,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "sites": {
            "type": "array",
            "minItems": 1,
            "maxItems": 50,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "merchant_id",
                "name",
                "site_url",
                "network_mode",
                "gateway_id",
                "proof_state"
              ],
              "properties": {
                "merchant_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "name": {
                  "type": "string",
                  "minLength": 3,
                  "maxLength": 80
                },
                "site_url": {
                  "type": "string",
                  "format": "uri",
                  "maxLength": 200
                },
                "network_mode": {
                  "type": "string",
                  "enum": [
                    "live",
                    "test"
                  ]
                },
                "gateway_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "proof_state": {
                  "type": "string",
                  "const": "PENDING_DNS"
                }
              }
            }
          }
        }
      },
      "MerchantConfigGateway": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "slug",
          "type",
          "enabled_intent",
          "priority",
          "upstream_base_url"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "slug": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]{2,39}$"
          },
          "type": {
            "type": "string",
            "const": "hosted_x402"
          },
          "enabled_intent": {
            "type": "boolean"
          },
          "priority": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          "upstream_base_url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048
          },
          "description": {
            "type": "string",
            "maxLength": 500
          },
          "metadata": {
            "type": "object",
            "maxProperties": 10,
            "propertyNames": {
              "minLength": 1,
              "maxLength": 40
            },
            "additionalProperties": {
              "type": "string",
              "maxLength": 200
            }
          },
          "chains": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          },
          "payment_assets": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          },
          "resources": {
            "type": "array",
            "maxItems": 500,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "route_pattern",
                "type"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "route_pattern": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "page",
                    "api",
                    "dataset",
                    "mcp_tool",
                    "product"
                  ]
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "maxLength": 60
                },
                "description": {
                  "type": "string",
                  "maxLength": 500
                },
                "active": {
                  "type": "boolean"
                },
                "paywall_enabled": {
                  "type": "boolean"
                },
                "currency": {
                  "const": "USD",
                  "type": "string"
                },
                "billing_unit": {
                  "const": "request",
                  "type": "string"
                },
                "unit_weight": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 100000
                },
                "price_usd": {
                  "type": "string",
                  "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,6})?$"
                },
                "tier": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "standard",
                    "complex",
                    "premium",
                    null
                  ]
                },
                "chains": {
                  "type": "array",
                  "uniqueItems": true,
                  "items": {
                    "type": "string"
                  }
                },
                "payment_assets": {
                  "type": "array",
                  "uniqueItems": true,
                  "items": {
                    "type": "string"
                  }
                },
                "daily_unit_limit": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 1,
                  "maximum": 100000000
                },
                "fallback_gateway_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "minLength": 1,
                  "maxLength": 100
                }
              }
            }
          }
        }
      },
      "MerchantConfigExport": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "format",
          "version",
          "revision",
          "router_slug",
          "default_gateway_id",
          "legacy_gateway_id",
          "gateways"
        ],
        "properties": {
          "format": {
            "const": "aifinpay-merchant-config",
            "type": "string"
          },
          "version": {
            "const": 1,
            "type": "integer"
          },
          "revision": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "router_slug": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 100
          },
          "default_gateway_id": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 100
          },
          "legacy_gateway_id": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 100
          },
          "gateways": {
            "type": "array",
            "maxItems": 8,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "name",
                "slug",
                "type",
                "enabled_intent",
                "priority",
                "upstream_base_url"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "slug": {
                  "type": "string",
                  "pattern": "^[a-z0-9][a-z0-9-]{2,39}$"
                },
                "type": {
                  "type": "string",
                  "const": "hosted_x402"
                },
                "enabled_intent": {
                  "type": "boolean"
                },
                "priority": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 1000
                },
                "upstream_base_url": {
                  "type": "string",
                  "format": "uri",
                  "maxLength": 2048
                },
                "description": {
                  "type": "string",
                  "maxLength": 500
                },
                "metadata": {
                  "type": "object",
                  "maxProperties": 10,
                  "propertyNames": {
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "additionalProperties": {
                    "type": "string",
                    "maxLength": 200
                  }
                },
                "chains": {
                  "type": "array",
                  "uniqueItems": true,
                  "items": {
                    "type": "string"
                  }
                },
                "payment_assets": {
                  "type": "array",
                  "uniqueItems": true,
                  "items": {
                    "type": "string"
                  }
                },
                "resources": {
                  "type": "array",
                  "maxItems": 500,
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "id",
                      "route_pattern",
                      "type"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "route_pattern": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "page",
                          "api",
                          "dataset",
                          "mcp_tool",
                          "product"
                        ]
                      },
                      "name": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 60
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "active": {
                        "type": "boolean"
                      },
                      "paywall_enabled": {
                        "type": "boolean"
                      },
                      "currency": {
                        "const": "USD",
                        "type": "string"
                      },
                      "billing_unit": {
                        "const": "request",
                        "type": "string"
                      },
                      "unit_weight": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100000
                      },
                      "price_usd": {
                        "type": "string",
                        "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,6})?$"
                      },
                      "tier": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "enum": [
                          "standard",
                          "complex",
                          "premium",
                          null
                        ]
                      },
                      "chains": {
                        "type": "array",
                        "uniqueItems": true,
                        "items": {
                          "type": "string"
                        }
                      },
                      "payment_assets": {
                        "type": "array",
                        "uniqueItems": true,
                        "items": {
                          "type": "string"
                        }
                      },
                      "daily_unit_limit": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "minimum": 1,
                        "maximum": 100000000
                      },
                      "fallback_gateway_id": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "minLength": 1,
                        "maxLength": 100
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "MerchantConfigImport": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "format",
          "version"
        ],
        "properties": {
          "format": {
            "const": "aifinpay-merchant-config",
            "type": "string"
          },
          "version": {
            "const": 1,
            "type": "integer"
          },
          "exported_revision": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "revision": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "router_slug": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 100
          },
          "default_gateway_id": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 100
          },
          "legacy_gateway_id": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 100
          },
          "upserts": {
            "type": "array",
            "maxItems": 8,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "name",
                "slug",
                "type",
                "enabled_intent",
                "priority",
                "upstream_base_url"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "slug": {
                  "type": "string",
                  "pattern": "^[a-z0-9][a-z0-9-]{2,39}$"
                },
                "type": {
                  "type": "string",
                  "const": "hosted_x402"
                },
                "enabled_intent": {
                  "type": "boolean"
                },
                "priority": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 1000
                },
                "upstream_base_url": {
                  "type": "string",
                  "format": "uri",
                  "maxLength": 2048
                },
                "description": {
                  "type": "string",
                  "maxLength": 500
                },
                "metadata": {
                  "type": "object",
                  "maxProperties": 10,
                  "propertyNames": {
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "additionalProperties": {
                    "type": "string",
                    "maxLength": 200
                  }
                },
                "chains": {
                  "type": "array",
                  "uniqueItems": true,
                  "items": {
                    "type": "string"
                  }
                },
                "payment_assets": {
                  "type": "array",
                  "uniqueItems": true,
                  "items": {
                    "type": "string"
                  }
                },
                "resources": {
                  "type": "array",
                  "maxItems": 500,
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "id",
                      "route_pattern",
                      "type"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "route_pattern": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "page",
                          "api",
                          "dataset",
                          "mcp_tool",
                          "product"
                        ]
                      },
                      "name": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 60
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "active": {
                        "type": "boolean"
                      },
                      "paywall_enabled": {
                        "type": "boolean"
                      },
                      "currency": {
                        "const": "USD",
                        "type": "string"
                      },
                      "billing_unit": {
                        "const": "request",
                        "type": "string"
                      },
                      "unit_weight": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100000
                      },
                      "price_usd": {
                        "type": "string",
                        "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,6})?$"
                      },
                      "tier": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "enum": [
                          "standard",
                          "complex",
                          "premium",
                          null
                        ]
                      },
                      "chains": {
                        "type": "array",
                        "uniqueItems": true,
                        "items": {
                          "type": "string"
                        }
                      },
                      "payment_assets": {
                        "type": "array",
                        "uniqueItems": true,
                        "items": {
                          "type": "string"
                        }
                      },
                      "daily_unit_limit": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "minimum": 1,
                        "maximum": 100000000
                      },
                      "fallback_gateway_id": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "minLength": 1,
                        "maxLength": 100
                      }
                    }
                  }
                }
              }
            }
          },
          "gateways": {
            "type": "array",
            "maxItems": 8,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "name",
                "slug",
                "type",
                "enabled_intent",
                "priority",
                "upstream_base_url"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 80
                },
                "slug": {
                  "type": "string",
                  "pattern": "^[a-z0-9][a-z0-9-]{2,39}$"
                },
                "type": {
                  "type": "string",
                  "const": "hosted_x402"
                },
                "enabled_intent": {
                  "type": "boolean"
                },
                "priority": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 1000
                },
                "upstream_base_url": {
                  "type": "string",
                  "format": "uri",
                  "maxLength": 2048
                },
                "description": {
                  "type": "string",
                  "maxLength": 500
                },
                "metadata": {
                  "type": "object",
                  "maxProperties": 10,
                  "propertyNames": {
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "additionalProperties": {
                    "type": "string",
                    "maxLength": 200
                  }
                },
                "chains": {
                  "type": "array",
                  "uniqueItems": true,
                  "items": {
                    "type": "string"
                  }
                },
                "payment_assets": {
                  "type": "array",
                  "uniqueItems": true,
                  "items": {
                    "type": "string"
                  }
                },
                "resources": {
                  "type": "array",
                  "maxItems": 500,
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "id",
                      "route_pattern",
                      "type"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "route_pattern": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "page",
                          "api",
                          "dataset",
                          "mcp_tool",
                          "product"
                        ]
                      },
                      "name": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 60
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "active": {
                        "type": "boolean"
                      },
                      "paywall_enabled": {
                        "type": "boolean"
                      },
                      "currency": {
                        "const": "USD",
                        "type": "string"
                      },
                      "billing_unit": {
                        "const": "request",
                        "type": "string"
                      },
                      "unit_weight": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100000
                      },
                      "price_usd": {
                        "type": "string",
                        "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,6})?$"
                      },
                      "tier": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "enum": [
                          "standard",
                          "complex",
                          "premium",
                          null
                        ]
                      },
                      "chains": {
                        "type": "array",
                        "uniqueItems": true,
                        "items": {
                          "type": "string"
                        }
                      },
                      "payment_assets": {
                        "type": "array",
                        "uniqueItems": true,
                        "items": {
                          "type": "string"
                        }
                      },
                      "daily_unit_limit": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "minimum": 1,
                        "maximum": 100000000
                      },
                      "fallback_gateway_id": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "minLength": 1,
                        "maxLength": 100
                      }
                    }
                  }
                }
              }
            }
          },
          "delete_gateway_ids": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            }
          },
          "delete_resources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "gateway_id",
                "resource_ids"
              ],
              "properties": {
                "gateway_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "resource_ids": {
                  "type": "array",
                  "uniqueItems": true,
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                }
              }
            }
          }
        }
      },
      "MerchantConfigConfirmation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "preview_id",
          "digest",
          "revision",
          "context_revision",
          "idempotency_key"
        ],
        "properties": {
          "preview_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "digest": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "revision": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "context_revision": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "idempotency_key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          }
        }
      },
      "MerchantSiteBatch": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "format",
          "version",
          "sites"
        ],
        "properties": {
          "format": {
            "type": "string",
            "const": "aifinpay-site-batch"
          },
          "version": {
            "type": "integer",
            "const": 1
          },
          "sites": {
            "type": "array",
            "minItems": 1,
            "maxItems": 50,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "client_row_id",
                "name",
                "site_url",
                "upstream_base_url",
                "gateway_slug",
                "enabled_intent",
                "network_mode",
                "settlement_chain",
                "settlement_version",
                "pay_to"
              ],
              "properties": {
                "client_row_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 64
                },
                "name": {
                  "type": "string",
                  "minLength": 3,
                  "maxLength": 80
                },
                "site_url": {
                  "type": "string",
                  "format": "uri",
                  "maxLength": 200
                },
                "upstream_base_url": {
                  "type": "string",
                  "format": "uri",
                  "maxLength": 2048
                },
                "gateway_slug": {
                  "type": "string",
                  "pattern": "^[a-z0-9][a-z0-9-]{2,39}$"
                },
                "enabled_intent": {
                  "type": "boolean"
                },
                "network_mode": {
                  "type": "string",
                  "enum": [
                    "live",
                    "test"
                  ]
                },
                "settlement_chain": {
                  "type": "string"
                },
                "settlement_version": {
                  "type": "string",
                  "enum": [
                    "1.2",
                    "1.4"
                  ]
                },
                "pay_to": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [],
                  "properties": {
                    "evm": {
                      "type": "string",
                      "pattern": "^0x[0-9a-fA-F]{40}$"
                    },
                    "polygon": {
                      "type": "string",
                      "pattern": "^0x[0-9a-fA-F]{40}$"
                    },
                    "solana": {
                      "type": "string",
                      "minLength": 32,
                      "maxLength": 44
                    }
                  }
                },
                "resources": {
                  "type": "array",
                  "maxItems": 500,
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "id",
                      "route_pattern",
                      "type"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "route_pattern": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "page",
                          "api",
                          "dataset",
                          "mcp_tool",
                          "product"
                        ]
                      },
                      "name": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "maxLength": 60
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 500
                      },
                      "active": {
                        "type": "boolean"
                      },
                      "paywall_enabled": {
                        "type": "boolean"
                      },
                      "currency": {
                        "const": "USD",
                        "type": "string"
                      },
                      "billing_unit": {
                        "const": "request",
                        "type": "string"
                      },
                      "unit_weight": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100000
                      },
                      "price_usd": {
                        "type": "string",
                        "pattern": "^(?:0|[1-9][0-9]*)(?:\\.[0-9]{1,6})?$"
                      },
                      "tier": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "enum": [
                          "standard",
                          "complex",
                          "premium",
                          null
                        ]
                      },
                      "chains": {
                        "type": "array",
                        "uniqueItems": true,
                        "items": {
                          "type": "string"
                        }
                      },
                      "payment_assets": {
                        "type": "array",
                        "uniqueItems": true,
                        "items": {
                          "type": "string"
                        }
                      },
                      "daily_unit_limit": {
                        "type": [
                          "integer",
                          "null"
                        ],
                        "minimum": 1,
                        "maximum": 100000000
                      },
                      "fallback_gateway_id": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "minLength": 1,
                        "maxLength": 100
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "MerchantConfigError": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "operation_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "can_confirm": {
            "type": "boolean"
          },
          "errors": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "path",
                "code",
                "message"
              ],
              "properties": {
                "path": {
                  "type": "string"
                },
                "code": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                },
                "detail": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "AgentWalletView": {
        "type": "object",
        "properties": {
          "address": {
            "type": "string"
          },
          "chain": {
            "type": "string"
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "wallet_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "balance_usd": {
            "type": [
              "number",
              "null"
            ]
          },
          "balance_native": {
            "type": [
              "number",
              "null"
            ]
          },
          "balance_usd_total": {
            "type": [
              "number",
              "null"
            ]
          },
          "calls_window": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "spent_usd_window": {
            "type": [
              "number",
              "null"
            ]
          },
          "last_activity_ts": {
            "type": [
              "integer",
              "null"
            ]
          },
          "health": {
            "type": "string",
            "enum": [
              "ok",
              "attention",
              "alert"
            ]
          }
        },
        "required": [
          "address",
          "chain",
          "balance_usd",
          "balance_native",
          "calls_window",
          "spent_usd_window",
          "health"
        ]
      },
      "LogicalAgentView": {
        "type": "object",
        "properties": {
          "agent_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "label": {
            "type": [
              "string",
              "null"
            ]
          },
          "wallet_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "claimed",
              "partner"
            ]
          },
          "wallets": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/AgentWalletView"
            }
          },
          "balance_usd_total": {
            "type": [
              "number",
              "null"
            ]
          },
          "balance_coverage": {
            "type": "object",
            "properties": {
              "priced_wallets": {
                "type": "integer",
                "minimum": 0
              },
              "total_wallets": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "priced_wallets",
              "total_wallets"
            ]
          },
          "calls_window": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "spent_usd_window": {
            "type": [
              "number",
              "null"
            ]
          },
          "history_coverage": {
            "type": "object",
            "properties": {
              "supported_wallets": {
                "type": "integer",
                "minimum": 0
              },
              "total_wallets": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "supported_wallets",
              "total_wallets"
            ]
          },
          "last_activity_ts": {
            "type": [
              "integer",
              "null"
            ]
          },
          "top_merchant": {
            "type": [
              "string",
              "null"
            ]
          },
          "health": {
            "type": "string",
            "enum": [
              "ok",
              "attention",
              "alert"
            ]
          }
        },
        "required": [
          "agent_id",
          "label",
          "wallet_id",
          "source",
          "wallets",
          "balance_usd_total",
          "balance_coverage",
          "calls_window",
          "spent_usd_window",
          "history_coverage",
          "last_activity_ts",
          "top_merchant",
          "health"
        ]
      },
      "GroupedAgentOverview": {
        "type": "object",
        "properties": {
          "window": {
            "type": "integer",
            "minimum": 1,
            "maximum": 90
          },
          "agents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LogicalAgentView"
            }
          }
        },
        "required": [
          "window",
          "agents"
        ]
      },
      "PaymentChainCapability": {
        "type": "object",
        "properties": {
          "chain": {
            "type": "string"
          },
          "chain_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "family": {
            "type": "string",
            "enum": [
              "evm",
              "solana",
              "near",
              "aptos",
              "casper"
            ]
          },
          "network_mode": {
            "type": "string",
            "enum": [
              "live",
              "test"
            ]
          },
          "testnet": {
            "type": "boolean",
            "description": "Explicit canonical test-network metadata; false does not imply payment or read availability."
          },
          "payment_supported": {
            "type": "boolean"
          },
          "history_supported": {
            "type": "boolean"
          },
          "balance_read_supported": {
            "type": "boolean"
          },
          "payment_unavailable_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "native_quote_available": {
            "type": "boolean"
          },
          "explorer_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "native": {
            "type": "object",
            "properties": {
              "symbol": {
                "type": "string"
              },
              "decimals": {
                "type": "integer",
                "minimum": 0,
                "maximum": 36
              }
            },
            "required": [
              "symbol",
              "decimals"
            ]
          },
          "assets": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "symbol": {
                  "type": "string"
                },
                "address": {
                  "type": "string"
                },
                "decimals": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 36
                }
              },
              "required": [
                "symbol",
                "address",
                "decimals"
              ]
            }
          }
        },
        "required": [
          "chain",
          "chain_id",
          "family",
          "network_mode",
          "testnet",
          "payment_supported",
          "history_supported",
          "balance_read_supported",
          "native",
          "assets"
        ]
      },
      "AifpError": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "AIFP-{status} code, or domain-specific string (e.g. csrf_origin_denied)"
          },
          "detail": {
            "type": "string"
          },
          "request_id": {
            "type": "string",
            "description": "AIFP-Request-Id for log correlation"
          }
        }
      },
      "MerchantAmount": {
        "type": "object",
        "description": "Money-path input. Quoted amount goes to the merchant verbatim; the paying agent covers treasury and creator fees on top. total = m × D / (D − tBps − cBps). See backend/aifp/split.js.",
        "required": [
          "merchant_amount_wei"
        ],
        "properties": {
          "merchant_amount_wei": {
            "type": "string",
            "description": "Wei / smallest unit, as string (no float drift)"
          },
          "asset": {
            "type": "string",
            "description": "POL / ETH / USDC / USDT / SOL — must match the quote's chain and accepted assets"
          },
          "order_id": {
            "type": "string"
          }
        }
      }
    }
  }
}
