Factur-X conversion on customer invoice import
You can now convert an imported customer invoice into a Factur-X (PDF/A-3) invoice in a single API call. Pass convert_to_e_invoice: true in the request body and it will asynchronously embed a structured CII XML into the uploaded PDF after the invoice is created.
- POST /api/external/v2/customer_invoices/imports
- Scope:
customer_invoices:all
- Scope:
What's new
New parameter: convert_to_e_invoice (boolean, default: false)
When set to true, Pennylane converts the imported PDF into a Factur-X invoice by embedding a structured XML attachment. The invoice is returned immediately in the response (201); the conversion happens in the background shortly after.
New parameter: discount
An invoice-level discount (absolute or relative) is now supported, as well as line-level invoice_lines[].discount. Both parameters are only accepted when convert_to_e_invoice: true.
invoice_lines[].label is no longer deprecated
This field is required by the Factur-X XML generator. The deprecation has been removed; it is now a standard optional field, required when convert_to_e_invoice: true.
Validation rules when convert_to_e_invoice: true
convert_to_e_invoice: true| Condition | HTTP status | Error message |
|---|---|---|
| Attached file is not a PDF | 422 | The file must be a PDF to convert to e-invoice |
| One or more invoice lines are missing a label | 422 | All invoice lines must have a label to convert to e-invoice |
invoice_number contains invalid characters | 422 | invoice_number must only contain alphanumeric characters and -+_/ to convert to e-invoice |
invoice_number exceeds 35 characters | 422 | invoice_number must be a maximum of 35 characters to convert to e-invoice |
| Customer is not a company or is a public administration | 422 | The customer is not eligible for e-invoicing |
discount sent without convert_to_e_invoice: true | 422 | discount can only be used when convert_to_e_invoice is true |
Note on
invoice_number: If not provided, Pennylane auto-generates one after import.

