These docs are for v1.0. Click to read the latest docs for v2.0.
Added

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.


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

ConditionHTTP statusError message
Attached file is not a PDF422The file must be a PDF to convert to e-invoice
One or more invoice lines are missing a label422All invoice lines must have a label to convert to e-invoice
invoice_number contains invalid characters422invoice_number must only contain alphanumeric characters and -+_/ to convert to e-invoice
invoice_number exceeds 35 characters422invoice_number must be a maximum of 35 characters to convert to e-invoice
Customer is not a company or is a public administration422The customer is not eligible for e-invoicing
discount sent without convert_to_e_invoice: true422discount can only be used when convert_to_e_invoice is true

Note on invoice_number: If not provided, Pennylane auto-generates one after import.