XRechnung

Extract invoice data from PDF or image using AI

Extracts structured invoice data from a PDF invoice or photo (JPG, PNG) using the configured AI provider.

The endpoint handles two input types:

  • Text-based PDF: Extracts text with PDFBox, sends it to AI for structured extraction
  • Scanned PDF / Photo: Sends the file to an AI vision-capable provider for OCR + extraction

Returns structured InvoiceData as JSON, ready to pass to /generate or /zugferd/embed. Missing fields (e.g. Leitweg-ID) are listed in missingFields — these should be filled from user profile data in the portal before generating the e-invoice.

Configure one provider with AI_PROVIDER plus OPENAI_API_KEY, GEMINI_API_KEY, ANTHROPIC_API_KEY, or OPENROUTER_API_KEY. Without a configured provider, only PDF/DOCX text extraction is performed and aiExtractionUsed will be false.

post/api/xrechnung/extract

Request

  • Base URL: https://api.dokmatiq.com
  • URL: https://api.dokmatiq.com/api/xrechnung/extract
  • Auth: API key in header X-API-Key

Response

OK

Changes

No recorded changes to this operation across all 1 revision of this API.