{
  "openapi": "3.0.3",
  "info": {
    "title": "RegiePro PayQR API",
    "version": "1.0",
    "description": "Generate SEPA payment QR codes (EPC QR / Girocode, EPC069-12) and validate IBANs. EU-hosted, no payload logging. Free demo key: 'demo' (50 req/day). Plans: https://api.installateur1210.at/",
    "contact": {"email": "office@installateur1210.at", "url": "https://api.installateur1210.at/"}
  },
  "servers": [{"url": "https://api.installateur1210.at"}],
  "security": [{"apiKey": []}, {"apiKeyQuery": []}],
  "components": {"securitySchemes": {
    "apiKey": {"type": "apiKey", "in": "header", "name": "X-API-Key"},
    "apiKeyQuery": {"type": "apiKey", "in": "query", "name": "key"}}},
  "paths": {
    "/v1/epc-qr": {"get": {
      "summary": "Generate SEPA/EPC payment QR code (Girocode)",
      "parameters": [
        {"name": "name", "in": "query", "required": true, "schema": {"type": "string", "maxLength": 70}, "description": "Recipient name"},
        {"name": "iban", "in": "query", "required": true, "schema": {"type": "string"}, "description": "Recipient IBAN (validated server-side)"},
        {"name": "amount", "in": "query", "schema": {"type": "number", "minimum": 0.01, "maximum": 999999999.99}, "description": "Amount in EUR"},
        {"name": "remittance", "in": "query", "schema": {"type": "string", "maxLength": 140}, "description": "Unstructured payment reference"},
        {"name": "reference", "in": "query", "schema": {"type": "string", "maxLength": 35}, "description": "Structured creditor reference (alternative to remittance)"},
        {"name": "bic", "in": "query", "schema": {"type": "string"}},
        {"name": "purpose", "in": "query", "schema": {"type": "string", "minLength": 4, "maxLength": 4}},
        {"name": "format", "in": "query", "schema": {"type": "string", "enum": ["png", "svg", "txt"], "default": "png"}},
        {"name": "size", "in": "query", "schema": {"type": "integer", "minimum": 2, "maximum": 40, "default": 8}}
      ],
      "responses": {"200": {"description": "QR code image (image/png or image/svg+xml) or raw EPC payload (text/plain)"},
                    "400": {"description": "Validation error (JSON)"}, "401": {"description": "Missing/invalid API key"}, "429": {"description": "Daily limit reached"}}}},
    "/v1/iban/{iban}": {"get": {
      "summary": "Validate an IBAN (format, country length, mod-97 checksum)",
      "parameters": [{"name": "iban", "in": "path", "required": true, "schema": {"type": "string"}}],
      "responses": {"200": {"description": "Validation result JSON with valid, country, checks, formatted"}}}},
    "/v1/health": {"get": {"summary": "Service health", "security": [], "responses": {"200": {"description": "Status JSON"}}}}
  }
}
