@factpulse/sdk 3.0.5 → 3.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +66 -4
- package/.openapi-generator/VERSION +1 -1
- package/CHANGELOG.md +3 -3
- package/api/document-conversion-api.ts +485 -0
- package/api/invoice-processing-api.ts +34 -34
- package/api.ts +1 -0
- package/dist/api/document-conversion-api.d.ts +226 -0
- package/dist/api/document-conversion-api.js +464 -0
- package/dist/api/invoice-processing-api.d.ts +33 -33
- package/dist/api/invoice-processing-api.js +16 -16
- package/dist/api.d.ts +1 -0
- package/dist/api.js +1 -0
- package/dist/esm/api/document-conversion-api.d.ts +226 -0
- package/dist/esm/api/document-conversion-api.js +454 -0
- package/dist/esm/api/invoice-processing-api.d.ts +33 -33
- package/dist/esm/api/invoice-processing-api.js +16 -16
- package/dist/esm/api.d.ts +1 -0
- package/dist/esm/api.js +1 -0
- package/dist/esm/models/additional-document.d.ts +24 -0
- package/dist/esm/models/additional-document.js +14 -0
- package/dist/esm/models/allowance-charge.d.ts +31 -0
- package/dist/esm/models/allowance-charge.js +14 -0
- package/dist/esm/models/{apiprofile.d.ts → allowance-total-amount.d.ts} +3 -8
- package/dist/esm/models/allowance-total-amount.js +14 -0
- package/dist/esm/models/amount-due.d.ts +1 -1
- package/dist/{models/apiprofile.d.ts → esm/models/amount.d.ts} +3 -8
- package/dist/esm/models/amount.js +14 -0
- package/dist/esm/models/base-amount.d.ts +16 -0
- package/dist/esm/models/base-amount.js +14 -0
- package/dist/esm/models/charge-total-amount.d.ts +16 -0
- package/dist/esm/models/charge-total-amount.js +14 -0
- package/dist/esm/models/contact.d.ts +20 -0
- package/dist/esm/models/contact.js +14 -0
- package/dist/esm/models/convert-error-response.d.ts +27 -0
- package/dist/esm/models/convert-error-response.js +14 -0
- package/dist/esm/models/convert-pending-input-response.d.ts +31 -0
- package/dist/esm/models/convert-pending-input-response.js +14 -0
- package/dist/esm/models/convert-resume-request.d.ts +22 -0
- package/dist/esm/models/convert-resume-request.js +14 -0
- package/dist/esm/models/{document-type.d.ts → convert-success-response.d.ts} +29 -19
- package/dist/esm/models/convert-success-response.js +14 -0
- package/dist/{models/document-type.d.ts → esm/models/convert-validation-failed-response.d.ts} +25 -20
- package/dist/esm/models/convert-validation-failed-response.js +14 -0
- package/dist/esm/models/delivery-party.d.ts +22 -0
- package/dist/esm/models/delivery-party.js +14 -0
- package/dist/esm/models/document-type-info.d.ts +28 -0
- package/dist/esm/models/document-type-info.js +14 -0
- package/dist/esm/models/extraction-info.d.ts +32 -0
- package/dist/esm/models/extraction-info.js +14 -0
- package/dist/esm/models/factur-xinvoice.d.ts +19 -0
- package/dist/esm/models/factur-xprofile.d.ts +21 -0
- package/{models/apiprofile.ts → dist/esm/models/factur-xprofile.js} +5 -14
- package/dist/esm/models/facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials.d.ts +4 -4
- package/dist/esm/models/file-info.d.ts +21 -0
- package/dist/esm/models/file-info.js +14 -0
- package/dist/esm/models/files-info.d.ts +19 -0
- package/dist/esm/models/files-info.js +14 -0
- package/dist/esm/models/generate-certificate-request.d.ts +5 -5
- package/dist/esm/models/get-chorus-pro-id-request.d.ts +1 -1
- package/dist/esm/models/get-invoice-request.d.ts +1 -1
- package/dist/esm/models/get-structure-request.d.ts +2 -2
- package/dist/esm/models/global-allowance-amount.d.ts +1 -1
- package/dist/esm/models/gross-unit-price.d.ts +16 -0
- package/dist/esm/models/gross-unit-price.js +14 -0
- package/dist/esm/models/incoming-invoice.d.ts +2 -2
- package/dist/esm/models/index.d.ts +32 -2
- package/dist/esm/models/index.js +32 -2
- package/dist/esm/models/invoice-line-allowance-amount.d.ts +1 -1
- package/dist/esm/models/invoice-line.d.ts +40 -6
- package/dist/esm/models/invoice-references.d.ts +20 -1
- package/dist/esm/models/invoice-totals-prepayment.d.ts +1 -1
- package/dist/esm/models/invoice-totals.d.ts +10 -2
- package/dist/esm/models/line-net-amount.d.ts +1 -1
- package/dist/esm/models/line-total-amount.d.ts +16 -0
- package/dist/esm/models/line-total-amount.js +14 -0
- package/dist/esm/models/manual-rate.d.ts +1 -1
- package/dist/esm/models/manual-vat-rate.d.ts +1 -1
- package/dist/esm/models/missing-field.d.ts +34 -0
- package/dist/esm/models/missing-field.js +14 -0
- package/dist/esm/models/payee.d.ts +2 -0
- package/dist/esm/models/payment-card.d.ts +18 -0
- package/dist/esm/models/payment-card.js +14 -0
- package/dist/esm/models/pdpcredentials.d.ts +5 -5
- package/dist/esm/models/percentage.d.ts +16 -0
- package/dist/esm/models/percentage.js +14 -0
- package/dist/esm/models/postal-address.d.ts +3 -1
- package/dist/esm/models/price-allowance-amount.d.ts +16 -0
- package/dist/esm/models/price-allowance-amount.js +14 -0
- package/dist/esm/models/price-basis-quantity.d.ts +16 -0
- package/dist/esm/models/price-basis-quantity.js +14 -0
- package/dist/esm/models/processing-options.d.ts +3 -3
- package/dist/esm/models/product-characteristic.d.ts +24 -0
- package/dist/esm/models/product-characteristic.js +14 -0
- package/dist/esm/models/product-classification.d.ts +22 -0
- package/dist/esm/models/product-classification.js +14 -0
- package/dist/esm/models/quantity.d.ts +1 -1
- package/dist/esm/models/recipient.d.ts +5 -1
- package/dist/esm/models/rounding-amount.d.ts +16 -0
- package/dist/esm/models/rounding-amount.js +14 -0
- package/dist/esm/models/scheme-id.d.ts +11 -5
- package/dist/esm/models/scheme-id.js +11 -5
- package/dist/esm/models/search-flow-request.d.ts +7 -7
- package/dist/esm/models/search-structure-request.d.ts +4 -4
- package/dist/esm/models/submit-flow-request.d.ts +6 -6
- package/dist/esm/models/submit-invoice-request.d.ts +13 -13
- package/dist/esm/models/supplier.d.ts +10 -1
- package/dist/esm/models/tax-representative.d.ts +29 -0
- package/dist/esm/models/tax-representative.js +14 -0
- package/dist/esm/models/taxable-amount.d.ts +1 -1
- package/dist/esm/models/total-gross-amount.d.ts +1 -1
- package/dist/esm/models/total-net-amount.d.ts +1 -1
- package/dist/esm/models/total-vatamount.d.ts +1 -1
- package/dist/esm/models/unit-net-price.d.ts +1 -1
- package/dist/esm/models/validation-info.d.ts +38 -0
- package/dist/esm/models/validation-info.js +14 -0
- package/dist/esm/models/vat-rate.d.ts +16 -0
- package/dist/esm/models/vat-rate.js +14 -0
- package/dist/esm/models/vatamount.d.ts +1 -1
- package/dist/esm/models/vatline.d.ts +3 -1
- package/dist/esm/models/vatpoint-date-code.d.ts +20 -0
- package/dist/esm/models/{apiprofile.js → vatpoint-date-code.js} +5 -6
- package/dist/models/additional-document.d.ts +24 -0
- package/dist/models/{apiprofile.js → additional-document.js} +0 -10
- package/dist/models/allowance-charge.d.ts +31 -0
- package/dist/models/allowance-charge.js +15 -0
- package/dist/models/allowance-total-amount.d.ts +16 -0
- package/dist/models/allowance-total-amount.js +15 -0
- package/dist/models/amount-due.d.ts +1 -1
- package/dist/models/amount.d.ts +16 -0
- package/dist/models/amount.js +15 -0
- package/dist/models/base-amount.d.ts +16 -0
- package/dist/models/base-amount.js +15 -0
- package/dist/models/charge-total-amount.d.ts +16 -0
- package/dist/models/charge-total-amount.js +15 -0
- package/dist/models/contact.d.ts +20 -0
- package/dist/models/contact.js +15 -0
- package/dist/models/convert-error-response.d.ts +27 -0
- package/dist/models/convert-error-response.js +15 -0
- package/dist/models/convert-pending-input-response.d.ts +31 -0
- package/dist/models/convert-pending-input-response.js +15 -0
- package/dist/models/convert-resume-request.d.ts +22 -0
- package/dist/models/convert-resume-request.js +15 -0
- package/dist/models/convert-success-response.d.ts +47 -0
- package/dist/models/convert-success-response.js +15 -0
- package/dist/models/{document-type.js → convert-validation-failed-response.d.ts} +25 -24
- package/dist/models/convert-validation-failed-response.js +15 -0
- package/dist/models/delivery-party.d.ts +22 -0
- package/dist/models/delivery-party.js +15 -0
- package/dist/models/document-type-info.d.ts +28 -0
- package/dist/models/document-type-info.js +15 -0
- package/dist/models/extraction-info.d.ts +32 -0
- package/dist/models/extraction-info.js +15 -0
- package/dist/models/factur-xinvoice.d.ts +19 -0
- package/dist/models/factur-xprofile.d.ts +21 -0
- package/dist/models/factur-xprofile.js +25 -0
- package/dist/models/facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials.d.ts +4 -4
- package/dist/models/file-info.d.ts +21 -0
- package/dist/models/file-info.js +15 -0
- package/dist/models/files-info.d.ts +19 -0
- package/dist/models/files-info.js +15 -0
- package/dist/models/generate-certificate-request.d.ts +5 -5
- package/dist/models/get-chorus-pro-id-request.d.ts +1 -1
- package/dist/models/get-invoice-request.d.ts +1 -1
- package/dist/models/get-structure-request.d.ts +2 -2
- package/dist/models/global-allowance-amount.d.ts +1 -1
- package/dist/models/gross-unit-price.d.ts +16 -0
- package/dist/models/gross-unit-price.js +15 -0
- package/dist/models/incoming-invoice.d.ts +2 -2
- package/dist/models/index.d.ts +32 -2
- package/dist/models/index.js +32 -2
- package/dist/models/invoice-line-allowance-amount.d.ts +1 -1
- package/dist/models/invoice-line.d.ts +40 -6
- package/dist/models/invoice-references.d.ts +20 -1
- package/dist/models/invoice-totals-prepayment.d.ts +1 -1
- package/dist/models/invoice-totals.d.ts +10 -2
- package/dist/models/line-net-amount.d.ts +1 -1
- package/dist/models/line-total-amount.d.ts +16 -0
- package/dist/models/line-total-amount.js +15 -0
- package/dist/models/manual-rate.d.ts +1 -1
- package/dist/models/manual-vat-rate.d.ts +1 -1
- package/dist/models/missing-field.d.ts +34 -0
- package/dist/models/missing-field.js +15 -0
- package/dist/models/payee.d.ts +2 -0
- package/dist/models/payment-card.d.ts +18 -0
- package/dist/models/payment-card.js +15 -0
- package/dist/models/pdpcredentials.d.ts +5 -5
- package/dist/models/percentage.d.ts +16 -0
- package/dist/models/percentage.js +15 -0
- package/dist/models/postal-address.d.ts +3 -1
- package/dist/models/price-allowance-amount.d.ts +16 -0
- package/dist/models/price-allowance-amount.js +15 -0
- package/dist/models/price-basis-quantity.d.ts +16 -0
- package/dist/models/price-basis-quantity.js +15 -0
- package/dist/models/processing-options.d.ts +3 -3
- package/dist/models/product-characteristic.d.ts +24 -0
- package/dist/models/product-characteristic.js +15 -0
- package/dist/models/product-classification.d.ts +22 -0
- package/dist/models/product-classification.js +15 -0
- package/dist/models/quantity.d.ts +1 -1
- package/dist/models/recipient.d.ts +5 -1
- package/dist/models/rounding-amount.d.ts +16 -0
- package/dist/models/rounding-amount.js +15 -0
- package/dist/models/scheme-id.d.ts +11 -5
- package/dist/models/scheme-id.js +11 -5
- package/dist/models/search-flow-request.d.ts +7 -7
- package/dist/models/search-structure-request.d.ts +4 -4
- package/dist/models/submit-flow-request.d.ts +6 -6
- package/dist/models/submit-invoice-request.d.ts +13 -13
- package/dist/models/supplier.d.ts +10 -1
- package/dist/models/tax-representative.d.ts +29 -0
- package/dist/models/tax-representative.js +15 -0
- package/dist/models/taxable-amount.d.ts +1 -1
- package/dist/models/total-gross-amount.d.ts +1 -1
- package/dist/models/total-net-amount.d.ts +1 -1
- package/dist/models/total-vatamount.d.ts +1 -1
- package/dist/models/unit-net-price.d.ts +1 -1
- package/dist/models/validation-info.d.ts +38 -0
- package/dist/models/validation-info.js +15 -0
- package/dist/models/vat-rate.d.ts +16 -0
- package/dist/models/vat-rate.js +15 -0
- package/dist/models/vatamount.d.ts +1 -1
- package/dist/models/vatline.d.ts +3 -1
- package/dist/models/vatpoint-date-code.d.ts +20 -0
- package/dist/models/vatpoint-date-code.js +24 -0
- package/docs/AdditionalDocument.md +29 -0
- package/docs/AllowanceCharge.md +35 -0
- package/docs/AllowanceTotalAmount.md +19 -0
- package/docs/Amount.md +19 -0
- package/docs/AmountDue.md +1 -1
- package/docs/BaseAmount.md +19 -0
- package/docs/ChargeTotalAmount.md +19 -0
- package/docs/Contact.md +27 -0
- package/docs/ConvertErrorResponse.md +29 -0
- package/docs/ConvertPendingInputResponse.md +35 -0
- package/docs/ConvertResumeRequest.md +21 -0
- package/docs/ConvertSuccessResponse.md +39 -0
- package/docs/ConvertValidationFailedResponse.md +37 -0
- package/docs/DeliveryParty.md +27 -0
- package/docs/DocumentConversionApi.md +297 -0
- package/docs/DocumentTypeInfo.md +25 -0
- package/docs/ExtractionInfo.md +27 -0
- package/docs/FacturXInvoice.md +28 -0
- package/docs/{APIProfile.md → FacturXProfile.md} +2 -2
- package/docs/FactureElectroniqueRestApiSchemasChorusProChorusProCredentials.md +8 -8
- package/docs/FileInfo.md +23 -0
- package/docs/FilesInfo.md +23 -0
- package/docs/GenerateCertificateRequest.md +10 -10
- package/docs/GetChorusProIdRequest.md +2 -2
- package/docs/GetInvoiceRequest.md +2 -2
- package/docs/GetStructureRequest.md +4 -4
- package/docs/GlobalAllowanceAmount.md +1 -1
- package/docs/GrossUnitPrice.md +19 -0
- package/docs/IncomingInvoice.md +1 -1
- package/docs/InvoiceLine.md +48 -14
- package/docs/InvoiceLineAllowanceAmount.md +1 -1
- package/docs/InvoiceProcessingApi.md +8 -8
- package/docs/InvoiceReferences.md +25 -5
- package/docs/InvoiceTotals.md +11 -3
- package/docs/InvoiceTotalsPrepayment.md +1 -1
- package/docs/LineNetAmount.md +1 -1
- package/docs/LineTotalAmount.md +19 -0
- package/docs/ManualRate.md +1 -1
- package/docs/ManualVatRate.md +1 -1
- package/docs/MissingField.md +31 -0
- package/docs/PDPCredentials.md +10 -10
- package/docs/Payee.md +4 -0
- package/docs/PaymentCard.md +23 -0
- package/docs/Percentage.md +19 -0
- package/docs/PostalAddress.md +5 -1
- package/docs/PriceAllowanceAmount.md +19 -0
- package/docs/PriceBasisQuantity.md +19 -0
- package/docs/ProcessingOptions.md +3 -3
- package/docs/ProductCharacteristic.md +23 -0
- package/docs/ProductClassification.md +25 -0
- package/docs/Quantity.md +1 -1
- package/docs/Recipient.md +7 -1
- package/docs/RoundingAmount.md +19 -0
- package/docs/SchemeID.md +17 -5
- package/docs/SearchFlowRequest.md +14 -14
- package/docs/SearchStructureRequest.md +8 -8
- package/docs/SubmitFlowRequest.md +12 -12
- package/docs/SubmitInvoiceRequest.md +26 -26
- package/docs/Supplier.md +17 -1
- package/docs/TaxRepresentative.md +25 -0
- package/docs/TaxableAmount.md +1 -1
- package/docs/TotalGrossAmount.md +1 -1
- package/docs/TotalNetAmount.md +1 -1
- package/docs/TotalVATAmount.md +1 -1
- package/docs/UnitNetPrice.md +1 -1
- package/docs/VATAmount.md +1 -1
- package/docs/VATLine.md +3 -1
- package/docs/VATPointDateCode.md +13 -0
- package/docs/ValidationInfo.md +31 -0
- package/docs/VatRate.md +19 -0
- package/models/additional-document.ts +30 -0
- package/models/{document-type.ts → allowance-charge.ts} +25 -27
- package/models/allowance-total-amount.ts +22 -0
- package/models/amount-due.ts +1 -1
- package/models/amount.ts +22 -0
- package/models/base-amount.ts +22 -0
- package/models/charge-total-amount.ts +22 -0
- package/models/contact.ts +26 -0
- package/models/convert-error-response.ts +33 -0
- package/models/convert-pending-input-response.ts +39 -0
- package/models/convert-resume-request.ts +26 -0
- package/models/convert-success-response.ts +59 -0
- package/models/convert-validation-failed-response.ts +52 -0
- package/models/delivery-party.ts +32 -0
- package/models/document-type-info.ts +34 -0
- package/models/extraction-info.ts +38 -0
- package/models/factur-xinvoice.ts +29 -0
- package/models/factur-xprofile.ts +31 -0
- package/models/facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials.ts +4 -4
- package/models/file-info.ts +27 -0
- package/models/files-info.ts +27 -0
- package/models/generate-certificate-request.ts +5 -5
- package/models/get-chorus-pro-id-request.ts +1 -1
- package/models/get-invoice-request.ts +1 -1
- package/models/get-structure-request.ts +2 -2
- package/models/global-allowance-amount.ts +1 -1
- package/models/gross-unit-price.ts +22 -0
- package/models/incoming-invoice.ts +4 -4
- package/models/index.ts +32 -2
- package/models/invoice-line-allowance-amount.ts +1 -1
- package/models/invoice-line.ts +56 -6
- package/models/invoice-references.ts +20 -1
- package/models/invoice-totals-prepayment.ts +1 -1
- package/models/invoice-totals.ts +18 -2
- package/models/line-net-amount.ts +1 -1
- package/models/line-total-amount.ts +22 -0
- package/models/manual-rate.ts +1 -1
- package/models/manual-vat-rate.ts +1 -1
- package/models/missing-field.ts +40 -0
- package/models/payee.ts +2 -0
- package/models/payment-card.ts +24 -0
- package/models/pdpcredentials.ts +5 -5
- package/models/percentage.ts +22 -0
- package/models/postal-address.ts +3 -1
- package/models/price-allowance-amount.ts +22 -0
- package/models/price-basis-quantity.ts +22 -0
- package/models/processing-options.ts +3 -3
- package/models/product-characteristic.ts +30 -0
- package/models/product-classification.ts +28 -0
- package/models/quantity.ts +1 -1
- package/models/recipient.ts +7 -1
- package/models/rounding-amount.ts +22 -0
- package/models/scheme-id.ts +11 -5
- package/models/search-flow-request.ts +7 -7
- package/models/search-structure-request.ts +4 -4
- package/models/submit-flow-request.ts +6 -6
- package/models/submit-invoice-request.ts +13 -13
- package/models/supplier.ts +12 -1
- package/models/tax-representative.ts +37 -0
- package/models/taxable-amount.ts +1 -1
- package/models/total-gross-amount.ts +1 -1
- package/models/total-net-amount.ts +1 -1
- package/models/total-vatamount.ts +1 -1
- package/models/unit-net-price.ts +1 -1
- package/{dist/esm/models/document-type.js → models/validation-info.ts} +28 -20
- package/models/vat-rate.ts +22 -0
- package/models/vatamount.ts +1 -1
- package/models/vatline.ts +5 -1
- package/models/vatpoint-date-code.ts +30 -0
- package/package.json +1 -1
- package/docs/DocumentType.md +0 -17
|
@@ -35,7 +35,7 @@ export const InvoiceProcessingApiAxiosParamCreator = function (configuration) {
|
|
|
35
35
|
* Generates an electronic invoice in Factur-X format compliant with European standards. ## Applied Standards - **Factur-X** (France): FNFE-MPE standard (Forum National de la Facture Électronique) - **ZUGFeRD** (Germany): German format compatible with Factur-X - **EN 16931**: European semantic standard for electronic invoicing - **ISO 19005-3** (PDF/A-3): Long-term electronic archiving - **Cross Industry Invoice (CII)**: UN/CEFACT XML syntax ## 🆕 New: Simplified format with auto-enrichment (P0.1) You can now create an invoice by providing only: - An invoice number - A sender SIRET + **IBAN** (required) - A recipient SIRET - Invoice lines (description, quantity, net price) **Simplified format example**: ```json { \"number\": \"FACT-2025-001\", \"sender\": { \"siret\": \"92019522900017\", \"iban\": \"FR7630001007941234567890185\" }, \"recipient\": {\"siret\": \"35600000000048\"}, \"lines\": [ {\"description\": \"Service\", \"quantity\": 10, \"unitPrice\": 100.00, \"vatRate\": 20.0} ] } ``` **⚠️ Required fields (simplified format)**: - `number`: Unique invoice number - `sender.siret`: Sender\'s SIRET (14 digits) - `sender.iban`: Bank account IBAN (no public API to retrieve it) - `recipient.siret`: Recipient\'s SIRET - `lines[]`: At least one invoice line **What happens automatically with `auto_enrich=True`**: - ✅ Name enrichment from Chorus Pro API - ✅ Address enrichment from Business Search API (free, public) - ✅ Automatic intra-EU VAT calculation (FR + key + SIREN) - ✅ Chorus Pro ID retrieval for electronic invoicing - ✅ Net/VAT/Gross totals calculation - ✅ Date generation (today + 30-day due date) - ✅ Multi-rate VAT handling **Supported identifiers**: - SIRET (14 digits): Specific establishment ⭐ Recommended - SIREN (9 digits): Company (auto-selection of headquarters) - Special types: UE_HORS_FRANCE, RIDET, TAHITI, etc. ## Checks performed during generation ### 1. Data validation (Pydantic) - Data types (amounts as Decimal, ISO 8601 dates) - Formats (14-digit SIRET, 9-digit SIREN, IBAN) - Required fields per profile - Amount consistency (Net + VAT = Gross) ### 2. CII-compliant XML generation - Serialization according to Cross Industry Invoice XSD schema - Correct UN/CEFACT namespaces - Hierarchical structure respected - UTF-8 encoding without BOM ### 3. Schematron validation - Business rules for selected profile (MINIMUM, BASIC, EN16931, EXTENDED) - Element cardinality (required, optional, repeatable) - Calculation rules (totals, VAT, discounts) - European EN 16931 compliance ### 4. PDF/A-3 conversion (if output_format=\'pdf\') - Source PDF conversion to PDF/A-3 via Ghostscript - Factur-X XML embedding in PDF - Compliant XMP metadata - ICC sRGB color profile - Removal of forbidden elements (JavaScript, forms) ## How it works 1. **Submission**: Invoice is queued in Celery for asynchronous processing 2. **Immediate return**: You receive a `task_id` (HTTP 202 Accepted) 3. **Tracking**: Use the `/tasks/{task_id}/status` endpoint to track progress ## Output formats - **xml**: Generates only Factur-X XML (recommended for testing) - **pdf**: Generates PDF/A-3 with embedded XML (requires `source_pdf`) ## Factur-X profiles - **MINIMUM**: Minimal data (simplified invoice) - **BASIC**: Basic information (SMEs) - **EN16931**: European standard (recommended, compliant with directive 2014/55/EU) - **EXTENDED**: All available data (large accounts) ## What you get After successful processing (status `completed`): - **XML only**: Base64-encoded Factur-X compliant XML file - **PDF/A-3**: PDF with embedded XML, ready for sending/archiving - **Metadata**: Profile, Factur-X version, file size - **Validation**: Schematron compliance confirmation ## Validation Data is automatically validated according to detected format. On error, a 422 status is returned with invalid field details.
|
|
36
36
|
* @summary Generate a Factur-X invoice
|
|
37
37
|
* @param {string} invoiceData Invoice data in JSON format. Two formats accepted: 1. **Classic format**: Complete FactureFacturX structure (all fields) 2. **Simplified format** (🆕 P0.1): Minimal structure with auto-enrichment Format is detected automatically!
|
|
38
|
-
* @param {
|
|
38
|
+
* @param {FacturXProfile} [profile] Factur-X profile: MINIMUM, BASIC, EN16931 or EXTENDED.
|
|
39
39
|
* @param {OutputFormat} [outputFormat] Output format: \\\'xml\\\' (XML only) or \\\'pdf\\\' (Factur-X PDF with embedded XML).
|
|
40
40
|
* @param {boolean} [autoEnrich] 🆕 Enable auto-enrichment from SIRET/SIREN (simplified format only)
|
|
41
41
|
* @param {File | null} [sourcePdf]
|
|
@@ -348,7 +348,7 @@ export const InvoiceProcessingApiAxiosParamCreator = function (configuration) {
|
|
|
348
348
|
* Validates a complete Factur-X PDF according to European and French standards. ## Applied validation standards - **EN 16931**: European semantic standard (directive 2014/55/EU) - **ISO 19005-3** (PDF/A-3): Long-term electronic archiving - **Factur-X / ZUGFeRD**: Franco-German specification - **Schematron**: XML business rules validation - **eIDAS**: European regulation on electronic identification (signatures) ## Checks performed ### 1. Factur-X XML extraction and validation **Checks performed:** - Presence of embedded XML file (`factur-x.xml` or `zugferd-invoice.xml`) - Automatic profile detection (MINIMUM, BASIC, EN16931, EXTENDED) - XML parsing with UTF-8 validation - GuidelineSpecifiedDocumentContextParameter/ID extraction **Schematron validation:** - Business rules for detected profile (MINIMUM: 45 rules, EN16931: 178 rules) - Cardinality of required elements - Calculation consistency (net, VAT, gross amounts, discounts) - Identifier formats (SIRET, intra-EU VAT, IBAN) - Standardized codes (ISO country codes, UN/ECE units, VAT codes) **What is verified:** - ✅ XML structure conforming to Cross Industry Invoice XSD - ✅ Correct UN/CEFACT namespace - ✅ European business rules (BR-xx) - ✅ French-specific rules (FR-xx) ### 2. PDF/A-3 compliance **Basic validation (metadata):** - Presence of `/Type` field set to `Catalog` - Metadata `pdfaid:part` = 3 (PDF/A-3) - Metadata `pdfaid:conformance` = B or U - PDF version >= 1.4 **Strict VeraPDF validation (if use_verapdf=True):** - 146+ ISO 19005-3 rules (PDF/A-3B) - Absence of forbidden content (JavaScript, multimedia, dynamic forms) - Correctly embedded fonts and subsets - Compliant color spaces (sRGB, DeviceGray) - Valid file structure (cross-reference table) - XMP metadata conforming to ISO 16684-1 **What is verified:** - ✅ Long-term archivable file (20+ years) - ✅ Guaranteed readability (embedded fonts) - ✅ Legal compliance (France, Germany, EU) ### 3. XMP metadata (eXtensible Metadata Platform) **Checks performed:** - Presence of `<?xpacket>` block with XMP metadata - `fx:` namespace for Factur-X: `urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#` - Required Factur-X fields: - `fx:ConformanceLevel`: Profile (MINIMUM, BASIC, EN16931, EXTENDED) - `fx:DocumentFileName`: Embedded XML name - `fx:DocumentType`: \"INVOICE\" - `fx:Version`: Factur-X version (1.0.07) **What is verified:** - ✅ Metadata conforming to ISO 16684-1 - ✅ Correct declared Factur-X profile - ✅ Supported Factur-X version ### 4. Electronic signatures **Detection and analysis:** - Presence of `/Sig` dictionaries in PDF - Signature type: PAdES (PDF Advanced Electronic Signature) - Information extraction: - Signer name (`/Name`) - Signing date (`/M`) - Signature reason (`/Reason`) - Signature location (`/Location`) - Signature type (approval, certification) **What is verified:** - ✅ Presence of signatures or seals - ✅ Number of signatures (single or multi-signature) - ℹ️ No cryptographic verification (requires certificates) ## Parameters - **pdf_file** (required): The Factur-X PDF file to validate - **profile** (optional): Expected profile. If absent, auto-detected from XML - **use_verapdf** (optional, default=false): Enable strict PDF/A validation with VeraPDF - `false`: Fast metadata validation (2-3 seconds) - `true`: Complete ISO 19005-3 validation (15-30 seconds, **recommended for production**) ## Detailed response ```json { \"isCompliant\": true, \"xml\": { \"present\": true, \"compliant\": true, \"profile\": \"EN16931\", \"errors\": [] }, \"pdfa\": { \"compliant\": true, \"version\": \"PDF/A-3B\", \"method\": \"verapdf\", \"errors\": [] }, \"xmp\": { \"present\": true, \"compliant\": true, \"metadata\": {...} }, \"signatures\": { \"present\": true, \"count\": 1, \"details\": [...] } } ``` ## Use cases - **Before sending**: Validate generated invoice before transmission to client - **On reception**: Verify compliance of invoice received from supplier - **Audit**: Check quality of invoice batches - **Legal compliance**: Ensure B2B/B2G obligations are met in France - **Debugging**: Identify issues in generation process - **Archiving**: Guarantee long-term validity (PDF/A-3) ## Processing time - Basic validation: 2-3 seconds - VeraPDF validation: 15-30 seconds (depends on PDF size)
|
|
349
349
|
* @summary Validate a complete Factur-X PDF
|
|
350
350
|
* @param {File} pdfFile Factur-X PDF file to validate (.pdf format).
|
|
351
|
-
* @param {
|
|
351
|
+
* @param {FacturXProfile | null} [profile]
|
|
352
352
|
* @param {boolean} [useVerapdf] Enable strict PDF/A validation with VeraPDF (recommended for production). If False, uses basic metadata validation.
|
|
353
353
|
* @param {*} [options] Override http request option.
|
|
354
354
|
* @throws {RequiredError}
|
|
@@ -394,7 +394,7 @@ export const InvoiceProcessingApiAxiosParamCreator = function (configuration) {
|
|
|
394
394
|
* Validates a Factur-X PDF asynchronously with polling system. ## How it works 1. **Submission**: PDF is queued for asynchronous validation 2. **Immediate return**: You receive a `task_id` (HTTP 202) 3. **Tracking**: Use the `/tasks/{task_id}/status` endpoint to track progress ## Advantages of asynchronous mode - **No timeout**: Ideal for large PDFs or VeraPDF validation (which can take several seconds) - **Scalability**: Validations are processed by dedicated Celery workers - **Status tracking**: Allows you to monitor validation progress - **Non-blocking**: Your client doesn\'t wait during validation ## When to use this mode? - **VeraPDF validation enabled** (`use_verapdf=True`): Strict validation can take 2-10 seconds - **Large PDF files**: PDFs > 1 MB - **Batch processing**: Validating multiple invoices in parallel - **Asynchronous integration**: Your system supports polling ## Checks performed ### 1. Factur-X XML extraction and validation - Verifies presence of Factur-X compliant embedded XML file - Automatically detects profile used (MINIMUM, BASIC, EN16931, EXTENDED) - Validates XML against detected profile\'s Schematron rules ### 2. PDF/A compliance - **Without VeraPDF**: Basic metadata validation (fast, ~100ms) - **With VeraPDF**: Strict ISO 19005 validation (146+ rules, 2-10s) - Detects PDF/A version (PDF/A-1, PDF/A-3, etc.) - Detailed non-compliance reports ### 3. XMP metadata - Verifies presence of XMP metadata in PDF - Validates Factur-X metadata compliance (profile, version) - Extracts all available XMP metadata ### 4. Electronic signatures - Detects presence of electronic signatures or seals - Extracts information about each signature (signer, date, reason) - Counts number of signatures present ## Parameters - **pdf_file**: The Factur-X PDF file to validate - **profile**: Expected Factur-X profile (optional). If not specified, profile will be auto-detected from embedded XML file. - **use_verapdf**: Enable strict PDF/A validation with VeraPDF. ⚠️ **Warning**: VeraPDF can take 2-10 seconds depending on PDF size. Recommended only in asynchronous mode to avoid timeouts. ## Retrieving results After submission, use `GET /tasks/{task_id}/status` endpoint to retrieve the result. **Polling example**: ```python import requests import time # 1. Submit task response = requests.post(\"/validate-facturx-async\", files={\"pdf_file\": pdf_file}) task_id = response.json()[\"taskId\"] # 2. Poll every 2 seconds while True: status_response = requests.get(f\"/tasks/{task_id}/status\") status = status_response.json() if status[\"status\"] == \"SUCCESS\": result = status[\"result\"][\"validation_result\"] print(f\"Compliant: {result[\'is_compliant\']}\") break elif status[\"status\"] == \"FAILURE\": print(f\"Error: {status[\'result\'][\'errorMessage\']}\") break time.sleep(2) # Wait 2 seconds before next check ``` ## Use cases - Validate invoices before sending with VeraPDF (strict validation) - Process invoice batches in parallel - Integrate validation into an asynchronous pipeline - Validate large PDFs without timeout risk
|
|
395
395
|
* @summary Validate a Factur-X PDF (asynchronous with polling)
|
|
396
396
|
* @param {File} pdfFile Factur-X PDF file to validate (.pdf format).
|
|
397
|
-
* @param {
|
|
397
|
+
* @param {FacturXProfile | null} [profile]
|
|
398
398
|
* @param {boolean} [useVerapdf] Enable strict PDF/A validation with VeraPDF (recommended for production). May take several seconds.
|
|
399
399
|
* @param {*} [options] Override http request option.
|
|
400
400
|
* @throws {RequiredError}
|
|
@@ -478,7 +478,7 @@ export const InvoiceProcessingApiAxiosParamCreator = function (configuration) {
|
|
|
478
478
|
* Validates a Factur-X XML file against Schematron business rules according to EN 16931 standard. ## Applied Standard **Schematron ISO/IEC 19757-3**: Business rules validation language for XML - Semantic validation (beyond XSD syntax) - European EN 16931 business rules - French-specific Factur-X rules - Arithmetic calculations and data consistency ## Profiles and validated rules ### MINIMUM (45 rules) - Unique invoice identifier - Dates (issue, due date) - Party identifiers (SIRET/SIREN) - Total gross amount ### BASIC (102 rules) - All MINIMUM rules - Detailed invoice lines - Basic VAT calculations - Payment methods - References (order, contract) ### EN16931 (178 rules) - All BASIC rules - **European rules (BR-xx)**: 81 business rules - **French rules (FR-xx)**: 12 France-specific rules - **Advanced calculations (CR-xx)**: 32 calculation rules - **Standardized codes (CL-xx)**: 52 code lists ### EXTENDED (210+ rules) - All EN16931 rules - Logistics information - Advanced accounting data - Multiple external references ## Checks performed ### 1. Syntax validation - Correct XML parsing (UTF-8, well-formed) - UN/CEFACT namespaces present - Hierarchical structure respected ### 2. Business rules (BR-xx) Examples: - `BR-1`: Invoice total must equal sum of line totals + document-level amounts - `BR-CO-10`: Sum of VAT base amounts must equal invoice net total - `BR-16`: Invoice currency code must be in ISO 4217 list ### 3. French rules (FR-xx) Examples: - `FR-1`: Supplier SIRET must have 14 digits - `FR-2`: Customer SIRET must have 14 digits (if present) - `FR-5`: Intra-EU VAT number must be in format FRxx999999999 ### 4. Calculation rules (CR-xx) - Net + VAT = Gross amounts - Sum of lines = Document total - Discounts and surcharges correctly applied - Compliant rounding (2 decimals for amounts) ### 5. Standardized codes (CL-xx) - ISO 3166-1 alpha-2 country codes - ISO 4217 currency codes - UN/ECE Rec 20 measurement units - VAT codes (types, categories, exemptions) - SchemeID for identifiers (0002=SIREN, 0009=SIRET, etc.) ## Validation process 1. **XSLT loading**: Schematron file converted to XSLT (Saxon-HE) 2. **Transformation**: Rules applied to XML 3. **Results analysis**: Extraction of errors (`failed-assert`) and warnings (`successful-report`) 4. **Report**: Structured list of non-conformities ## Responses **200 OK**: Compliant XML ```json { \"message\": \"XML is compliant with EN16931 profile\" } ``` **400 Bad Request**: Non-compliant XML ```json { \"detail\": [ \"[BR-1] Invoice total (120.00) does not match calculated sum (100.00 + 20.00)\", \"[FR-1] Supplier SIRET must contain exactly 14 digits\" ] } ``` ## Use cases - **Pre-validation**: Verify XML before PDF/A integration - **Debugging**: Precisely identify generation errors - **Testing**: Validate test or example XMLs - **Compliance**: Ensure European and French rules are met - **Development**: Quick testing without PDF generation ## Processing time - MINIMUM profile: ~0.5 second - EN16931 profile: ~1-2 seconds - EXTENDED profile: ~2-3 seconds
|
|
479
479
|
* @summary Validate an existing Factur-X XML
|
|
480
480
|
* @param {File} xmlFile Factur-X XML file to validate (.xml format).
|
|
481
|
-
* @param {
|
|
481
|
+
* @param {FacturXProfile} [profile] Validation profile (MINIMUM, BASIC, EN16931, EXTENDED).
|
|
482
482
|
* @param {*} [options] Override http request option.
|
|
483
483
|
* @throws {RequiredError}
|
|
484
484
|
*/
|
|
@@ -528,7 +528,7 @@ export const InvoiceProcessingApiFp = function (configuration) {
|
|
|
528
528
|
* Generates an electronic invoice in Factur-X format compliant with European standards. ## Applied Standards - **Factur-X** (France): FNFE-MPE standard (Forum National de la Facture Électronique) - **ZUGFeRD** (Germany): German format compatible with Factur-X - **EN 16931**: European semantic standard for electronic invoicing - **ISO 19005-3** (PDF/A-3): Long-term electronic archiving - **Cross Industry Invoice (CII)**: UN/CEFACT XML syntax ## 🆕 New: Simplified format with auto-enrichment (P0.1) You can now create an invoice by providing only: - An invoice number - A sender SIRET + **IBAN** (required) - A recipient SIRET - Invoice lines (description, quantity, net price) **Simplified format example**: ```json { \"number\": \"FACT-2025-001\", \"sender\": { \"siret\": \"92019522900017\", \"iban\": \"FR7630001007941234567890185\" }, \"recipient\": {\"siret\": \"35600000000048\"}, \"lines\": [ {\"description\": \"Service\", \"quantity\": 10, \"unitPrice\": 100.00, \"vatRate\": 20.0} ] } ``` **⚠️ Required fields (simplified format)**: - `number`: Unique invoice number - `sender.siret`: Sender\'s SIRET (14 digits) - `sender.iban`: Bank account IBAN (no public API to retrieve it) - `recipient.siret`: Recipient\'s SIRET - `lines[]`: At least one invoice line **What happens automatically with `auto_enrich=True`**: - ✅ Name enrichment from Chorus Pro API - ✅ Address enrichment from Business Search API (free, public) - ✅ Automatic intra-EU VAT calculation (FR + key + SIREN) - ✅ Chorus Pro ID retrieval for electronic invoicing - ✅ Net/VAT/Gross totals calculation - ✅ Date generation (today + 30-day due date) - ✅ Multi-rate VAT handling **Supported identifiers**: - SIRET (14 digits): Specific establishment ⭐ Recommended - SIREN (9 digits): Company (auto-selection of headquarters) - Special types: UE_HORS_FRANCE, RIDET, TAHITI, etc. ## Checks performed during generation ### 1. Data validation (Pydantic) - Data types (amounts as Decimal, ISO 8601 dates) - Formats (14-digit SIRET, 9-digit SIREN, IBAN) - Required fields per profile - Amount consistency (Net + VAT = Gross) ### 2. CII-compliant XML generation - Serialization according to Cross Industry Invoice XSD schema - Correct UN/CEFACT namespaces - Hierarchical structure respected - UTF-8 encoding without BOM ### 3. Schematron validation - Business rules for selected profile (MINIMUM, BASIC, EN16931, EXTENDED) - Element cardinality (required, optional, repeatable) - Calculation rules (totals, VAT, discounts) - European EN 16931 compliance ### 4. PDF/A-3 conversion (if output_format=\'pdf\') - Source PDF conversion to PDF/A-3 via Ghostscript - Factur-X XML embedding in PDF - Compliant XMP metadata - ICC sRGB color profile - Removal of forbidden elements (JavaScript, forms) ## How it works 1. **Submission**: Invoice is queued in Celery for asynchronous processing 2. **Immediate return**: You receive a `task_id` (HTTP 202 Accepted) 3. **Tracking**: Use the `/tasks/{task_id}/status` endpoint to track progress ## Output formats - **xml**: Generates only Factur-X XML (recommended for testing) - **pdf**: Generates PDF/A-3 with embedded XML (requires `source_pdf`) ## Factur-X profiles - **MINIMUM**: Minimal data (simplified invoice) - **BASIC**: Basic information (SMEs) - **EN16931**: European standard (recommended, compliant with directive 2014/55/EU) - **EXTENDED**: All available data (large accounts) ## What you get After successful processing (status `completed`): - **XML only**: Base64-encoded Factur-X compliant XML file - **PDF/A-3**: PDF with embedded XML, ready for sending/archiving - **Metadata**: Profile, Factur-X version, file size - **Validation**: Schematron compliance confirmation ## Validation Data is automatically validated according to detected format. On error, a 422 status is returned with invalid field details.
|
|
529
529
|
* @summary Generate a Factur-X invoice
|
|
530
530
|
* @param {string} invoiceData Invoice data in JSON format. Two formats accepted: 1. **Classic format**: Complete FactureFacturX structure (all fields) 2. **Simplified format** (🆕 P0.1): Minimal structure with auto-enrichment Format is detected automatically!
|
|
531
|
-
* @param {
|
|
531
|
+
* @param {FacturXProfile} [profile] Factur-X profile: MINIMUM, BASIC, EN16931 or EXTENDED.
|
|
532
532
|
* @param {OutputFormat} [outputFormat] Output format: \\\'xml\\\' (XML only) or \\\'pdf\\\' (Factur-X PDF with embedded XML).
|
|
533
533
|
* @param {boolean} [autoEnrich] 🆕 Enable auto-enrichment from SIRET/SIREN (simplified format only)
|
|
534
534
|
* @param {File | null} [sourcePdf]
|
|
@@ -656,7 +656,7 @@ export const InvoiceProcessingApiFp = function (configuration) {
|
|
|
656
656
|
* Validates a complete Factur-X PDF according to European and French standards. ## Applied validation standards - **EN 16931**: European semantic standard (directive 2014/55/EU) - **ISO 19005-3** (PDF/A-3): Long-term electronic archiving - **Factur-X / ZUGFeRD**: Franco-German specification - **Schematron**: XML business rules validation - **eIDAS**: European regulation on electronic identification (signatures) ## Checks performed ### 1. Factur-X XML extraction and validation **Checks performed:** - Presence of embedded XML file (`factur-x.xml` or `zugferd-invoice.xml`) - Automatic profile detection (MINIMUM, BASIC, EN16931, EXTENDED) - XML parsing with UTF-8 validation - GuidelineSpecifiedDocumentContextParameter/ID extraction **Schematron validation:** - Business rules for detected profile (MINIMUM: 45 rules, EN16931: 178 rules) - Cardinality of required elements - Calculation consistency (net, VAT, gross amounts, discounts) - Identifier formats (SIRET, intra-EU VAT, IBAN) - Standardized codes (ISO country codes, UN/ECE units, VAT codes) **What is verified:** - ✅ XML structure conforming to Cross Industry Invoice XSD - ✅ Correct UN/CEFACT namespace - ✅ European business rules (BR-xx) - ✅ French-specific rules (FR-xx) ### 2. PDF/A-3 compliance **Basic validation (metadata):** - Presence of `/Type` field set to `Catalog` - Metadata `pdfaid:part` = 3 (PDF/A-3) - Metadata `pdfaid:conformance` = B or U - PDF version >= 1.4 **Strict VeraPDF validation (if use_verapdf=True):** - 146+ ISO 19005-3 rules (PDF/A-3B) - Absence of forbidden content (JavaScript, multimedia, dynamic forms) - Correctly embedded fonts and subsets - Compliant color spaces (sRGB, DeviceGray) - Valid file structure (cross-reference table) - XMP metadata conforming to ISO 16684-1 **What is verified:** - ✅ Long-term archivable file (20+ years) - ✅ Guaranteed readability (embedded fonts) - ✅ Legal compliance (France, Germany, EU) ### 3. XMP metadata (eXtensible Metadata Platform) **Checks performed:** - Presence of `<?xpacket>` block with XMP metadata - `fx:` namespace for Factur-X: `urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#` - Required Factur-X fields: - `fx:ConformanceLevel`: Profile (MINIMUM, BASIC, EN16931, EXTENDED) - `fx:DocumentFileName`: Embedded XML name - `fx:DocumentType`: \"INVOICE\" - `fx:Version`: Factur-X version (1.0.07) **What is verified:** - ✅ Metadata conforming to ISO 16684-1 - ✅ Correct declared Factur-X profile - ✅ Supported Factur-X version ### 4. Electronic signatures **Detection and analysis:** - Presence of `/Sig` dictionaries in PDF - Signature type: PAdES (PDF Advanced Electronic Signature) - Information extraction: - Signer name (`/Name`) - Signing date (`/M`) - Signature reason (`/Reason`) - Signature location (`/Location`) - Signature type (approval, certification) **What is verified:** - ✅ Presence of signatures or seals - ✅ Number of signatures (single or multi-signature) - ℹ️ No cryptographic verification (requires certificates) ## Parameters - **pdf_file** (required): The Factur-X PDF file to validate - **profile** (optional): Expected profile. If absent, auto-detected from XML - **use_verapdf** (optional, default=false): Enable strict PDF/A validation with VeraPDF - `false`: Fast metadata validation (2-3 seconds) - `true`: Complete ISO 19005-3 validation (15-30 seconds, **recommended for production**) ## Detailed response ```json { \"isCompliant\": true, \"xml\": { \"present\": true, \"compliant\": true, \"profile\": \"EN16931\", \"errors\": [] }, \"pdfa\": { \"compliant\": true, \"version\": \"PDF/A-3B\", \"method\": \"verapdf\", \"errors\": [] }, \"xmp\": { \"present\": true, \"compliant\": true, \"metadata\": {...} }, \"signatures\": { \"present\": true, \"count\": 1, \"details\": [...] } } ``` ## Use cases - **Before sending**: Validate generated invoice before transmission to client - **On reception**: Verify compliance of invoice received from supplier - **Audit**: Check quality of invoice batches - **Legal compliance**: Ensure B2B/B2G obligations are met in France - **Debugging**: Identify issues in generation process - **Archiving**: Guarantee long-term validity (PDF/A-3) ## Processing time - Basic validation: 2-3 seconds - VeraPDF validation: 15-30 seconds (depends on PDF size)
|
|
657
657
|
* @summary Validate a complete Factur-X PDF
|
|
658
658
|
* @param {File} pdfFile Factur-X PDF file to validate (.pdf format).
|
|
659
|
-
* @param {
|
|
659
|
+
* @param {FacturXProfile | null} [profile]
|
|
660
660
|
* @param {boolean} [useVerapdf] Enable strict PDF/A validation with VeraPDF (recommended for production). If False, uses basic metadata validation.
|
|
661
661
|
* @param {*} [options] Override http request option.
|
|
662
662
|
* @throws {RequiredError}
|
|
@@ -674,7 +674,7 @@ export const InvoiceProcessingApiFp = function (configuration) {
|
|
|
674
674
|
* Validates a Factur-X PDF asynchronously with polling system. ## How it works 1. **Submission**: PDF is queued for asynchronous validation 2. **Immediate return**: You receive a `task_id` (HTTP 202) 3. **Tracking**: Use the `/tasks/{task_id}/status` endpoint to track progress ## Advantages of asynchronous mode - **No timeout**: Ideal for large PDFs or VeraPDF validation (which can take several seconds) - **Scalability**: Validations are processed by dedicated Celery workers - **Status tracking**: Allows you to monitor validation progress - **Non-blocking**: Your client doesn\'t wait during validation ## When to use this mode? - **VeraPDF validation enabled** (`use_verapdf=True`): Strict validation can take 2-10 seconds - **Large PDF files**: PDFs > 1 MB - **Batch processing**: Validating multiple invoices in parallel - **Asynchronous integration**: Your system supports polling ## Checks performed ### 1. Factur-X XML extraction and validation - Verifies presence of Factur-X compliant embedded XML file - Automatically detects profile used (MINIMUM, BASIC, EN16931, EXTENDED) - Validates XML against detected profile\'s Schematron rules ### 2. PDF/A compliance - **Without VeraPDF**: Basic metadata validation (fast, ~100ms) - **With VeraPDF**: Strict ISO 19005 validation (146+ rules, 2-10s) - Detects PDF/A version (PDF/A-1, PDF/A-3, etc.) - Detailed non-compliance reports ### 3. XMP metadata - Verifies presence of XMP metadata in PDF - Validates Factur-X metadata compliance (profile, version) - Extracts all available XMP metadata ### 4. Electronic signatures - Detects presence of electronic signatures or seals - Extracts information about each signature (signer, date, reason) - Counts number of signatures present ## Parameters - **pdf_file**: The Factur-X PDF file to validate - **profile**: Expected Factur-X profile (optional). If not specified, profile will be auto-detected from embedded XML file. - **use_verapdf**: Enable strict PDF/A validation with VeraPDF. ⚠️ **Warning**: VeraPDF can take 2-10 seconds depending on PDF size. Recommended only in asynchronous mode to avoid timeouts. ## Retrieving results After submission, use `GET /tasks/{task_id}/status` endpoint to retrieve the result. **Polling example**: ```python import requests import time # 1. Submit task response = requests.post(\"/validate-facturx-async\", files={\"pdf_file\": pdf_file}) task_id = response.json()[\"taskId\"] # 2. Poll every 2 seconds while True: status_response = requests.get(f\"/tasks/{task_id}/status\") status = status_response.json() if status[\"status\"] == \"SUCCESS\": result = status[\"result\"][\"validation_result\"] print(f\"Compliant: {result[\'is_compliant\']}\") break elif status[\"status\"] == \"FAILURE\": print(f\"Error: {status[\'result\'][\'errorMessage\']}\") break time.sleep(2) # Wait 2 seconds before next check ``` ## Use cases - Validate invoices before sending with VeraPDF (strict validation) - Process invoice batches in parallel - Integrate validation into an asynchronous pipeline - Validate large PDFs without timeout risk
|
|
675
675
|
* @summary Validate a Factur-X PDF (asynchronous with polling)
|
|
676
676
|
* @param {File} pdfFile Factur-X PDF file to validate (.pdf format).
|
|
677
|
-
* @param {
|
|
677
|
+
* @param {FacturXProfile | null} [profile]
|
|
678
678
|
* @param {boolean} [useVerapdf] Enable strict PDF/A validation with VeraPDF (recommended for production). May take several seconds.
|
|
679
679
|
* @param {*} [options] Override http request option.
|
|
680
680
|
* @throws {RequiredError}
|
|
@@ -708,7 +708,7 @@ export const InvoiceProcessingApiFp = function (configuration) {
|
|
|
708
708
|
* Validates a Factur-X XML file against Schematron business rules according to EN 16931 standard. ## Applied Standard **Schematron ISO/IEC 19757-3**: Business rules validation language for XML - Semantic validation (beyond XSD syntax) - European EN 16931 business rules - French-specific Factur-X rules - Arithmetic calculations and data consistency ## Profiles and validated rules ### MINIMUM (45 rules) - Unique invoice identifier - Dates (issue, due date) - Party identifiers (SIRET/SIREN) - Total gross amount ### BASIC (102 rules) - All MINIMUM rules - Detailed invoice lines - Basic VAT calculations - Payment methods - References (order, contract) ### EN16931 (178 rules) - All BASIC rules - **European rules (BR-xx)**: 81 business rules - **French rules (FR-xx)**: 12 France-specific rules - **Advanced calculations (CR-xx)**: 32 calculation rules - **Standardized codes (CL-xx)**: 52 code lists ### EXTENDED (210+ rules) - All EN16931 rules - Logistics information - Advanced accounting data - Multiple external references ## Checks performed ### 1. Syntax validation - Correct XML parsing (UTF-8, well-formed) - UN/CEFACT namespaces present - Hierarchical structure respected ### 2. Business rules (BR-xx) Examples: - `BR-1`: Invoice total must equal sum of line totals + document-level amounts - `BR-CO-10`: Sum of VAT base amounts must equal invoice net total - `BR-16`: Invoice currency code must be in ISO 4217 list ### 3. French rules (FR-xx) Examples: - `FR-1`: Supplier SIRET must have 14 digits - `FR-2`: Customer SIRET must have 14 digits (if present) - `FR-5`: Intra-EU VAT number must be in format FRxx999999999 ### 4. Calculation rules (CR-xx) - Net + VAT = Gross amounts - Sum of lines = Document total - Discounts and surcharges correctly applied - Compliant rounding (2 decimals for amounts) ### 5. Standardized codes (CL-xx) - ISO 3166-1 alpha-2 country codes - ISO 4217 currency codes - UN/ECE Rec 20 measurement units - VAT codes (types, categories, exemptions) - SchemeID for identifiers (0002=SIREN, 0009=SIRET, etc.) ## Validation process 1. **XSLT loading**: Schematron file converted to XSLT (Saxon-HE) 2. **Transformation**: Rules applied to XML 3. **Results analysis**: Extraction of errors (`failed-assert`) and warnings (`successful-report`) 4. **Report**: Structured list of non-conformities ## Responses **200 OK**: Compliant XML ```json { \"message\": \"XML is compliant with EN16931 profile\" } ``` **400 Bad Request**: Non-compliant XML ```json { \"detail\": [ \"[BR-1] Invoice total (120.00) does not match calculated sum (100.00 + 20.00)\", \"[FR-1] Supplier SIRET must contain exactly 14 digits\" ] } ``` ## Use cases - **Pre-validation**: Verify XML before PDF/A integration - **Debugging**: Precisely identify generation errors - **Testing**: Validate test or example XMLs - **Compliance**: Ensure European and French rules are met - **Development**: Quick testing without PDF generation ## Processing time - MINIMUM profile: ~0.5 second - EN16931 profile: ~1-2 seconds - EXTENDED profile: ~2-3 seconds
|
|
709
709
|
* @summary Validate an existing Factur-X XML
|
|
710
710
|
* @param {File} xmlFile Factur-X XML file to validate (.xml format).
|
|
711
|
-
* @param {
|
|
711
|
+
* @param {FacturXProfile} [profile] Validation profile (MINIMUM, BASIC, EN16931, EXTENDED).
|
|
712
712
|
* @param {*} [options] Override http request option.
|
|
713
713
|
* @throws {RequiredError}
|
|
714
714
|
*/
|
|
@@ -733,7 +733,7 @@ export const InvoiceProcessingApiFactory = function (configuration, basePath, ax
|
|
|
733
733
|
* Generates an electronic invoice in Factur-X format compliant with European standards. ## Applied Standards - **Factur-X** (France): FNFE-MPE standard (Forum National de la Facture Électronique) - **ZUGFeRD** (Germany): German format compatible with Factur-X - **EN 16931**: European semantic standard for electronic invoicing - **ISO 19005-3** (PDF/A-3): Long-term electronic archiving - **Cross Industry Invoice (CII)**: UN/CEFACT XML syntax ## 🆕 New: Simplified format with auto-enrichment (P0.1) You can now create an invoice by providing only: - An invoice number - A sender SIRET + **IBAN** (required) - A recipient SIRET - Invoice lines (description, quantity, net price) **Simplified format example**: ```json { \"number\": \"FACT-2025-001\", \"sender\": { \"siret\": \"92019522900017\", \"iban\": \"FR7630001007941234567890185\" }, \"recipient\": {\"siret\": \"35600000000048\"}, \"lines\": [ {\"description\": \"Service\", \"quantity\": 10, \"unitPrice\": 100.00, \"vatRate\": 20.0} ] } ``` **⚠️ Required fields (simplified format)**: - `number`: Unique invoice number - `sender.siret`: Sender\'s SIRET (14 digits) - `sender.iban`: Bank account IBAN (no public API to retrieve it) - `recipient.siret`: Recipient\'s SIRET - `lines[]`: At least one invoice line **What happens automatically with `auto_enrich=True`**: - ✅ Name enrichment from Chorus Pro API - ✅ Address enrichment from Business Search API (free, public) - ✅ Automatic intra-EU VAT calculation (FR + key + SIREN) - ✅ Chorus Pro ID retrieval for electronic invoicing - ✅ Net/VAT/Gross totals calculation - ✅ Date generation (today + 30-day due date) - ✅ Multi-rate VAT handling **Supported identifiers**: - SIRET (14 digits): Specific establishment ⭐ Recommended - SIREN (9 digits): Company (auto-selection of headquarters) - Special types: UE_HORS_FRANCE, RIDET, TAHITI, etc. ## Checks performed during generation ### 1. Data validation (Pydantic) - Data types (amounts as Decimal, ISO 8601 dates) - Formats (14-digit SIRET, 9-digit SIREN, IBAN) - Required fields per profile - Amount consistency (Net + VAT = Gross) ### 2. CII-compliant XML generation - Serialization according to Cross Industry Invoice XSD schema - Correct UN/CEFACT namespaces - Hierarchical structure respected - UTF-8 encoding without BOM ### 3. Schematron validation - Business rules for selected profile (MINIMUM, BASIC, EN16931, EXTENDED) - Element cardinality (required, optional, repeatable) - Calculation rules (totals, VAT, discounts) - European EN 16931 compliance ### 4. PDF/A-3 conversion (if output_format=\'pdf\') - Source PDF conversion to PDF/A-3 via Ghostscript - Factur-X XML embedding in PDF - Compliant XMP metadata - ICC sRGB color profile - Removal of forbidden elements (JavaScript, forms) ## How it works 1. **Submission**: Invoice is queued in Celery for asynchronous processing 2. **Immediate return**: You receive a `task_id` (HTTP 202 Accepted) 3. **Tracking**: Use the `/tasks/{task_id}/status` endpoint to track progress ## Output formats - **xml**: Generates only Factur-X XML (recommended for testing) - **pdf**: Generates PDF/A-3 with embedded XML (requires `source_pdf`) ## Factur-X profiles - **MINIMUM**: Minimal data (simplified invoice) - **BASIC**: Basic information (SMEs) - **EN16931**: European standard (recommended, compliant with directive 2014/55/EU) - **EXTENDED**: All available data (large accounts) ## What you get After successful processing (status `completed`): - **XML only**: Base64-encoded Factur-X compliant XML file - **PDF/A-3**: PDF with embedded XML, ready for sending/archiving - **Metadata**: Profile, Factur-X version, file size - **Validation**: Schematron compliance confirmation ## Validation Data is automatically validated according to detected format. On error, a 422 status is returned with invalid field details.
|
|
734
734
|
* @summary Generate a Factur-X invoice
|
|
735
735
|
* @param {string} invoiceData Invoice data in JSON format. Two formats accepted: 1. **Classic format**: Complete FactureFacturX structure (all fields) 2. **Simplified format** (🆕 P0.1): Minimal structure with auto-enrichment Format is detected automatically!
|
|
736
|
-
* @param {
|
|
736
|
+
* @param {FacturXProfile} [profile] Factur-X profile: MINIMUM, BASIC, EN16931 or EXTENDED.
|
|
737
737
|
* @param {OutputFormat} [outputFormat] Output format: \\\'xml\\\' (XML only) or \\\'pdf\\\' (Factur-X PDF with embedded XML).
|
|
738
738
|
* @param {boolean} [autoEnrich] 🆕 Enable auto-enrichment from SIRET/SIREN (simplified format only)
|
|
739
739
|
* @param {File | null} [sourcePdf]
|
|
@@ -819,7 +819,7 @@ export const InvoiceProcessingApiFactory = function (configuration, basePath, ax
|
|
|
819
819
|
* Validates a complete Factur-X PDF according to European and French standards. ## Applied validation standards - **EN 16931**: European semantic standard (directive 2014/55/EU) - **ISO 19005-3** (PDF/A-3): Long-term electronic archiving - **Factur-X / ZUGFeRD**: Franco-German specification - **Schematron**: XML business rules validation - **eIDAS**: European regulation on electronic identification (signatures) ## Checks performed ### 1. Factur-X XML extraction and validation **Checks performed:** - Presence of embedded XML file (`factur-x.xml` or `zugferd-invoice.xml`) - Automatic profile detection (MINIMUM, BASIC, EN16931, EXTENDED) - XML parsing with UTF-8 validation - GuidelineSpecifiedDocumentContextParameter/ID extraction **Schematron validation:** - Business rules for detected profile (MINIMUM: 45 rules, EN16931: 178 rules) - Cardinality of required elements - Calculation consistency (net, VAT, gross amounts, discounts) - Identifier formats (SIRET, intra-EU VAT, IBAN) - Standardized codes (ISO country codes, UN/ECE units, VAT codes) **What is verified:** - ✅ XML structure conforming to Cross Industry Invoice XSD - ✅ Correct UN/CEFACT namespace - ✅ European business rules (BR-xx) - ✅ French-specific rules (FR-xx) ### 2. PDF/A-3 compliance **Basic validation (metadata):** - Presence of `/Type` field set to `Catalog` - Metadata `pdfaid:part` = 3 (PDF/A-3) - Metadata `pdfaid:conformance` = B or U - PDF version >= 1.4 **Strict VeraPDF validation (if use_verapdf=True):** - 146+ ISO 19005-3 rules (PDF/A-3B) - Absence of forbidden content (JavaScript, multimedia, dynamic forms) - Correctly embedded fonts and subsets - Compliant color spaces (sRGB, DeviceGray) - Valid file structure (cross-reference table) - XMP metadata conforming to ISO 16684-1 **What is verified:** - ✅ Long-term archivable file (20+ years) - ✅ Guaranteed readability (embedded fonts) - ✅ Legal compliance (France, Germany, EU) ### 3. XMP metadata (eXtensible Metadata Platform) **Checks performed:** - Presence of `<?xpacket>` block with XMP metadata - `fx:` namespace for Factur-X: `urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#` - Required Factur-X fields: - `fx:ConformanceLevel`: Profile (MINIMUM, BASIC, EN16931, EXTENDED) - `fx:DocumentFileName`: Embedded XML name - `fx:DocumentType`: \"INVOICE\" - `fx:Version`: Factur-X version (1.0.07) **What is verified:** - ✅ Metadata conforming to ISO 16684-1 - ✅ Correct declared Factur-X profile - ✅ Supported Factur-X version ### 4. Electronic signatures **Detection and analysis:** - Presence of `/Sig` dictionaries in PDF - Signature type: PAdES (PDF Advanced Electronic Signature) - Information extraction: - Signer name (`/Name`) - Signing date (`/M`) - Signature reason (`/Reason`) - Signature location (`/Location`) - Signature type (approval, certification) **What is verified:** - ✅ Presence of signatures or seals - ✅ Number of signatures (single or multi-signature) - ℹ️ No cryptographic verification (requires certificates) ## Parameters - **pdf_file** (required): The Factur-X PDF file to validate - **profile** (optional): Expected profile. If absent, auto-detected from XML - **use_verapdf** (optional, default=false): Enable strict PDF/A validation with VeraPDF - `false`: Fast metadata validation (2-3 seconds) - `true`: Complete ISO 19005-3 validation (15-30 seconds, **recommended for production**) ## Detailed response ```json { \"isCompliant\": true, \"xml\": { \"present\": true, \"compliant\": true, \"profile\": \"EN16931\", \"errors\": [] }, \"pdfa\": { \"compliant\": true, \"version\": \"PDF/A-3B\", \"method\": \"verapdf\", \"errors\": [] }, \"xmp\": { \"present\": true, \"compliant\": true, \"metadata\": {...} }, \"signatures\": { \"present\": true, \"count\": 1, \"details\": [...] } } ``` ## Use cases - **Before sending**: Validate generated invoice before transmission to client - **On reception**: Verify compliance of invoice received from supplier - **Audit**: Check quality of invoice batches - **Legal compliance**: Ensure B2B/B2G obligations are met in France - **Debugging**: Identify issues in generation process - **Archiving**: Guarantee long-term validity (PDF/A-3) ## Processing time - Basic validation: 2-3 seconds - VeraPDF validation: 15-30 seconds (depends on PDF size)
|
|
820
820
|
* @summary Validate a complete Factur-X PDF
|
|
821
821
|
* @param {File} pdfFile Factur-X PDF file to validate (.pdf format).
|
|
822
|
-
* @param {
|
|
822
|
+
* @param {FacturXProfile | null} [profile]
|
|
823
823
|
* @param {boolean} [useVerapdf] Enable strict PDF/A validation with VeraPDF (recommended for production). If False, uses basic metadata validation.
|
|
824
824
|
* @param {*} [options] Override http request option.
|
|
825
825
|
* @throws {RequiredError}
|
|
@@ -831,7 +831,7 @@ export const InvoiceProcessingApiFactory = function (configuration, basePath, ax
|
|
|
831
831
|
* Validates a Factur-X PDF asynchronously with polling system. ## How it works 1. **Submission**: PDF is queued for asynchronous validation 2. **Immediate return**: You receive a `task_id` (HTTP 202) 3. **Tracking**: Use the `/tasks/{task_id}/status` endpoint to track progress ## Advantages of asynchronous mode - **No timeout**: Ideal for large PDFs or VeraPDF validation (which can take several seconds) - **Scalability**: Validations are processed by dedicated Celery workers - **Status tracking**: Allows you to monitor validation progress - **Non-blocking**: Your client doesn\'t wait during validation ## When to use this mode? - **VeraPDF validation enabled** (`use_verapdf=True`): Strict validation can take 2-10 seconds - **Large PDF files**: PDFs > 1 MB - **Batch processing**: Validating multiple invoices in parallel - **Asynchronous integration**: Your system supports polling ## Checks performed ### 1. Factur-X XML extraction and validation - Verifies presence of Factur-X compliant embedded XML file - Automatically detects profile used (MINIMUM, BASIC, EN16931, EXTENDED) - Validates XML against detected profile\'s Schematron rules ### 2. PDF/A compliance - **Without VeraPDF**: Basic metadata validation (fast, ~100ms) - **With VeraPDF**: Strict ISO 19005 validation (146+ rules, 2-10s) - Detects PDF/A version (PDF/A-1, PDF/A-3, etc.) - Detailed non-compliance reports ### 3. XMP metadata - Verifies presence of XMP metadata in PDF - Validates Factur-X metadata compliance (profile, version) - Extracts all available XMP metadata ### 4. Electronic signatures - Detects presence of electronic signatures or seals - Extracts information about each signature (signer, date, reason) - Counts number of signatures present ## Parameters - **pdf_file**: The Factur-X PDF file to validate - **profile**: Expected Factur-X profile (optional). If not specified, profile will be auto-detected from embedded XML file. - **use_verapdf**: Enable strict PDF/A validation with VeraPDF. ⚠️ **Warning**: VeraPDF can take 2-10 seconds depending on PDF size. Recommended only in asynchronous mode to avoid timeouts. ## Retrieving results After submission, use `GET /tasks/{task_id}/status` endpoint to retrieve the result. **Polling example**: ```python import requests import time # 1. Submit task response = requests.post(\"/validate-facturx-async\", files={\"pdf_file\": pdf_file}) task_id = response.json()[\"taskId\"] # 2. Poll every 2 seconds while True: status_response = requests.get(f\"/tasks/{task_id}/status\") status = status_response.json() if status[\"status\"] == \"SUCCESS\": result = status[\"result\"][\"validation_result\"] print(f\"Compliant: {result[\'is_compliant\']}\") break elif status[\"status\"] == \"FAILURE\": print(f\"Error: {status[\'result\'][\'errorMessage\']}\") break time.sleep(2) # Wait 2 seconds before next check ``` ## Use cases - Validate invoices before sending with VeraPDF (strict validation) - Process invoice batches in parallel - Integrate validation into an asynchronous pipeline - Validate large PDFs without timeout risk
|
|
832
832
|
* @summary Validate a Factur-X PDF (asynchronous with polling)
|
|
833
833
|
* @param {File} pdfFile Factur-X PDF file to validate (.pdf format).
|
|
834
|
-
* @param {
|
|
834
|
+
* @param {FacturXProfile | null} [profile]
|
|
835
835
|
* @param {boolean} [useVerapdf] Enable strict PDF/A validation with VeraPDF (recommended for production). May take several seconds.
|
|
836
836
|
* @param {*} [options] Override http request option.
|
|
837
837
|
* @throws {RequiredError}
|
|
@@ -853,7 +853,7 @@ export const InvoiceProcessingApiFactory = function (configuration, basePath, ax
|
|
|
853
853
|
* Validates a Factur-X XML file against Schematron business rules according to EN 16931 standard. ## Applied Standard **Schematron ISO/IEC 19757-3**: Business rules validation language for XML - Semantic validation (beyond XSD syntax) - European EN 16931 business rules - French-specific Factur-X rules - Arithmetic calculations and data consistency ## Profiles and validated rules ### MINIMUM (45 rules) - Unique invoice identifier - Dates (issue, due date) - Party identifiers (SIRET/SIREN) - Total gross amount ### BASIC (102 rules) - All MINIMUM rules - Detailed invoice lines - Basic VAT calculations - Payment methods - References (order, contract) ### EN16931 (178 rules) - All BASIC rules - **European rules (BR-xx)**: 81 business rules - **French rules (FR-xx)**: 12 France-specific rules - **Advanced calculations (CR-xx)**: 32 calculation rules - **Standardized codes (CL-xx)**: 52 code lists ### EXTENDED (210+ rules) - All EN16931 rules - Logistics information - Advanced accounting data - Multiple external references ## Checks performed ### 1. Syntax validation - Correct XML parsing (UTF-8, well-formed) - UN/CEFACT namespaces present - Hierarchical structure respected ### 2. Business rules (BR-xx) Examples: - `BR-1`: Invoice total must equal sum of line totals + document-level amounts - `BR-CO-10`: Sum of VAT base amounts must equal invoice net total - `BR-16`: Invoice currency code must be in ISO 4217 list ### 3. French rules (FR-xx) Examples: - `FR-1`: Supplier SIRET must have 14 digits - `FR-2`: Customer SIRET must have 14 digits (if present) - `FR-5`: Intra-EU VAT number must be in format FRxx999999999 ### 4. Calculation rules (CR-xx) - Net + VAT = Gross amounts - Sum of lines = Document total - Discounts and surcharges correctly applied - Compliant rounding (2 decimals for amounts) ### 5. Standardized codes (CL-xx) - ISO 3166-1 alpha-2 country codes - ISO 4217 currency codes - UN/ECE Rec 20 measurement units - VAT codes (types, categories, exemptions) - SchemeID for identifiers (0002=SIREN, 0009=SIRET, etc.) ## Validation process 1. **XSLT loading**: Schematron file converted to XSLT (Saxon-HE) 2. **Transformation**: Rules applied to XML 3. **Results analysis**: Extraction of errors (`failed-assert`) and warnings (`successful-report`) 4. **Report**: Structured list of non-conformities ## Responses **200 OK**: Compliant XML ```json { \"message\": \"XML is compliant with EN16931 profile\" } ``` **400 Bad Request**: Non-compliant XML ```json { \"detail\": [ \"[BR-1] Invoice total (120.00) does not match calculated sum (100.00 + 20.00)\", \"[FR-1] Supplier SIRET must contain exactly 14 digits\" ] } ``` ## Use cases - **Pre-validation**: Verify XML before PDF/A integration - **Debugging**: Precisely identify generation errors - **Testing**: Validate test or example XMLs - **Compliance**: Ensure European and French rules are met - **Development**: Quick testing without PDF generation ## Processing time - MINIMUM profile: ~0.5 second - EN16931 profile: ~1-2 seconds - EXTENDED profile: ~2-3 seconds
|
|
854
854
|
* @summary Validate an existing Factur-X XML
|
|
855
855
|
* @param {File} xmlFile Factur-X XML file to validate (.xml format).
|
|
856
|
-
* @param {
|
|
856
|
+
* @param {FacturXProfile} [profile] Validation profile (MINIMUM, BASIC, EN16931, EXTENDED).
|
|
857
857
|
* @param {*} [options] Override http request option.
|
|
858
858
|
* @throws {RequiredError}
|
|
859
859
|
*/
|
|
@@ -870,7 +870,7 @@ export class InvoiceProcessingApi extends BaseAPI {
|
|
|
870
870
|
* Generates an electronic invoice in Factur-X format compliant with European standards. ## Applied Standards - **Factur-X** (France): FNFE-MPE standard (Forum National de la Facture Électronique) - **ZUGFeRD** (Germany): German format compatible with Factur-X - **EN 16931**: European semantic standard for electronic invoicing - **ISO 19005-3** (PDF/A-3): Long-term electronic archiving - **Cross Industry Invoice (CII)**: UN/CEFACT XML syntax ## 🆕 New: Simplified format with auto-enrichment (P0.1) You can now create an invoice by providing only: - An invoice number - A sender SIRET + **IBAN** (required) - A recipient SIRET - Invoice lines (description, quantity, net price) **Simplified format example**: ```json { \"number\": \"FACT-2025-001\", \"sender\": { \"siret\": \"92019522900017\", \"iban\": \"FR7630001007941234567890185\" }, \"recipient\": {\"siret\": \"35600000000048\"}, \"lines\": [ {\"description\": \"Service\", \"quantity\": 10, \"unitPrice\": 100.00, \"vatRate\": 20.0} ] } ``` **⚠️ Required fields (simplified format)**: - `number`: Unique invoice number - `sender.siret`: Sender\'s SIRET (14 digits) - `sender.iban`: Bank account IBAN (no public API to retrieve it) - `recipient.siret`: Recipient\'s SIRET - `lines[]`: At least one invoice line **What happens automatically with `auto_enrich=True`**: - ✅ Name enrichment from Chorus Pro API - ✅ Address enrichment from Business Search API (free, public) - ✅ Automatic intra-EU VAT calculation (FR + key + SIREN) - ✅ Chorus Pro ID retrieval for electronic invoicing - ✅ Net/VAT/Gross totals calculation - ✅ Date generation (today + 30-day due date) - ✅ Multi-rate VAT handling **Supported identifiers**: - SIRET (14 digits): Specific establishment ⭐ Recommended - SIREN (9 digits): Company (auto-selection of headquarters) - Special types: UE_HORS_FRANCE, RIDET, TAHITI, etc. ## Checks performed during generation ### 1. Data validation (Pydantic) - Data types (amounts as Decimal, ISO 8601 dates) - Formats (14-digit SIRET, 9-digit SIREN, IBAN) - Required fields per profile - Amount consistency (Net + VAT = Gross) ### 2. CII-compliant XML generation - Serialization according to Cross Industry Invoice XSD schema - Correct UN/CEFACT namespaces - Hierarchical structure respected - UTF-8 encoding without BOM ### 3. Schematron validation - Business rules for selected profile (MINIMUM, BASIC, EN16931, EXTENDED) - Element cardinality (required, optional, repeatable) - Calculation rules (totals, VAT, discounts) - European EN 16931 compliance ### 4. PDF/A-3 conversion (if output_format=\'pdf\') - Source PDF conversion to PDF/A-3 via Ghostscript - Factur-X XML embedding in PDF - Compliant XMP metadata - ICC sRGB color profile - Removal of forbidden elements (JavaScript, forms) ## How it works 1. **Submission**: Invoice is queued in Celery for asynchronous processing 2. **Immediate return**: You receive a `task_id` (HTTP 202 Accepted) 3. **Tracking**: Use the `/tasks/{task_id}/status` endpoint to track progress ## Output formats - **xml**: Generates only Factur-X XML (recommended for testing) - **pdf**: Generates PDF/A-3 with embedded XML (requires `source_pdf`) ## Factur-X profiles - **MINIMUM**: Minimal data (simplified invoice) - **BASIC**: Basic information (SMEs) - **EN16931**: European standard (recommended, compliant with directive 2014/55/EU) - **EXTENDED**: All available data (large accounts) ## What you get After successful processing (status `completed`): - **XML only**: Base64-encoded Factur-X compliant XML file - **PDF/A-3**: PDF with embedded XML, ready for sending/archiving - **Metadata**: Profile, Factur-X version, file size - **Validation**: Schematron compliance confirmation ## Validation Data is automatically validated according to detected format. On error, a 422 status is returned with invalid field details.
|
|
871
871
|
* @summary Generate a Factur-X invoice
|
|
872
872
|
* @param {string} invoiceData Invoice data in JSON format. Two formats accepted: 1. **Classic format**: Complete FactureFacturX structure (all fields) 2. **Simplified format** (🆕 P0.1): Minimal structure with auto-enrichment Format is detected automatically!
|
|
873
|
-
* @param {
|
|
873
|
+
* @param {FacturXProfile} [profile] Factur-X profile: MINIMUM, BASIC, EN16931 or EXTENDED.
|
|
874
874
|
* @param {OutputFormat} [outputFormat] Output format: \\\'xml\\\' (XML only) or \\\'pdf\\\' (Factur-X PDF with embedded XML).
|
|
875
875
|
* @param {boolean} [autoEnrich] 🆕 Enable auto-enrichment from SIRET/SIREN (simplified format only)
|
|
876
876
|
* @param {File | null} [sourcePdf]
|
|
@@ -956,7 +956,7 @@ export class InvoiceProcessingApi extends BaseAPI {
|
|
|
956
956
|
* Validates a complete Factur-X PDF according to European and French standards. ## Applied validation standards - **EN 16931**: European semantic standard (directive 2014/55/EU) - **ISO 19005-3** (PDF/A-3): Long-term electronic archiving - **Factur-X / ZUGFeRD**: Franco-German specification - **Schematron**: XML business rules validation - **eIDAS**: European regulation on electronic identification (signatures) ## Checks performed ### 1. Factur-X XML extraction and validation **Checks performed:** - Presence of embedded XML file (`factur-x.xml` or `zugferd-invoice.xml`) - Automatic profile detection (MINIMUM, BASIC, EN16931, EXTENDED) - XML parsing with UTF-8 validation - GuidelineSpecifiedDocumentContextParameter/ID extraction **Schematron validation:** - Business rules for detected profile (MINIMUM: 45 rules, EN16931: 178 rules) - Cardinality of required elements - Calculation consistency (net, VAT, gross amounts, discounts) - Identifier formats (SIRET, intra-EU VAT, IBAN) - Standardized codes (ISO country codes, UN/ECE units, VAT codes) **What is verified:** - ✅ XML structure conforming to Cross Industry Invoice XSD - ✅ Correct UN/CEFACT namespace - ✅ European business rules (BR-xx) - ✅ French-specific rules (FR-xx) ### 2. PDF/A-3 compliance **Basic validation (metadata):** - Presence of `/Type` field set to `Catalog` - Metadata `pdfaid:part` = 3 (PDF/A-3) - Metadata `pdfaid:conformance` = B or U - PDF version >= 1.4 **Strict VeraPDF validation (if use_verapdf=True):** - 146+ ISO 19005-3 rules (PDF/A-3B) - Absence of forbidden content (JavaScript, multimedia, dynamic forms) - Correctly embedded fonts and subsets - Compliant color spaces (sRGB, DeviceGray) - Valid file structure (cross-reference table) - XMP metadata conforming to ISO 16684-1 **What is verified:** - ✅ Long-term archivable file (20+ years) - ✅ Guaranteed readability (embedded fonts) - ✅ Legal compliance (France, Germany, EU) ### 3. XMP metadata (eXtensible Metadata Platform) **Checks performed:** - Presence of `<?xpacket>` block with XMP metadata - `fx:` namespace for Factur-X: `urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#` - Required Factur-X fields: - `fx:ConformanceLevel`: Profile (MINIMUM, BASIC, EN16931, EXTENDED) - `fx:DocumentFileName`: Embedded XML name - `fx:DocumentType`: \"INVOICE\" - `fx:Version`: Factur-X version (1.0.07) **What is verified:** - ✅ Metadata conforming to ISO 16684-1 - ✅ Correct declared Factur-X profile - ✅ Supported Factur-X version ### 4. Electronic signatures **Detection and analysis:** - Presence of `/Sig` dictionaries in PDF - Signature type: PAdES (PDF Advanced Electronic Signature) - Information extraction: - Signer name (`/Name`) - Signing date (`/M`) - Signature reason (`/Reason`) - Signature location (`/Location`) - Signature type (approval, certification) **What is verified:** - ✅ Presence of signatures or seals - ✅ Number of signatures (single or multi-signature) - ℹ️ No cryptographic verification (requires certificates) ## Parameters - **pdf_file** (required): The Factur-X PDF file to validate - **profile** (optional): Expected profile. If absent, auto-detected from XML - **use_verapdf** (optional, default=false): Enable strict PDF/A validation with VeraPDF - `false`: Fast metadata validation (2-3 seconds) - `true`: Complete ISO 19005-3 validation (15-30 seconds, **recommended for production**) ## Detailed response ```json { \"isCompliant\": true, \"xml\": { \"present\": true, \"compliant\": true, \"profile\": \"EN16931\", \"errors\": [] }, \"pdfa\": { \"compliant\": true, \"version\": \"PDF/A-3B\", \"method\": \"verapdf\", \"errors\": [] }, \"xmp\": { \"present\": true, \"compliant\": true, \"metadata\": {...} }, \"signatures\": { \"present\": true, \"count\": 1, \"details\": [...] } } ``` ## Use cases - **Before sending**: Validate generated invoice before transmission to client - **On reception**: Verify compliance of invoice received from supplier - **Audit**: Check quality of invoice batches - **Legal compliance**: Ensure B2B/B2G obligations are met in France - **Debugging**: Identify issues in generation process - **Archiving**: Guarantee long-term validity (PDF/A-3) ## Processing time - Basic validation: 2-3 seconds - VeraPDF validation: 15-30 seconds (depends on PDF size)
|
|
957
957
|
* @summary Validate a complete Factur-X PDF
|
|
958
958
|
* @param {File} pdfFile Factur-X PDF file to validate (.pdf format).
|
|
959
|
-
* @param {
|
|
959
|
+
* @param {FacturXProfile | null} [profile]
|
|
960
960
|
* @param {boolean} [useVerapdf] Enable strict PDF/A validation with VeraPDF (recommended for production). If False, uses basic metadata validation.
|
|
961
961
|
* @param {*} [options] Override http request option.
|
|
962
962
|
* @throws {RequiredError}
|
|
@@ -968,7 +968,7 @@ export class InvoiceProcessingApi extends BaseAPI {
|
|
|
968
968
|
* Validates a Factur-X PDF asynchronously with polling system. ## How it works 1. **Submission**: PDF is queued for asynchronous validation 2. **Immediate return**: You receive a `task_id` (HTTP 202) 3. **Tracking**: Use the `/tasks/{task_id}/status` endpoint to track progress ## Advantages of asynchronous mode - **No timeout**: Ideal for large PDFs or VeraPDF validation (which can take several seconds) - **Scalability**: Validations are processed by dedicated Celery workers - **Status tracking**: Allows you to monitor validation progress - **Non-blocking**: Your client doesn\'t wait during validation ## When to use this mode? - **VeraPDF validation enabled** (`use_verapdf=True`): Strict validation can take 2-10 seconds - **Large PDF files**: PDFs > 1 MB - **Batch processing**: Validating multiple invoices in parallel - **Asynchronous integration**: Your system supports polling ## Checks performed ### 1. Factur-X XML extraction and validation - Verifies presence of Factur-X compliant embedded XML file - Automatically detects profile used (MINIMUM, BASIC, EN16931, EXTENDED) - Validates XML against detected profile\'s Schematron rules ### 2. PDF/A compliance - **Without VeraPDF**: Basic metadata validation (fast, ~100ms) - **With VeraPDF**: Strict ISO 19005 validation (146+ rules, 2-10s) - Detects PDF/A version (PDF/A-1, PDF/A-3, etc.) - Detailed non-compliance reports ### 3. XMP metadata - Verifies presence of XMP metadata in PDF - Validates Factur-X metadata compliance (profile, version) - Extracts all available XMP metadata ### 4. Electronic signatures - Detects presence of electronic signatures or seals - Extracts information about each signature (signer, date, reason) - Counts number of signatures present ## Parameters - **pdf_file**: The Factur-X PDF file to validate - **profile**: Expected Factur-X profile (optional). If not specified, profile will be auto-detected from embedded XML file. - **use_verapdf**: Enable strict PDF/A validation with VeraPDF. ⚠️ **Warning**: VeraPDF can take 2-10 seconds depending on PDF size. Recommended only in asynchronous mode to avoid timeouts. ## Retrieving results After submission, use `GET /tasks/{task_id}/status` endpoint to retrieve the result. **Polling example**: ```python import requests import time # 1. Submit task response = requests.post(\"/validate-facturx-async\", files={\"pdf_file\": pdf_file}) task_id = response.json()[\"taskId\"] # 2. Poll every 2 seconds while True: status_response = requests.get(f\"/tasks/{task_id}/status\") status = status_response.json() if status[\"status\"] == \"SUCCESS\": result = status[\"result\"][\"validation_result\"] print(f\"Compliant: {result[\'is_compliant\']}\") break elif status[\"status\"] == \"FAILURE\": print(f\"Error: {status[\'result\'][\'errorMessage\']}\") break time.sleep(2) # Wait 2 seconds before next check ``` ## Use cases - Validate invoices before sending with VeraPDF (strict validation) - Process invoice batches in parallel - Integrate validation into an asynchronous pipeline - Validate large PDFs without timeout risk
|
|
969
969
|
* @summary Validate a Factur-X PDF (asynchronous with polling)
|
|
970
970
|
* @param {File} pdfFile Factur-X PDF file to validate (.pdf format).
|
|
971
|
-
* @param {
|
|
971
|
+
* @param {FacturXProfile | null} [profile]
|
|
972
972
|
* @param {boolean} [useVerapdf] Enable strict PDF/A validation with VeraPDF (recommended for production). May take several seconds.
|
|
973
973
|
* @param {*} [options] Override http request option.
|
|
974
974
|
* @throws {RequiredError}
|
|
@@ -990,7 +990,7 @@ export class InvoiceProcessingApi extends BaseAPI {
|
|
|
990
990
|
* Validates a Factur-X XML file against Schematron business rules according to EN 16931 standard. ## Applied Standard **Schematron ISO/IEC 19757-3**: Business rules validation language for XML - Semantic validation (beyond XSD syntax) - European EN 16931 business rules - French-specific Factur-X rules - Arithmetic calculations and data consistency ## Profiles and validated rules ### MINIMUM (45 rules) - Unique invoice identifier - Dates (issue, due date) - Party identifiers (SIRET/SIREN) - Total gross amount ### BASIC (102 rules) - All MINIMUM rules - Detailed invoice lines - Basic VAT calculations - Payment methods - References (order, contract) ### EN16931 (178 rules) - All BASIC rules - **European rules (BR-xx)**: 81 business rules - **French rules (FR-xx)**: 12 France-specific rules - **Advanced calculations (CR-xx)**: 32 calculation rules - **Standardized codes (CL-xx)**: 52 code lists ### EXTENDED (210+ rules) - All EN16931 rules - Logistics information - Advanced accounting data - Multiple external references ## Checks performed ### 1. Syntax validation - Correct XML parsing (UTF-8, well-formed) - UN/CEFACT namespaces present - Hierarchical structure respected ### 2. Business rules (BR-xx) Examples: - `BR-1`: Invoice total must equal sum of line totals + document-level amounts - `BR-CO-10`: Sum of VAT base amounts must equal invoice net total - `BR-16`: Invoice currency code must be in ISO 4217 list ### 3. French rules (FR-xx) Examples: - `FR-1`: Supplier SIRET must have 14 digits - `FR-2`: Customer SIRET must have 14 digits (if present) - `FR-5`: Intra-EU VAT number must be in format FRxx999999999 ### 4. Calculation rules (CR-xx) - Net + VAT = Gross amounts - Sum of lines = Document total - Discounts and surcharges correctly applied - Compliant rounding (2 decimals for amounts) ### 5. Standardized codes (CL-xx) - ISO 3166-1 alpha-2 country codes - ISO 4217 currency codes - UN/ECE Rec 20 measurement units - VAT codes (types, categories, exemptions) - SchemeID for identifiers (0002=SIREN, 0009=SIRET, etc.) ## Validation process 1. **XSLT loading**: Schematron file converted to XSLT (Saxon-HE) 2. **Transformation**: Rules applied to XML 3. **Results analysis**: Extraction of errors (`failed-assert`) and warnings (`successful-report`) 4. **Report**: Structured list of non-conformities ## Responses **200 OK**: Compliant XML ```json { \"message\": \"XML is compliant with EN16931 profile\" } ``` **400 Bad Request**: Non-compliant XML ```json { \"detail\": [ \"[BR-1] Invoice total (120.00) does not match calculated sum (100.00 + 20.00)\", \"[FR-1] Supplier SIRET must contain exactly 14 digits\" ] } ``` ## Use cases - **Pre-validation**: Verify XML before PDF/A integration - **Debugging**: Precisely identify generation errors - **Testing**: Validate test or example XMLs - **Compliance**: Ensure European and French rules are met - **Development**: Quick testing without PDF generation ## Processing time - MINIMUM profile: ~0.5 second - EN16931 profile: ~1-2 seconds - EXTENDED profile: ~2-3 seconds
|
|
991
991
|
* @summary Validate an existing Factur-X XML
|
|
992
992
|
* @param {File} xmlFile Factur-X XML file to validate (.xml format).
|
|
993
|
-
* @param {
|
|
993
|
+
* @param {FacturXProfile} [profile] Validation profile (MINIMUM, BASIC, EN16931, EXTENDED).
|
|
994
994
|
* @param {*} [options] Override http request option.
|
|
995
995
|
* @throws {RequiredError}
|
|
996
996
|
*/
|
package/dist/esm/api.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from './api/afnorpdppaapi';
|
|
|
13
13
|
export * from './api/afnorpdppadirectory-service-api';
|
|
14
14
|
export * from './api/afnorpdppaflow-service-api';
|
|
15
15
|
export * from './api/chorus-pro-api';
|
|
16
|
+
export * from './api/document-conversion-api';
|
|
16
17
|
export * from './api/health-api';
|
|
17
18
|
export * from './api/invoice-processing-api';
|
|
18
19
|
export * from './api/pdfxmlverification-api';
|
package/dist/esm/api.js
CHANGED
|
@@ -15,6 +15,7 @@ export * from './api/afnorpdppaapi';
|
|
|
15
15
|
export * from './api/afnorpdppadirectory-service-api';
|
|
16
16
|
export * from './api/afnorpdppaflow-service-api';
|
|
17
17
|
export * from './api/chorus-pro-api';
|
|
18
|
+
export * from './api/document-conversion-api';
|
|
18
19
|
export * from './api/health-api';
|
|
19
20
|
export * from './api/invoice-processing-api';
|
|
20
21
|
export * from './api/pdfxmlverification-api';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FactPulse REST API
|
|
3
|
+
* REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://www.factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://www.factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d \'{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }\' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d \'{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }\' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://www.factpulse.fr/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://www.factpulse.fr/documentation-api/
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Additional supporting document (BG-24). References to external documents or embedded attachments.
|
|
14
|
+
*/
|
|
15
|
+
export interface AdditionalDocument {
|
|
16
|
+
/**
|
|
17
|
+
* Document reference identifier (BT-122).
|
|
18
|
+
*/
|
|
19
|
+
'id': string;
|
|
20
|
+
'type_code'?: string | null;
|
|
21
|
+
'name'?: string | null;
|
|
22
|
+
'uri'?: string | null;
|
|
23
|
+
'reference_type_code'?: string | null;
|
|
24
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* FactPulse REST API
|
|
5
|
+
* REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://www.factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://www.factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d \'{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }\' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d \'{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }\' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://www.factpulse.fr/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://www.factpulse.fr/documentation-api/
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FactPulse REST API
|
|
3
|
+
* REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://www.factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://www.factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d \'{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }\' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d \'{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }\' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://www.factpulse.fr/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://www.factpulse.fr/documentation-api/
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import type { Amount } from './amount';
|
|
13
|
+
import type { BaseAmount } from './base-amount';
|
|
14
|
+
import type { Percentage } from './percentage';
|
|
15
|
+
import type { VatRate } from './vat-rate';
|
|
16
|
+
/**
|
|
17
|
+
* Document-level or line-level allowance/charge. Represents BG-20 (Document level allowances), BG-21 (Document level charges), BG-27 (Invoice line allowances), or BG-28 (Invoice line charges).
|
|
18
|
+
*/
|
|
19
|
+
export interface AllowanceCharge {
|
|
20
|
+
/**
|
|
21
|
+
* True for charge, False for allowance (ChargeIndicator).
|
|
22
|
+
*/
|
|
23
|
+
'is_charge': boolean;
|
|
24
|
+
'amount': Amount;
|
|
25
|
+
'base_amount'?: BaseAmount | null;
|
|
26
|
+
'percentage'?: Percentage | null;
|
|
27
|
+
'reason'?: string | null;
|
|
28
|
+
'reason_code'?: string | null;
|
|
29
|
+
'vat_category'?: string | null;
|
|
30
|
+
'vat_rate'?: VatRate | null;
|
|
31
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* FactPulse REST API
|
|
5
|
+
* REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://www.factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://www.factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d \'{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }\' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d \'{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }\' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://www.factpulse.fr/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://www.factpulse.fr/documentation-api/
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
@@ -10,12 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Sum of all allowances on document level (BT-107).
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
readonly Basic: "BASIC";
|
|
18
|
-
readonly En16931: "EN16931";
|
|
19
|
-
readonly Extended: "EXTENDED";
|
|
20
|
-
};
|
|
21
|
-
export type APIProfile = typeof APIProfile[keyof typeof APIProfile];
|
|
15
|
+
export interface AllowanceTotalAmount {
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* FactPulse REST API
|
|
5
|
+
* REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://www.factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://www.factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d \'{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }\' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d \'{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }\' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://www.factpulse.fr/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://www.factpulse.fr/documentation-api/
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
@@ -10,12 +10,7 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Allowance/charge amount (BT-92/99/136/141).
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
readonly Basic: "BASIC";
|
|
18
|
-
readonly En16931: "EN16931";
|
|
19
|
-
readonly Extended: "EXTENDED";
|
|
20
|
-
};
|
|
21
|
-
export type APIProfile = typeof APIProfile[keyof typeof APIProfile];
|
|
15
|
+
export interface Amount {
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* FactPulse REST API
|
|
5
|
+
* REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://www.factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://www.factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d \'{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }\' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d \'{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }\' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://www.factpulse.fr/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://www.factpulse.fr/documentation-api/
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FactPulse REST API
|
|
3
|
+
* REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://www.factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://www.factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d \'{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }\' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d \'{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }\' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://www.factpulse.fr/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://www.factpulse.fr/documentation-api/
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Base amount for percentage calculation (BT-93/100/137/142).
|
|
14
|
+
*/
|
|
15
|
+
export interface BaseAmount {
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* FactPulse REST API
|
|
5
|
+
* REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://www.factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://www.factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d \'{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }\' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d \'{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }\' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://www.factpulse.fr/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://www.factpulse.fr/documentation-api/
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FactPulse REST API
|
|
3
|
+
* REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://www.factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://www.factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d \'{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }\' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d \'{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }\' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://www.factpulse.fr/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://www.factpulse.fr/documentation-api/
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Sum of all charges on document level (BT-108).
|
|
14
|
+
*/
|
|
15
|
+
export interface ChargeTotalAmount {
|
|
16
|
+
}
|