Generate Factur-X (EN 16931) Invoice XML
Skill: Convert invoice data into the Factur-X CII XML payload
Region: France
Category: E-Invoicing — facturation électronique
Does: Takes ordinary invoice data and produces the UN/CEFACT CII (CrossIndustryInvoice) XML that is embedded as factur-x.xml inside a Factur-X PDF/A-3, and routed through a Plateforme de Dématérialisation Partenaire (PDP).
Standard: EN 16931 + Factur-X 1.0 profiles
Factur-X is a hybrid PDF/A-3 carrying this XML. This skill produces the structured XML half. The same CII model is used by ZUGFeRD — only the BT-24 specification identifier differs. Validate against the EN 16931 schematron before sending.
Profiles and the BT-24 specification identifier
| Profile | Specification identifier (GuidelineSpecifiedDocumentContextParameter/ram:ID) |
|---|---|
| MINIMUM | urn:factur-x.eu:1p0:minimum |
| BASIC WL | urn:factur-x.eu:1p0:basicwl |
| BASIC | urn:cen.eu:en16931:2017#compliant#urn:factur-x.eu:1p0:basic |
| EN 16931 (COMFORT) | urn:cen.eu:en16931:2017 |
| EXTENDED | urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:extended |
Use the EN 16931 profile for full B2B reform compliance. MINIMUM/BASIC WL carry header data only (no lines) and are not sufficient as a complete e-invoice on their own.
Input data required
| Input | EN 16931 term |
|---|---|
| Invoice number, issue date, type code | BT-1, BT-2, BT-3 |
| Currency | BT-5 |
| Seller name, address, SIREN/SIRET, VAT ID | BT-27, BT-30, BT-31 |
| Buyer name, address, SIREN/SIRET, VAT ID | BT-44, BT-47, BT-48 |
| Line items: name, quantity, net price, VAT category & rate | BG-25 |
| Payment means, IBAN, due date | BG-16, BT-9 |
French specifics: the seller and buyer SIREN/SIRET (legal registration id, BT-30/BT-47, schemeID="0002") are expected, and certain transactions also drive e-reporting of transaction and payment data to the tax authority.
Document structure (CII)
Identical aggregate structure to XRechnung CII:
rsm:CrossIndustryInvoice
├── rsm:ExchangedDocumentContext (BT-24 profile identifier above)
├── rsm:ExchangedDocument (BT-1 number, BT-3 type 380/381, BT-2 date)
└── rsm:SupplyChainTradeTransaction
├── ram:IncludedSupplyChainTradeLineItem ...
├── ram:ApplicableHeaderTradeAgreement (seller, buyer, SIREN/SIRET, VAT IDs)
├── ram:ApplicableHeaderTradeDelivery
└── ram:ApplicableHeaderTradeSettlement (currency, ApplicableTradeTax, monetary summation, payment)
Namespaces: rsm, ram, udt as for CII (see the XRechnung skill). Dates use udt:DateTimeString format="102" = YYYYMMDD. VAT category codes (S, Z, E, AE, K, G, O) and the totals fields (LineTotalAmount BT-106, TaxBasisTotalAmount BT-109, TaxTotalAmount BT-110, GrandTotalAmount BT-112, DuePayableAmount BT-115) follow EN 16931 exactly as in the German CII profile.
Calculation rules
- Line net = quantity × net unit price (2 decimals).
- Group lines by VAT category + rate →
BasisAmountandCalculatedAmount = basis × rateper group. GrandTotalAmount=TaxBasisTotalAmount+TaxTotalAmount;DuePayableAmount= grand total − prepaid.- Standard French VAT rate is 20%; reduced rates 10%, 5.5%, 2.1%.
Worked example (EN 16931 profile, header + one line)
<?xml version="1.0" encoding="UTF-8"?>
<rsm:CrossIndustryInvoice
xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
<rsm:ExchangedDocumentContext>
<ram:GuidelineSpecifiedDocumentContextParameter>
<ram:ID>urn:cen.eu:en16931:2017</ram:ID>
</ram:GuidelineSpecifiedDocumentContextParameter>
</rsm:ExchangedDocumentContext>
<rsm:ExchangedDocument>
<ram:ID>FA-2024-001</ram:ID>
<ram:TypeCode>380</ram:TypeCode>
<ram:IssueDateTime><udt:DateTimeString format="102">20240115</udt:DateTimeString></ram:IssueDateTime>
</rsm:ExchangedDocument>
<rsm:SupplyChainTradeTransaction>
<ram:IncludedSupplyChainTradeLineItem>
<ram:AssociatedDocumentLineDocument><ram:LineID>1</ram:LineID></ram:AssociatedDocumentLineDocument>
<ram:SpecifiedTradeProduct><ram:Name>Prestation de conseil</ram:Name></ram:SpecifiedTradeProduct>
<ram:SpecifiedLineTradeAgreement>
<ram:NetPriceProductTradePrice><ram:ChargeAmount>250.00</ram:ChargeAmount></ram:NetPriceProductTradePrice>
</ram:SpecifiedLineTradeAgreement>
<ram:SpecifiedLineTradeDelivery><ram:BilledQuantity unitCode="HUR">40</ram:BilledQuantity></ram:SpecifiedLineTradeDelivery>
<ram:SpecifiedLineTradeSettlement>
<ram:ApplicableTradeTax><ram:TypeCode>VAT</ram:TypeCode><ram:CategoryCode>S</ram:CategoryCode><ram:RateApplicablePercent>20</ram:RateApplicablePercent></ram:ApplicableTradeTax>
<ram:SpecifiedTradeSettlementLineMonetarySummation><ram:LineTotalAmount>10000.00</ram:LineTotalAmount></ram:SpecifiedTradeSettlementLineMonetarySummation>
</ram:SpecifiedLineTradeSettlement>
</ram:IncludedSupplyChainTradeLineItem>
<ram:ApplicableHeaderTradeAgreement>
<ram:SellerTradeParty>
<ram:Name>Acme SARL</ram:Name>
<ram:SpecifiedLegalOrganization><ram:ID schemeID="0002">552081317</ram:ID></ram:SpecifiedLegalOrganization>
<ram:PostalTradeAddress><ram:PostcodeCode>75001</ram:PostcodeCode><ram:LineOne>1 rue de Rivoli</ram:LineOne><ram:CityName>Paris</ram:CityName><ram:CountryID>FR</ram:CountryID></ram:PostalTradeAddress>
<ram:SpecifiedTaxRegistration><ram:ID schemeID="VA">FR12552081317</ram:ID></ram:SpecifiedTaxRegistration>
</ram:SellerTradeParty>
<ram:BuyerTradeParty>
<ram:Name>Client SA</ram:Name>
<ram:SpecifiedLegalOrganization><ram:ID schemeID="0002">404833048</ram:ID></ram:SpecifiedLegalOrganization>
<ram:PostalTradeAddress><ram:PostcodeCode>69002</ram:PostcodeCode><ram:LineOne>7 rue de la Bourse</ram:LineOne><ram:CityName>Lyon</ram:CityName><ram:CountryID>FR</ram:CountryID></ram:PostalTradeAddress>
</ram:BuyerTradeParty>
</ram:ApplicableHeaderTradeAgreement>
<ram:ApplicableHeaderTradeDelivery/>
<ram:ApplicableHeaderTradeSettlement>
<ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode>
<ram:ApplicableTradeTax>
<ram:CalculatedAmount>2000.00</ram:CalculatedAmount><ram:TypeCode>VAT</ram:TypeCode>
<ram:BasisAmount>10000.00</ram:BasisAmount><ram:CategoryCode>S</ram:CategoryCode><ram:RateApplicablePercent>20</ram:RateApplicablePercent>
</ram:ApplicableTradeTax>
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
<ram:LineTotalAmount>10000.00</ram:LineTotalAmount>
<ram:TaxBasisTotalAmount>10000.00</ram:TaxBasisTotalAmount>
<ram:TaxTotalAmount currencyID="EUR">2000.00</ram:TaxTotalAmount>
<ram:GrandTotalAmount>12000.00</ram:GrandTotalAmount>
<ram:DuePayableAmount>12000.00</ram:DuePayableAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
</ram:ApplicableHeaderTradeSettlement>
</rsm:SupplyChainTradeTransaction>
</rsm:CrossIndustryInvoice>
When building the full Factur-X file, embed this XML as factur-x.xml in a PDF/A-3 and reference it in the XMP metadata with the matching profile (ConformanceLevel).
Validation checklist
- BT-24 profile identifier matches the chosen profile (EN 16931 for full B2B compliance)
- Seller and buyer SIREN/SIRET present (
schemeID="0002"); VAT IDs withschemeID="VA" - Each line: quantity (
unitCode), net price, VAT category + rate, line total - Per-category VAT breakdown reconciles with line totals
-
GrandTotalAmount= basis + VAT;DuePayableAmount= grand total − prepaid - XML embedded as
factur-x.xmlin a valid PDF/A-3 with matching XMP profile - Passes EN 16931 schematron validation before routing via the PDP
Last updated: 2026-05-26 — confirm the active Factur-X version, profile identifiers, and the PDP routing/e-reporting requirements against the current DGFiP / FNFE-MPE specifications before use.