{
  "openapi": "3.1.0",
  "info": {
    "title": "LotoCard API",
    "version": "1.0",
    "description": "Browser-local visual LOTO placard credit authorization, MCP field-presence check, and self-serve refund API."
  },
  "servers": [
    {
      "url": "https://lotocards.com"
    }
  ],
  "paths": {
    "/api/healthz": {
      "get": {
        "summary": "Health and D1 connectivity check",
        "responses": {
          "200": {
            "description": "Healthy"
          }
        }
      }
    },
    "/api/mcp": {
      "post": {
        "summary": "Streamable HTTP JSON-RPC 2.0 MCP server",
        "responses": {
          "200": {
            "description": "JSON-RPC response"
          },
          "202": {
            "description": "Notification accepted"
          }
        }
      }
    },
    "/api/a2a": {
      "post": {
        "summary": "A2A v1.0 JSON-RPC 2.0 agent endpoint (SendMessage)",
        "responses": {
          "200": {
            "description": "A2A Task response"
          },
          "202": {
            "description": "Notification accepted"
          }
        }
      }
    },
    "/api/checkout": {
      "post": {
        "summary": "Create Stripe Checkout session for 20-machine ($29) or 80-machine ($79) pack",
        "responses": {
          "200": {
            "description": "Checkout URL"
          }
        }
      }
    },
    "/api/export/authorize": {
      "post": {
        "summary": "Atomically consume 1 credit for clean PDF export",
        "responses": {
          "200": {
            "description": "Authorized"
          },
          "402": {
            "description": "Payment required"
          }
        }
      }
    },
    "/api/recovery": {
      "post": {
        "summary": "Send 30-minute Magic-Link recovery email",
        "responses": {
          "200": {
            "description": "Accepted"
          }
        }
      }
    },
    "/api/refund": {
      "post": {
        "summary": "30-day 1-click self-serve Stripe refund",
        "responses": {
          "200": {
            "description": "Refunded"
          }
        }
      }
    }
  }
}
