Skip to content

Error Codes

Reference for all validation and API error codes.

API Errors

Authentication

ErrorHTTP StatusDescription
missing_api_key401No API key provided
invalid_api_key401API key is invalid or revoked
key_disabled403API key has been disabled

Rate Limiting

ErrorHTTP StatusDescription
rate_limited429Too many requests
quota_exceeded403Monthly quota exceeded

Request Errors

ErrorHTTP StatusDescription
validation_failed400Input validation failed
invalid_json400Request body is not valid JSON
not_zugferd400PDF is not ZUGFeRD/Factur-X

Validation Errors

Input Validation

These errors occur when required fields are missing or invalid:

CodePathMessage
REQUIRED$.invoice.numberInvoice number is required
REQUIRED$.invoice.dateInvoice date is required
REQUIRED$.invoice.sellerSeller information is required
REQUIRED$.invoice.seller.nameSeller name is required
REQUIRED$.invoice.seller.vatIdSeller VAT ID is required
REQUIRED$.invoice.buyerBuyer information is required
REQUIRED$.invoice.buyer.nameBuyer name is required
REQUIRED$.invoice.itemsAt least one item is required
INVALID$.invoice.dateInvalid date format (use YYYY-MM-DD)
INVALID$.invoice.items[n].unitInvalid unit code

EN 16931 Business Rules

CodeRuleDescription
BR-01Invoice numberInvoice shall have a specification identifier
BR-02SellerInvoice shall have a seller
BR-03BuyerInvoice shall have a buyer
BR-04Seller nameSeller shall have a trading name or name
BR-05Seller addressSeller shall have an address
BR-06Seller countrySeller address shall have a country code
BR-07Buyer nameBuyer shall have a name
BR-08Buyer addressBuyer shall have an address
BR-09Issue dateInvoice shall have an issue date
BR-10CurrencyInvoice shall have a currency code
BR-11Due datePayment due date shall be valid
BR-12Line itemInvoice shall have at least one line
BR-13Line IDEach line shall have an identifier
BR-16CalculationSum of line amounts shall equal total

Code List Validation

CodeRuleDescription
BR-CL-01Invoice typeInvoice type code shall be valid
BR-CL-10CurrencyCurrency code shall be from ISO 4217
BR-CL-23UnitUnit code shall be from UN/ECE Rec 20
BR-CO-09VAT formatVAT identifier format must match country
BR-CO-10Buyer VATBuyer VAT identifier if applicable

Example Error Response

json
{
  "error": "validation_failed",
  "message": "Invoice validation failed",
  "details": [
    {
      "path": "$.invoice.seller.vatId",
      "code": "REQUIRED",
      "message": "Seller VAT ID is required"
    },
    {
      "path": "$.invoice.items[0].unit",
      "code": "BR-CL-23",
      "message": "Unit code 'HOUR' is not valid. Use 'HUR' instead."
    }
  ]
}

Handling Errors

TypeScript

typescript
const result = await client.invoice()
  .number('2026-001')
  .generate()

if (!result.success) {
  for (const error of result.errors) {
    switch (error.code) {
      case 'REQUIRED':
        console.log(`Missing field: ${error.path}`)
        break
      case 'BR-CL-23':
        console.log(`Invalid unit code at ${error.path}`)
        break
      default:
        console.log(`${error.code}: ${error.message}`)
    }
  }
}

Python

python
result = client.invoice().number("2026-001").generate()

if not result.success:
    for error in result.errors:
        if error.code == "REQUIRED":
            print(f"Missing field: {error.path}")
        elif error.code == "BR-CL-23":
            print(f"Invalid unit code at {error.path}")
        else:
            print(f"{error.code}: {error.message}")

ZUGFeRD 2.3 & Factur-X 1.0 compliant