/v1/intelligent/parseParse natural language text into an EN 16931 invoice (AI)
Extract structured invoice data from free-form text (email body, chat message, OCR output, supplier description) and return an EN 16931 invoice JSON that is schema-identical to the `POST /v1/convert` input. If `ready_to_convert` is `true`, the caller can forward the `invoice` object directly to `/v1/convert` to obtain a compliant Peppol/XRechnung/Factur-X document. **Privacy pipeline:** all PII (names, companies, VAT IDs, IBANs, emails, phones, addresses) is anonymized via Microsoft Presidio + multilingual spaCy NER BEFORE the text leaves EU infrastructure. The exact text sent to the AI is returned in `anonymized_text` so the caller can audit it. After the model responds, placeholders are mapped back to the original values; if the mapping fails (model mangled a placeholder), the API returns `502 ANONYMIZATION_INTEGRITY_ERROR` rather than shipping corrupted data. **Strict-mode guarantee:** if the anonymization post-pass detects residual PII (typically a VAT ID, IBAN, email, or phone that slipped past NER), the request is aborted with `422 UNANONYMIZED_PII_DETECTED` **before** any AI call. The response lists the coarse categories that were detected so the caller knows what to redact. No raw PII values are included in the error body. **Quality signals:** `field_status` reports per-field extraction state (`extracted`, `inferred`, `default`, `missing`, `invalid`), `missing_fields` lists required fields that could not be extracted, and `confidence` gives an overall 0.0-1.0 score. **Legal notice:** AI-generated output. Always verify before submission. Required scope: `einvoice:parse`. Counted against your AI Parse quota.
Authentication
Requires API key via X-API-Key header.
Request body
textstringrequiredNatural language text describing an invoice
minLen 10 · maxLen 10000
contextanyoptionalOptional context hints
seller_countryanyoptionalISO 3166-1 alpha-2 country of the seller
buyer_countryanyoptionalISO 3166-1 alpha-2 country of the buyer
currencyanyoptionalExpected currency code (ISO 4217)
languageanyoptionalLanguage of the input text (ISO 639-1)
Example request
curl -X POST \
"https://einvoice.aethar.dev/api/v1/intelligent/parse" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"string"}'Responses
dataParseResultrequiredStructured result of AI-powered invoice parsing.
invoiceInvoice-OutputrequiredEN 16931 invoice — canonical JSON representation. This model is the single source of truth for invoice data flowing through the API. It is used as input to /v1/convert and as output from /v1/intelligent/parse (schema idempotency).
invoice_numberstringrequiredBT-1 Invoice number
maxLen 64
issue_datestring (date)requiredBT-2 Invoice issue date
type_codestringoptionalBT-3 Invoice type code (UNTDID 1001). 380=Invoice
maxLen 4 · default "380"
currency_codestringrequiredBT-5 Invoice currency code (ISO 4217)
minLen 3 · maxLen 3
due_dateanyoptionalBT-9 Payment due date
buyer_referenceanyoptionalBT-10 Buyer reference (mandatory for XRechnung)
purchase_order_referenceanyoptionalBT-13 Purchase order reference
project_referenceanyoptionalBT-11 Project reference
contract_referenceanyoptionalBT-12 Contract reference
vat_accounting_currencyanyoptionalBT-6 VAT accounting currency
tax_point_dateanyoptionalBT-7 Value added tax point date
noteanyoptionalBT-22 Invoice note
preceding_invoice_referenceanyoptionalBT-25 Preceding invoice reference
sellerPartyrequiredSeller (BG-4) or Buyer (BG-7) party.
namestringrequiredBT-27/BT-44 Party name
maxLen 256
addressAddressrequiredPostal address (BG-5 Seller / BG-8 Buyer / BG-15 Delivery).
streetstringrequiredBT-35/BT-50 Address line 1
maxLen 256
street2anyoptionalBT-36/BT-51 Address line 2
citystringrequiredBT-37/BT-52 City
maxLen 128
postal_codestringrequiredBT-38/BT-53 Post code
maxLen 16
country_subdivisionanyoptionalBT-39/BT-54 Country subdivision
country_codestringrequiredBT-40/BT-55 ISO 3166-1 alpha-2
minLen 2 · maxLen 2
vat_idanyoptionalBT-31/BT-48 VAT identifier
tax_registration_idanyoptionalBT-32 Tax registration ID
legal_registration_idanyoptionalBT-30/BT-47 Legal registration ID
identifieranyoptionalBT-29/BT-46 Party identifier
identifier_schemeanyoptionalBT-29-1/BT-46-1 Scheme ID
electronic_addressanyoptionalBT-34/BT-49 Electronic address
schemestringrequiredElectronic Address Scheme (EAS), e.g. EM, 0088, 0184
maxLen 8
idstringrequiredElectronic address value
maxLen 256
contactanyoptionalBG-6 Seller contact
nameanyoptionalBT-41 Contact name
phoneanyoptionalBT-42 Contact telephone
emailanyoptionalBT-43 Contact email
buyerPartyrequiredSeller (BG-4) or Buyer (BG-7) party.
namestringrequiredBT-27/BT-44 Party name
maxLen 256
addressAddressrequiredPostal address (BG-5 Seller / BG-8 Buyer / BG-15 Delivery).
streetstringrequiredBT-35/BT-50 Address line 1
maxLen 256
street2anyoptionalBT-36/BT-51 Address line 2
citystringrequiredBT-37/BT-52 City
maxLen 128
postal_codestringrequiredBT-38/BT-53 Post code
maxLen 16
country_subdivisionanyoptionalBT-39/BT-54 Country subdivision
country_codestringrequiredBT-40/BT-55 ISO 3166-1 alpha-2
minLen 2 · maxLen 2
vat_idanyoptionalBT-31/BT-48 VAT identifier
tax_registration_idanyoptionalBT-32 Tax registration ID
legal_registration_idanyoptionalBT-30/BT-47 Legal registration ID
identifieranyoptionalBT-29/BT-46 Party identifier
identifier_schemeanyoptionalBT-29-1/BT-46-1 Scheme ID
electronic_addressanyoptionalBT-34/BT-49 Electronic address
schemestringrequiredElectronic Address Scheme (EAS), e.g. EM, 0088, 0184
maxLen 8
idstringrequiredElectronic address value
maxLen 256
contactanyoptionalBG-6 Seller contact
nameanyoptionalBT-41 Contact name
phoneanyoptionalBT-42 Contact telephone
emailanyoptionalBT-43 Contact email
deliveryanyoptionalBG-13 Delivery information
dateanyoptionalBT-72 Actual delivery date
locationanyoptionalnameanyoptionalBT-70 Deliver to party name
addressanyoptionalpaymentanyoptionalBG-16 Payment instructions
means_codestringrequiredBT-81 Payment means type code (UNTDID 4461)
maxLen 4
means_textanyoptionalBT-82 Payment means text
termsanyoptionalBT-20 Payment terms
bank_accountanyoptionalBG-17 Credit transfer
ibananyoptionalBT-84 IBAN
bicanyoptionalBT-86 BIC/SWIFT
bank_nameanyoptionalBank name (informational)
account_nameanyoptionalBT-85 Account name
payment_idanyoptionalBT-83 Remittance information
linesarray<InvoiceLine-Output>requiredBG-25 Invoice lines (at least one)
minItems 1
idstringrequiredBT-126 Invoice line identifier
maxLen 32
descriptionstringrequiredBT-153 Item name
maxLen 512
quantitystringrequiredBT-129 Invoiced quantity
pattern /^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
unitstringrequiredBT-130 Unit of measure (UN/ECE Rec 20)
maxLen 8
unit_pricestringrequiredBT-146 Item net price
pattern /^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
net_amountstringrequiredBT-131 Invoice line net amount
pattern /^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
vat_categorystringrequiredBT-151 VAT category code (UN/ECE 5305)
maxLen 4
vat_rateanyoptionalBT-152 VAT rate as percentage
item_classificationanyoptionalBT-158 Item classification
codestringrequiredBT-158 Item classification identifier
maxLen 32
schemestringrequiredBT-158-1 Scheme identifier (e.g. STI, CPV)
maxLen 8
noteanyoptionalBT-127 Invoice line note
order_line_referenceanyoptionalBT-132 Referenced purchase order line
allowance_amountanyoptionalBT-136 Invoice line allowance amount
charge_amountanyoptionalBT-141 Invoice line charge amount
allowancesanyoptionalBG-20/BG-21 Allowances and charges
is_chargebooleanrequiredTrue = charge (BG-21), False = allowance (BG-20)
amountstringrequiredBT-92/BT-99 Amount
pattern /^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$/
vat_categorystringrequiredBT-95/BT-102 VAT category code
maxLen 4
vat_rateanyoptionalBT-96/BT-103 VAT rate
reasonanyoptionalBT-97/BT-104 Reason
reason_codeanyoptionalBT-98/BT-105 Reason code
country_extensionsanyoptionalCountry-specific fields
itanyoptionalcodice_destinatariostringrequiredSDI recipient code
minLen 7 · maxLen 7
codice_fiscale_selleranyoptionalSeller Codice Fiscale
codice_fiscale_buyeranyoptionalBuyer Codice Fiscale
regime_fiscalestringoptionalTax regime code
maxLen 4 · default "RF01"
tipo_documentostringoptionalDocument type code
maxLen 4 · default "TD01"
deanyoptionalleitweg_idstringrequiredLeitweg-ID (BT-10 routing ID for German B2G)
maxLen 64
planyoptionalnip_sellerstringrequiredSeller NIP
maxLen 10
nip_buyeranyoptionalBuyer NIP
gtu_codesanyoptionalGTU goods/services type codes
split_paymentbooleanoptionalMPP split payment flag
default false
esanyoptionalnif_sellerstringrequiredSeller NIF
maxLen 16
face_oficina_contableanyoptionalFACe routing code
face_organo_gestoranyoptionalFACe routing code
face_unidad_tramitadoraanyoptionalFACe routing code
franyoptionalsiret_selleranyoptionalSeller SIRET
siret_buyeranyoptionalBuyer SIRET
service_codeanyoptionalChorus Pro service code
field_statusobjectrequiredPer-field extraction status (dot-notation keys, e.g. 'seller.name')
ready_to_convertbooleanrequiredTrue if all required fields are present and valid — safe to send to /v1/convert
missing_fieldsarray<string>optionalRequired fields that could not be extracted
confidencenumberrequiredOverall parse confidence (0.0-1.0)
min 0 · max 1
legal_noticestringoptionalLegal disclaimer — always present
default "AI-generated. Verify before submission."
anonymized_textstringrequiredExact text that was sent to the AI model after PII anonymization. Sensitive identifiers (names, companies, VAT IDs, IBANs, emails, phone numbers, addresses) are replaced with format-preserving placeholders before the text leaves EU infrastructure. Use this field to audit what the AI actually saw.
detected_entity_countsobjectoptionalPer-entity-type counts of anonymized items (PERSON, LOCATION, VAT_ID, IBAN_CODE, EMAIL_ADDRESS, PHONE_NUMBER, COMPANY_NAME, …). Values only — no PII.
metadataMetadataSchemarequiredsourcesarray<SourceSchema>optionalnamestringrequiredData source name
urlanyoptionalURL to the source
request_idstringrequiredUnique request identifier
rate_limitanyoptionalerrorErrorDetailrequiredStructured error payload returned by all Aethar APIs. Mirrors the shape produced by aethar_auth.exception_handlers so the OpenAPI spec accurately describes real error bodies for documentation readers and MCP clients.
codestringrequiredMachine-readable error code (e.g. INVALID_API_KEY)
messagestringrequiredHuman-readable error message
statusintegerrequiredHTTP status code
request_idstringrequiredRequest identifier — include in support tickets
suggestionanyoptionalActionable hint on how to resolve the error
doc_urlanyoptionalLink to full documentation for this error code
fieldanyoptionalField that caused the error (if applicable)
errorsanyoptionalPer-field validation errors (only for 422 VALIDATION_ERROR responses)
errorErrorDetailrequiredStructured error payload returned by all Aethar APIs. Mirrors the shape produced by aethar_auth.exception_handlers so the OpenAPI spec accurately describes real error bodies for documentation readers and MCP clients.
codestringrequiredMachine-readable error code (e.g. INVALID_API_KEY)
messagestringrequiredHuman-readable error message
statusintegerrequiredHTTP status code
request_idstringrequiredRequest identifier — include in support tickets
suggestionanyoptionalActionable hint on how to resolve the error
doc_urlanyoptionalLink to full documentation for this error code
fieldanyoptionalField that caused the error (if applicable)
errorsanyoptionalPer-field validation errors (only for 422 VALIDATION_ERROR responses)
errorErrorDetailrequiredStructured error payload returned by all Aethar APIs. Mirrors the shape produced by aethar_auth.exception_handlers so the OpenAPI spec accurately describes real error bodies for documentation readers and MCP clients.
codestringrequiredMachine-readable error code (e.g. INVALID_API_KEY)
messagestringrequiredHuman-readable error message
statusintegerrequiredHTTP status code
request_idstringrequiredRequest identifier — include in support tickets
suggestionanyoptionalActionable hint on how to resolve the error
doc_urlanyoptionalLink to full documentation for this error code
fieldanyoptionalField that caused the error (if applicable)
errorsanyoptionalPer-field validation errors (only for 422 VALIDATION_ERROR responses)
errorErrorDetailrequiredStructured error payload returned by all Aethar APIs. Mirrors the shape produced by aethar_auth.exception_handlers so the OpenAPI spec accurately describes real error bodies for documentation readers and MCP clients.
codestringrequiredMachine-readable error code (e.g. INVALID_API_KEY)
messagestringrequiredHuman-readable error message
statusintegerrequiredHTTP status code
request_idstringrequiredRequest identifier — include in support tickets
suggestionanyoptionalActionable hint on how to resolve the error
doc_urlanyoptionalLink to full documentation for this error code
fieldanyoptionalField that caused the error (if applicable)
errorsanyoptionalPer-field validation errors (only for 422 VALIDATION_ERROR responses)
errorErrorDetailrequiredStructured error payload returned by all Aethar APIs. Mirrors the shape produced by aethar_auth.exception_handlers so the OpenAPI spec accurately describes real error bodies for documentation readers and MCP clients.
codestringrequiredMachine-readable error code (e.g. INVALID_API_KEY)
messagestringrequiredHuman-readable error message
statusintegerrequiredHTTP status code
request_idstringrequiredRequest identifier — include in support tickets
suggestionanyoptionalActionable hint on how to resolve the error
doc_urlanyoptionalLink to full documentation for this error code
fieldanyoptionalField that caused the error (if applicable)
errorsanyoptionalPer-field validation errors (only for 422 VALIDATION_ERROR responses)
errorErrorDetailrequiredStructured error payload returned by all Aethar APIs. Mirrors the shape produced by aethar_auth.exception_handlers so the OpenAPI spec accurately describes real error bodies for documentation readers and MCP clients.
codestringrequiredMachine-readable error code (e.g. INVALID_API_KEY)
messagestringrequiredHuman-readable error message
statusintegerrequiredHTTP status code
request_idstringrequiredRequest identifier — include in support tickets
suggestionanyoptionalActionable hint on how to resolve the error
doc_urlanyoptionalLink to full documentation for this error code
fieldanyoptionalField that caused the error (if applicable)
errorsanyoptionalPer-field validation errors (only for 422 VALIDATION_ERROR responses)
errorErrorDetailrequiredStructured error payload returned by all Aethar APIs. Mirrors the shape produced by aethar_auth.exception_handlers so the OpenAPI spec accurately describes real error bodies for documentation readers and MCP clients.
codestringrequiredMachine-readable error code (e.g. INVALID_API_KEY)
messagestringrequiredHuman-readable error message
statusintegerrequiredHTTP status code
request_idstringrequiredRequest identifier — include in support tickets
suggestionanyoptionalActionable hint on how to resolve the error
doc_urlanyoptionalLink to full documentation for this error code
fieldanyoptionalField that caused the error (if applicable)
errorsanyoptionalPer-field validation errors (only for 422 VALIDATION_ERROR responses)
errorErrorDetailrequiredStructured error payload returned by all Aethar APIs. Mirrors the shape produced by aethar_auth.exception_handlers so the OpenAPI spec accurately describes real error bodies for documentation readers and MCP clients.
codestringrequiredMachine-readable error code (e.g. INVALID_API_KEY)
messagestringrequiredHuman-readable error message
statusintegerrequiredHTTP status code
request_idstringrequiredRequest identifier — include in support tickets
suggestionanyoptionalActionable hint on how to resolve the error
doc_urlanyoptionalLink to full documentation for this error code
fieldanyoptionalField that caused the error (if applicable)
errorsanyoptionalPer-field validation errors (only for 422 VALIDATION_ERROR responses)
Try this endpoint
Create a free Aethar account and generate an API key in 2 minutes.
Create free account →