{
  "openapi": "3.0.3",
  "info": {
    "title": "Sorgera Services v3 (Sorgera One) API",
    "version": "3.0.0",
    "description": "Public API for Peppol (BIS 3.0 / 3.1), PINT, Germany ZUGFeRD 2.5 / XRechnung, France Factur-X / CTC and Poland KSeF FA(3) converters and validators, plus the remote MCP server.\n\nBilling: one shared Unified Credit wallet. Billable API operations use the per-product rate from GET /api/credit-rates. Web UI validators use their free web allowance. Insufficient credits return HTTP 403 with a topUpUrl field pointing at /pricing.\n\nAll converter and validator services expose both Multipart and JSON Base64 (-base64) endpoints accepting `xml` or `xmlBase64` (URL-safe, multiline, unpadded, data-URI, or raw XML) and return standardized quota headers (`X-Remaining-Quota`, `X-Quota-Usage`, `X-Quota-Limit`, `X-Usage-Count`, `X-Quota-Type`)."
  },
  "servers": [
    {
      "url": "https://services.sorgera.com",
      "description": "Production"
    },
    {
      "url": "http://localhost:3000",
      "description": "Local Development"
    }
  ],
  "tags": [
    {
      "name": "Authentication",
      "description": "Endpoints for generating OAuth2 access tokens"
    },
    {
      "name": "Peppol Converters",
      "description": "Convert Peppol XML files to PDF"
    },
    {
      "name": "Peppol Validation",
      "description": "Validate Peppol XML files against schemas"
    },
    {
      "name": "Peppol Directory & Live Lookup (Free)",
      "description": "Free public real-time Peppol SML (DNS NAPTR) + SMP lookup and Directory fallback API. No authentication required (rate limited to 100 requests/minute per IP)."
    },
    {
      "name": "KSeF Converters",
      "description": "Convert Polish KSeF XML files to PDF"
    },
    {
      "name": "KSeF Validation",
      "description": "Validate KSeF XML files against schemas"
    },
    {
      "name": "France Validation",
      "description": "Validation services for French B2B E-Invoicing (UBL 2.1 & Factur-X/CII against FNFE FR CTC V1.4.0) and E-Reporting / Cycle de Vie (CDAR)"
    },
    {
      "name": "France Converters",
      "description": "Convert French B2B electronic invoices (UBL 2.1 / Factur-X CII) to PDF"
    },
    {
      "name": "Germany Converters",
      "description": "Convert UBL 2.1 invoices to Germany ZUGFeRD / Factur-X CII XML & Hybrid PDF/A-3 documents"
    },
    {
      "name": "Germany Validation",
      "description": "Validate Germany UBL 2.1, ZUGFeRD / Factur-X CII XML, XRechnung, and Hybrid ZUGFeRD PDF invoices"
    }
  ],
  "paths": {
    "/api/auth/token": {
      "post": {
        "summary": "Generate Access Token",
        "description": "Exchange your Client ID and Client Secret for a Bearer Access Token.",
        "tags": [
          "Authentication"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "clientId",
                  "clientSecret"
                ],
                "properties": {
                  "clientId": {
                    "type": "string",
                    "description": "Your unique Client ID."
                  },
                  "clientSecret": {
                    "type": "string",
                    "description": "Your secure Client Secret."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful authentication",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "access_token": {
                      "type": "string",
                      "description": "The Bearer token to use in API requests."
                    },
                    "token_type": {
                      "type": "string",
                      "example": "Bearer"
                    },
                    "expires_in": {
                      "type": "integer",
                      "description": "Token validity in seconds (90 days).",
                      "example": 7776000
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid client credentials"
          }
        }
      }
    },
    "/api/peppol/xml-to-pdf": {
      "post": {
        "summary": "Convert Peppol XML to PDF (Multipart)",
        "description": "Accepts one or more Peppol XML files via multipart/form-data and returns a PDF file (or a ZIP file if multiple XMLs are uploaded).",
        "tags": [
          "Peppol Converters"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "xml"
                ],
                "properties": {
                  "xml": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    },
                    "description": "One or more Peppol XML files."
                  },
                  "lang": {
                    "type": "string",
                    "description": "Output language (e.g., 'en', 'es', 'de'). Defaults to 'en'."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A PDF file stream (or ZIP file for bulk uploads). Includes quota info in X-Remaining-Quota header.",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "At least one XML file required"
          },
          "401": {
            "description": "Unauthorized - Invalid or missing token"
          }
        }
      }
    },
    "/api/peppol/xml-to-pdf-base64": {
      "post": {
        "summary": "Convert Peppol XML to PDF (Base64)",
        "description": "Accepts base64-encoded UBL XML and returns a base64-encoded PDF.",
        "tags": [
          "Peppol Converters"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "xml": {
                    "type": "string",
                    "description": "Base64-encoded XML content. (Alias for `xmlBase64` - provide either `xml` or `xmlBase64`)."
                  },
                  "xmlBase64": {
                    "type": "string",
                    "description": "Base64-encoded XML invoice content (alias for `xml`)."
                  },
                  "lang": {
                    "type": "string",
                    "description": "Language selection (e.g., 'en'). Defaults to 'en'."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful conversion",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pdf": {
                      "type": "string",
                      "description": "Base64-encoded PDF binary."
                    },
                    "filename": {
                      "type": "string",
                      "description": "Suggested filename."
                    },
                    "quota": {
                      "type": "object",
                      "properties": {
                        "usage": {
                          "type": "integer"
                        },
                        "limit": {
                          "type": "integer"
                        },
                        "remaining": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "XML base64 required or invalid"
          },
          "401": {
            "description": "Unauthorized - Invalid or missing token"
          }
        }
      }
    },
    "/api/peppol/xml-validator": {
      "post": {
        "summary": "Validate Peppol XML Document (Multipart)",
        "description": "Accepts a Peppol (UBL/BIS 3.0/PINT) XML file via multipart/form-data and validates it using Saxon-JS against official Schematron rules. Requires authentication (session cookie, Bearer token, or x-api-key). Free - no quota deducted.",
        "tags": [
          "Peppol Validation"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "xml"
                ],
                "properties": {
                  "xml": {
                    "type": "string",
                    "format": "binary",
                    "description": "The Peppol XML file to validate."
                  },
                  "version": {
                    "type": "string",
                    "enum": [
                      "2026-05",
                      "2026-11"
                    ],
                    "default": "2026-05",
                    "description": "Schematron ruleset release: \"2026-05\" (May 2026 v3.0.22 + EN 16931 1.3.16, mandatory now) or \"2026-11\" (November 2026 v3.1.0 + EN 16931 1.3.17, mandatory Feb 22-24, 2027). Query/field alias: `release`."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Validation results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "isValid": {
                      "type": "boolean"
                    },
                    "documentType": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "fatal": {
                          "type": "integer"
                        },
                        "warning": {
                          "type": "integer"
                        },
                        "info": {
                          "type": "integer"
                        }
                      }
                    },
                    "errors": {
                      "type": "object",
                      "properties": {
                        "fatal": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "warning": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "info": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    },
                    "breakdown": {
                      "type": "object"
                    },
                    "rulesetVersion": {
                      "type": "string",
                      "example": "2026-05"
                    },
                    "rulesetLabel": {
                      "type": "string",
                      "example": "May 2026 (v3.0.22 / EN 16931 1.3.16 - Mandatory)"
                    },
                    "availableVersions": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "example": [
                        "2026-05",
                        "2026-11"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "XML file is required"
          },
          "401": {
            "description": "Authentication required"
          }
        },
        "parameters": [
          {
            "name": "version",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-05",
                "2026-11"
              ],
              "default": "2026-05"
            },
            "description": "Optional ruleset release override (\"2026-05\" or \"2026-11\"). Also accepted as `release` or body field."
          }
        ]
      }
    },
    "/api/peppol/xml-validator-base64": {
      "post": {
        "summary": "Validate Peppol XML Document (Base64)",
        "description": "Accepts a Peppol (UBL/BIS 3.0/PINT) XML file encoded in Base64 via JSON body and validates it using Saxon-JS against official Schematron rules. Requires authentication (session cookie, Bearer token, or x-api-key). Free - no quota deducted.",
        "tags": [
          "Peppol Validation"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "xml": {
                    "type": "string",
                    "description": "Base64 encoded string of the Peppol XML file. (Alias for `xmlBase64` - provide either `xml` or `xmlBase64`)."
                  },
                  "xmlBase64": {
                    "type": "string",
                    "description": "Base64-encoded XML invoice content (alias for `xml`)."
                  },
                  "version": {
                    "type": "string",
                    "enum": [
                      "2026-05",
                      "2026-11"
                    ],
                    "default": "2026-05",
                    "description": "Schematron ruleset release: \"2026-05\" (May 2026 v3.0.22 + EN 16931 1.3.16, mandatory now) or \"2026-11\" (November 2026 v3.1.0 + EN 16931 1.3.17, mandatory Feb 22-24, 2027). Query/field alias: `release`."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Validation results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "isValid": {
                      "type": "boolean"
                    },
                    "documentType": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "fatal": {
                          "type": "integer"
                        },
                        "warning": {
                          "type": "integer"
                        },
                        "info": {
                          "type": "integer"
                        }
                      }
                    },
                    "errors": {
                      "type": "object",
                      "properties": {
                        "fatal": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "warning": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "info": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    },
                    "breakdown": {
                      "type": "object"
                    },
                    "rulesetVersion": {
                      "type": "string",
                      "example": "2026-05"
                    },
                    "rulesetLabel": {
                      "type": "string",
                      "example": "May 2026 (v3.0.22 / EN 16931 1.3.16 - Mandatory)"
                    },
                    "availableVersions": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "example": [
                        "2026-05",
                        "2026-11"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Base64-encoded XML is required or Invalid base64 encoding"
          },
          "401": {
            "description": "Authentication required"
          }
        },
        "parameters": [
          {
            "name": "version",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-05",
                "2026-11"
              ],
              "default": "2026-05"
            },
            "description": "Optional ruleset release override (\"2026-05\" or \"2026-11\"). Also accepted as `release` or body field."
          }
        ]
      }
    },
    "/api/ksef/xml-to-pdf-v2": {
      "post": {
        "summary": "Convert KSeF XML to PDF (Multipart)",
        "description": "Accepts KSeF FA(3) XML files via multipart/form-data (or Base64 JSON) and renders white-label PDF using in-process pdfmake 0.3.15 with RFC 5987 UTF-8 filenames. Debits \"ksef-xml-to-pdf-v2\".",
        "tags": [
          "KSeF Converters"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "xml"
                ],
                "properties": {
                  "xml": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "binary"
                    },
                    "description": "One or more KSeF XML files."
                  },
                  "lang": {
                    "type": "string",
                    "enum": [
                      "pl",
                      "en"
                    ],
                    "default": "pl"
                  },
                  "qrUrl": {
                    "type": "string",
                    "description": "Optional QR Code Verification URL."
                  },
                  "ksefUuid": {
                    "type": "string",
                    "description": "Optional KSeF Number."
                  },
                  "offlineQrUrl": {
                    "type": "string",
                    "description": "Optional secondary OFFLINE certificate QR URL."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "A PDF file stream (or ZIP file for bulk uploads).",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "At least one XML file required"
          },
          "401": {
            "description": "Unauthorized - Invalid or missing token"
          }
        }
      }
    },
    "/api/ksef/validator": {
      "post": {
        "summary": "Validate KSeF XML Document (Multipart)",
        "description": "Accepts a KSeF XML file as multipart/form-data and returns validation results against the official FA(2) schemas.",
        "tags": [
          "KSeF Validation"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "xml"
                ],
                "properties": {
                  "xml": {
                    "type": "string",
                    "format": "binary",
                    "description": "The KSeF XML file to validate."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful validation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "isValid": {
                      "type": "boolean",
                      "description": "Indicates if the document passed all schema checks."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "message": {
                            "type": "string"
                          },
                          "line": {
                            "type": "integer"
                          },
                          "column": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "quota": {
                      "type": "object",
                      "properties": {
                        "usage": {
                          "type": "integer"
                        },
                        "limit": {
                          "type": "integer"
                        },
                        "remaining": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - Invalid or missing token"
          },
          "403": {
            "description": "Quota exceeded or forbidden"
          }
        }
      }
    },
    "/api/ksef/validator-base64": {
      "post": {
        "summary": "Validate KSeF XML Document (Base64)",
        "description": "Accepts a base64-encoded KSeF XML document via JSON and validates it against the official schemas. Shares quota with the multipart validator.",
        "tags": [
          "KSeF Validation"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "xml": {
                    "type": "string",
                    "description": "Base64-encoded KSeF XML content. (Alias for `xmlBase64` - provide either `xml` or `xmlBase64`)."
                  },
                  "xmlBase64": {
                    "type": "string",
                    "description": "Base64-encoded XML invoice content (alias for `xml`)."
                  }
                }
              },
              "example": {
                "xml": "PD94bWwgdmVyc2lvbj0iMS4wIi..."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Validation completed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "isValid": {
                      "type": "boolean",
                      "description": "True if the document passed all XSD schema checks."
                    },
                    "errors": {
                      "type": "array",
                      "description": "List of validation errors (empty if valid).",
                      "items": {
                        "type": "object",
                        "properties": {
                          "message": {
                            "type": "string"
                          },
                          "line": {
                            "type": "integer"
                          },
                          "column": {
                            "type": "integer"
                          }
                        }
                      }
                    },
                    "quota": {
                      "type": "object",
                      "properties": {
                        "usage": {
                          "type": "integer"
                        },
                        "limit": {
                          "type": "integer"
                        },
                        "remaining": {
                          "type": "integer"
                        }
                      }
                    },
                    "quotaType": {
                      "type": "string",
                      "enum": [
                        "FREE",
                        "PAID"
                      ],
                      "description": "Which quota tier was consumed."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request - missing or invalid base64 XML"
          },
          "401": {
            "description": "Unauthorized - Invalid or missing token"
          },
          "403": {
            "description": "Quota exceeded"
          }
        }
      }
    },
    "/api/ksef/xml-to-pdf-v2-base64": {
      "post": {
        "summary": "Convert KSeF XML to PDF (v2 in-process, Base64)",
        "description": "Accepts base64-encoded KSeF XML and returns a base64-encoded PDF. In-process pdfmake engine (no Cloud Run round-trip) for lower latency. Accepts \"xml\" or \"xmlBase64\" as the body key. Supports qrUrl, offlineQrUrl, ksefUuid options. Debits the ksef-xml-to-pdf-v2 quota product.",
        "tags": [
          "KSeF Converters"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "xml": {
                    "type": "string",
                    "description": "Base64-encoded KSeF XML content. (Alias for `xmlBase64` - provide either `xml` or `xmlBase64`)."
                  },
                  "xmlBase64": {
                    "type": "string",
                    "description": "Base64-encoded XML invoice content (alias for `xml`)."
                  },
                  "lang": {
                    "type": "string",
                    "enum": [
                      "pl",
                      "en"
                    ],
                    "default": "pl"
                  },
                  "qrUrl": {
                    "type": "string",
                    "description": "Optional embedded QR Code URL."
                  },
                  "ksefUuid": {
                    "type": "string",
                    "description": "Optional KSeF reference UUID."
                  },
                  "offlineQrUrl": {
                    "type": "string",
                    "description": "Optional embedded offline-mode QR Code URL."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful conversion",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pdf": {
                      "type": "string",
                      "description": "Base64-encoded PDF binary."
                    },
                    "filename": {
                      "type": "string",
                      "description": "Suggested filename."
                    },
                    "quota": {
                      "type": "object",
                      "properties": {
                        "usage": {
                          "type": "integer"
                        },
                        "limit": {
                          "type": "integer"
                        },
                        "remaining": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "XML base64 required or invalid"
          },
          "401": {
            "description": "Unauthorized - Invalid or missing token"
          }
        }
      }
    },
    "/api/france/validator": {
      "post": {
        "summary": "Validate France UBL 2.1, CII D22B & Factur-X 1.09 PDF (Multipart)",
        "description": "Validates French UBL 2.1 XML, UN/CEFACT CII D22B XML, and hybrid Factur-X 1.09 PDF/A-3B documents against official FNFE-MPE FR CTC V1.4.0.04 & Factur-X 1.09.2 XSD + Schematron rules (EN16931, BASIC WL, EXTENDED, EXTENDED-CTC-FR).",
        "tags": [
          "France Validation"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "xml"
                ],
                "properties": {
                  "xml": {
                    "type": "string",
                    "format": "binary",
                    "description": "The French UBL 2.1 or Factur-X / CII XML invoice file to validate."
                  },
                  "translate": {
                    "type": "string",
                    "description": "Optional language preference ('en' or 'fr', defaults to returning bilingual messages)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Detailed validation report",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "isValid": {
                      "type": "boolean",
                      "description": "True if the document is completely valid (0 fatal Schematron errors and valid XSD)."
                    },
                    "documentType": {
                      "type": "string",
                      "example": "France UBL"
                    },
                    "profile": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "example": "EXTENDED-CTC-FR"
                        },
                        "billingMode": {
                          "type": "string",
                          "example": "B1"
                        },
                        "customizationId": {
                          "type": "string",
                          "example": "urn:cen.eu:en16931:2017#compliant#urn:fnfe-mpe.org:factur-x:1.0:extended"
                        }
                      }
                    },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "fatal": {
                          "type": "integer"
                        },
                        "warning": {
                          "type": "integer"
                        },
                        "info": {
                          "type": "integer"
                        }
                      }
                    },
                    "xsd": {
                      "type": "object",
                      "properties": {
                        "isValid": {
                          "type": "boolean"
                        },
                        "errors": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "message": {
                                "type": "string"
                              },
                              "message_en": {
                                "type": "string"
                              },
                              "message_fr": {
                                "type": "string"
                              },
                              "element": {
                                "type": "string"
                              },
                              "line": {
                                "type": "integer"
                              }
                            }
                          }
                        }
                      }
                    },
                    "errors": {
                      "type": "object",
                      "properties": {
                        "fatal": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "source": {
                                "type": "string",
                                "example": "FR CTC Base"
                              },
                              "id": {
                                "type": "string",
                                "example": "BR-FREXT-S-08"
                              },
                              "flag": {
                                "type": "string",
                                "example": "fatal"
                              },
                              "location": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "message_en": {
                                "type": "string"
                              },
                              "message_fr": {
                                "type": "string"
                              },
                              "businessTermId": {
                                "type": "string",
                                "example": "BG-23"
                              },
                              "businessTerm": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "en": {
                                    "type": "string"
                                  },
                                  "fr": {
                                    "type": "string"
                                  }
                                }
                              },
                              "debugInfo": {
                                "type": "object",
                                "description": "Extracted calculation parameters from the Schematron assertion (e.g. basisAmount, SumBT131, rate)."
                              }
                            }
                          }
                        },
                        "warning": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "info": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    },
                    "breakdown": {
                      "type": "object",
                      "properties": {
                        "frBase": {
                          "type": "object",
                          "properties": {
                            "fatal": {
                              "type": "integer"
                            },
                            "warning": {
                              "type": "integer"
                            },
                            "info": {
                              "type": "integer"
                            }
                          }
                        },
                        "frRules": {
                          "type": "object",
                          "properties": {
                            "fatal": {
                              "type": "integer"
                            },
                            "warning": {
                              "type": "integer"
                            },
                            "info": {
                              "type": "integer"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Missing XML file or invalid document format"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/france/e-reporting/validator": {
      "post": {
        "summary": "Validate French E-Reporting & Lifecycle (CDAR) XML",
        "description": "Validates French E-Reporting XML files (Flux 10: Transactions Report Flux 10.1/10.3, Payments Report Flux 10.2/10.4) and Life Cycle Status Reporting (Cycle de Vie / CDAR - CrossDomainAcknowledgementAndResponse) against official DGFIP XSD v3.1 schemas and FNFE FR CTC V1.4.0 Schematrons.\n\nAutomatically detects whether the uploaded document is a CDAR lifecycle report or an E-Reporting Flux 10 transmission.",
        "tags": [
          "France Validation"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "xml"
                ],
                "properties": {
                  "xml": {
                    "type": "string",
                    "format": "binary",
                    "description": "The XML file to validate (E-Reporting Flux 10 or CDAR Cycle de Vie)."
                  },
                  "docType": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "cdar",
                      "transaction",
                      "payment",
                      "ereporting"
                    ],
                    "default": "auto",
                    "description": "Document type hint. Defaults to 'auto' for automatic content detection."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Validation results for E-Reporting / CDAR document",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "isValid": {
                      "type": "boolean"
                    },
                    "docType": {
                      "type": "string",
                      "example": "cdar"
                    },
                    "docLabel": {
                      "type": "string",
                      "example": "Cycle de Vie (CDAR)"
                    },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "fatal": {
                          "type": "integer"
                        },
                        "warning": {
                          "type": "integer"
                        },
                        "info": {
                          "type": "integer"
                        }
                      }
                    },
                    "xsd": {
                      "type": "object",
                      "properties": {
                        "isValid": {
                          "type": "boolean"
                        },
                        "errors": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    },
                    "errors": {
                      "type": "object",
                      "properties": {
                        "fatal": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "warning": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        },
                        "info": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          }
                        }
                      }
                    },
                    "breakdown": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - XML file missing or empty"
          },
          "500": {
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/api/france/xml-to-pdf": {
      "post": {
        "summary": "Convert UBL/CII XML to France Factur-X 1.09 & PDF (Multipart / Binary)",
        "description": "Accepts UBL 2.1 or CII D22B XML files (single or bulk ZIP up to 50) and renders white-label Factur-X 1.09 Hybrid PDF/A-3B, standalone visual PDF, ZIP bundle, or Factur-X XML via pdfmake 0.3.15. Debits \"france-facturx-to-pdf\".",
        "tags": [
          "France Converters"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "xml"
                ],
                "properties": {
                  "xml": {
                    "type": "string",
                    "format": "binary",
                    "description": "Single French XML file, or multiple files for batch conversion."
                  },
                  "lang": {
                    "type": "string",
                    "enum": [
                      "fr",
                      "en"
                    ],
                    "default": "fr",
                    "description": "Output PDF rendering language (fr or en)."
                  },
                  "outputMode": {
                    "type": "string",
                    "enum": [
                      "facturx_pdf",
                      "pdf",
                      "zip",
                      "xml"
                    ],
                    "default": "facturx_pdf",
                    "description": "Output mode: facturx_pdf (Hybrid PDF/A-3B with embedded factur-x.xml), pdf (visual PDF only), zip (PDF + XML), or xml (Factur-X CII XML only)."
                  },
                  "profile": {
                    "type": "string",
                    "enum": [
                      "EN16931",
                      "EXTENDED",
                      "EXTENDED_CTC_FR",
                      "BASIC",
                      "BASICWL",
                      "MINIMUM"
                    ],
                    "default": "EN16931",
                    "description": "Target Factur-X 1.09 / FR CTC profile."
                  },
                  "includeQr": {
                    "type": "boolean",
                    "default": true,
                    "description": "Embed SEPA EPC-QR payment code on EUR invoices with seller IBAN."
                  },
                  "accentColor": {
                    "type": "string",
                    "example": "#1e3a8a",
                    "description": "Optional hex accent color (#RRGGBB) for white-label paid Factur-X PDFs."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Binary PDF stream (single file) or ZIP archive (multiple files)",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Missing XML file"
          },
          "401": {
            "description": "Unauthorized - Invalid or missing token / Insufficient quota"
          }
        }
      }
    },
    "/api/france/xml-to-pdf-base64": {
      "post": {
        "summary": "Convert UBL/CII XML to France Factur-X 1.09 & PDF (Base64 JSON)",
        "description": "Accepts Base64-encoded (or raw) UBL 2.1 or CII D22B XML (`xml` / `xmlBase64`) and renders white-label Factur-X 1.09 Hybrid PDF/A-3B or standalone French PDF using in-process pdfmake 0.3.15. Debits \"france-facturx-to-pdf\".",
        "tags": [
          "France Converters"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "xml": {
                    "type": "string",
                    "description": "Base64-encoded French XML invoice content. (Alias for `xmlBase64` - provide either `xml` or `xmlBase64`)."
                  },
                  "xmlBase64": {
                    "type": "string",
                    "description": "Base64-encoded XML invoice content (alias for `xml`)."
                  },
                  "lang": {
                    "type": "string",
                    "enum": [
                      "fr",
                      "en"
                    ],
                    "default": "fr",
                    "description": "Output PDF rendering language (fr or en)."
                  },
                  "outputMode": {
                    "type": "string",
                    "enum": [
                      "facturx_pdf",
                      "pdf",
                      "zip",
                      "xml"
                    ],
                    "default": "facturx_pdf",
                    "description": "Output mode: facturx_pdf (Hybrid PDF/A-3B with embedded factur-x.xml), pdf (visual PDF only), zip (PDF + XML), or xml (Factur-X CII XML only)."
                  },
                  "profile": {
                    "type": "string",
                    "enum": [
                      "EN16931",
                      "EXTENDED",
                      "EXTENDED_CTC_FR",
                      "BASIC",
                      "BASICWL",
                      "MINIMUM"
                    ],
                    "default": "EN16931",
                    "description": "Target Factur-X 1.09 / FR CTC profile."
                  },
                  "includeQr": {
                    "type": "boolean",
                    "default": true,
                    "description": "Embed SEPA EPC-QR payment code on EUR invoices with seller IBAN."
                  },
                  "accentColor": {
                    "type": "string",
                    "example": "#1e3a8a",
                    "description": "Optional hex accent color (#RRGGBB) for white-label paid Factur-X PDFs."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful conversion returning Base64 PDF",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pdf": {
                      "type": "string",
                      "description": "Base64-encoded PDF binary."
                    },
                    "filename": {
                      "type": "string",
                      "example": "F202500001.pdf"
                    },
                    "quota": {
                      "type": "object",
                      "properties": {
                        "usage": {
                          "type": "integer"
                        },
                        "limit": {
                          "type": "integer"
                        },
                        "remaining": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - XML base64 required or invalid"
          },
          "401": {
            "description": "Unauthorized - Invalid or missing token / Insufficient quota"
          }
        }
      }
    },
    "/api/germany/ubl-to-zugferd": {
      "post": {
        "summary": "Convert UBL 2.1 XML to Germany ZUGFeRD 2.3 (Multipart / Binary)",
        "description": "Converts Peppol / EN 16931 UBL 2.1 XML invoices into white-label Germany ZUGFeRD 2.3 CII XML and/or Hybrid PDF/A-3B (GiroCode EPC-QR, optional DIN 5008 layout). Uses the \"germany-ubl-to-zugferd\" quota.",
        "tags": [
          "Germany Converters"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "xml"
                ],
                "properties": {
                  "xml": {
                    "type": "string",
                    "format": "binary",
                    "description": "UBL 2.1 XML invoice file (or multiple files for ZIP bundle)."
                  },
                  "lang": {
                    "type": "string",
                    "enum": [
                      "en",
                      "de"
                    ],
                    "default": "en",
                    "description": "Output language for labels on the generated ZUGFeRD PDF."
                  },
                  "outputMode": {
                    "type": "string",
                    "enum": [
                      "hybrid_pdf",
                      "zip",
                      "xml"
                    ],
                    "default": "hybrid_pdf",
                    "description": "Return Hybrid PDF (`hybrid_pdf`), ZIP containing PDF + factur-x.xml (`zip`), or ZUGFeRD CII XML only (`xml`)."
                  },
                  "profile": {
                    "type": "string",
                    "default": "EN16931",
                    "description": "ZUGFeRD conformance profile (e.g. EN16931, EXTENDED, XRECHNUNG)."
                  },
                  "layout": {
                    "type": "string",
                    "enum": [
                      "modern",
                      "din5008"
                    ],
                    "default": "modern",
                    "description": "PDF page layout: \"modern\" or \"din5008\" (German DIN 5008 window envelope alignment)."
                  },
                  "includeQr": {
                    "type": "boolean",
                    "default": true,
                    "description": "Embed GiroCode (EPC-QR SEPA payment QR) on EUR invoices with seller IBAN."
                  },
                  "accentColor": {
                    "type": "string",
                    "example": "#1e3a8a",
                    "description": "Optional hex accent color (#RRGGBB) for white-label paid ZUGFeRD 2.3 PDFs."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Generated Hybrid ZUGFeRD PDF, ZUGFeRD CII XML, or ZIP bundle",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/xml": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Missing or invalid XML input"
          },
          "401": {
            "description": "Unauthorized - Invalid or missing token"
          },
          "403": {
            "description": "Forbidden - Insufficient quota"
          }
        }
      }
    },
    "/api/germany/ubl-to-zugferd-base64": {
      "post": {
        "summary": "Convert UBL 2.1 XML to Germany ZUGFeRD 2.3 (Base64 JSON)",
        "description": "Accepts Base64-encoded (or raw) UBL 2.1 XML via JSON (`xml` or `xmlBase64`) and returns white-label ZUGFeRD 2.3 CII XML and/or Hybrid PDF/A-3B (with GiroCode EPC-QR, optional DIN 5008 layout, XMP/OutputIntent sync) plus quota metadata. Uses the \"germany-ubl-to-zugferd\" quota.",
        "tags": [
          "Germany Converters"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "xml": {
                    "type": "string",
                    "description": "Base64-encoded UBL 2.1 XML invoice (provide either `xml` or `xmlBase64`)."
                  },
                  "xmlBase64": {
                    "type": "string",
                    "description": "Base64-encoded UBL 2.1 XML invoice (alias for `xml`)."
                  },
                  "lang": {
                    "type": "string",
                    "enum": [
                      "en",
                      "de"
                    ],
                    "default": "en"
                  },
                  "outputMode": {
                    "type": "string",
                    "enum": [
                      "hybrid_pdf",
                      "xml"
                    ],
                    "default": "hybrid_pdf"
                  },
                  "profile": {
                    "type": "string",
                    "default": "EN16931"
                  },
                  "layout": {
                    "type": "string",
                    "enum": [
                      "modern",
                      "din5008"
                    ],
                    "default": "modern",
                    "description": "PDF page layout: \"modern\" or \"din5008\" (German DIN 5008 window envelope alignment)."
                  },
                  "includeQr": {
                    "type": "boolean",
                    "default": true,
                    "description": "Embed GiroCode (EPC-QR SEPA payment QR) on EUR invoices with seller IBAN."
                  },
                  "accentColor": {
                    "type": "string",
                    "example": "#1e3a8a",
                    "description": "Optional hex accent color (#RRGGBB) for white-label paid ZUGFeRD 2.3 PDFs."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful conversion returning ZUGFeRD Hybrid PDF and CII XML",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pdf": {
                      "type": "string",
                      "nullable": true,
                      "description": "Base64-encoded Hybrid PDF (null when outputMode is `xml`)."
                    },
                    "xml": {
                      "type": "string",
                      "description": "Generated ZUGFeRD / Factur-X CII XML string."
                    },
                    "xmlBase64": {
                      "type": "string",
                      "description": "Base64-encoded ZUGFeRD CII XML."
                    },
                    "filename": {
                      "type": "string"
                    },
                    "profile": {
                      "type": "string"
                    },
                    "outputMode": {
                      "type": "string"
                    },
                    "quota": {
                      "type": "object",
                      "nullable": true,
                      "properties": {
                        "usage": {
                          "type": "integer"
                        },
                        "limit": {
                          "type": "integer"
                        },
                        "remaining": {
                          "type": "integer"
                        },
                        "resetTime": {
                          "type": "string"
                        },
                        "quotaType": {
                          "type": "string",
                          "enum": [
                            "FREE",
                            "PAID"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Base64 XML required or invalid"
          },
          "401": {
            "description": "Unauthorized - Invalid or missing token"
          },
          "403": {
            "description": "Forbidden - Insufficient quota"
          }
        }
      }
    },
    "/api/germany/validator": {
      "post": {
        "summary": "Validate Germany ZUGFeRD / XRechnung / UBL Invoice (Multipart)",
        "description": "Validates ZUGFeRD 2.3 CII XML, UBL 2.1 XML, and Hybrid ZUGFeRD PDFs against UN/CEFACT D22B XSD, EN 16931 Schematron (CII 1.3.17 / UBL 1.3.16 or 1.3.17), and German XRechnung BR-DE rules (including DE-R-T02).",
        "tags": [
          "Germany Validation"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "xml"
                ],
                "properties": {
                  "xml": {
                    "type": "string",
                    "format": "binary",
                    "description": "XML invoice or Hybrid ZUGFeRD PDF file to validate."
                  },
                  "version": {
                    "type": "string",
                    "enum": [
                      "2026-05",
                      "2026-11"
                    ],
                    "default": "2026-05",
                    "description": "Schematron ruleset release: \"2026-05\" (May 2026 v3.0.22 + EN 16931 1.3.16, mandatory now) or \"2026-11\" (November 2026 v3.1.0 + EN 16931 1.3.17, mandatory Feb 22-24, 2027). Query/field alias: `release`."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Validation results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "isValid": {
                      "type": "boolean"
                    },
                    "documentType": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "fatal": {
                          "type": "integer"
                        },
                        "warning": {
                          "type": "integer"
                        },
                        "info": {
                          "type": "integer"
                        },
                        "xsdErrors": {
                          "type": "integer"
                        }
                      }
                    },
                    "rulesetVersion": {
                      "type": "string",
                      "example": "cii-1.3.17"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - XML or Hybrid PDF required"
          }
        },
        "parameters": [
          {
            "name": "version",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-05",
                "2026-11"
              ],
              "default": "2026-05"
            },
            "description": "Optional ruleset release override (\"2026-05\" or \"2026-11\"). Also accepted as `release` or body field."
          }
        ]
      }
    },
    "/api/germany/validator-base64": {
      "post": {
        "summary": "Validate Germany ZUGFeRD / XRechnung / UBL Invoice (Base64 JSON)",
        "description": "Validates ZUGFeRD 2.3 CII XML, UBL 2.1 XML, and Hybrid ZUGFeRD PDFs against UN/CEFACT D22B XSD, EN 16931 Schematron (CII 1.3.17 / UBL 1.3.16 or 1.3.17), and German XRechnung BR-DE rules (including DE-R-T02).",
        "tags": [
          "Germany Validation"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "xml": {
                    "type": "string",
                    "description": "Base64-encoded XML or Hybrid PDF (provide any of `xml`, `xmlBase64`, `pdf`, `pdfBase64`)."
                  },
                  "xmlBase64": {
                    "type": "string",
                    "description": "Base64-encoded XML invoice."
                  },
                  "pdf": {
                    "type": "string",
                    "description": "Base64-encoded Hybrid ZUGFeRD PDF."
                  },
                  "pdfBase64": {
                    "type": "string",
                    "description": "Base64-encoded Hybrid ZUGFeRD PDF (alias for `pdf`)."
                  },
                  "version": {
                    "type": "string",
                    "enum": [
                      "2026-05",
                      "2026-11"
                    ],
                    "default": "2026-05",
                    "description": "Schematron ruleset release: \"2026-05\" (May 2026 v3.0.22 + EN 16931 1.3.16, mandatory now) or \"2026-11\" (November 2026 v3.1.0 + EN 16931 1.3.17, mandatory Feb 22-24, 2027). Query/field alias: `release`."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Validation results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "isValid": {
                      "type": "boolean"
                    },
                    "documentType": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "fatal": {
                          "type": "integer"
                        },
                        "warning": {
                          "type": "integer"
                        },
                        "info": {
                          "type": "integer"
                        },
                        "xsdErrors": {
                          "type": "integer"
                        }
                      }
                    },
                    "rulesetVersion": {
                      "type": "string",
                      "example": "cii-1.3.17"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Invalid or missing Base64 input"
          }
        },
        "parameters": [
          {
            "name": "version",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "2026-05",
                "2026-11"
              ],
              "default": "2026-05"
            },
            "description": "Optional ruleset release override (\"2026-05\" or \"2026-11\"). Also accepted as `release` or body field."
          }
        ]
      }
    },
    "/api/france/validator-base64": {
      "post": {
        "summary": "Validate France UBL 2.1, CII D22B & Factur-X 1.09 PDF (Base64 JSON)",
        "description": "Validates French UBL 2.1 XML, UN/CEFACT CII D22B XML, and hybrid Factur-X 1.09 PDF/A-3B documents against official FNFE-MPE FR CTC V1.4.0.04 & Factur-X 1.09.2 XSD + Schematron rules (EN16931, BASIC WL, EXTENDED, EXTENDED-CTC-FR).",
        "tags": [
          "France Validation"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "xml": {
                    "type": "string",
                    "description": "Base64-encoded French XML invoice (provide either `xml` or `xmlBase64`)."
                  },
                  "xmlBase64": {
                    "type": "string",
                    "description": "Base64-encoded French XML invoice (alias for `xml`)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Validation results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "isValid": {
                      "type": "boolean"
                    },
                    "documentType": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "fatal": {
                          "type": "integer"
                        },
                        "warning": {
                          "type": "integer"
                        },
                        "info": {
                          "type": "integer"
                        },
                        "xsdErrors": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Base64 XML required or invalid"
          }
        }
      }
    },
    "/api/france/e-reporting/validator-base64": {
      "post": {
        "summary": "Validate French E-Reporting (Flux 10) / CDAR XML (Base64 JSON)",
        "description": "Accepts a Base64-encoded (or raw) French Flux 10 E-Reporting or CDAR XML document (`xml` or `xmlBase64`) and validates against official rules.",
        "tags": [
          "France Validation"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "xml": {
                    "type": "string",
                    "description": "Base64-encoded Flux 10 / CDAR XML (provide either `xml` or `xmlBase64`)."
                  },
                  "xmlBase64": {
                    "type": "string",
                    "description": "Base64-encoded Flux 10 / CDAR XML (alias for `xml`)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Validation results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "isValid": {
                      "type": "boolean"
                    },
                    "documentType": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "fatal": {
                          "type": "integer"
                        },
                        "warning": {
                          "type": "integer"
                        },
                        "info": {
                          "type": "integer"
                        },
                        "xsdErrors": {
                          "type": "integer"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Base64 XML required or invalid"
          }
        }
      }
    },
    "/api/peppol/check-participant": {
      "get": {
        "tags": [
          "Peppol Directory & Live Lookup (Free)"
        ],
        "summary": "Real-Time Peppol Participant Lookup (Free, GET)",
        "description": "Free public endpoint - no API key or login required (rate limited 100 req/min/IP). Performs a real-time Peppol SML (DNS NAPTR) + SMP HTTP lookup for the participant ServiceGroup, BusinessCard, and optional AS4 endpoints/X.509 certificates, falling back to the daily-synced 9M+ Peppol Directory for alternative scheme discovery.",
        "security": [],
        "parameters": [
          {
            "name": "participant",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "example": "0088:5798009811578"
            },
            "description": "Combined scheme:id (alternative to passing schemeID and participantID separately)"
          },
          {
            "name": "schemeID",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "example": "0088"
            },
            "description": "ICD / Peppol scheme code (required unless combined participant is provided)"
          },
          {
            "name": "participantID",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "example": "5798009811578"
            },
            "description": "Participant identifier (required unless combined participant is provided)"
          },
          {
            "name": "env",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "prod",
                "test"
              ],
              "default": "prod"
            },
            "description": "Target Peppol network: prod (participant.sml.prod.tech.peppol.org) or test (participant.sml.test.tech.peppol.org)"
          },
          {
            "name": "isProduction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": true
            },
            "description": "Boolean alias for env"
          },
          {
            "name": "documentType",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "example": "Invoice"
            },
            "description": "Optional document type filter/check (e.g. Invoice, CreditNote, Order, CrossIndustryInvoice)"
          },
          {
            "name": "includeEndpoints",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Set true to fetch SMP ServiceMetadata AS4 endpoint URLs and X.509 certificate validity"
          },
          {
            "name": "fresh",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Set true to bypass the 5-minute Redis cache and query SML/SMP live"
          }
        ],
        "responses": {
          "200": {
            "description": "Participant lookup result (Live SML/SMP or Directory fallback)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "found": {
                      "type": "boolean"
                    },
                    "registeredInSml": {
                      "type": "boolean",
                      "description": "True when DNS NAPTR + SMP resolved directly on live Peppol network"
                    },
                    "foundIn": {
                      "type": "string",
                      "enum": [
                        "peppol_live_sml_smp",
                        "peppol_live_sml_smp+neon",
                        "neon_database",
                        "none"
                      ]
                    },
                    "matchType": {
                      "type": "string",
                      "enum": [
                        "direct",
                        "alternative_schemes",
                        "not_found"
                      ]
                    },
                    "participantID": {
                      "type": "string"
                    },
                    "schemeID": {
                      "type": "string"
                    },
                    "actualFullPid": {
                      "type": "string"
                    },
                    "environment": {
                      "type": "string",
                      "enum": [
                        "prod",
                        "test"
                      ]
                    },
                    "companyName": {
                      "type": "string",
                      "nullable": true
                    },
                    "countryCode": {
                      "type": "string",
                      "nullable": true
                    },
                    "documentType": {
                      "type": "string",
                      "nullable": true
                    },
                    "supportsDocumentType": {
                      "type": "boolean",
                      "nullable": true
                    },
                    "allDocumentTypes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "rawDocumentTypes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "smpUrl": {
                      "type": "string",
                      "nullable": true
                    },
                    "smlDomain": {
                      "type": "string"
                    },
                    "naptrHost": {
                      "type": "string"
                    },
                    "businessCard": {
                      "type": "object",
                      "nullable": true
                    },
                    "endpoints": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      },
                      "description": "Included when includeEndpoints=true"
                    },
                    "alternativeSchemes": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "message": {
                      "type": "string"
                    },
                    "cached": {
                      "type": "boolean"
                    }
                  }
                },
                "examples": {
                  "liveSmlSmpMatch": {
                    "summary": "Live SML/SMP Match",
                    "value": {
                      "found": true,
                      "registeredInSml": true,
                      "foundIn": "peppol_live_sml_smp",
                      "matchType": "direct",
                      "participantID": "5798009811578",
                      "schemeID": "0088",
                      "actualFullPid": "0088:5798009811578",
                      "environment": "prod",
                      "companyName": "Example Company A/S",
                      "countryCode": "DK",
                      "documentType": "Invoice",
                      "supportsDocumentType": true,
                      "allDocumentTypes": [
                        "Invoice",
                        "CreditNote"
                      ],
                      "rawDocumentTypes": [
                        "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1"
                      ],
                      "smpUrl": "https://smp.example.com",
                      "smlDomain": "participant.sml.prod.tech.peppol.org",
                      "naptrHost": "abcd1234.iso6523-actorid-upis.participant.sml.prod.tech.peppol.org",
                      "businessCard": {
                        "companyName": "Example Company A/S",
                        "countryCode": "DK",
                        "regDate": "2020-01-15",
                        "website": "https://example.com",
                        "contacts": [],
                        "identifiers": []
                      },
                      "endpoints": [
                        {
                          "documentType": "Invoice",
                          "transportProfile": "peppol-transport-as4-v2_0",
                          "endpointUrl": "https://ap.example.com/as4",
                          "certificate": {
                            "subject": "CN=POP000001, O=Example AP, C=DK",
                            "issuer": "CN=PEPPOL ACCESS POINT CA G2",
                            "validFrom": "2025-01-01T00:00:00Z",
                            "validTo": "2027-01-01T00:00:00Z",
                            "isExpired": false
                          }
                        }
                      ],
                      "message": "Invoice supported - Example Company A/S",
                      "cached": false
                    }
                  },
                  "alternativeSchemesFallback": {
                    "summary": "Alternative Schemes Fallback",
                    "value": {
                      "found": true,
                      "registeredInSml": false,
                      "foundIn": "neon_database",
                      "matchType": "alternative_schemes",
                      "participantID": "5798009811578",
                      "schemeID": "9999",
                      "environment": "prod",
                      "companyName": "Multiple alternatives found",
                      "alternativeSchemes": [
                        {
                          "scheme": "0088",
                          "fullPid": "0088:5798009811578",
                          "companyName": "Example Company A/S"
                        }
                      ],
                      "message": "Exact scheme 9999 not found, but alternatives for normalized ID: 5798009811578",
                      "note": "Try one of the alternative full PIDs below.",
                      "cached": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing schemeID / participantID or invalid JSON body"
          },
          "429": {
            "description": "Rate limit exceeded (100 requests/minute per IP)"
          }
        }
      },
      "post": {
        "tags": [
          "Peppol Directory & Live Lookup (Free)"
        ],
        "summary": "Real-Time Peppol Participant Lookup (Free, POST)",
        "description": "Free public endpoint - no API key or login required (rate limited 100 req/min/IP). JSON POST variant of the real-time Peppol SML (DNS NAPTR) + SMP lookup with Neon Directory fallback. Note: for backwards compatibility with existing callers, POST defaults to test when neither env nor isProduction is passed; pass \"env\": \"prod\" or \"isProduction\": true for Production.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "participant": {
                    "type": "string",
                    "example": "0088:5798009811578",
                    "description": "Optional combined scheme:id"
                  },
                  "schemeID": {
                    "type": "string",
                    "example": "0088"
                  },
                  "participantID": {
                    "type": "string",
                    "example": "5798009811578"
                  },
                  "env": {
                    "type": "string",
                    "enum": [
                      "prod",
                      "test"
                    ],
                    "example": "prod"
                  },
                  "isProduction": {
                    "type": "boolean",
                    "example": true
                  },
                  "documentType": {
                    "type": "string",
                    "example": "Invoice"
                  },
                  "includeEndpoints": {
                    "type": "boolean",
                    "default": false
                  },
                  "fresh": {
                    "type": "boolean",
                    "default": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Participant lookup result (Live SML/SMP or Directory fallback)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "found": {
                      "type": "boolean"
                    },
                    "registeredInSml": {
                      "type": "boolean",
                      "description": "True when DNS NAPTR + SMP resolved directly on live Peppol network"
                    },
                    "foundIn": {
                      "type": "string",
                      "enum": [
                        "peppol_live_sml_smp",
                        "peppol_live_sml_smp+neon",
                        "neon_database",
                        "none"
                      ]
                    },
                    "matchType": {
                      "type": "string",
                      "enum": [
                        "direct",
                        "alternative_schemes",
                        "not_found"
                      ]
                    },
                    "participantID": {
                      "type": "string"
                    },
                    "schemeID": {
                      "type": "string"
                    },
                    "actualFullPid": {
                      "type": "string"
                    },
                    "environment": {
                      "type": "string",
                      "enum": [
                        "prod",
                        "test"
                      ]
                    },
                    "companyName": {
                      "type": "string",
                      "nullable": true
                    },
                    "countryCode": {
                      "type": "string",
                      "nullable": true
                    },
                    "documentType": {
                      "type": "string",
                      "nullable": true
                    },
                    "supportsDocumentType": {
                      "type": "boolean",
                      "nullable": true
                    },
                    "allDocumentTypes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "rawDocumentTypes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "smpUrl": {
                      "type": "string",
                      "nullable": true
                    },
                    "smlDomain": {
                      "type": "string"
                    },
                    "naptrHost": {
                      "type": "string"
                    },
                    "businessCard": {
                      "type": "object",
                      "nullable": true
                    },
                    "endpoints": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      },
                      "description": "Included when includeEndpoints=true"
                    },
                    "alternativeSchemes": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "message": {
                      "type": "string"
                    },
                    "cached": {
                      "type": "boolean"
                    }
                  }
                },
                "examples": {
                  "liveSmlSmpMatch": {
                    "summary": "Live SML/SMP Match",
                    "value": {
                      "found": true,
                      "registeredInSml": true,
                      "foundIn": "peppol_live_sml_smp",
                      "matchType": "direct",
                      "participantID": "5798009811578",
                      "schemeID": "0088",
                      "actualFullPid": "0088:5798009811578",
                      "environment": "prod",
                      "companyName": "Example Company A/S",
                      "countryCode": "DK",
                      "documentType": "Invoice",
                      "supportsDocumentType": true,
                      "allDocumentTypes": [
                        "Invoice",
                        "CreditNote"
                      ],
                      "rawDocumentTypes": [
                        "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1"
                      ],
                      "smpUrl": "https://smp.example.com",
                      "smlDomain": "participant.sml.prod.tech.peppol.org",
                      "naptrHost": "abcd1234.iso6523-actorid-upis.participant.sml.prod.tech.peppol.org",
                      "businessCard": {
                        "companyName": "Example Company A/S",
                        "countryCode": "DK",
                        "regDate": "2020-01-15",
                        "website": "https://example.com",
                        "contacts": [],
                        "identifiers": []
                      },
                      "endpoints": [
                        {
                          "documentType": "Invoice",
                          "transportProfile": "peppol-transport-as4-v2_0",
                          "endpointUrl": "https://ap.example.com/as4",
                          "certificate": {
                            "subject": "CN=POP000001, O=Example AP, C=DK",
                            "issuer": "CN=PEPPOL ACCESS POINT CA G2",
                            "validFrom": "2025-01-01T00:00:00Z",
                            "validTo": "2027-01-01T00:00:00Z",
                            "isExpired": false
                          }
                        }
                      ],
                      "message": "Invoice supported - Example Company A/S",
                      "cached": false
                    }
                  },
                  "alternativeSchemesFallback": {
                    "summary": "Alternative Schemes Fallback",
                    "value": {
                      "found": true,
                      "registeredInSml": false,
                      "foundIn": "neon_database",
                      "matchType": "alternative_schemes",
                      "participantID": "5798009811578",
                      "schemeID": "9999",
                      "environment": "prod",
                      "companyName": "Multiple alternatives found",
                      "alternativeSchemes": [
                        {
                          "scheme": "0088",
                          "fullPid": "0088:5798009811578",
                          "companyName": "Example Company A/S"
                        }
                      ],
                      "message": "Exact scheme 9999 not found, but alternatives for normalized ID: 5798009811578",
                      "note": "Try one of the alternative full PIDs below.",
                      "cached": false
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing schemeID / participantID or invalid JSON body"
          },
          "429": {
            "description": "Rate limit exceeded (100 requests/minute per IP)"
          }
        }
      }
    },
    "/api/germany/test-ubl-to-zugferd": {
      "post": {
        "summary": "Convert UBL 2.1 XML to Germany ZUGFeRD 2.3 Free Trial (Multipart or Base64 JSON)",
        "description": "Free-tier endpoint generating watermarked ZUGFeRD 2.3 Hybrid PDF/A-3B previews with embedded CII XML. Accepts either multipart/form-data or application/json (`xml` / `xmlBase64`). Uses the \"germany-ubl-to-zugferd-free\" quota.",
        "tags": [
          "Germany Converters"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "xml"
                ],
                "properties": {
                  "xml": {
                    "type": "string",
                    "format": "binary",
                    "description": "UBL 2.1 XML file."
                  },
                  "lang": {
                    "type": "string",
                    "enum": [
                      "en",
                      "de"
                    ],
                    "default": "en"
                  },
                  "profile": {
                    "type": "string",
                    "enum": [
                      "EN16931",
                      "XRECHNUNG_30",
                      "EXTENDED",
                      "BASIC",
                      "BASICWL",
                      "MINIMUM"
                    ],
                    "default": "EN16931"
                  },
                  "layout": {
                    "type": "string",
                    "enum": [
                      "modern",
                      "din5008"
                    ],
                    "default": "modern",
                    "description": "PDF page layout: \"modern\" or \"din5008\" (German DIN 5008 window envelope alignment)."
                  },
                  "includeQr": {
                    "type": "boolean",
                    "default": true,
                    "description": "Embed GiroCode (EPC-QR SEPA payment QR) on EUR invoices with seller IBAN."
                  }
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "xml": {
                    "type": "string",
                    "description": "Base64-encoded UBL 2.1 XML (or alias `xmlBase64`)."
                  },
                  "xmlBase64": {
                    "type": "string",
                    "description": "Base64-encoded UBL 2.1 XML."
                  },
                  "lang": {
                    "type": "string",
                    "enum": [
                      "en",
                      "de"
                    ],
                    "default": "en"
                  },
                  "profile": {
                    "type": "string",
                    "default": "EN16931"
                  },
                  "layout": {
                    "type": "string",
                    "enum": [
                      "modern",
                      "din5008"
                    ],
                    "default": "modern",
                    "description": "PDF page layout: \"modern\" or \"din5008\" (German DIN 5008 window envelope alignment)."
                  },
                  "includeQr": {
                    "type": "boolean",
                    "default": true,
                    "description": "Embed GiroCode (EPC-QR SEPA payment QR) on EUR invoices with seller IBAN."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Watermarked Hybrid ZUGFeRD 2.3 PDF/A-3B stream (or ZIP for multiple files).",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "429": {
            "description": "Free quota exceeded"
          }
        }
      }
    },
    "/api/ksef/xml-preview": {
      "post": {
        "summary": "Render KSeF FA(3) Visual PDF Preview (Multipart or Base64 JSON)",
        "description": "Renders a watermarked KSeF FA(3) visual PDF preview using the shared ksef-visualizer (pdfmake 0.3.15) engine. Accepts multipart/form-data or application/json (`xml` / `xmlBase64`). Set `format=base64` for JSON output.",
        "tags": [
          "KSeF Converters"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "xml"
                ],
                "properties": {
                  "xml": {
                    "type": "string",
                    "format": "binary",
                    "description": "KSeF FA(3) XML file."
                  },
                  "lang": {
                    "type": "string",
                    "enum": [
                      "pl",
                      "en"
                    ],
                    "default": "pl"
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "pdf",
                      "base64"
                    ],
                    "default": "pdf"
                  }
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "xml": {
                    "type": "string",
                    "description": "Base64-encoded or raw KSeF FA(3) XML."
                  },
                  "xmlBase64": {
                    "type": "string",
                    "description": "Base64-encoded KSeF FA(3) XML."
                  },
                  "lang": {
                    "type": "string",
                    "enum": [
                      "pl",
                      "en"
                    ],
                    "default": "pl"
                  },
                  "format": {
                    "type": "string",
                    "enum": [
                      "pdf",
                      "base64"
                    ],
                    "default": "pdf"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Watermarked PDF stream (or JSON `{ pdf, filename, contentType }` when `format=base64`).",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "pdf": {
                      "type": "string"
                    },
                    "filename": {
                      "type": "string"
                    },
                    "contentType": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    },
    "/api/france/test-xml-to-pdf": {
      "post": {
        "summary": "Convert UBL/CII XML to France Factur-X 1.09 Free Trial (Multipart or Base64 JSON)",
        "description": "Free-tier sandbox endpoint generating watermarked France Factur-X 1.09 Hybrid PDF/A-3B or standalone PDF previews via pdfmake 0.3.15. Accepts multipart/form-data or application/json (`xml` / `xmlBase64`). Uses \"france-facturx-to-pdf-free\".",
        "tags": [
          "France Converters"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "xml"
                ],
                "properties": {
                  "xml": {
                    "type": "string",
                    "format": "binary",
                    "description": "UBL 2.1 or CII D22B XML file."
                  },
                  "lang": {
                    "type": "string",
                    "enum": [
                      "fr",
                      "en"
                    ],
                    "default": "fr",
                    "description": "Output PDF rendering language (fr or en)."
                  },
                  "outputMode": {
                    "type": "string",
                    "enum": [
                      "facturx_pdf",
                      "pdf"
                    ],
                    "default": "facturx_pdf"
                  },
                  "profile": {
                    "type": "string",
                    "enum": [
                      "EN16931",
                      "EXTENDED",
                      "EXTENDED_CTC_FR",
                      "BASIC",
                      "BASICWL",
                      "MINIMUM"
                    ],
                    "default": "EN16931",
                    "description": "Target Factur-X 1.09 / FR CTC profile."
                  },
                  "includeQr": {
                    "type": "boolean",
                    "default": true,
                    "description": "Embed SEPA EPC-QR payment code on EUR invoices with seller IBAN."
                  }
                }
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "xml": {
                    "type": "string",
                    "description": "Base64-encoded UBL 2.1 or CII D22B XML (or alias `xmlBase64`)."
                  },
                  "xmlBase64": {
                    "type": "string",
                    "description": "Base64-encoded UBL 2.1 or CII D22B XML."
                  },
                  "lang": {
                    "type": "string",
                    "enum": [
                      "fr",
                      "en"
                    ],
                    "default": "fr",
                    "description": "Output PDF rendering language (fr or en)."
                  },
                  "outputMode": {
                    "type": "string",
                    "enum": [
                      "facturx_pdf",
                      "pdf"
                    ],
                    "default": "facturx_pdf"
                  },
                  "profile": {
                    "type": "string",
                    "enum": [
                      "EN16931",
                      "EXTENDED",
                      "EXTENDED_CTC_FR",
                      "BASIC",
                      "BASICWL",
                      "MINIMUM"
                    ],
                    "default": "EN16931",
                    "description": "Target Factur-X 1.09 / FR CTC profile."
                  },
                  "includeQr": {
                    "type": "boolean",
                    "default": true,
                    "description": "Embed SEPA EPC-QR payment code on EUR invoices with seller IBAN."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Watermarked Factur-X 1.09 Hybrid PDF/A-3B stream (or JSON `{ pdf, filename, inputSyntax, profile }` for JSON requests).",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "429": {
            "description": "Free quota exceeded"
          }
        }
      }
    },
    "/api/credit-rates": {
      "get": {
        "summary": "List current Unified Credit rates",
        "description": "Returns the current rate per operation, keyed by paid product slug.",
        "security": [],
        "responses": {
          "200": {
            "description": "Current rates",
            "content": { "application/json": { "schema": {
              "type": "object",
              "required": ["rates"],
              "properties": { "rates": { "type": "object", "additionalProperties": { "type": "integer", "minimum": 0 } } }
            } } }
          },
          "503": { "description": "Product credit rates are unavailable" }
        }
      }
    },
    "/api/mcp": {
      "post": {
        "summary": "Remote MCP server (JSON-RPC 2.0)",
        "description": "Model Context Protocol endpoint, with Streamable HTTP and protocol version negotiation. Tools: validate_peppol, validate_pint, validate_germany, validate_france, validate_ksef and convert_cii_to_ubl use the product rates. lookup_peppol_participant, get_credit_balance and get_compliance_changelog use zero credits.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "example": "2.0"
                  },
                  "id": {
                    "type": "integer",
                    "example": 1
                  },
                  "method": {
                    "type": "string",
                    "example": "tools/list"
                  },
                  "params": {
                    "type": "object"
                  }
                },
                "required": [
                  "jsonrpc",
                  "method"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response"
          },
          "401": {
            "description": "Missing or invalid token"
          }
        }
      }
    },
    "/api/changelog": {
      "get": {
        "summary": "Public compliance release notes",
        "responses": {
          "200": {
            "description": "Published releases and active standard versions"
          }
        }
      }
    },
    "/api/peppol/v2/xml-to-pdf": {
      "post": {
        "tags": [
          "Peppol Converters"
        ],
        "summary": "Peppol XML to PDF/A-3B V2 (Multipart, 12 languages + Arabic RTL, PINT AE)",
        "description": "Pure in-process PDF/A-3B converter supporting Peppol BIS 3.0/3.1 and UAE PINT AE across 12 languages including RTL Arabic. See GET /api/credit-rates for the current per-product cost.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "xml"
                ],
                "properties": {
                  "xml": {
                    "type": "string",
                    "format": "binary"
                  },
                  "lang": {
                    "type": "string",
                    "example": "en",
                    "description": "en, de, fr, es, it, nl, pl, ar, sv, no, da, fi"
                  },
                  "accentColor": {
                    "type": "string",
                    "example": "#bd2f2c"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "PDF/A-3B binary stream"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Insufficient Unified Credits"
          }
        }
      }
    },
    "/api/peppol/v2/xml-to-pdf-base64": {
      "post": {
        "tags": [
          "Peppol Converters"
        ],
        "summary": "Peppol XML to PDF/A-3B V2 (JSON Base64)",
        "description": "JSON Base64 V2 converter returning `{ pdf }` (base64 PDF/A-3B) with 12-language & RTL Arabic support. See GET /api/credit-rates for the current per-product cost.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "xmlBase64"
                ],
                "properties": {
                  "xmlBase64": {
                    "type": "string"
                  },
                  "xml": {
                    "type": "string"
                  },
                  "lang": {
                    "type": "string",
                    "example": "en"
                  },
                  "filename": {
                    "type": "string",
                    "example": "invoice.xml"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON payload containing base64 `pdf`"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Insufficient Unified Credits"
          }
        }
      }
    },
    "/api/peppol/pint/{jurisdiction}": {
      "post": {
        "tags": [
          "Peppol Validation"
        ],
        "summary": "Validate Global PINT Invoice (Multipart: AE, A-NZ, SG, JP, MY, OM, EU)",
        "description": "Validates UBL XML against the selected PINT jurisdiction Schematron pack. See GET /api/credit-rates for the current per-product cost.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "jurisdiction",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ae",
                "aunz",
                "sg",
                "jp",
                "my",
                "om",
                "eu"
              ]
            },
            "description": "PINT jurisdiction pack: ae (UAE), aunz (AU/NZ), sg (Singapore), jp (Japan), my (Malaysia), om (Oman), eu (Europe)"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "xml"
                ],
                "properties": {
                  "xml": {
                    "type": "string",
                    "format": "binary",
                    "description": "XML invoice file"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Validation result (`isValid`, `errors`, `warnings`)"
          }
        }
      }
    },
    "/api/peppol/pint/{jurisdiction}/base64": {
      "post": {
        "tags": [
          "Peppol Validation"
        ],
        "summary": "Validate Global PINT Invoice (JSON Base64: AE, A-NZ, SG, JP, MY, OM, EU)",
        "description": "Validates base64/raw UBL XML against the selected PINT jurisdiction pack. See GET /api/credit-rates for the current per-product cost.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "jurisdiction",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "ae",
                "aunz",
                "sg",
                "jp",
                "my",
                "om",
                "eu"
              ]
            },
            "description": "PINT jurisdiction pack: ae (UAE), aunz (AU/NZ), sg (Singapore), jp (Japan), my (Malaysia), om (Oman), eu (Europe)"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "xmlBase64"
                ],
                "properties": {
                  "xmlBase64": {
                    "type": "string",
                    "description": "Base64-encoded PINT UBL XML"
                  },
                  "xml": {
                    "type": "string",
                    "description": "Alias for xmlBase64."
                  },
                  "filename": {
                    "type": "string",
                    "example": "invoice.xml"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Validation result (`isValid`, `errors`, `warnings`)"
          }
        }
      }
    },
    "/api/peppol/pint-ae-validator": {
      "post": {
        "tags": [
          "Peppol Validation"
        ],
        "summary": "UAE PINT AE Validator (Multipart)",
        "description": "Dedicated UAE FTA 5-Corner PINT AE (v1.0.5 & 2026-11) validator. See GET /api/credit-rates for the current per-product cost.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "xml"
                ],
                "properties": {
                  "xml": {
                    "type": "string",
                    "format": "binary",
                    "description": "XML invoice file"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Validation result"
          }
        }
      }
    },
    "/api/peppol/pint-ae-validator-base64": {
      "post": {
        "tags": [
          "Peppol Validation"
        ],
        "summary": "UAE PINT AE Validator (JSON Base64)",
        "description": "Dedicated UAE PINT AE JSON Base64 validator. See GET /api/credit-rates for the current per-product cost.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "xmlBase64"
                ],
                "properties": {
                  "xmlBase64": {
                    "type": "string",
                    "description": "Base64-encoded UAE PINT AE UBL XML"
                  },
                  "xml": {
                    "type": "string",
                    "description": "Alias for xmlBase64."
                  },
                  "filename": {
                    "type": "string",
                    "example": "invoice.xml"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Validation result"
          }
        }
      }
    },
    "/api/peppol/pint-aunz-validator": {
      "post": {
        "tags": [
          "Peppol Validation"
        ],
        "summary": "Australia / New Zealand PINT A-NZ Validator (Multipart)",
        "description": "Dedicated PINT A-NZ 1.1.3 validator. See GET /api/credit-rates for the current per-product cost.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "xml"
                ],
                "properties": {
                  "xml": {
                    "type": "string",
                    "format": "binary",
                    "description": "XML invoice file"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Validation result"
          }
        }
      }
    },
    "/api/peppol/pint-aunz-validator-base64": {
      "post": {
        "tags": [
          "Peppol Validation"
        ],
        "summary": "Australia / New Zealand PINT A-NZ Validator (JSON Base64)",
        "description": "Dedicated PINT A-NZ JSON Base64 validator. See GET /api/credit-rates for the current per-product cost.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "xmlBase64"
                ],
                "properties": {
                  "xmlBase64": {
                    "type": "string",
                    "description": "Base64-encoded PINT A-NZ UBL XML"
                  },
                  "xml": {
                    "type": "string",
                    "description": "Alias for xmlBase64."
                  },
                  "filename": {
                    "type": "string",
                    "example": "invoice.xml"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Validation result"
          }
        }
      }
    },
    "/api/peppol/cii-to-ubl": {
      "post": {
        "tags": [
          "Peppol Converters"
        ],
        "summary": "Convert UN/CEFACT CII D22B or Hybrid PDF to Peppol UBL 2.1",
        "description": "Bridges Factur-X / ZUGFeRD CII XML or Hybrid PDF/A-3B into EN 16931 Peppol UBL 2.1 XML (`multipart/form-data`).",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "xml"
                ],
                "properties": {
                  "xml": {
                    "type": "string",
                    "format": "binary",
                    "description": "XML invoice file"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "UBL 2.1 XML or ZIP bundle"
          }
        }
      }
    },
    "/api/peppol/search": {
      "get": {
        "tags": [
          "Peppol Directory & Live Lookup (Free)"
        ],
        "summary": "Search 9M+ Peppol Participant Directory",
        "description": "Free public directory search by company name, identifier, or ISO2 country code.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "Siemens"
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "DE"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching Peppol participants"
          }
        }
      }
    },
    "/api/user/quotas": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "Get Unified Credit Wallet Balance & Quotas",
        "description": "Returns the caller's `creditWallet` balance, active buckets, and any legacy contracts.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Wallet balance & quota summary"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  }
}
