/v1/convertConvert an EN 16931 invoice to Peppol / XRechnung / Factur-X
Convert a canonical EN 16931 invoice (JSON) into a compliant e-invoicing document in the target format. Use this endpoint when the user has structured invoice data and needs to generate a legally valid XML or PDF/A-3 file for submission to a Peppol access point, XRechnung portal, or Factur-X workflow. **Inputs:** an `Invoice` object (fields map to EN 16931 Business Terms BT-1…BT-158), a `target_format` code, an optional `target_profile`, and an `output` mode. **Output:** a `conversion_id` plus a 24-hour `download_url` pointing at `GET /v1/download/{conversion_id}`. Documents expire after 24 hours. **Supported target formats:** `peppol_bis_3`, `xrechnung`, `facturx`, `zugferd`, `ubl_2_1`. **Output modes:** `xml` (default, all formats) or `pdf` (Factur-X / ZUGFeRD only — embeds the XML in a PDF/A-3 container). Required scope: `einvoice:convert`.
Authentication
Requires API key via X-API-Key header.
Request body
invoiceInvoice-InputrequiredEN 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-Input>requiredBG-25 Invoice lines (at least one)
minItems 1
idstringrequiredBT-126 Invoice line identifier
maxLen 32
descriptionstringrequiredBT-153 Item name
maxLen 512
quantityanyrequiredBT-129 Invoiced quantity
unitstringrequiredBT-130 Unit of measure (UN/ECE Rec 20)
maxLen 8
unit_priceanyrequiredBT-146 Item net price
net_amountanyrequiredBT-131 Invoice line net amount
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)
amountanyrequiredBT-92/BT-99 Amount
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
target_formatstringrequiredTarget e-invoicing format code: peppol_bis_3, xrechnung, facturx, ubl_2_1
target_profileanyoptionalFormat profile (e.g. facturx_en16931, facturx_basic, facturx_minimum)
outputstringoptionalenum: xml | pdfOutput type. 'pdf' only for Factur-X.
default "xml"
Example request
curl -X POST \
"https://einvoice.aethar.dev/api/v1/convert" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"invoice":{"invoice_number":"string","issue_date":"string","type_code":"380","currency_code":"string","seller":{"name":"string","address":{"street":"string","city":"string","postal_code":"string","country_code":"string"}},"buyer":{"name":"string","address":{"street":"string","city":"string","postal_code":"string","country_code":"string"}},"lines":[{"id":"string","description":"string","unit":"string","vat_category":"string"}]},"target_format":"string","output":"xml"}'Responses
dataConversionResultrequiredConversion result returned in the response envelope.
conversion_idstring (uuid)requiredUnique conversion identifier (UUID)
target_formatstringrequiredtarget_profileanyoptionalstatusstringoptionalenum: success | errordefault "success"
document_size_bytesanyoptionalprocessing_msanyoptionaldownload_urlanyoptionalURL to download the converted document (24h TTL)
download_expires_atanyoptionalmetadataMetadataSchemarequiredsourcesarray<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)
Try this endpoint
Create a free Aethar account and generate an API key in 2 minutes.
Create free account →