{
  "openapi": "3.1.2",
  "info": {
    "title": "XSDHub Validation API",
    "version": "1.0.0",
    "description": "Run XML and invoice checks from a script or build job. This contract covers XML, supplied XSD and Schematron, and fixed invoice checks. See the developer reference for other uses of the routes.\n\nTo try a request without a key, omit Authorization. The two routes share 25 anonymous checks per IP per UTC day. Each route allows up to 10 per minute per IP. Pro includes 300 XML validations and 250 invoice checks per UTC day, with up to 20 per minute per route. Team includes 1,000 checks in each category per UTC day, with up to 40 per minute per route. Paid limits are shared across the account or workspace and its keys. Retries can use quota.\n\nThe validation worker has a 20-second processing limit. A passing report helps you prepare the file for your next step."
  },
  "servers": [
    {
      "url": "https://xsdhub.com"
    }
  ],
  "externalDocs": {
    "description": "XSDHub developer reference",
    "url": "https://xsdhub.com/developers#validation-api"
  },
  "security": [
    {},
    {
      "ApiKey": []
    }
  ],
  "paths": {
    "/api/validate": {
      "post": {
        "operationId": "validateXml",
        "summary": "Check XML, XSD or Schematron",
        "description": "Use xml for well-formedness, xsd10 or xsd11 with xsd or a schemaFiles project, or schematron with self-contained XPath 1.0 rules. If you omit engine, it defaults to xsd11. Include all project dependencies.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/XmlRequest"
              },
              "examples": {
                "xsdPass": {
                  "value": {
                    "consent": true,
                    "engine": "xsd10",
                    "xml": "<quantity>2</quantity>",
                    "xsd": "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"><xs:element name=\"quantity\" type=\"xs:positiveInteger\"/></xs:schema>"
                  }
                },
                "xsdFail": {
                  "value": {
                    "consent": true,
                    "engine": "xsd10",
                    "xml": "<quantity>0</quantity>",
                    "xsd": "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"><xs:element name=\"quantity\" type=\"xs:positiveInteger\"/></xs:schema>"
                  }
                },
                "xsdProject": {
                  "value": {
                    "consent": true,
                    "engine": "xsd11",
                    "xml": "<quantity>2</quantity>",
                    "rootSchema": "main.xsd",
                    "schemaFiles": [
                      {
                        "path": "main.xsd",
                        "content": "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"><xs:element name=\"quantity\" type=\"xs:positiveInteger\"/></xs:schema>"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Validation report. Read ok to tell whether the check passed.",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit for the reported minute window or paid UTC-day quota.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Checks or attempts left in the reported window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "End of the reported window as a Unix timestamp in seconds.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Limit": {
                "description": "Anonymous API limit shared by both routes per IP and UTC day.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Remaining": {
                "description": "Anonymous API checks left in the current UTC day.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Reset": {
                "description": "Start of the next UTC day as a Unix timestamp in seconds.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/XmlResult"
                },
                "examples": {
                  "passed": {
                    "value": {
                      "ok": true,
                      "stage": "Validation",
                      "engine": "xmlschema 4.3.2 / XSD 1.0",
                      "errors": [],
                      "warnings": []
                    }
                  },
                  "failed": {
                    "value": {
                      "ok": false,
                      "stage": "Validation",
                      "engine": "xmlschema 4.3.2 / XSD 1.0",
                      "errors": [
                        {
                          "message": "The value must be a positive integer.",
                          "path": "/quantity",
                          "line": 1
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request, such as missing explicit consent or malformed JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit for the reported minute window or paid UTC-day quota.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Checks or attempts left in the reported window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "End of the reported window as a Unix timestamp in seconds.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Limit": {
                "description": "Anonymous API limit shared by both routes per IP and UTC day.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Remaining": {
                "description": "Anonymous API checks left in the current UTC day.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Reset": {
                "description": "Start of the next UTC day as a Unix timestamp in seconds.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "401": {
            "description": "The API key is invalid or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The key needs an active Pro or Team subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin is disallowed, or the edge rejected the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The HTTP body is missing or too large. The edge can return a non-JSON body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Send the request as application/json.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit for the reported minute window or paid UTC-day quota.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Checks or attempts left in the reported window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "End of the reported window as a Unix timestamp in seconds.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Limit": {
                "description": "Anonymous API limit shared by both routes per IP and UTC day.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Remaining": {
                "description": "Anonymous API checks left in the current UTC day.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Reset": {
                "description": "Start of the next UTC day as a Unix timestamp in seconds.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "422": {
            "description": "The validation worker timed out, exceeded a service limit, or failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit for the reported minute window or paid UTC-day quota.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Checks or attempts left in the reported window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "End of the reported window as a Unix timestamp in seconds.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Limit": {
                "description": "Anonymous API limit shared by both routes per IP and UTC day.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Remaining": {
                "description": "Anonymous API checks left in the current UTC day.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Reset": {
                "description": "Start of the next UTC day as a Unix timestamp in seconds.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "503": {
            "description": "The validation or account service is busy or unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit for the reported minute window or paid UTC-day quota.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Checks or attempts left in the reported window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "End of the reported window as a Unix timestamp in seconds.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Limit": {
                "description": "Anonymous API limit shared by both routes per IP and UTC day.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Remaining": {
                "description": "Anonymous API checks left in the current UTC day.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Reset": {
                "description": "Start of the next UTC day as a Unix timestamp in seconds.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "429": {
            "description": "A daily quota, minute window or authentication-attempt limit was reached. Honor Retry-After when present.",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit for the reported minute window or paid UTC-day quota.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Checks or attempts left in the reported window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "End of the reported window as a Unix timestamp in seconds.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Limit": {
                "description": "Anonymous API limit shared by both routes per IP and UTC day.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Remaining": {
                "description": "Anonymous API checks left in the current UTC day.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Reset": {
                "description": "Start of the next UTC day as a Unix timestamp in seconds.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before the next request.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/DailyLimit"
                    },
                    {
                      "type": "object",
                      "required": [
                        "error"
                      ],
                      "properties": {
                        "error": {
                          "type": "string",
                          "not": {
                            "const": "free_api_daily_limit"
                          }
                        }
                      }
                    }
                  ]
                },
                "examples": {
                  "minuteLimit": {
                    "value": {
                      "error": "Rate limit reached. Try again in one minute."
                    }
                  },
                  "paidDailyLimit": {
                    "value": {
                      "error": "Daily API quota reached."
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Other responses can come from the HTTP edge. Check the status and Content-Type before reading JSON."
          }
        }
      }
    },
    "/api/invoice-validate": {
      "post": {
        "operationId": "validateInvoice",
        "summary": "Check an invoice XML file",
        "description": "Choose a fixed standard. Send XML extracted from the invoice if you started with a Factur-X PDF. KSeF runs an XSD check.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceRequest"
              },
              "examples": {
                "invoicePass": {
                  "value": {
                    "consent": true,
                    "standard": "en16931",
                    "xml": "<Invoice xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\"\n xmlns:cac=\"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2\"\n xmlns:cbc=\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\">\n  <cbc:CustomizationID>urn:cen.eu:en16931:2017</cbc:CustomizationID>\n  <cbc:ID>DEMO-1</cbc:ID>\n  <cbc:IssueDate>2026-11-21</cbc:IssueDate>\n  <cbc:DueDate>2026-12-21</cbc:DueDate>\n  <cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode>\n  <cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode>\n  <cac:AccountingSupplierParty>\n    <cac:Party>\n      <cac:PostalAddress><cac:Country><cbc:IdentificationCode>DE</cbc:IdentificationCode></cac:Country></cac:PostalAddress>\n      <cac:PartyLegalEntity><cbc:RegistrationName>Example Seller</cbc:RegistrationName><cbc:CompanyID>DEMO-SELLER</cbc:CompanyID></cac:PartyLegalEntity>\n    </cac:Party>\n  </cac:AccountingSupplierParty>\n  <cac:AccountingCustomerParty>\n    <cac:Party>\n      <cac:PostalAddress><cac:Country><cbc:IdentificationCode>DE</cbc:IdentificationCode></cac:Country></cac:PostalAddress>\n      <cac:PartyLegalEntity><cbc:RegistrationName>Example Buyer</cbc:RegistrationName></cac:PartyLegalEntity>\n    </cac:Party>\n  </cac:AccountingCustomerParty>\n  <cac:TaxTotal>\n    <cbc:TaxAmount currencyID=\"EUR\">0</cbc:TaxAmount>\n    <cac:TaxSubtotal>\n      <cbc:TaxableAmount currencyID=\"EUR\">10</cbc:TaxableAmount>\n      <cbc:TaxAmount currencyID=\"EUR\">0</cbc:TaxAmount>\n      <cac:TaxCategory><cbc:ID>O</cbc:ID><cbc:TaxExemptionReason>Not subject to VAT</cbc:TaxExemptionReason><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory>\n    </cac:TaxSubtotal>\n  </cac:TaxTotal>\n  <cac:LegalMonetaryTotal>\n    <cbc:LineExtensionAmount currencyID=\"EUR\">10</cbc:LineExtensionAmount>\n    <cbc:TaxExclusiveAmount currencyID=\"EUR\">10</cbc:TaxExclusiveAmount>\n    <cbc:TaxInclusiveAmount currencyID=\"EUR\">10</cbc:TaxInclusiveAmount>\n    <cbc:PayableAmount currencyID=\"EUR\">10</cbc:PayableAmount>\n  </cac:LegalMonetaryTotal>\n  <cac:InvoiceLine>\n    <cbc:ID>1</cbc:ID>\n    <cbc:InvoicedQuantity unitCode=\"C62\">1</cbc:InvoicedQuantity>\n    <cbc:LineExtensionAmount currencyID=\"EUR\">10</cbc:LineExtensionAmount>\n    <cac:Item>\n      <cbc:Name>Example service</cbc:Name>\n      <cac:ClassifiedTaxCategory><cbc:ID>O</cbc:ID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:ClassifiedTaxCategory>\n    </cac:Item>\n    <cac:Price><cbc:PriceAmount currencyID=\"EUR\">10</cbc:PriceAmount></cac:Price>\n  </cac:InvoiceLine>\n</Invoice>"
                  }
                },
                "invoiceNamespaceError": {
                  "value": {
                    "consent": true,
                    "standard": "en16931",
                    "xml": "<Invoice/>"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Validation report. Read ok to tell whether the check passed.",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit for the reported minute window or paid UTC-day quota.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Checks or attempts left in the reported window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "End of the reported window as a Unix timestamp in seconds.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Limit": {
                "description": "Anonymous API limit shared by both routes per IP and UTC day.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Remaining": {
                "description": "Anonymous API checks left in the current UTC day.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Reset": {
                "description": "Start of the next UTC day as a Unix timestamp in seconds.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvoiceResult"
                },
                "examples": {
                  "passed": {
                    "value": {
                      "ok": true,
                      "stage": "Business rules",
                      "errors": [],
                      "warnings": []
                    }
                  },
                  "failed": {
                    "value": {
                      "ok": false,
                      "stage": "Input",
                      "errors": [
                        {
                          "code": "INVOICE-ROOT-NAMESPACE",
                          "message": "The invoice root or namespace does not match the standard.",
                          "path": "/",
                          "line": 1
                        }
                      ],
                      "warnings": []
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request, such as missing explicit consent or malformed JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit for the reported minute window or paid UTC-day quota.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Checks or attempts left in the reported window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "End of the reported window as a Unix timestamp in seconds.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Limit": {
                "description": "Anonymous API limit shared by both routes per IP and UTC day.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Remaining": {
                "description": "Anonymous API checks left in the current UTC day.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Reset": {
                "description": "Start of the next UTC day as a Unix timestamp in seconds.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "401": {
            "description": "The API key is invalid or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The key needs an active Pro or Team subscription.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin is disallowed, or the edge rejected the request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The HTTP body is missing or too large. The edge can return a non-JSON body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Send the request as application/json.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit for the reported minute window or paid UTC-day quota.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Checks or attempts left in the reported window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "End of the reported window as a Unix timestamp in seconds.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Limit": {
                "description": "Anonymous API limit shared by both routes per IP and UTC day.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Remaining": {
                "description": "Anonymous API checks left in the current UTC day.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Reset": {
                "description": "Start of the next UTC day as a Unix timestamp in seconds.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "422": {
            "description": "The validation worker timed out, exceeded a service limit, or failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit for the reported minute window or paid UTC-day quota.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Checks or attempts left in the reported window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "End of the reported window as a Unix timestamp in seconds.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Limit": {
                "description": "Anonymous API limit shared by both routes per IP and UTC day.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Remaining": {
                "description": "Anonymous API checks left in the current UTC day.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Reset": {
                "description": "Start of the next UTC day as a Unix timestamp in seconds.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "503": {
            "description": "The validation or account service is busy or unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit for the reported minute window or paid UTC-day quota.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Checks or attempts left in the reported window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "End of the reported window as a Unix timestamp in seconds.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Limit": {
                "description": "Anonymous API limit shared by both routes per IP and UTC day.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Remaining": {
                "description": "Anonymous API checks left in the current UTC day.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Reset": {
                "description": "Start of the next UTC day as a Unix timestamp in seconds.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "429": {
            "description": "A daily quota, minute window or authentication-attempt limit was reached. Honor Retry-After when present.",
            "headers": {
              "X-RateLimit-Limit": {
                "description": "Limit for the reported minute window or paid UTC-day quota.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Remaining": {
                "description": "Checks or attempts left in the reported window.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-RateLimit-Reset": {
                "description": "End of the reported window as a Unix timestamp in seconds.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Limit": {
                "description": "Anonymous API limit shared by both routes per IP and UTC day.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Remaining": {
                "description": "Anonymous API checks left in the current UTC day.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "X-Free-Daily-Reset": {
                "description": "Start of the next UTC day as a Unix timestamp in seconds.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before the next request.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/DailyLimit"
                    },
                    {
                      "type": "object",
                      "required": [
                        "error"
                      ],
                      "properties": {
                        "error": {
                          "type": "string",
                          "not": {
                            "const": "free_api_daily_limit"
                          }
                        }
                      }
                    }
                  ]
                },
                "examples": {
                  "minuteLimit": {
                    "value": {
                      "error": "Rate limit reached. Try again in one minute."
                    }
                  },
                  "paidDailyLimit": {
                    "value": {
                      "error": "Daily API quota reached."
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Other responses can come from the HTTP edge. Check the status and Content-Type before reading JSON."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Use a key from an active Pro or Team account."
      }
    },
    "schemas": {
      "XmlRequest": {
        "type": "object",
        "required": [
          "xml",
          "consent"
        ],
        "properties": {
          "xml": {
            "type": "string",
            "description": "XML text, up to 10 MiB when encoded as UTF-8."
          },
          "consent": {
            "type": "boolean",
            "const": true,
            "description": "Confirms permission to send the document for server processing."
          },
          "engine": {
            "type": "string",
            "default": "xsd11",
            "examples": [
              "xml",
              "xsd10",
              "xsd11",
              "schematron"
            ]
          },
          "xsd": {
            "type": "string",
            "description": "Standalone XSD, up to 1 MiB."
          },
          "rootSchema": {
            "type": "string",
            "description": "Relative path to the entry XSD. Default is schema.xsd."
          },
          "schemaFiles": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "object",
              "required": [
                "path",
                "content"
              ],
              "properties": {
                "path": {
                  "type": "string",
                  "description": "Local project path."
                },
                "content": {
                  "type": "string",
                  "description": "XSD text, up to 1 MiB per file."
                }
              }
            },
            "description": "Up to 10 MiB of XSD text in total."
          },
          "schematron": {
            "type": "string",
            "description": "Self-contained ISO Schematron text, up to 1 MiB."
          },
          "phase": {
            "type": "string",
            "description": "Optional Schematron phase."
          }
        }
      },
      "InvoiceRequest": {
        "type": "object",
        "required": [
          "xml",
          "standard",
          "consent"
        ],
        "properties": {
          "xml": {
            "type": "string",
            "description": "XML text, up to 10 MiB when encoded as UTF-8."
          },
          "consent": {
            "type": "boolean",
            "const": true,
            "description": "Confirms permission to send the document for server processing."
          },
          "standard": {
            "type": "string",
            "examples": [
              "en16931",
              "xrechnung",
              "facturx",
              "ksef",
              "ro",
              "hr"
            ]
          },
          "rulesDate": {
            "type": "string",
            "format": "date",
            "description": "Optional for en16931, hr and facturx. Available dates depend on the package."
          }
        },
        "additionalProperties": false
      },
      "XmlResult": {
        "type": "object",
        "required": [
          "ok",
          "stage",
          "errors"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "stage": {
            "type": "string"
          },
          "engine": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Finding"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/Finding"
                },
                {
                  "type": "string"
                }
              ]
            }
          },
          "truncated": {
            "type": "boolean"
          }
        }
      },
      "InvoiceResult": {
        "type": "object",
        "required": [
          "ok",
          "stage",
          "errors",
          "warnings"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "stage": {
            "type": "string"
          },
          "engine": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Finding"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/Finding"
                },
                {
                  "type": "string"
                }
              ]
            }
          },
          "truncated": {
            "type": "boolean"
          },
          "rules": {
            "type": "string",
            "description": "Rule package label when supplied."
          },
          "syntax": {
            "type": "string"
          },
          "profile": {
            "type": "string"
          },
          "ruleVersions": {
            "type": "object"
          }
        }
      },
      "Finding": {
        "type": "object",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "line": {
            "type": "integer"
          },
          "column": {
            "type": "integer"
          },
          "file": {
            "type": "string"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          }
        }
      },
      "DailyLimit": {
        "type": "object",
        "required": [
          "error",
          "message",
          "language",
          "limit",
          "resets_at",
          "upgrade_url",
          "api_keys_url"
        ],
        "properties": {
          "error": {
            "const": "free_api_daily_limit",
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "limit": {
            "type": "integer"
          },
          "resets_at": {
            "type": "string",
            "format": "date-time"
          },
          "upgrade_url": {
            "type": "string",
            "format": "uri"
          },
          "api_keys_url": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    }
  }
}
