E-invoicing
invoice completeinvoice checkinvoice checkinvoice to_ciiinvoice to_ciiinvoice to_ublinvoice to_ublinvoice parseinvoice facturx_extractinvoice facturx_extractinvoice facturx_createinvoice facturx_createinvoice to_pdfinvoice to_pdf

invoice complete <json_invoice>


Description

    Compute what is missing: line net amounts (quantity x price), totals, VAT breakdown per category and rate (basis x rate rounded), amount due; default unit C62 and line ids. Returns the normalized JSON invoice

Parameters

    json_invoice:   The JSON invoice - String - required
admin
invoice complete "{\"number\": \"F2026-0042\", \"type_code\": \"380\", \"issue_date\": \"2026-11-03\", \"due_date\": \"2026-12-03\", \"currency\": \"EUR\", \"seller\": {\"name\": \"Atelier Payet SARL\", \"siren\": \"732829320\", \"vat_id\": \"FR44732829320\", \"address\": {\"line1\": \"12 rue de Paris\", \"postcode\": \"97400\", \"city\": \"Saint-Denis\", \"country\": \"FR\"}}, \"buyer\": {\"name\": \"Client SAS\", \"siren\": \"552100554\", \"address\": {\"postcode\": \"75008\", \"city\": \"Paris\", \"country\": \"FR\"}}, \"lines\": [{\"name\": \"Consulting\", \"quantity\": 3, \"unit\": \"HUR\", \"unit_price\": 95, \"vat_category\": \"S\", \"vat_rate\": 8.5}, {\"name\": \"Book\", \"quantity\": 2, \"unit_price\": 18.99, \"vat_category\": \"S\", \"vat_rate\": 2.1}], \"payment\": {\"iban\": \"FR7630006000011234567890189\", \"bic\": \"AGRIFRPP\", \"terms\": \"30 days\"}}"
mentdb
{"number": "F2026-0042", "type_code": "380", "issue_date": "2026-11-03", "due_date": "2026-12-03", "currency": "EUR", "seller": {"name": "Atelier Payet SARL", "siren": "732829320", "vat_id": "FR44732829320", "address": {"line1": "12 rue de Paris", "postcode": "97400", "city": "Saint-Denis", "country": "FR"}}, "buyer": {"name": "Client SAS", "siren": "552100554", "address": {"postcode": "75008", "city": "Paris", "country": "FR"}}, "lines": [{"id": "1", "name": "Consulting", "quantity": 3, "unit": "HUR", "unit_price": 95, "net_amount": 285, "vat_category": "S", "vat_rate": 8.5}, {"id": "2", "name": "Book", "quantity": 2, "unit": "C62", "unit_price": 18.99, "net_amount": 37.98, "vat_category": "S", "vat_rate": 2.1}], "vat_breakdown": [{"category": "S", "rate": 8.5, "basis": 285, "amount": 24.23}, {"category": "S", "rate": 2.1, "basis": 37.98, "amount": 0.8}], "totals": {"lines": 322.98, "tax_basis": 322.98, "vat": 25.03, "grand_total": 348.01, "due": 348.01}, "payment": {"means_code": "58", "iban": "FR7630006000011234567890189", "bic": "AGRIFRPP", "terms": "30 days"}}
Used in use cases (1 recipe)

    Accountant & manager › Electronic invoice: compute the totals, check the EN 16931 rules, export in CII and UBL
Often used with

    invoice check  ·  invoice parse  ·  invoice to_cii  ·  invoice to_ubl

invoice check <invoice>


Description

    Check an invoice (JSON, CII or UBL XML, or the path of an XML file): EN 16931 core business rules (a subset: mandatory fields BR-01 to BR-27, totals BR-CO-10 to BR-CO-18, VAT breakdown BR-x-08 / 09 / 10, seller VAT id BR-S-02) and French rules (SIREN / SIRET Luhn keys, key of the FR VAT number, IBAN, VAT rates); valid, errors and warnings with the rule codes

Parameters

    invoice:   The JSON invoice, the XML or the path of an XML file - String - required
admin
invoice check "{\"number\": \"F2026-0042\", \"type_code\": \"380\", \"issue_date\": \"2026-11-03\", \"due_date\": \"2026-12-03\", \"currency\": \"EUR\", \"seller\": {\"name\": \"Atelier Payet SARL\", \"siren\": \"732829320\", \"vat_id\": \"FR44732829320\", \"address\": {\"line1\": \"12 rue de Paris\", \"postcode\": \"97400\", \"city\": \"Saint-Denis\", \"country\": \"FR\"}}, \"buyer\": {\"name\": \"Client SAS\", \"siren\": \"552100555\", \"address\": {\"postcode\": \"75008\", \"city\": \"Paris\", \"country\": \"FR\"}}, \"lines\": [{\"name\": \"Consulting\", \"quantity\": 3, \"unit\": \"HUR\", \"unit_price\": 95, \"vat_category\": \"S\", \"vat_rate\": 8.5, \"id\": \"1\", \"net_amount\": 280}, {\"name\": \"Book\", \"quantity\": 2, \"unit_price\": 18.99, \"vat_category\": \"S\", \"vat_rate\": 2.1, \"id\": \"2\", \"unit\": \"C62\", \"net_amount\": 37.98}], \"payment\": {\"iban\": \"FR7630006000011234567890189\", \"bic\": \"AGRIFRPP\", \"terms\": \"30 days\"}, \"vat_breakdown\": [{\"category\": \"S\", \"rate\": 8.5, \"basis\": 280, \"amount\": 22.5}, {\"category\": \"S\", \"rate\": 2.1, \"basis\": 37.98, \"amount\": 0.8}], \"totals\": {\"lines\": 317.98, \"tax_basis\": 317.98, \"vat\": 24.6, \"grand_total\": 342.58, \"due\": 342.58}}"
mentdb
{"valid": false, "errors": [{"rule": "BR-S-09", "message": "VAT S 8.5 %: the VAT amount 22.5 differs from taxable amount x rate 23.80"}, {"rule": "BR-CO-14", "message": "totals.vat 24.6 differs from the sum of the VAT breakdown 23.30"}, {"rule": "FR-SIREN", "message": "buyer: the SIREN 552100555 is not valid (9 digits, Luhn key)"}], "warnings": [{"rule": "LINE-AMOUNT", "message": "line 1: net amount 280 differs from quantity x price 285.00 (allowed only with line allowances or charges)"}], "rules": "EN 16931 core business rules (a subset, not the full Schematron) and French identifiers"}
A CII invoice (Factur-X EN 16931)
admin
invoice check "<?xml version=\"1.0\" encoding=\"UTF-8\"?><rsm:CrossIndustryInvoice xmlns:rsm=\"urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100\" xmlns:qdt=\"urn:un:unece:uncefact:data:standard:QualifiedDataType: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>F2026-0042</ram:ID><ram:TypeCode>380</ram:TypeCode><ram:IssueDateTime><udt:DateTimeString format=\"102\">20261103</udt:DateTimeString></ram:IssueDateTime></rsm:ExchangedDocument><rsm:SupplyChainTradeTransaction><ram:IncludedSupplyChainTradeLineItem><ram:AssociatedDocumentLineDocument><ram:LineID>1</ram:LineID></ram:AssociatedDocumentLineDocument><ram:SpecifiedTradeProduct><ram:Name>Consulting</ram:Name></ram:SpecifiedTradeProduct><ram:SpecifiedLineTradeAgreement><ram:NetPriceProductTradePrice><ram:ChargeAmount>95</ram:ChargeAmount></ram:NetPriceProductTradePrice></ram:SpecifiedLineTradeAgreement><ram:SpecifiedLineTradeDelivery><ram:BilledQuantity unitCode=\"HUR\">3</ram:BilledQuantity></ram:SpecifiedLineTradeDelivery><ram:SpecifiedLineTradeSettlement><ram:ApplicableTradeTax><ram:TypeCode>VAT</ram:TypeCode><ram:CategoryCode>S</ram:CategoryCode><ram:RateApplicablePercent>8.5</ram:RateApplicablePercent></ram:ApplicableTradeTax><ram:SpecifiedTradeSettlementLineMonetarySummation><ram:LineTotalAmount>285.00</ram:LineTotalAmount></ram:SpecifiedTradeSettlementLineMonetarySummation></ram:SpecifiedLineTradeSettlement></ram:IncludedSupplyChainTradeLineItem><ram:IncludedSupplyChainTradeLineItem><ram:AssociatedDocumentLineDocument><ram:LineID>2</ram:LineID></ram:AssociatedDocumentLineDocument><ram:SpecifiedTradeProduct><ram:Name>Book</ram:Name></ram:SpecifiedTradeProduct><ram:SpecifiedLineTradeAgreement><ram:NetPriceProductTradePrice><ram:ChargeAmount>18.99</ram:ChargeAmount></ram:NetPriceProductTradePrice></ram:SpecifiedLineTradeAgreement><ram:SpecifiedLineTradeDelivery><ram:BilledQuantity unitCode=\"C62\">2</ram:BilledQuantity></ram:SpecifiedLineTradeDelivery><ram:SpecifiedLineTradeSettlement><ram:ApplicableTradeTax><ram:TypeCode>VAT</ram:TypeCode><ram:CategoryCode>S</ram:CategoryCode><ram:RateApplicablePercent>2.1</ram:RateApplicablePercent></ram:ApplicableTradeTax><ram:SpecifiedTradeSettlementLineMonetarySummation><ram:LineTotalAmount>37.98</ram:LineTotalAmount></ram:SpecifiedTradeSettlementLineMonetarySummation></ram:SpecifiedLineTradeSettlement></ram:IncludedSupplyChainTradeLineItem><ram:ApplicableHeaderTradeAgreement><ram:SellerTradeParty><ram:Name>Atelier Payet SARL</ram:Name><ram:SpecifiedLegalOrganization><ram:ID schemeID=\"0002\">732829320</ram:ID></ram:SpecifiedLegalOrganization><ram:PostalTradeAddress><ram:PostcodeCode>97400</ram:PostcodeCode><ram:LineOne>12 rue de Paris</ram:LineOne><ram:CityName>Saint-Denis</ram:CityName><ram:CountryID>FR</ram:CountryID></ram:PostalTradeAddress><ram:SpecifiedTaxRegistration><ram:ID schemeID=\"VA\">FR44732829320</ram:ID></ram:SpecifiedTaxRegistration></ram:SellerTradeParty><ram:BuyerTradeParty><ram:Name>Client SAS</ram:Name><ram:SpecifiedLegalOrganization><ram:ID schemeID=\"0002\">552100554</ram:ID></ram:SpecifiedLegalOrganization><ram:PostalTradeAddress><ram:PostcodeCode>75008</ram:PostcodeCode><ram:CityName>Paris</ram:CityName><ram:CountryID>FR</ram:CountryID></ram:PostalTradeAddress></ram:BuyerTradeParty></ram:ApplicableHeaderTradeAgreement><ram:ApplicableHeaderTradeDelivery/><ram:ApplicableHeaderTradeSettlement><ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode><ram:SpecifiedTradeSettlementPaymentMeans><ram:TypeCode>58</ram:TypeCode><ram:PayeePartyCreditorFinancialAccount><ram:IBANID>FR7630006000011234567890189</ram:IBANID></ram:PayeePartyCreditorFinancialAccount><ram:PayeeSpecifiedCreditorFinancialInstitution><ram:BICID>AGRIFRPP</ram:BICID></ram:PayeeSpecifiedCreditorFinancialInstitution></ram:SpecifiedTradeSettlementPaymentMeans><ram:ApplicableTradeTax><ram:CalculatedAmount>24.23</ram:CalculatedAmount><ram:TypeCode>VAT</ram:TypeCode><ram:BasisAmount>285.00</ram:BasisAmount><ram:CategoryCode>S</ram:CategoryCode><ram:RateApplicablePercent>8.5</ram:RateApplicablePercent></ram:ApplicableTradeTax><ram:ApplicableTradeTax><ram:CalculatedAmount>0.80</ram:CalculatedAmount><ram:TypeCode>VAT</ram:TypeCode><ram:BasisAmount>37.98</ram:BasisAmount><ram:CategoryCode>S</ram:CategoryCode><ram:RateApplicablePercent>2.1</ram:RateApplicablePercent></ram:ApplicableTradeTax><ram:SpecifiedTradePaymentTerms><ram:Description>30 days</ram:Description><ram:DueDateDateTime><udt:DateTimeString format=\"102\">20261203</udt:DateTimeString></ram:DueDateDateTime></ram:SpecifiedTradePaymentTerms><ram:SpecifiedTradeSettlementHeaderMonetarySummation><ram:LineTotalAmount>322.98</ram:LineTotalAmount><ram:TaxBasisTotalAmount>322.98</ram:TaxBasisTotalAmount><ram:TaxTotalAmount currencyID=\"EUR\">25.03</ram:TaxTotalAmount><ram:GrandTotalAmount>348.01</ram:GrandTotalAmount><ram:DuePayableAmount>348.01</ram:DuePayableAmount></ram:SpecifiedTradeSettlementHeaderMonetarySummation></ram:ApplicableHeaderTradeSettlement></rsm:SupplyChainTradeTransaction></rsm:CrossIndustryInvoice>"
mentdb
{"valid": true, "errors": [], "warnings": [], "rules": "EN 16931 core business rules (a subset, not the full Schematron) and French identifiers"}

invoice check <invoice> <json_params>


Description

    Check with parameters: french_rules (true by default)

Parameters

    invoice:   The invoice - String - required
    json_params:   The parameters - String - required
admin
invoice check "{\"number\": \"F2026-0042\", \"type_code\": \"380\", \"issue_date\": \"2026-11-03\", \"due_date\": \"2026-12-03\", \"currency\": \"EUR\", \"seller\": {\"name\": \"Atelier Payet SARL\", \"siren\": \"732829320\", \"vat_id\": \"FR44732829320\", \"address\": {\"line1\": \"12 rue de Paris\", \"postcode\": \"97400\", \"city\": \"Saint-Denis\", \"country\": \"FR\"}}, \"buyer\": {\"name\": \"Client SAS\", \"siren\": \"552100555\", \"address\": {\"postcode\": \"75008\", \"city\": \"Paris\", \"country\": \"FR\"}}, \"lines\": [{\"name\": \"Consulting\", \"quantity\": 3, \"unit\": \"HUR\", \"unit_price\": 95, \"vat_category\": \"S\", \"vat_rate\": 8.5, \"id\": \"1\", \"net_amount\": 280}, {\"name\": \"Book\", \"quantity\": 2, \"unit_price\": 18.99, \"vat_category\": \"S\", \"vat_rate\": 2.1, \"id\": \"2\", \"unit\": \"C62\", \"net_amount\": 37.98}], \"payment\": {\"iban\": \"FR7630006000011234567890189\", \"bic\": \"AGRIFRPP\", \"terms\": \"30 days\"}, \"vat_breakdown\": [{\"category\": \"S\", \"rate\": 8.5, \"basis\": 280, \"amount\": 22.5}, {\"category\": \"S\", \"rate\": 2.1, \"basis\": 37.98, \"amount\": 0.8}], \"totals\": {\"lines\": 317.98, \"tax_basis\": 317.98, \"vat\": 24.6, \"grand_total\": 342.58, \"due\": 342.58}}" "{\"french_rules\": false}"
mentdb
{"valid": false, "errors": [{"rule": "BR-S-09", "message": "VAT S 8.5 %: the VAT amount 22.5 differs from taxable amount x rate 23.80"}, {"rule": "BR-CO-14", "message": "totals.vat 24.6 differs from the sum of the VAT breakdown 23.30"}], "warnings": [{"rule": "LINE-AMOUNT", "message": "line 1: net amount 280 differs from quantity x price 285.00 (allowed only with line allowances or charges)"}], "rules": "EN 16931 core business rules (a subset, not the full Schematron) and French identifiers"}
Used in use cases (1 recipe)

    Accountant & manager › Electronic invoice: compute the totals, check the EN 16931 rules, export in CII and UBL
Often used with

    invoice complete  ·  invoice parse  ·  invoice to_cii  ·  invoice to_ubl

invoice to_cii <json_invoice>


Description

    Write the CII XML (UN/CEFACT Cross Industry Invoice D16B, the XML of Factur-X / ZUGFeRD), profile EN 16931; the invoice is completed then checked first (refused if errors)

Parameters

    json_invoice:   The JSON invoice - String - required
admin
invoice to_cii "{\"number\": \"F2026-0042\", \"type_code\": \"380\", \"issue_date\": \"2026-11-03\", \"due_date\": \"2026-12-03\", \"currency\": \"EUR\", \"seller\": {\"name\": \"Atelier Payet SARL\", \"siren\": \"732829320\", \"vat_id\": \"FR44732829320\", \"address\": {\"line1\": \"12 rue de Paris\", \"postcode\": \"97400\", \"city\": \"Saint-Denis\", \"country\": \"FR\"}}, \"buyer\": {\"name\": \"Client SAS\", \"siren\": \"552100554\", \"address\": {\"postcode\": \"75008\", \"city\": \"Paris\", \"country\": \"FR\"}}, \"lines\": [{\"name\": \"Consulting\", \"quantity\": 3, \"unit\": \"HUR\", \"unit_price\": 95, \"vat_category\": \"S\", \"vat_rate\": 8.5}, {\"name\": \"Book\", \"quantity\": 2, \"unit_price\": 18.99, \"vat_category\": \"S\", \"vat_rate\": 2.1}], \"payment\": {\"iban\": \"FR7630006000011234567890189\", \"bic\": \"AGRIFRPP\", \"terms\": \"30 days\"}}"
mentdb
<?xml version="1.0" encoding="UTF-8"?> <rsm:CrossIndustryInvoice xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType: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>F2026-0042</ram:ID> <ram:TypeCode>380</ram:TypeCode> <ram:IssueDateTime> <udt:DateTimeString format="102">20261103</udt:DateTimeString> </ram:IssueDateTime> </rsm:ExchangedDocument> <rsm:SupplyChainTradeTransaction> <ram:IncludedSupplyChainTradeLineItem> <ram:AssociatedDocumentLineDocument> <ram:LineID>1</ram:LineID> </ram:AssociatedDocumentLineDocument> <ram:SpecifiedTradeProduct> <ram:Name>Consulting</ram:Name> </ram:SpecifiedTradeProduct> <ram:SpecifiedLineTradeAgreement> <ram:NetPriceProductTradePrice> <ram:ChargeAmount>95</ram:ChargeAmount> </ram:NetPriceProductTradePrice> </ram:SpecifiedLineTradeAgreement> <ram:SpecifiedLineTradeDelivery> <ram:BilledQuantity unitCode="HUR">3</ram:BilledQuantity> </ram:SpecifiedLineTradeDelivery> <ram:SpecifiedLineTradeSettlement> <ram:ApplicableTradeTax> <ram:TypeCode>VAT</ram:TypeCode> <ram:CategoryCode>S</ram:CategoryCode> <ram:RateApplicablePercent>8.5</ram:RateApplicablePercent> </ram:ApplicableTradeTax> <ram:SpecifiedTradeSettlementLineMonetarySummation> <ram:LineTotalAmount>285.00</ram:LineTotalAmount> </ram:SpecifiedTradeSettlementLineMonetarySummation> </ram:SpecifiedLineTradeSettlement> </ram:IncludedSupplyChainTradeLineItem> <ram:IncludedSupplyChainTradeLineItem> <ram:AssociatedDocumentLineDocument> <ram:LineID>2</ram:LineID> </ram:AssociatedDocumentLineDocument> <ram:SpecifiedTradeProduct> <ram:Name>Book</ram:Name> </ram:SpecifiedTradeProduct> <ram:SpecifiedLineTradeAgreement> <ram:NetPriceProductTradePrice> <ram:ChargeAmount>18.99</ram:ChargeAmount> </ram:NetPriceProductTradePrice> </ram:SpecifiedLineTradeAgreement> <ram:SpecifiedLineTradeDelivery> <ram:BilledQuantity unitCode="C62">2</ram:BilledQuantity> </ram:SpecifiedLineTradeDelivery> <ram:SpecifiedLineTradeSettlement> <ram:ApplicableTradeTax> <ram:TypeCode>VAT</ram:TypeCode> <ram:CategoryCode>S</ram:CategoryCode> <ram:RateApplicablePercent>2.1</ram:RateApplicablePercent> </ram:ApplicableTradeTax> <ram:SpecifiedTradeSettlementLineMonetarySummation> <ram:LineTotalAmount>37.98</ram:LineTotalAmount> </ram:SpecifiedTradeSettlementLineMonetarySummation> </ram:SpecifiedLineTradeSettlement> </ram:IncludedSupplyChainTradeLineItem> <ram:ApplicableHeaderTradeAgreement> <ram:SellerTradeParty> <ram:Name>Atelier Payet SARL</ram:Name> <ram:SpecifiedLegalOrganization> <ram:ID schemeID="0002">732829320</ram:ID> </ram:SpecifiedLegalOrganization> <ram:PostalTradeAddress> <ram:PostcodeCode>97400</ram:PostcodeCode> <ram:LineOne>12 rue de Paris</ram:LineOne> <ram:CityName>Saint-Denis</ram:CityName> <ram:CountryID>FR</ram:CountryID> </ram:PostalTradeAddress> <ram:SpecifiedTaxRegistration> <ram:ID schemeID="VA">FR44732829320</ram:ID> </ram:SpecifiedTaxRegistration> </ram:SellerTradeParty> <ram:BuyerTradeParty> <ram:Name>Client SAS</ram:Name> <ram:SpecifiedLegalOrganization> <ram:ID schemeID="0002">552100554</ram:ID> </ram:SpecifiedLegalOrganization> <ram:PostalTradeAddress> <ram:PostcodeCode>75008</ram:PostcodeCode> <ram:CityName>Paris</ram:CityName> <ram:CountryID>FR</ram:CountryID> </ram:PostalTradeAddress> </ram:BuyerTradeParty> </ram:ApplicableHeaderTradeAgreement> <ram:ApplicableHeaderTradeDelivery/> <ram:ApplicableHeaderTradeSettlement> <ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode> <ram:SpecifiedTradeSettlementPaymentMeans> <ram:TypeCode>58</ram:TypeCode> <ram:PayeePartyCreditorFinancialAccount> <ram:IBANID>FR7630006000011234567890189</ram:IBANID> </ram:PayeePartyCreditorFinancialAccount> <ram:PayeeSpecifiedCreditorFinancialInstitution> <ram:BICID>AGRIFRPP</ram:BICID> </ram:PayeeSpecifiedCreditorFinancialInstitution> </ram:SpecifiedTradeSettlementPaymentMeans> <ram:ApplicableTradeTax> <ram:CalculatedAmount>24.23</ram:CalculatedAmount> <ram:TypeCode>VAT</ram:TypeCode> <ram:BasisAmount>285.00</ram:BasisAmount> <ram:CategoryCode>S</ram:CategoryCode> <ram:RateApplicablePercent>8.5</ram:RateApplicablePercent> </ram:ApplicableTradeTax> <ram:ApplicableTradeTax> <ram:CalculatedAmount>0.80</ram:CalculatedAmount> <ram:TypeCode>VAT</ram:TypeCode> <ram:BasisAmount>37.98</ram:BasisAmount> <ram:CategoryCode>S</ram:CategoryCode> <ram:RateApplicablePercent>2.1</ram:RateApplicablePercent> </ram:ApplicableTradeTax> <ram:SpecifiedTradePaymentTerms> <ram:Description>30 days</ram:Description> <ram:DueDateDateTime> <udt:DateTimeString format="102">20261203</udt:DateTimeString> </ram:DueDateDateTime> </ram:SpecifiedTradePaymentTerms> <ram:SpecifiedTradeSettlementHeaderMonetarySummation> <ram:LineTotalAmount>322.98</ram:LineTotalAmount> <ram:TaxBasisTotalAmount>322.98</ram:TaxBasisTotalAmount> <ram:TaxTotalAmount currencyID="EUR">25.03</ram:TaxTotalAmount> <ram:GrandTotalAmount>348.01</ram:GrandTotalAmount> <ram:DuePayableAmount>348.01</ram:DuePayableAmount> </ram:SpecifiedTradeSettlementHeaderMonetarySummation> </ram:ApplicableHeaderTradeSettlement> </rsm:SupplyChainTradeTransaction> </rsm:CrossIndustryInvoice>

invoice to_cii <json_invoice> <json_params>


Description

    CII with parameters: profile (basic, en16931, extended: the guideline id), business_process, force (write even with errors), french_rules

Parameters

    json_invoice:   The JSON invoice - String - required
    json_params:   The parameters - String - required
admin
invoice to_cii "{\"number\": \"F2026-0043\", \"type_code\": \"380\", \"issue_date\": \"2026-11-04\", \"currency\": \"EUR\", \"seller\": {\"name\": \"Atelier Payet SARL\", \"siren\": \"732829320\", \"vat_id\": \"FR44732829320\", \"address\": {\"line1\": \"12 rue de Paris\", \"postcode\": \"97400\", \"city\": \"Saint-Denis\", \"country\": \"FR\"}}, \"buyer\": {\"name\": \"Formation Plus\", \"address\": {\"city\": \"Lyon\", \"country\": \"FR\"}}, \"lines\": [{\"name\": \"Training day\", \"quantity\": 2, \"unit\": \"DAY\", \"unit_price\": 600, \"vat_category\": \"E\", \"vat_rate\": 0}], \"vat_breakdown\": [{\"category\": \"E\", \"rate\": 0, \"basis\": 1200, \"amount\": 0, \"exemption_reason\": \"Exoneration art. 261-4-4 a du CGI\"}], \"totals\": {\"prepaid\": 200}}" "{\"profile\": \"basic\"}"
mentdb
<?xml version="1.0" encoding="UTF-8"?> <rsm:CrossIndustryInvoice xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType: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#compliant#urn:factur-x.eu:1p0:basic</ram:ID> </ram:GuidelineSpecifiedDocumentContextParameter> </rsm:ExchangedDocumentContext> <rsm:ExchangedDocument> <ram:ID>F2026-0043</ram:ID> <ram:TypeCode>380</ram:TypeCode> <ram:IssueDateTime> <udt:DateTimeString format="102">20261104</udt:DateTimeString> </ram:IssueDateTime> </rsm:ExchangedDocument> <rsm:SupplyChainTradeTransaction> <ram:IncludedSupplyChainTradeLineItem> <ram:AssociatedDocumentLineDocument> <ram:LineID>1</ram:LineID> </ram:AssociatedDocumentLineDocument> <ram:SpecifiedTradeProduct> <ram:Name>Training day</ram:Name> </ram:SpecifiedTradeProduct> <ram:SpecifiedLineTradeAgreement> <ram:NetPriceProductTradePrice> <ram:ChargeAmount>600</ram:ChargeAmount> </ram:NetPriceProductTradePrice> </ram:SpecifiedLineTradeAgreement> <ram:SpecifiedLineTradeDelivery> <ram:BilledQuantity unitCode="DAY">2</ram:BilledQuantity> </ram:SpecifiedLineTradeDelivery> <ram:SpecifiedLineTradeSettlement> <ram:ApplicableTradeTax> <ram:TypeCode>VAT</ram:TypeCode> <ram:CategoryCode>E</ram:CategoryCode> <ram:RateApplicablePercent>0</ram:RateApplicablePercent> </ram:ApplicableTradeTax> <ram:SpecifiedTradeSettlementLineMonetarySummation> <ram:LineTotalAmount>1200.00</ram:LineTotalAmount> </ram:SpecifiedTradeSettlementLineMonetarySummation> </ram:SpecifiedLineTradeSettlement> </ram:IncludedSupplyChainTradeLineItem> <ram:ApplicableHeaderTradeAgreement> <ram:SellerTradeParty> <ram:Name>Atelier Payet SARL</ram:Name> <ram:SpecifiedLegalOrganization> <ram:ID schemeID="0002">732829320</ram:ID> </ram:SpecifiedLegalOrganization> <ram:PostalTradeAddress> <ram:PostcodeCode>97400</ram:PostcodeCode> <ram:LineOne>12 rue de Paris</ram:LineOne> <ram:CityName>Saint-Denis</ram:CityName> <ram:CountryID>FR</ram:CountryID> </ram:PostalTradeAddress> <ram:SpecifiedTaxRegistration> <ram:ID schemeID="VA">FR44732829320</ram:ID> </ram:SpecifiedTaxRegistration> </ram:SellerTradeParty> <ram:BuyerTradeParty> <ram:Name>Formation Plus</ram:Name> <ram:PostalTradeAddress> <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>0.00</ram:CalculatedAmount> <ram:TypeCode>VAT</ram:TypeCode> <ram:ExemptionReason>Exoneration art. 261-4-4 a du CGI</ram:ExemptionReason> <ram:BasisAmount>1200.00</ram:BasisAmount> <ram:CategoryCode>E</ram:CategoryCode> <ram:RateApplicablePercent>0</ram:RateApplicablePercent> </ram:ApplicableTradeTax> <ram:SpecifiedTradeSettlementHeaderMonetarySummation> <ram:LineTotalAmount>1200.00</ram:LineTotalAmount> <ram:TaxBasisTotalAmount>1200.00</ram:TaxBasisTotalAmount> <ram:TaxTotalAmount currencyID="EUR">0.00</ram:TaxTotalAmount> <ram:GrandTotalAmount>1200.00</ram:GrandTotalAmount> <ram:TotalPrepaidAmount>200.00</ram:TotalPrepaidAmount> <ram:DuePayableAmount>1000.00</ram:DuePayableAmount> </ram:SpecifiedTradeSettlementHeaderMonetarySummation> </ram:ApplicableHeaderTradeSettlement> </rsm:SupplyChainTradeTransaction> </rsm:CrossIndustryInvoice>
Used in use cases (1 recipe)

    Accountant & manager › Electronic invoice: compute the totals, check the EN 16931 rules, export in CII and UBL
Often used with

    invoice check  ·  invoice complete  ·  invoice parse  ·  invoice to_ubl

invoice to_ubl <json_invoice>


Description

    Write the UBL 2.1 XML (Invoice, or CreditNote for the credit note type codes 261, 262, 296, 308, 381, 396, 420, 458, 532), CustomizationID EN 16931; completed then checked first. The electronic address of the parties (EndpointID, mandatory on Peppol) is the SIRET (scheme 0009) or else the SIREN (0002): give one of them for Peppol

Parameters

    json_invoice:   The JSON invoice - String - required
admin
invoice to_ubl "{\"number\": \"F2026-0042\", \"type_code\": \"380\", \"issue_date\": \"2026-11-03\", \"due_date\": \"2026-12-03\", \"currency\": \"EUR\", \"seller\": {\"name\": \"Atelier Payet SARL\", \"siren\": \"732829320\", \"vat_id\": \"FR44732829320\", \"address\": {\"line1\": \"12 rue de Paris\", \"postcode\": \"97400\", \"city\": \"Saint-Denis\", \"country\": \"FR\"}}, \"buyer\": {\"name\": \"Client SAS\", \"siren\": \"552100554\", \"address\": {\"postcode\": \"75008\", \"city\": \"Paris\", \"country\": \"FR\"}}, \"lines\": [{\"name\": \"Consulting\", \"quantity\": 3, \"unit\": \"HUR\", \"unit_price\": 95, \"vat_category\": \"S\", \"vat_rate\": 8.5}, {\"name\": \"Book\", \"quantity\": 2, \"unit_price\": 18.99, \"vat_category\": \"S\", \"vat_rate\": 2.1}], \"payment\": {\"iban\": \"FR7630006000011234567890189\", \"bic\": \"AGRIFRPP\", \"terms\": \"30 days\"}}"
mentdb
<?xml version="1.0" encoding="UTF-8"?> <Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"> <cbc:CustomizationID>urn:cen.eu:en16931:2017</cbc:CustomizationID> <cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID> <cbc:ID>F2026-0042</cbc:ID> <cbc:IssueDate>2026-11-03</cbc:IssueDate> <cbc:DueDate>2026-12-03</cbc:DueDate> <cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode> <cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode> <cac:AccountingSupplierParty> <cac:Party> <cbc:EndpointID schemeID="0002">732829320</cbc:EndpointID> <cac:PartyName> <cbc:Name>Atelier Payet SARL</cbc:Name> </cac:PartyName> <cac:PostalAddress> <cbc:StreetName>12 rue de Paris</cbc:StreetName> <cbc:CityName>Saint-Denis</cbc:CityName> <cbc:PostalZone>97400</cbc:PostalZone> <cac:Country> <cbc:IdentificationCode>FR</cbc:IdentificationCode> </cac:Country> </cac:PostalAddress> <cac:PartyTaxScheme> <cbc:CompanyID>FR44732829320</cbc:CompanyID> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:PartyTaxScheme> <cac:PartyLegalEntity> <cbc:RegistrationName>Atelier Payet SARL</cbc:RegistrationName> <cbc:CompanyID schemeID="0002">732829320</cbc:CompanyID> </cac:PartyLegalEntity> </cac:Party> </cac:AccountingSupplierParty> <cac:AccountingCustomerParty> <cac:Party> <cbc:EndpointID schemeID="0002">552100554</cbc:EndpointID> <cac:PartyName> <cbc:Name>Client SAS</cbc:Name> </cac:PartyName> <cac:PostalAddress> <cbc:CityName>Paris</cbc:CityName> <cbc:PostalZone>75008</cbc:PostalZone> <cac:Country> <cbc:IdentificationCode>FR</cbc:IdentificationCode> </cac:Country> </cac:PostalAddress> <cac:PartyLegalEntity> <cbc:RegistrationName>Client SAS</cbc:RegistrationName> <cbc:CompanyID schemeID="0002">552100554</cbc:CompanyID> </cac:PartyLegalEntity> </cac:Party> </cac:AccountingCustomerParty> <cac:PaymentMeans> <cbc:PaymentMeansCode>58</cbc:PaymentMeansCode> <cac:PayeeFinancialAccount> <cbc:ID>FR7630006000011234567890189</cbc:ID> <cac:FinancialInstitutionBranch> <cbc:ID>AGRIFRPP</cbc:ID> </cac:FinancialInstitutionBranch> </cac:PayeeFinancialAccount> </cac:PaymentMeans> <cac:PaymentTerms> <cbc:Note>30 days</cbc:Note> </cac:PaymentTerms> <cac:TaxTotal> <cbc:TaxAmount currencyID="EUR">25.03</cbc:TaxAmount> <cac:TaxSubtotal> <cbc:TaxableAmount currencyID="EUR">285.00</cbc:TaxableAmount> <cbc:TaxAmount currencyID="EUR">24.23</cbc:TaxAmount> <cac:TaxCategory> <cbc:ID>S</cbc:ID> <cbc:Percent>8.5</cbc:Percent> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:TaxCategory> </cac:TaxSubtotal> <cac:TaxSubtotal> <cbc:TaxableAmount currencyID="EUR">37.98</cbc:TaxableAmount> <cbc:TaxAmount currencyID="EUR">0.80</cbc:TaxAmount> <cac:TaxCategory> <cbc:ID>S</cbc:ID> <cbc:Percent>2.1</cbc:Percent> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:TaxCategory> </cac:TaxSubtotal> </cac:TaxTotal> <cac:LegalMonetaryTotal> <cbc:LineExtensionAmount currencyID="EUR">322.98</cbc:LineExtensionAmount> <cbc:TaxExclusiveAmount currencyID="EUR">322.98</cbc:TaxExclusiveAmount> <cbc:TaxInclusiveAmount currencyID="EUR">348.01</cbc:TaxInclusiveAmount> <cbc:PayableAmount currencyID="EUR">348.01</cbc:PayableAmount> </cac:LegalMonetaryTotal> <cac:InvoiceLine> <cbc:ID>1</cbc:ID> <cbc:InvoicedQuantity unitCode="HUR">3</cbc:InvoicedQuantity> <cbc:LineExtensionAmount currencyID="EUR">285.00</cbc:LineExtensionAmount> <cac:Item> <cbc:Name>Consulting</cbc:Name> <cac:ClassifiedTaxCategory> <cbc:ID>S</cbc:ID> <cbc:Percent>8.5</cbc:Percent> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:ClassifiedTaxCategory> </cac:Item> <cac:Price> <cbc:PriceAmount currencyID="EUR">95</cbc:PriceAmount> </cac:Price> </cac:InvoiceLine> <cac:InvoiceLine> <cbc:ID>2</cbc:ID> <cbc:InvoicedQuantity unitCode="C62">2</cbc:InvoicedQuantity> <cbc:LineExtensionAmount currencyID="EUR">37.98</cbc:LineExtensionAmount> <cac:Item> <cbc:Name>Book</cbc:Name> <cac:ClassifiedTaxCategory> <cbc:ID>S</cbc:ID> <cbc:Percent>2.1</cbc:Percent> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:ClassifiedTaxCategory> </cac:Item> <cac:Price> <cbc:PriceAmount currencyID="EUR">18.99</cbc:PriceAmount> </cac:Price> </cac:InvoiceLine> </Invoice>

invoice to_ubl <json_invoice> <json_params>


Description

    UBL with parameters: customization_id, profile_id (Peppol BIS Billing 3 by default), force, french_rules

Parameters

    json_invoice:   The JSON invoice - String - required
    json_params:   The parameters - String - required
admin
invoice to_ubl "{\"number\": \"AV2026-0007\", \"type_code\": \"381\", \"issue_date\": \"2026-11-03\", \"due_date\": \"2026-12-03\", \"currency\": \"EUR\", \"seller\": {\"name\": \"Atelier Payet SARL\", \"siren\": \"732829320\", \"vat_id\": \"FR44732829320\", \"address\": {\"line1\": \"12 rue de Paris\", \"postcode\": \"97400\", \"city\": \"Saint-Denis\", \"country\": \"FR\"}}, \"buyer\": {\"name\": \"Client SAS\", \"siren\": \"552100554\", \"address\": {\"postcode\": \"75008\", \"city\": \"Paris\", \"country\": \"FR\"}}, \"lines\": [{\"name\": \"Consulting\", \"quantity\": 3, \"unit\": \"HUR\", \"unit_price\": 95, \"vat_category\": \"S\", \"vat_rate\": 8.5}, {\"name\": \"Book\", \"quantity\": 2, \"unit_price\": 18.99, \"vat_category\": \"S\", \"vat_rate\": 2.1}], \"payment\": {\"iban\": \"FR7630006000011234567890189\", \"bic\": \"AGRIFRPP\", \"terms\": \"30 days\"}}" "{\"profile_id\": \"urn:fdc:peppol.eu:2017:poacc:billing:01:1.0\"}"
mentdb
<?xml version="1.0" encoding="UTF-8"?> <CreditNote xmlns="urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"> <cbc:CustomizationID>urn:cen.eu:en16931:2017</cbc:CustomizationID> <cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID> <cbc:ID>AV2026-0007</cbc:ID> <cbc:IssueDate>2026-11-03</cbc:IssueDate> <cbc:CreditNoteTypeCode>381</cbc:CreditNoteTypeCode> <cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode> <cac:AccountingSupplierParty> <cac:Party> <cbc:EndpointID schemeID="0002">732829320</cbc:EndpointID> <cac:PartyName> <cbc:Name>Atelier Payet SARL</cbc:Name> </cac:PartyName> <cac:PostalAddress> <cbc:StreetName>12 rue de Paris</cbc:StreetName> <cbc:CityName>Saint-Denis</cbc:CityName> <cbc:PostalZone>97400</cbc:PostalZone> <cac:Country> <cbc:IdentificationCode>FR</cbc:IdentificationCode> </cac:Country> </cac:PostalAddress> <cac:PartyTaxScheme> <cbc:CompanyID>FR44732829320</cbc:CompanyID> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:PartyTaxScheme> <cac:PartyLegalEntity> <cbc:RegistrationName>Atelier Payet SARL</cbc:RegistrationName> <cbc:CompanyID schemeID="0002">732829320</cbc:CompanyID> </cac:PartyLegalEntity> </cac:Party> </cac:AccountingSupplierParty> <cac:AccountingCustomerParty> <cac:Party> <cbc:EndpointID schemeID="0002">552100554</cbc:EndpointID> <cac:PartyName> <cbc:Name>Client SAS</cbc:Name> </cac:PartyName> <cac:PostalAddress> <cbc:CityName>Paris</cbc:CityName> <cbc:PostalZone>75008</cbc:PostalZone> <cac:Country> <cbc:IdentificationCode>FR</cbc:IdentificationCode> </cac:Country> </cac:PostalAddress> <cac:PartyLegalEntity> <cbc:RegistrationName>Client SAS</cbc:RegistrationName> <cbc:CompanyID schemeID="0002">552100554</cbc:CompanyID> </cac:PartyLegalEntity> </cac:Party> </cac:AccountingCustomerParty> <cac:PaymentMeans> <cbc:PaymentMeansCode>58</cbc:PaymentMeansCode> <cbc:PaymentDueDate>2026-12-03</cbc:PaymentDueDate> <cac:PayeeFinancialAccount> <cbc:ID>FR7630006000011234567890189</cbc:ID> <cac:FinancialInstitutionBranch> <cbc:ID>AGRIFRPP</cbc:ID> </cac:FinancialInstitutionBranch> </cac:PayeeFinancialAccount> </cac:PaymentMeans> <cac:PaymentTerms> <cbc:Note>30 days</cbc:Note> </cac:PaymentTerms> <cac:TaxTotal> <cbc:TaxAmount currencyID="EUR">25.03</cbc:TaxAmount> <cac:TaxSubtotal> <cbc:TaxableAmount currencyID="EUR">285.00</cbc:TaxableAmount> <cbc:TaxAmount currencyID="EUR">24.23</cbc:TaxAmount> <cac:TaxCategory> <cbc:ID>S</cbc:ID> <cbc:Percent>8.5</cbc:Percent> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:TaxCategory> </cac:TaxSubtotal> <cac:TaxSubtotal> <cbc:TaxableAmount currencyID="EUR">37.98</cbc:TaxableAmount> <cbc:TaxAmount currencyID="EUR">0.80</cbc:TaxAmount> <cac:TaxCategory> <cbc:ID>S</cbc:ID> <cbc:Percent>2.1</cbc:Percent> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:TaxCategory> </cac:TaxSubtotal> </cac:TaxTotal> <cac:LegalMonetaryTotal> <cbc:LineExtensionAmount currencyID="EUR">322.98</cbc:LineExtensionAmount> <cbc:TaxExclusiveAmount currencyID="EUR">322.98</cbc:TaxExclusiveAmount> <cbc:TaxInclusiveAmount currencyID="EUR">348.01</cbc:TaxInclusiveAmount> <cbc:PayableAmount currencyID="EUR">348.01</cbc:PayableAmount> </cac:LegalMonetaryTotal> <cac:CreditNoteLine> <cbc:ID>1</cbc:ID> <cbc:CreditedQuantity unitCode="HUR">3</cbc:CreditedQuantity> <cbc:LineExtensionAmount currencyID="EUR">285.00</cbc:LineExtensionAmount> <cac:Item> <cbc:Name>Consulting</cbc:Name> <cac:ClassifiedTaxCategory> <cbc:ID>S</cbc:ID> <cbc:Percent>8.5</cbc:Percent> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:ClassifiedTaxCategory> </cac:Item> <cac:Price> <cbc:PriceAmount currencyID="EUR">95</cbc:PriceAmount> </cac:Price> </cac:CreditNoteLine> <cac:CreditNoteLine> <cbc:ID>2</cbc:ID> <cbc:CreditedQuantity unitCode="C62">2</cbc:CreditedQuantity> <cbc:LineExtensionAmount currencyID="EUR">37.98</cbc:LineExtensionAmount> <cac:Item> <cbc:Name>Book</cbc:Name> <cac:ClassifiedTaxCategory> <cbc:ID>S</cbc:ID> <cbc:Percent>2.1</cbc:Percent> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:ClassifiedTaxCategory> </cac:Item> <cac:Price> <cbc:PriceAmount currencyID="EUR">18.99</cbc:PriceAmount> </cac:Price> </cac:CreditNoteLine> </CreditNote>
Used in use cases (1 recipe)

    Accountant & manager › Electronic invoice: compute the totals, check the EN 16931 rules, export in CII and UBL
Often used with

    invoice check  ·  invoice complete  ·  invoice parse  ·  invoice to_cii

invoice parse <invoice>


Description

    Read a CII (Factur-X / ZUGFeRD, profiles MINIMUM to EXTENDED) or UBL 2.1 invoice (Invoice or CreditNote), given as XML or as the path of a file, into the normalized JSON invoice

Parameters

    invoice:   The XML or the path of an XML file - String - required
admin
invoice parse "<?xml version=\"1.0\" encoding=\"UTF-8\"?><rsm:CrossIndustryInvoice xmlns:rsm=\"urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100\" xmlns:qdt=\"urn:un:unece:uncefact:data:standard:QualifiedDataType: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>F2026-0042</ram:ID><ram:TypeCode>380</ram:TypeCode><ram:IssueDateTime><udt:DateTimeString format=\"102\">20261103</udt:DateTimeString></ram:IssueDateTime></rsm:ExchangedDocument><rsm:SupplyChainTradeTransaction><ram:IncludedSupplyChainTradeLineItem><ram:AssociatedDocumentLineDocument><ram:LineID>1</ram:LineID></ram:AssociatedDocumentLineDocument><ram:SpecifiedTradeProduct><ram:Name>Consulting</ram:Name></ram:SpecifiedTradeProduct><ram:SpecifiedLineTradeAgreement><ram:NetPriceProductTradePrice><ram:ChargeAmount>95</ram:ChargeAmount></ram:NetPriceProductTradePrice></ram:SpecifiedLineTradeAgreement><ram:SpecifiedLineTradeDelivery><ram:BilledQuantity unitCode=\"HUR\">3</ram:BilledQuantity></ram:SpecifiedLineTradeDelivery><ram:SpecifiedLineTradeSettlement><ram:ApplicableTradeTax><ram:TypeCode>VAT</ram:TypeCode><ram:CategoryCode>S</ram:CategoryCode><ram:RateApplicablePercent>8.5</ram:RateApplicablePercent></ram:ApplicableTradeTax><ram:SpecifiedTradeSettlementLineMonetarySummation><ram:LineTotalAmount>285.00</ram:LineTotalAmount></ram:SpecifiedTradeSettlementLineMonetarySummation></ram:SpecifiedLineTradeSettlement></ram:IncludedSupplyChainTradeLineItem><ram:IncludedSupplyChainTradeLineItem><ram:AssociatedDocumentLineDocument><ram:LineID>2</ram:LineID></ram:AssociatedDocumentLineDocument><ram:SpecifiedTradeProduct><ram:Name>Book</ram:Name></ram:SpecifiedTradeProduct><ram:SpecifiedLineTradeAgreement><ram:NetPriceProductTradePrice><ram:ChargeAmount>18.99</ram:ChargeAmount></ram:NetPriceProductTradePrice></ram:SpecifiedLineTradeAgreement><ram:SpecifiedLineTradeDelivery><ram:BilledQuantity unitCode=\"C62\">2</ram:BilledQuantity></ram:SpecifiedLineTradeDelivery><ram:SpecifiedLineTradeSettlement><ram:ApplicableTradeTax><ram:TypeCode>VAT</ram:TypeCode><ram:CategoryCode>S</ram:CategoryCode><ram:RateApplicablePercent>2.1</ram:RateApplicablePercent></ram:ApplicableTradeTax><ram:SpecifiedTradeSettlementLineMonetarySummation><ram:LineTotalAmount>37.98</ram:LineTotalAmount></ram:SpecifiedTradeSettlementLineMonetarySummation></ram:SpecifiedLineTradeSettlement></ram:IncludedSupplyChainTradeLineItem><ram:ApplicableHeaderTradeAgreement><ram:SellerTradeParty><ram:Name>Atelier Payet SARL</ram:Name><ram:SpecifiedLegalOrganization><ram:ID schemeID=\"0002\">732829320</ram:ID></ram:SpecifiedLegalOrganization><ram:PostalTradeAddress><ram:PostcodeCode>97400</ram:PostcodeCode><ram:LineOne>12 rue de Paris</ram:LineOne><ram:CityName>Saint-Denis</ram:CityName><ram:CountryID>FR</ram:CountryID></ram:PostalTradeAddress><ram:SpecifiedTaxRegistration><ram:ID schemeID=\"VA\">FR44732829320</ram:ID></ram:SpecifiedTaxRegistration></ram:SellerTradeParty><ram:BuyerTradeParty><ram:Name>Client SAS</ram:Name><ram:SpecifiedLegalOrganization><ram:ID schemeID=\"0002\">552100554</ram:ID></ram:SpecifiedLegalOrganization><ram:PostalTradeAddress><ram:PostcodeCode>75008</ram:PostcodeCode><ram:CityName>Paris</ram:CityName><ram:CountryID>FR</ram:CountryID></ram:PostalTradeAddress></ram:BuyerTradeParty></ram:ApplicableHeaderTradeAgreement><ram:ApplicableHeaderTradeDelivery/><ram:ApplicableHeaderTradeSettlement><ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode><ram:SpecifiedTradeSettlementPaymentMeans><ram:TypeCode>58</ram:TypeCode><ram:PayeePartyCreditorFinancialAccount><ram:IBANID>FR7630006000011234567890189</ram:IBANID></ram:PayeePartyCreditorFinancialAccount><ram:PayeeSpecifiedCreditorFinancialInstitution><ram:BICID>AGRIFRPP</ram:BICID></ram:PayeeSpecifiedCreditorFinancialInstitution></ram:SpecifiedTradeSettlementPaymentMeans><ram:ApplicableTradeTax><ram:CalculatedAmount>24.23</ram:CalculatedAmount><ram:TypeCode>VAT</ram:TypeCode><ram:BasisAmount>285.00</ram:BasisAmount><ram:CategoryCode>S</ram:CategoryCode><ram:RateApplicablePercent>8.5</ram:RateApplicablePercent></ram:ApplicableTradeTax><ram:ApplicableTradeTax><ram:CalculatedAmount>0.80</ram:CalculatedAmount><ram:TypeCode>VAT</ram:TypeCode><ram:BasisAmount>37.98</ram:BasisAmount><ram:CategoryCode>S</ram:CategoryCode><ram:RateApplicablePercent>2.1</ram:RateApplicablePercent></ram:ApplicableTradeTax><ram:SpecifiedTradePaymentTerms><ram:Description>30 days</ram:Description><ram:DueDateDateTime><udt:DateTimeString format=\"102\">20261203</udt:DateTimeString></ram:DueDateDateTime></ram:SpecifiedTradePaymentTerms><ram:SpecifiedTradeSettlementHeaderMonetarySummation><ram:LineTotalAmount>322.98</ram:LineTotalAmount><ram:TaxBasisTotalAmount>322.98</ram:TaxBasisTotalAmount><ram:TaxTotalAmount currencyID=\"EUR\">25.03</ram:TaxTotalAmount><ram:GrandTotalAmount>348.01</ram:GrandTotalAmount><ram:DuePayableAmount>348.01</ram:DuePayableAmount></ram:SpecifiedTradeSettlementHeaderMonetarySummation></ram:ApplicableHeaderTradeSettlement></rsm:SupplyChainTradeTransaction></rsm:CrossIndustryInvoice>"
mentdb
{"syntax": "CII", "profile": "urn:cen.eu:en16931:2017", "number": "F2026-0042", "type_code": "380", "issue_date": "2026-11-03", "due_date": "2026-12-03", "currency": "EUR", "seller": {"name": "Atelier Payet SARL", "siren": "732829320", "vat_id": "FR44732829320", "address": {"line1": "12 rue de Paris", "postcode": "97400", "city": "Saint-Denis", "country": "FR"}}, "buyer": {"name": "Client SAS", "siren": "552100554", "address": {"postcode": "75008", "city": "Paris", "country": "FR"}}, "lines": [{"id": "1", "name": "Consulting", "quantity": 3, "unit": "HUR", "unit_price": 95, "net_amount": 285, "vat_category": "S", "vat_rate": 8.5}, {"id": "2", "name": "Book", "quantity": 2, "unit": "C62", "unit_price": 18.99, "net_amount": 37.98, "vat_category": "S", "vat_rate": 2.1}], "vat_breakdown": [{"category": "S", "rate": 8.5, "basis": 285, "amount": 24.23}, {"category": "S", "rate": 2.1, "basis": 37.98, "amount": 0.8}], "totals": {"lines": 322.98, "tax_basis": 322.98, "vat": 25.03, "grand_total": 348.01, "due": 348.01}, "payment": {"means_code": "58", "iban": "FR7630006000011234567890189", "bic": "AGRIFRPP", "terms": "30 days"}}
UBL
admin
invoice parse "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Invoice xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\" xmlns:cac=\"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2\" xmlns:cbc=\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\"><cbc:CustomizationID>urn:cen.eu:en16931:2017</cbc:CustomizationID><cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID><cbc:ID>F2026-0042</cbc:ID><cbc:IssueDate>2026-11-03</cbc:IssueDate><cbc:DueDate>2026-12-03</cbc:DueDate><cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode><cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode><cac:AccountingSupplierParty><cac:Party><cac:PartyName><cbc:Name>Atelier Payet SARL</cbc:Name></cac:PartyName><cac:PostalAddress><cbc:StreetName>12 rue de Paris</cbc:StreetName><cbc:CityName>Saint-Denis</cbc:CityName><cbc:PostalZone>97400</cbc:PostalZone><cac:Country><cbc:IdentificationCode>FR</cbc:IdentificationCode></cac:Country></cac:PostalAddress><cac:PartyTaxScheme><cbc:CompanyID>FR44732829320</cbc:CompanyID><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:PartyTaxScheme><cac:PartyLegalEntity><cbc:RegistrationName>Atelier Payet SARL</cbc:RegistrationName><cbc:CompanyID schemeID=\"0002\">732829320</cbc:CompanyID></cac:PartyLegalEntity></cac:Party></cac:AccountingSupplierParty><cac:AccountingCustomerParty><cac:Party><cac:PartyName><cbc:Name>Client SAS</cbc:Name></cac:PartyName><cac:PostalAddress><cbc:CityName>Paris</cbc:CityName><cbc:PostalZone>75008</cbc:PostalZone><cac:Country><cbc:IdentificationCode>FR</cbc:IdentificationCode></cac:Country></cac:PostalAddress><cac:PartyLegalEntity><cbc:RegistrationName>Client SAS</cbc:RegistrationName><cbc:CompanyID schemeID=\"0002\">552100554</cbc:CompanyID></cac:PartyLegalEntity></cac:Party></cac:AccountingCustomerParty><cac:PaymentMeans><cbc:PaymentMeansCode>58</cbc:PaymentMeansCode><cac:PayeeFinancialAccount><cbc:ID>FR7630006000011234567890189</cbc:ID><cac:FinancialInstitutionBranch><cbc:ID>AGRIFRPP</cbc:ID></cac:FinancialInstitutionBranch></cac:PayeeFinancialAccount></cac:PaymentMeans><cac:PaymentTerms><cbc:Note>30 days</cbc:Note></cac:PaymentTerms><cac:TaxTotal><cbc:TaxAmount currencyID=\"EUR\">25.03</cbc:TaxAmount><cac:TaxSubtotal><cbc:TaxableAmount currencyID=\"EUR\">285.00</cbc:TaxableAmount><cbc:TaxAmount currencyID=\"EUR\">24.23</cbc:TaxAmount><cac:TaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>8.5</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory></cac:TaxSubtotal><cac:TaxSubtotal><cbc:TaxableAmount currencyID=\"EUR\">37.98</cbc:TaxableAmount><cbc:TaxAmount currencyID=\"EUR\">0.80</cbc:TaxAmount><cac:TaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>2.1</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:TaxCategory></cac:TaxSubtotal></cac:TaxTotal><cac:LegalMonetaryTotal><cbc:LineExtensionAmount currencyID=\"EUR\">322.98</cbc:LineExtensionAmount><cbc:TaxExclusiveAmount currencyID=\"EUR\">322.98</cbc:TaxExclusiveAmount><cbc:TaxInclusiveAmount currencyID=\"EUR\">348.01</cbc:TaxInclusiveAmount><cbc:PayableAmount currencyID=\"EUR\">348.01</cbc:PayableAmount></cac:LegalMonetaryTotal><cac:InvoiceLine><cbc:ID>1</cbc:ID><cbc:InvoicedQuantity unitCode=\"HUR\">3</cbc:InvoicedQuantity><cbc:LineExtensionAmount currencyID=\"EUR\">285.00</cbc:LineExtensionAmount><cac:Item><cbc:Name>Consulting</cbc:Name><cac:ClassifiedTaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>8.5</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:ClassifiedTaxCategory></cac:Item><cac:Price><cbc:PriceAmount currencyID=\"EUR\">95</cbc:PriceAmount></cac:Price></cac:InvoiceLine><cac:InvoiceLine><cbc:ID>2</cbc:ID><cbc:InvoicedQuantity unitCode=\"C62\">2</cbc:InvoicedQuantity><cbc:LineExtensionAmount currencyID=\"EUR\">37.98</cbc:LineExtensionAmount><cac:Item><cbc:Name>Book</cbc:Name><cac:ClassifiedTaxCategory><cbc:ID>S</cbc:ID><cbc:Percent>2.1</cbc:Percent><cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme></cac:ClassifiedTaxCategory></cac:Item><cac:Price><cbc:PriceAmount currencyID=\"EUR\">18.99</cbc:PriceAmount></cac:Price></cac:InvoiceLine></Invoice>"
mentdb
{"syntax": "UBL", "profile": "urn:cen.eu:en16931:2017", "number": "F2026-0042", "type_code": "380", "issue_date": "2026-11-03", "due_date": "2026-12-03", "currency": "EUR", "seller": {"name": "Atelier Payet SARL", "siren": "732829320", "vat_id": "FR44732829320", "address": {"line1": "12 rue de Paris", "postcode": "97400", "city": "Saint-Denis", "country": "FR"}}, "buyer": {"name": "Client SAS", "siren": "552100554", "address": {"postcode": "75008", "city": "Paris", "country": "FR"}}, "lines": [{"id": "1", "name": "Consulting", "quantity": 3, "unit": "HUR", "unit_price": 95, "net_amount": 285, "vat_category": "S", "vat_rate": 8.5}, {"id": "2", "name": "Book", "quantity": 2, "unit": "C62", "unit_price": 18.99, "net_amount": 37.98, "vat_category": "S", "vat_rate": 2.1}], "vat_breakdown": [{"category": "S", "rate": 8.5, "basis": 285, "amount": 24.23}, {"category": "S", "rate": 2.1, "basis": 37.98, "amount": 0.8}], "totals": {"lines": 322.98, "tax_basis": 322.98, "vat": 25.03, "grand_total": 348.01, "due": 348.01}, "payment": {"means_code": "58", "iban": "FR7630006000011234567890189", "bic": "AGRIFRPP", "terms": "30 days"}}
Used in use cases (1 recipe)

    Accountant & manager › Electronic invoice: compute the totals, check the EN 16931 rules, export in CII and UBL
Often used with

    invoice check  ·  invoice complete  ·  invoice to_cii  ·  invoice to_ubl

invoice facturx_extract <pdf_path>


Description

    Extract the XML invoice of a Factur-X / ZUGFeRD / XRechnung PDF (embedded files and /AF of the document): found, attachments, filename, relationship, profile, xml and the parsed invoice

Parameters

    pdf_path:   The path of the PDF - String - required
admin
pdf create "tuto_fx"; pdf page add "tuto_fx" "A4" "portrait"; pdf text add "tuto_fx" 1 40 40 "Invoice F2026-0042" "font=HELVETICA_BOLD;size=18"; pdf save "tuto_fx" "tmp/tuto_etl/invoice.pdf"; pdf close "tuto_fx"; -> "[xml]" (invoice to_cii "{\"number\": \"F2026-0042\", \"type_code\": \"380\", \"issue_date\": \"2026-11-03\", \"due_date\": \"2026-12-03\", \"currency\": \"EUR\", \"seller\": {\"name\": \"Atelier Payet SARL\", \"siren\": \"732829320\", \"vat_id\": \"FR44732829320\", \"address\": {\"line1\": \"12 rue de Paris\", \"postcode\": \"97400\", \"city\": \"Saint-Denis\", \"country\": \"FR\"}}, \"buyer\": {\"name\": \"Client SAS\", \"siren\": \"552100554\", \"address\": {\"postcode\": \"75008\", \"city\": \"Paris\", \"country\": \"FR\"}}, \"lines\": [{\"name\": \"Consulting\", \"quantity\": 3, \"unit\": \"HUR\", \"unit_price\": 95, \"vat_category\": \"S\", \"vat_rate\": 8.5}, {\"name\": \"Book\", \"quantity\": 2, \"unit_price\": 18.99, \"vat_category\": \"S\", \"vat_rate\": 2.1}], \"payment\": {\"iban\": \"FR7630006000011234567890189\", \"bic\": \"AGRIFRPP\", \"terms\": \"30 days\"}}"); json load "tuto_c" (invoice facturx_create "tmp/tuto_etl/invoice.pdf" [xml] "tmp/tuto_etl/invoice_fx.pdf" "{\"date\": \"2026-11-03\"}"); json load "tuto_e" (invoice facturx_extract "tmp/tuto_etl/invoice_fx.pdf"); -> "[res]" (concat (json select "tuto_e" "/filename") " (" (json select "tuto_c" "/conformance_level") ", " (json select "tuto_e" "/relationship") "): invoice " (json select "tuto_e" "/invoice/number") ", due " (json select "tuto_e" "/invoice/totals/due") " " (json select "tuto_e" "/invoice/currency")); json unload "tuto_c"; json unload "tuto_e"; file delete "tmp/tuto_etl/invoice.pdf"; file delete "tmp/tuto_etl/invoice_fx.pdf"; [res]
mentdb
factur-x.xml (EN 16931, Alternative): invoice F2026-0042, due 348.01 EUR

invoice facturx_extract <pdf_path> <json_params>


Description

    Extraction with parameters: password (protected PDF)

Parameters

    pdf_path:   The path of the PDF - String - required
    json_params:   The parameters - String - required
admin
pdf create "tuto_fx"; pdf page add "tuto_fx" "A4" "portrait"; pdf save "tuto_fx" "tmp/tuto_etl/invoice.pdf"; pdf close "tuto_fx"; invoice facturx_create "tmp/tuto_etl/invoice.pdf" (invoice to_cii "{\"number\": \"F2026-0042\", \"type_code\": \"380\", \"issue_date\": \"2026-11-03\", \"due_date\": \"2026-12-03\", \"currency\": \"EUR\", \"seller\": {\"name\": \"Atelier Payet SARL\", \"siren\": \"732829320\", \"vat_id\": \"FR44732829320\", \"address\": {\"line1\": \"12 rue de Paris\", \"postcode\": \"97400\", \"city\": \"Saint-Denis\", \"country\": \"FR\"}}, \"buyer\": {\"name\": \"Client SAS\", \"siren\": \"552100554\", \"address\": {\"postcode\": \"75008\", \"city\": \"Paris\", \"country\": \"FR\"}}, \"lines\": [{\"name\": \"Consulting\", \"quantity\": 3, \"unit\": \"HUR\", \"unit_price\": 95, \"vat_category\": \"S\", \"vat_rate\": 8.5}, {\"name\": \"Book\", \"quantity\": 2, \"unit_price\": 18.99, \"vat_category\": \"S\", \"vat_rate\": 2.1}], \"payment\": {\"iban\": \"FR7630006000011234567890189\", \"bic\": \"AGRIFRPP\", \"terms\": \"30 days\"}}") "tmp/tuto_etl/invoice_fx.pdf"; json load "tuto_e" (invoice facturx_extract "tmp/tuto_etl/invoice_fx.pdf" "{\"password\": \"\"}"); -> "[res]" (concat "found " (json select "tuto_e" "/found") ", attachments " (json select "tuto_e" "/attachments") ", profile " (json select "tuto_e" "/profile")); json unload "tuto_e"; file delete "tmp/tuto_etl/invoice.pdf"; file delete "tmp/tuto_etl/invoice_fx.pdf"; [res]
mentdb
found true, attachments [ "factur-x.xml" ], profile urn:cen.eu:en16931:2017
Used in use cases (1 recipe)

    Accountant & manager › Issue a Factur-X invoice from the invoicing data: readable PDF and embedded XML in one call
Often used with

    equal  ·  file delete  ·  file exist  ·  file mkdir  ·  invoice to_pdf

invoice facturx_create <pdf_in> <xml> <pdf_out>


Description

    Make a Factur-X: embed the CII XML (content or file) in a PDF as factur-x.xml with its /AFRelationship (Data for MINIMUM and BASIC WL, Alternative otherwise), the /AF of the document, the XMP metadata PDF/A-3B with the Factur-X extension schema and an sRGB output intent. Returns the file, the conformance level and warnings (fonts not embedded...): the PDF must already respect PDF/A (embedded fonts), validate the result with a PDF/A-3 validator such as veraPDF

Parameters

    pdf_in:   The source PDF - String - required
    xml:   The CII XML or the path of the XML file - String - required
    pdf_out:   The Factur-X PDF to write - String - required
admin
pdf create "tuto_fx"; pdf page add "tuto_fx" "A4" "portrait"; pdf text add "tuto_fx" 1 40 40 "Invoice F2026-0042" "size=18"; pdf save "tuto_fx" "tmp/tuto_etl/invoice.pdf"; pdf close "tuto_fx"; -> "[res]" (invoice facturx_create "tmp/tuto_etl/invoice.pdf" (invoice to_cii "{\"number\": \"F2026-0042\", \"type_code\": \"380\", \"issue_date\": \"2026-11-03\", \"due_date\": \"2026-12-03\", \"currency\": \"EUR\", \"seller\": {\"name\": \"Atelier Payet SARL\", \"siren\": \"732829320\", \"vat_id\": \"FR44732829320\", \"address\": {\"line1\": \"12 rue de Paris\", \"postcode\": \"97400\", \"city\": \"Saint-Denis\", \"country\": \"FR\"}}, \"buyer\": {\"name\": \"Client SAS\", \"siren\": \"552100554\", \"address\": {\"postcode\": \"75008\", \"city\": \"Paris\", \"country\": \"FR\"}}, \"lines\": [{\"name\": \"Consulting\", \"quantity\": 3, \"unit\": \"HUR\", \"unit_price\": 95, \"vat_category\": \"S\", \"vat_rate\": 8.5}, {\"name\": \"Book\", \"quantity\": 2, \"unit_price\": 18.99, \"vat_category\": \"S\", \"vat_rate\": 2.1}], \"payment\": {\"iban\": \"FR7630006000011234567890189\", \"bic\": \"AGRIFRPP\", \"terms\": \"30 days\"}}") "tmp/tuto_etl/invoice_fx.pdf"); file delete "tmp/tuto_etl/invoice.pdf"; file delete "tmp/tuto_etl/invoice_fx.pdf"; [res]
mentdb
{"file": "tmp/tuto_etl/invoice_fx.pdf", "filename": "factur-x.xml", "profile": "urn:cen.eu:en16931:2017", "conformance_level": "EN 16931", "relationship": "Alternative", "warnings": ["fonts not embedded (PDF/A requires embedded fonts, regenerate the PDF with embedded fonts): Helvetica", "the content of the pages (transparency, colors, annotations) is not checked: validate the result with a PDF/A-3 validator (for example veraPDF) before sending"]}

invoice facturx_create <pdf_in> <xml> <pdf_out> <json_params>


Description

    Factur-X with parameters: relationship (Data, Alternative, Source, Supplement, Unspecified), conformance_level, filename, title, author, date (of the modification, yyyy-MM-dd), password (of the source PDF)

Parameters

    pdf_in:   The source PDF - String - required
    xml:   The XML - String - required
    pdf_out:   The PDF to write - String - required
    json_params:   The parameters - String - required
admin
pdf create "tuto_fx"; pdf page add "tuto_fx" "A4" "portrait"; pdf save "tuto_fx" "tmp/tuto_etl/invoice.pdf"; pdf close "tuto_fx"; -> "[res]" (invoice facturx_create "tmp/tuto_etl/invoice.pdf" "<?xml version=\"1.0\" encoding=\"UTF-8\"?><rsm:CrossIndustryInvoice xmlns:rsm=\"urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100\" xmlns:qdt=\"urn:un:unece:uncefact:data:standard:QualifiedDataType: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>F2026-0042</ram:ID><ram:TypeCode>380</ram:TypeCode><ram:IssueDateTime><udt:DateTimeString format=\"102\">20261103</udt:DateTimeString></ram:IssueDateTime></rsm:ExchangedDocument><rsm:SupplyChainTradeTransaction><ram:IncludedSupplyChainTradeLineItem><ram:AssociatedDocumentLineDocument><ram:LineID>1</ram:LineID></ram:AssociatedDocumentLineDocument><ram:SpecifiedTradeProduct><ram:Name>Consulting</ram:Name></ram:SpecifiedTradeProduct><ram:SpecifiedLineTradeAgreement><ram:NetPriceProductTradePrice><ram:ChargeAmount>95</ram:ChargeAmount></ram:NetPriceProductTradePrice></ram:SpecifiedLineTradeAgreement><ram:SpecifiedLineTradeDelivery><ram:BilledQuantity unitCode=\"HUR\">3</ram:BilledQuantity></ram:SpecifiedLineTradeDelivery><ram:SpecifiedLineTradeSettlement><ram:ApplicableTradeTax><ram:TypeCode>VAT</ram:TypeCode><ram:CategoryCode>S</ram:CategoryCode><ram:RateApplicablePercent>8.5</ram:RateApplicablePercent></ram:ApplicableTradeTax><ram:SpecifiedTradeSettlementLineMonetarySummation><ram:LineTotalAmount>285.00</ram:LineTotalAmount></ram:SpecifiedTradeSettlementLineMonetarySummation></ram:SpecifiedLineTradeSettlement></ram:IncludedSupplyChainTradeLineItem><ram:IncludedSupplyChainTradeLineItem><ram:AssociatedDocumentLineDocument><ram:LineID>2</ram:LineID></ram:AssociatedDocumentLineDocument><ram:SpecifiedTradeProduct><ram:Name>Book</ram:Name></ram:SpecifiedTradeProduct><ram:SpecifiedLineTradeAgreement><ram:NetPriceProductTradePrice><ram:ChargeAmount>18.99</ram:ChargeAmount></ram:NetPriceProductTradePrice></ram:SpecifiedLineTradeAgreement><ram:SpecifiedLineTradeDelivery><ram:BilledQuantity unitCode=\"C62\">2</ram:BilledQuantity></ram:SpecifiedLineTradeDelivery><ram:SpecifiedLineTradeSettlement><ram:ApplicableTradeTax><ram:TypeCode>VAT</ram:TypeCode><ram:CategoryCode>S</ram:CategoryCode><ram:RateApplicablePercent>2.1</ram:RateApplicablePercent></ram:ApplicableTradeTax><ram:SpecifiedTradeSettlementLineMonetarySummation><ram:LineTotalAmount>37.98</ram:LineTotalAmount></ram:SpecifiedTradeSettlementLineMonetarySummation></ram:SpecifiedLineTradeSettlement></ram:IncludedSupplyChainTradeLineItem><ram:ApplicableHeaderTradeAgreement><ram:SellerTradeParty><ram:Name>Atelier Payet SARL</ram:Name><ram:SpecifiedLegalOrganization><ram:ID schemeID=\"0002\">732829320</ram:ID></ram:SpecifiedLegalOrganization><ram:PostalTradeAddress><ram:PostcodeCode>97400</ram:PostcodeCode><ram:LineOne>12 rue de Paris</ram:LineOne><ram:CityName>Saint-Denis</ram:CityName><ram:CountryID>FR</ram:CountryID></ram:PostalTradeAddress><ram:SpecifiedTaxRegistration><ram:ID schemeID=\"VA\">FR44732829320</ram:ID></ram:SpecifiedTaxRegistration></ram:SellerTradeParty><ram:BuyerTradeParty><ram:Name>Client SAS</ram:Name><ram:SpecifiedLegalOrganization><ram:ID schemeID=\"0002\">552100554</ram:ID></ram:SpecifiedLegalOrganization><ram:PostalTradeAddress><ram:PostcodeCode>75008</ram:PostcodeCode><ram:CityName>Paris</ram:CityName><ram:CountryID>FR</ram:CountryID></ram:PostalTradeAddress></ram:BuyerTradeParty></ram:ApplicableHeaderTradeAgreement><ram:ApplicableHeaderTradeDelivery/><ram:ApplicableHeaderTradeSettlement><ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode><ram:SpecifiedTradeSettlementPaymentMeans><ram:TypeCode>58</ram:TypeCode><ram:PayeePartyCreditorFinancialAccount><ram:IBANID>FR7630006000011234567890189</ram:IBANID></ram:PayeePartyCreditorFinancialAccount><ram:PayeeSpecifiedCreditorFinancialInstitution><ram:BICID>AGRIFRPP</ram:BICID></ram:PayeeSpecifiedCreditorFinancialInstitution></ram:SpecifiedTradeSettlementPaymentMeans><ram:ApplicableTradeTax><ram:CalculatedAmount>24.23</ram:CalculatedAmount><ram:TypeCode>VAT</ram:TypeCode><ram:BasisAmount>285.00</ram:BasisAmount><ram:CategoryCode>S</ram:CategoryCode><ram:RateApplicablePercent>8.5</ram:RateApplicablePercent></ram:ApplicableTradeTax><ram:ApplicableTradeTax><ram:CalculatedAmount>0.80</ram:CalculatedAmount><ram:TypeCode>VAT</ram:TypeCode><ram:BasisAmount>37.98</ram:BasisAmount><ram:CategoryCode>S</ram:CategoryCode><ram:RateApplicablePercent>2.1</ram:RateApplicablePercent></ram:ApplicableTradeTax><ram:SpecifiedTradePaymentTerms><ram:Description>30 days</ram:Description><ram:DueDateDateTime><udt:DateTimeString format=\"102\">20261203</udt:DateTimeString></ram:DueDateDateTime></ram:SpecifiedTradePaymentTerms><ram:SpecifiedTradeSettlementHeaderMonetarySummation><ram:LineTotalAmount>322.98</ram:LineTotalAmount><ram:TaxBasisTotalAmount>322.98</ram:TaxBasisTotalAmount><ram:TaxTotalAmount currencyID=\"EUR\">25.03</ram:TaxTotalAmount><ram:GrandTotalAmount>348.01</ram:GrandTotalAmount><ram:DuePayableAmount>348.01</ram:DuePayableAmount></ram:SpecifiedTradeSettlementHeaderMonetarySummation></ram:ApplicableHeaderTradeSettlement></rsm:SupplyChainTradeTransaction></rsm:CrossIndustryInvoice>" "tmp/tuto_etl/invoice_fx.pdf" "{\"relationship\": \"Data\", \"title\": \"Invoice F2026-0042\", \"date\": \"2026-11-03\"}"); file delete "tmp/tuto_etl/invoice.pdf"; file delete "tmp/tuto_etl/invoice_fx.pdf"; [res]
mentdb
{"file": "tmp/tuto_etl/invoice_fx.pdf", "filename": "factur-x.xml", "profile": "urn:cen.eu:en16931:2017", "conformance_level": "EN 16931", "relationship": "Data", "warnings": ["the content of the pages (transparency, colors, annotations) is not checked: validate the result with a PDF/A-3 validator (for example veraPDF) before sending"]}

invoice to_pdf <json_invoice> <pdf_path>


Description

    Write the readable PDF of an invoice (A4): seller and buyer, number and dates, lines with word wrap and page breaks (header repeated), VAT breakdown, totals, payment (IBAN, BIC, terms), notes, legal mentions and page numbers. The invoice is completed (invoice complete) and checked first (errors stop it, unless {"force": true}). The font is a TrueType font embedded in the PDF (Arial, DejaVu Sans or Liberation Sans found on the server, or the font parameter), so that the PDF can become a Factur-X. Returns {file, pages, font, embedded, facturx, warnings} Every free text (addresses, references, title, payment, exemption reasons, notes) is wrapped or cut with … in its column; a line description longer than a page continues on the next pages. With facturx true and no TrueType font, the error is given before any file is written.

Parameters

    json_invoice:   The invoice (JSON) - String - required
    pdf_path:   The PDF to write - String - required
admin
json load "tuto_p" (invoice to_pdf "{\"number\": \"F2026-0042\", \"type_code\": \"380\", \"issue_date\": \"2026-11-03\", \"due_date\": \"2026-12-03\", \"currency\": \"EUR\", \"seller\": {\"name\": \"Atelier Payet SARL\", \"siren\": \"732829320\", \"vat_id\": \"FR44732829320\", \"address\": {\"line1\": \"12 rue de Paris\", \"postcode\": \"97400\", \"city\": \"Saint-Denis\", \"country\": \"FR\"}}, \"buyer\": {\"name\": \"Client SAS\", \"siren\": \"552100554\", \"address\": {\"postcode\": \"75008\", \"city\": \"Paris\", \"country\": \"FR\"}}, \"lines\": [{\"name\": \"Consulting\", \"quantity\": 3, \"unit\": \"HUR\", \"unit_price\": 95, \"vat_category\": \"S\", \"vat_rate\": 8.5, \"description\": \"Audit of the data flows and of the ETL chain, with a written report\"}, {\"name\": \"Book\", \"quantity\": 2, \"unit_price\": 18.99, \"vat_category\": \"S\", \"vat_rate\": 2.1}], \"payment\": {\"iban\": \"FR7630006000011234567890189\", \"bic\": \"AGRIFRPP\", \"terms\": \"30 days\"}, \"notes\": [\"Thank you for your trust.\"]}" "tmp/tuto_etl/F2026-0042.pdf"); -> "[res]" (concat "pages " (json select "tuto_p" "/pages") ", font embedded " (json select "tuto_p" "/embedded") ", Factur-X " (json select "tuto_p" "/facturx") ", text of the PDF: " (pdf page_count_file "tmp/tuto_etl/F2026-0042.pdf") " page, " (string length (pdf extract_text "tmp/tuto_etl/F2026-0042.pdf")) " characters"); json unload "tuto_p"; file delete "tmp/tuto_etl/F2026-0042.pdf"; [res]
mentdb
pages 1, font embedded true, Factur-X false, text of the PDF: 1 page, 938 characters

invoice to_pdf <json_invoice> <pdf_path> <json_params>


Description

    PDF with parameters: lang (en or fr: labels, dates dd/MM/yyyy and numbers 1 234,56), facturx (true: the CII XML of the invoice is embedded at once, the PDF becomes a Factur-X; profile, date and the parameters of invoice facturx_create), title, logo (png or jpg file, top left), font and font_bold (TrueType .ttf files), legal_mentions (text or list of texts at the bottom; "" for none; default: the late payment penalties and the 40 EUR recovery compensation), force, french_rules (as invoice check). Without a TrueType font, Helvetica is used and the PDF cannot be a Factur-X (warning)

Parameters

    json_invoice:   The invoice (JSON) - String - required
    pdf_path:   The PDF to write - String - required
    json_params:   The parameters - String - required
admin
json load "tuto_p" (invoice to_pdf "{\"number\": \"F2026-0042\", \"type_code\": \"380\", \"issue_date\": \"2026-11-03\", \"due_date\": \"2026-12-03\", \"currency\": \"EUR\", \"seller\": {\"name\": \"Atelier Payet SARL\", \"siren\": \"732829320\", \"vat_id\": \"FR44732829320\", \"address\": {\"line1\": \"12 rue de Paris\", \"postcode\": \"97400\", \"city\": \"Saint-Denis\", \"country\": \"FR\"}}, \"buyer\": {\"name\": \"Client SAS\", \"siren\": \"552100554\", \"address\": {\"postcode\": \"75008\", \"city\": \"Paris\", \"country\": \"FR\"}}, \"lines\": [{\"name\": \"Consulting\", \"quantity\": 3, \"unit\": \"HUR\", \"unit_price\": 95, \"vat_category\": \"S\", \"vat_rate\": 8.5, \"description\": \"Audit of the data flows and of the ETL chain, with a written report\"}, {\"name\": \"Book\", \"quantity\": 2, \"unit_price\": 18.99, \"vat_category\": \"S\", \"vat_rate\": 2.1}], \"payment\": {\"iban\": \"FR7630006000011234567890189\", \"bic\": \"AGRIFRPP\", \"terms\": \"30 days\"}, \"notes\": [\"Thank you for your trust.\"]}" "tmp/tuto_etl/F2026-0042.pdf" "{\"lang\": \"fr\", \"facturx\": true, \"date\": \"2026-11-03\"}"); json load "tuto_e" (invoice facturx_extract "tmp/tuto_etl/F2026-0042.pdf"); -> "[res]" (concat "pages " (json select "tuto_p" "/pages") ", Factur-X " (json select "tuto_p" "/facturx") " (" (json select "tuto_p" "/conformance_level") ") | read back: " (json select "tuto_e" "/filename") ", invoice " (json select "tuto_e" "/invoice/number") ", due " (json select "tuto_e" "/invoice/totals/due") " " (json select "tuto_e" "/invoice/currency")); json unload "tuto_p"; json unload "tuto_e"; file delete "tmp/tuto_etl/F2026-0042.pdf"; [res]
mentdb
pages 1, Factur-X true (EN 16931) | read back: factur-x.xml, invoice F2026-0042, due 348.01 EUR
Used in use cases (1 recipe)

    Accountant & manager › Issue a Factur-X invoice from the invoicing data: readable PDF and embedded XML in one call
Often used with

    equal  ·  file delete  ·  file exist  ·  file mkdir  ·  invoice facturx_extract