{
  "openapi": "3.1.0",
  "info": {
    "title": "RecurCrypto API",
    "version": "v1",
    "description": "Merchant API for recurring crypto payments on Polygon with USDC."
  },
  "servers": [{ "url": "https://www.recurcrypto.com" }],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "security": [{ "bearerAuth": [] }],
  "paths": {
    "/api/v1/health": {
      "get": {
        "summary": "Health"
      }
    },
    "/api/v1/auth/keys": {
      "get": { "summary": "Read merchant API key status" },
      "post": { "summary": "Create or rotate merchant API key" },
      "delete": { "summary": "Revoke merchant API key" }
    },
    "/api/v1/plans": {
      "get": { "summary": "List merchant plans" },
      "post": { "summary": "Create merchant plan" }
    },
    "/api/v1/checkouts": {
      "post": { "summary": "Create checkout link" }
    },
    "/api/v1/subscriptions": {
      "get": { "summary": "List merchant subscriptions" }
    },
    "/api/v1/subscriptions/{id}": {
      "get": {
        "summary": "Read one subscription",
        "parameters": [
          { "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }
        ]
      }
    },
    "/api/v1/events": {
      "get": { "summary": "List API events" }
    }
  }
}
