factpulse 4.4.0 → 4.5.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -7
- data/Gemfile.lock +9 -9
- data/docs/Amount3.md +15 -0
- data/docs/ChorusProDestination.md +1 -1
- data/docs/ClientManagementApi.md +152 -0
- data/docs/CreateCDARRequest.md +5 -1
- data/docs/ElectronicSignatureApi.md +6 -6
- data/docs/EncaisseAmountByRate.md +20 -0
- data/docs/EncaisseeRequest.md +7 -3
- data/docs/FacturXConversionApi.md +2 -2
- data/docs/FacturXPDFXMLVerificationApi.md +4 -4
- data/docs/FacturXValidationApi.md +4 -4
- data/docs/FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.md +15 -0
- data/docs/{ChorusProCredentials.md → FactureElectroniqueRestApiSchemasProcessingChorusProCredentials.md} +2 -2
- data/docs/{ValidationErrorResponse.md → FactureElectroniqueRestApiSchemasValidationValidationErrorResponse.md} +2 -2
- data/docs/Flux10EReportingApi.md +4 -4
- data/docs/Flux6InvoiceLifecycleCDARApi.md +8 -4
- data/docs/InvoiceGenerationApi.md +4 -4
- data/docs/InvoiceInput.md +1 -1
- data/docs/LifecycleResponse.md +9 -1
- data/docs/ParseApi.md +4 -4
- data/docs/PaymentAmountByRate.md +1 -1
- data/docs/SubmitCDARRequest.md +4 -0
- data/docs/SuperPDPVatRegimeResponse.md +20 -0
- data/docs/SuperPDPVatRegimeUpdateRequest.md +20 -0
- data/docs/ValidateCDARRequest.md +3 -1
- data/docs/ValidationApi.md +3 -3
- data/docs/ValidationError.md +5 -1
- data/lib/factpulse/api/client_management_api.rb +137 -0
- data/lib/factpulse/api/electronic_signature_api.rb +6 -6
- data/lib/factpulse/api/factur_x_conversion_api.rb +2 -2
- data/lib/factpulse/api/factur_x_validation_api.rb +4 -4
- data/lib/factpulse/api/factur_xpdfxml_verification_api.rb +4 -4
- data/lib/factpulse/api/flux10_e_reporting_api.rb +4 -4
- data/lib/factpulse/api/flux6_invoice_lifecycle_cdar_api.rb +10 -4
- data/lib/factpulse/api/invoice_generation_api.rb +2 -2
- data/lib/factpulse/api/parse_api.rb +4 -4
- data/lib/factpulse/api/validation_api.rb +4 -4
- data/lib/factpulse/models/amount1.rb +1 -1
- data/lib/factpulse/models/amount2.rb +1 -1
- data/lib/factpulse/models/amount3.rb +104 -0
- data/lib/factpulse/models/chorus_pro_destination.rb +1 -1
- data/lib/factpulse/models/create_cdar_request.rb +56 -4
- data/lib/factpulse/models/encaisse_amount_by_rate.rb +192 -0
- data/lib/factpulse/models/encaisseamount.rb +1 -1
- data/lib/factpulse/models/encaissee_request.rb +43 -24
- data/lib/factpulse/models/facture_electronique_rest_api_schemas_ereporting_invoice_type_code.rb +43 -0
- data/lib/factpulse/models/{chorus_pro_credentials.rb → facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.rb} +3 -3
- data/lib/factpulse/models/{validation_error_response.rb → facture_electronique_rest_api_schemas_validation_validation_error_response.rb} +3 -3
- data/lib/factpulse/models/invoice_input.rb +1 -1
- data/lib/factpulse/models/invoice_type_code.rb +17 -6
- data/lib/factpulse/models/lifecycle_response.rb +48 -4
- data/lib/factpulse/models/payment_amount_by_rate.rb +1 -1
- data/lib/factpulse/models/payment_means.rb +2 -1
- data/lib/factpulse/models/submit_cdar_request.rb +53 -1
- data/lib/factpulse/models/super_pdp_vat_regime_response.rb +195 -0
- data/lib/factpulse/models/super_pdp_vat_regime_update_request.rb +200 -0
- data/lib/factpulse/models/validate_cdar_request.rb +17 -5
- data/lib/factpulse/models/validation_error.rb +23 -4
- data/lib/factpulse/version.rb +1 -1
- data/lib/factpulse.rb +7 -2
- metadata +16 -6
|
@@ -39,7 +39,7 @@ opts = {
|
|
|
39
39
|
profile: FactPulse::APIProfile::MINIMUM, # APIProfile | Factur-X/CII profile: MINIMUM, BASIC, EN16931 or EXTENDED. Ignored when output_format='ubl' (always EN16931).
|
|
40
40
|
output_format: FactPulse::OutputFormat::XML, # OutputFormat | Output format: 'xml' or 'cii' (CII/Factur-X XML), 'ubl' (UBL 2.1 XML), 'pdf' (Factur-X PDF/A-3).
|
|
41
41
|
auto_enrich: true, # Boolean | 🆕 Enable auto-enrichment from SIRET/SIREN (simplified format only)
|
|
42
|
-
source_pdf:
|
|
42
|
+
source_pdf: 'source_pdf_example', # String |
|
|
43
43
|
callback_url: 'callback_url_example', # String |
|
|
44
44
|
webhook_mode: 'webhook_mode_example', # String | Webhook content delivery: 'inline' (base64 in payload) or 'download_url' (temporary URL, 1h TTL)
|
|
45
45
|
skip_br_fr: true # Boolean |
|
|
@@ -80,7 +80,7 @@ end
|
|
|
80
80
|
| **profile** | [**APIProfile**](APIProfile.md) | Factur-X/CII profile: MINIMUM, BASIC, EN16931 or EXTENDED. Ignored when output_format='ubl' (always EN16931). | [optional] |
|
|
81
81
|
| **output_format** | [**OutputFormat**](OutputFormat.md) | Output format: 'xml' or 'cii' (CII/Factur-X XML), 'ubl' (UBL 2.1 XML), 'pdf' (Factur-X PDF/A-3). | [optional] |
|
|
82
82
|
| **auto_enrich** | **Boolean** | 🆕 Enable auto-enrichment from SIRET/SIREN (simplified format only) | [optional][default to true] |
|
|
83
|
-
| **source_pdf** | **
|
|
83
|
+
| **source_pdf** | **String** | | [optional] |
|
|
84
84
|
| **callback_url** | **String** | | [optional] |
|
|
85
85
|
| **webhook_mode** | **String** | Webhook content delivery: 'inline' (base64 in payload) or 'download_url' (temporary URL, 1h TTL) | [optional][default to 'inline'] |
|
|
86
86
|
| **skip_br_fr** | **Boolean** | | [optional] |
|
|
@@ -124,7 +124,7 @@ FactPulse.configure do |config|
|
|
|
124
124
|
end
|
|
125
125
|
|
|
126
126
|
api_instance = FactPulse::InvoiceGenerationApi.new
|
|
127
|
-
submit_complete_invoice_request = FactPulse::SubmitCompleteInvoiceRequest.new({invoice_data: FactPulse::FacturXInvoice.new({invoice_number: 'invoice_number_example', payment_due_date: 'payment_due_date_example', recipient: FactPulse::Recipient.new, supplier: FactPulse::Supplier.new, references: FactPulse::InvoiceReferences.new({payment_means: FactPulse::PaymentMeans::CHEQUE, invoice_type: FactPulse::InvoiceTypeCode::
|
|
127
|
+
submit_complete_invoice_request = FactPulse::SubmitCompleteInvoiceRequest.new({invoice_data: FactPulse::FacturXInvoice.new({invoice_number: 'invoice_number_example', payment_due_date: 'payment_due_date_example', recipient: FactPulse::Recipient.new, supplier: FactPulse::Supplier.new, references: FactPulse::InvoiceReferences.new({payment_means: FactPulse::PaymentMeans::CHEQUE, invoice_type: FactPulse::InvoiceTypeCode::INVOICE, vat_accounting_code: FactPulse::VATAccountingCode::TVA_SUR_DEBIT}), totals: FactPulse::InvoiceTotals.new({total_net_amount: FactPulse::TotalNetAmount.new, vat_amount: FactPulse::TotalVATAmount.new, total_gross_amount: FactPulse::TotalGrossAmount.new, amount_due: FactPulse::AmountDue.new})}), source_pdf: 'source_pdf_example', destination: FactPulse::AFNORDestination.new}) # SubmitCompleteInvoiceRequest |
|
|
128
128
|
opts = {
|
|
129
129
|
organization_id: 'organization_id_example' # String | Organization ID relayed to the PDP (AFNOR XP Z12-013 delegation / multi-tenancy). Required by some PDPs to select the client space.
|
|
130
130
|
}
|
|
@@ -202,7 +202,7 @@ FactPulse.configure do |config|
|
|
|
202
202
|
end
|
|
203
203
|
|
|
204
204
|
api_instance = FactPulse::InvoiceGenerationApi.new
|
|
205
|
-
submit_complete_invoice_request = FactPulse::SubmitCompleteInvoiceRequest.new({invoice_data: FactPulse::FacturXInvoice.new({invoice_number: 'invoice_number_example', payment_due_date: 'payment_due_date_example', recipient: FactPulse::Recipient.new, supplier: FactPulse::Supplier.new, references: FactPulse::InvoiceReferences.new({payment_means: FactPulse::PaymentMeans::CHEQUE, invoice_type: FactPulse::InvoiceTypeCode::
|
|
205
|
+
submit_complete_invoice_request = FactPulse::SubmitCompleteInvoiceRequest.new({invoice_data: FactPulse::FacturXInvoice.new({invoice_number: 'invoice_number_example', payment_due_date: 'payment_due_date_example', recipient: FactPulse::Recipient.new, supplier: FactPulse::Supplier.new, references: FactPulse::InvoiceReferences.new({payment_means: FactPulse::PaymentMeans::CHEQUE, invoice_type: FactPulse::InvoiceTypeCode::INVOICE, vat_accounting_code: FactPulse::VATAccountingCode::TVA_SUR_DEBIT}), totals: FactPulse::InvoiceTotals.new({total_net_amount: FactPulse::TotalNetAmount.new, vat_amount: FactPulse::TotalVATAmount.new, total_gross_amount: FactPulse::TotalGrossAmount.new, amount_due: FactPulse::AmountDue.new})}), source_pdf: 'source_pdf_example', destination: FactPulse::AFNORDestination.new}) # SubmitCompleteInvoiceRequest |
|
|
206
206
|
opts = {
|
|
207
207
|
callback_url: 'callback_url_example', # String | Webhook URL for async notification when submission completes.
|
|
208
208
|
webhook_mode: 'webhook_mode_example', # String | Webhook content delivery: 'inline' (base64 in payload) or 'download_url' (temporary URL, 1h TTL)
|
data/docs/InvoiceInput.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **invoice_id** | **String** | Invoice identifier | |
|
|
8
8
|
| **issue_date** | **Date** | Invoice issue date | |
|
|
9
|
-
| **type_code** | [**
|
|
9
|
+
| **type_code** | [**FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode**](FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.md) | Invoice type code | [optional] |
|
|
10
10
|
| **currency** | [**Currency**](Currency.md) | | [optional] |
|
|
11
11
|
| **due_date** | **Date** | | [optional] |
|
|
12
12
|
| **seller_id** | **String** | | [optional] |
|
data/docs/LifecycleResponse.md
CHANGED
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
| **invoices** | [**Array<InvoiceLifecycle>**](InvoiceLifecycle.md) | Cycles de vie par facture | [optional] |
|
|
8
8
|
| **total_invoices** | **Integer** | Nombre de factures | |
|
|
9
9
|
| **cutoff_days** | **Integer** | Nombre de jours de la fenetre de recherche | |
|
|
10
|
+
| **total_flows** | **Integer** | Nombre de flux de statut (CDAR) lus sur la PA | [optional][default to 0] |
|
|
11
|
+
| **truncated** | **Boolean** | True si la limite de flux lus par appel a ete atteinte : la reponse est incomplete, reduire la fenetre (dateFrom/dateTo ou days) | [optional][default to false] |
|
|
12
|
+
| **date_from** | **String** | | [optional] |
|
|
13
|
+
| **date_to** | **String** | | [optional] |
|
|
10
14
|
|
|
11
15
|
## Example
|
|
12
16
|
|
|
@@ -16,7 +20,11 @@ require 'factpulse'
|
|
|
16
20
|
instance = FactPulse::LifecycleResponse.new(
|
|
17
21
|
invoices: null,
|
|
18
22
|
total_invoices: null,
|
|
19
|
-
cutoff_days: null
|
|
23
|
+
cutoff_days: null,
|
|
24
|
+
total_flows: null,
|
|
25
|
+
truncated: null,
|
|
26
|
+
date_from: null,
|
|
27
|
+
date_to: null
|
|
20
28
|
)
|
|
21
29
|
```
|
|
22
30
|
|
data/docs/ParseApi.md
CHANGED
|
@@ -33,7 +33,7 @@ FactPulse.configure do |config|
|
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
api_instance = FactPulse::ParseApi.new
|
|
36
|
-
file =
|
|
36
|
+
file = 'file_example' # String | Factur-X PDF or XML file to parse
|
|
37
37
|
opts = {
|
|
38
38
|
callback_url: 'callback_url_example' # String |
|
|
39
39
|
}
|
|
@@ -69,7 +69,7 @@ end
|
|
|
69
69
|
|
|
70
70
|
| Name | Type | Description | Notes |
|
|
71
71
|
| ---- | ---- | ----------- | ----- |
|
|
72
|
-
| **file** | **
|
|
72
|
+
| **file** | **String** | Factur-X PDF or XML file to parse | |
|
|
73
73
|
| **callback_url** | **String** | | [optional] |
|
|
74
74
|
|
|
75
75
|
### Return type
|
|
@@ -111,7 +111,7 @@ FactPulse.configure do |config|
|
|
|
111
111
|
end
|
|
112
112
|
|
|
113
113
|
api_instance = FactPulse::ParseApi.new
|
|
114
|
-
file =
|
|
114
|
+
file = 'file_example' # String | Factur-X PDF or XML file to parse
|
|
115
115
|
|
|
116
116
|
begin
|
|
117
117
|
# Parse CII, UBL or Factur-X PDF (sync)
|
|
@@ -144,7 +144,7 @@ end
|
|
|
144
144
|
|
|
145
145
|
| Name | Type | Description | Notes |
|
|
146
146
|
| ---- | ---- | ----------- | ----- |
|
|
147
|
-
| **file** | **
|
|
147
|
+
| **file** | **String** | Factur-X PDF or XML file to parse | |
|
|
148
148
|
|
|
149
149
|
### Return type
|
|
150
150
|
|
data/docs/PaymentAmountByRate.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **rate** | [**Rate**](Rate.md) | | |
|
|
8
|
-
| **amount** | [**
|
|
8
|
+
| **amount** | [**Amount3**](Amount3.md) | | |
|
|
9
9
|
| **amount_eur** | [**Amounteur**](Amounteur.md) | | [optional] |
|
|
10
10
|
|
|
11
11
|
## Example
|
data/docs/SubmitCDARRequest.md
CHANGED
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
| **action_code** | **String** | | [optional] |
|
|
24
24
|
| **encaisse_amount** | [**Encaisseamount**](Encaisseamount.md) | | [optional] |
|
|
25
25
|
| **encaisse_vat_rate** | **Float** | Taux de TVA du montant encaissé en % (MDT-224, requis par BR-FR-CDV-14 pour le statut 212 ; défaut 20) | [optional][default to 20] |
|
|
26
|
+
| **encaisse_amounts_by_rate** | [**Array<EncaisseAmountByRate>**](EncaisseAmountByRate.md) | | [optional] |
|
|
27
|
+
| **comment** | **String** | | [optional] |
|
|
26
28
|
| **flow_type** | **String** | Type de flux AFNOR (CustomerInvoiceLC, SupplierInvoiceLC, etc.) | [optional][default to 'CustomerInvoiceLC'] |
|
|
27
29
|
| **pdp_flow_service_url** | **String** | | [optional] |
|
|
28
30
|
| **pdp_token_url** | **String** | | [optional] |
|
|
@@ -54,6 +56,8 @@ instance = FactPulse::SubmitCDARRequest.new(
|
|
|
54
56
|
action_code: null,
|
|
55
57
|
encaisse_amount: null,
|
|
56
58
|
encaisse_vat_rate: null,
|
|
59
|
+
encaisse_amounts_by_rate: null,
|
|
60
|
+
comment: null,
|
|
57
61
|
flow_type: null,
|
|
58
62
|
pdp_flow_service_url: null,
|
|
59
63
|
pdp_token_url: null,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# FactPulse::SuperPDPVatRegimeResponse
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **vat_regime** | **String** | | [optional] |
|
|
8
|
+
| **has_vat_on_debits** | **Boolean** | Whether VAT on debits is opted for | [optional][default to false] |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'factpulse'
|
|
14
|
+
|
|
15
|
+
instance = FactPulse::SuperPDPVatRegimeResponse.new(
|
|
16
|
+
vat_regime: null,
|
|
17
|
+
has_vat_on_debits: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# FactPulse::SuperPDPVatRegimeUpdateRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **vat_regime** | **String** | monthly (réel normal mensuel), quarterly (réel normal trimestriel), simplified (régime simplifié), vat_exemption (franchise en base) | |
|
|
8
|
+
| **has_vat_on_debits** | **Boolean** | | [optional] |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'factpulse'
|
|
14
|
+
|
|
15
|
+
instance = FactPulse::SuperPDPVatRegimeUpdateRequest.new(
|
|
16
|
+
vat_regime: null,
|
|
17
|
+
has_vat_on_debits: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
data/docs/ValidateCDARRequest.md
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
| **status** | **String** | | [optional] |
|
|
13
13
|
| **reason_code** | **String** | | [optional] |
|
|
14
14
|
| **encaisse_amount** | [**Encaisseamount1**](Encaisseamount1.md) | | [optional] |
|
|
15
|
+
| **encaisse_amounts_by_rate** | [**Array<EncaisseAmountByRate>**](EncaisseAmountByRate.md) | | [optional] |
|
|
15
16
|
|
|
16
17
|
## Example
|
|
17
18
|
|
|
@@ -26,7 +27,8 @@ instance = FactPulse::ValidateCDARRequest.new(
|
|
|
26
27
|
invoice_issue_date: null,
|
|
27
28
|
status: null,
|
|
28
29
|
reason_code: null,
|
|
29
|
-
encaisse_amount: null
|
|
30
|
+
encaisse_amount: null,
|
|
31
|
+
encaisse_amounts_by_rate: null
|
|
30
32
|
)
|
|
31
33
|
```
|
|
32
34
|
|
data/docs/ValidationApi.md
CHANGED
|
@@ -13,7 +13,7 @@ All URIs are relative to *https://factpulse.fr*
|
|
|
13
13
|
|
|
14
14
|
Validate a CII or UBL XML against Schematron rules
|
|
15
15
|
|
|
16
|
-
Validates a CII (Factur-X) or UBL XML file against Schematron business rules. The XML format is **auto-detected** from namespace: - CII XML → validated with EN16931-CII + profile-specific + BR-FR-CII Schematrons - UBL XML → validated with EN16931-UBL + BR-FR-UBL Schematrons ## 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 rules (BR-FR-CII or BR-FR-UBL) - Arithmetic calculations and data consistency ## Profiles and validated rules (CII only) ### 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
|
|
16
|
+
Validates a CII (Factur-X) or UBL XML file against Schematron business rules. The XML format is **auto-detected** from namespace: - CII XML → validated with EN16931-CII + profile-specific + BR-FR-CII Schematrons - UBL XML → validated with EN16931-UBL + BR-FR-UBL Schematrons ## 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 rules (BR-FR-CII or BR-FR-UBL) - Arithmetic calculations and data consistency ## Profiles and validated rules (CII only) ### 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 `failed-assert` and `successful-report`; an unflagged rule is fatal, flagged `warning`/`info` rules are non-blocking 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
|
|
17
17
|
|
|
18
18
|
### Examples
|
|
19
19
|
|
|
@@ -32,7 +32,7 @@ FactPulse.configure do |config|
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
api_instance = FactPulse::ValidationApi.new
|
|
35
|
-
xml_file =
|
|
35
|
+
xml_file = 'xml_file_example' # String | CII (Factur-X) or UBL XML file to validate (.xml format). Format is auto-detected.
|
|
36
36
|
opts = {
|
|
37
37
|
profile: FactPulse::APIProfile::MINIMUM, # APIProfile | Validation profile (MINIMUM, BASIC, EN16931, EXTENDED). Used for CII only; ignored for UBL (always EN16931).
|
|
38
38
|
skip_br_fr: true # Boolean |
|
|
@@ -69,7 +69,7 @@ end
|
|
|
69
69
|
|
|
70
70
|
| Name | Type | Description | Notes |
|
|
71
71
|
| ---- | ---- | ----------- | ----- |
|
|
72
|
-
| **xml_file** | **
|
|
72
|
+
| **xml_file** | **String** | CII (Factur-X) or UBL XML file to validate (.xml format). Format is auto-detected. | |
|
|
73
73
|
| **profile** | [**APIProfile**](APIProfile.md) | Validation profile (MINIMUM, BASIC, EN16931, EXTENDED). Used for CII only; ignored for UBL (always EN16931). | [optional] |
|
|
74
74
|
| **skip_br_fr** | **Boolean** | | [optional] |
|
|
75
75
|
|
data/docs/ValidationError.md
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
| **loc** | [**Array<LocationInner>**](LocationInner.md) | | |
|
|
8
8
|
| **msg** | **String** | | |
|
|
9
9
|
| **type** | **String** | | |
|
|
10
|
+
| **input** | **Object** | | [optional] |
|
|
11
|
+
| **ctx** | **Object** | | [optional] |
|
|
10
12
|
|
|
11
13
|
## Example
|
|
12
14
|
|
|
@@ -16,7 +18,9 @@ require 'factpulse'
|
|
|
16
18
|
instance = FactPulse::ValidationError.new(
|
|
17
19
|
loc: null,
|
|
18
20
|
msg: null,
|
|
19
|
-
type: null
|
|
21
|
+
type: null,
|
|
22
|
+
input: null,
|
|
23
|
+
ctx: null
|
|
20
24
|
)
|
|
21
25
|
```
|
|
22
26
|
|
|
@@ -660,6 +660,69 @@ module FactPulse
|
|
|
660
660
|
return data, status_code, headers
|
|
661
661
|
end
|
|
662
662
|
|
|
663
|
+
# Get the SuperPDP VAT regime
|
|
664
|
+
# Read the VAT regime of the client's company at SuperPDP (`vatRegime` is null when not set). SuperPDP refuses e-reporting (\"The VAT regime needs to be setup at the company level\") until the VAT regime of the company is set: it defines the e-reporting transmission periods, and the Flux 10 file does not carry it. This setting is not part of the AFNOR API; FactPulse sets it with the client's SuperPDP connection. **Scope**: Client level (JWT with client_uid that must match {uid}) **Errors**: - `404 not_connected`: the client has not connected its SuperPDP account - `400 superpdp_error`: SuperPDP refused the request (`superpdp_status`, `message`) - `502`: SuperPDP unreachable, or the SuperPDP connection must be redone
|
|
665
|
+
# @param uid [String] Client unique identifier (UUID)
|
|
666
|
+
# @param [Hash] opts the optional parameters
|
|
667
|
+
# @return [SuperPDPVatRegimeResponse]
|
|
668
|
+
def get_superpdp_vat_regime_api_v1_clients_uid_superpdp_vat_regime_get(uid, opts = {})
|
|
669
|
+
data, _status_code, _headers = get_superpdp_vat_regime_api_v1_clients_uid_superpdp_vat_regime_get_with_http_info(uid, opts)
|
|
670
|
+
data
|
|
671
|
+
end
|
|
672
|
+
|
|
673
|
+
# Get the SuperPDP VAT regime
|
|
674
|
+
# Read the VAT regime of the client's company at SuperPDP (`vatRegime` is null when not set). SuperPDP refuses e-reporting (\"The VAT regime needs to be setup at the company level\") until the VAT regime of the company is set: it defines the e-reporting transmission periods, and the Flux 10 file does not carry it. This setting is not part of the AFNOR API; FactPulse sets it with the client's SuperPDP connection. **Scope**: Client level (JWT with client_uid that must match {uid}) **Errors**: - `404 not_connected`: the client has not connected its SuperPDP account - `400 superpdp_error`: SuperPDP refused the request (`superpdp_status`, `message`) - `502`: SuperPDP unreachable, or the SuperPDP connection must be redone
|
|
675
|
+
# @param uid [String] Client unique identifier (UUID)
|
|
676
|
+
# @param [Hash] opts the optional parameters
|
|
677
|
+
# @return [Array<(SuperPDPVatRegimeResponse, Integer, Hash)>] SuperPDPVatRegimeResponse data, response status code and response headers
|
|
678
|
+
def get_superpdp_vat_regime_api_v1_clients_uid_superpdp_vat_regime_get_with_http_info(uid, opts = {})
|
|
679
|
+
if @api_client.config.debugging
|
|
680
|
+
@api_client.config.logger.debug 'Calling API: ClientManagementApi.get_superpdp_vat_regime_api_v1_clients_uid_superpdp_vat_regime_get ...'
|
|
681
|
+
end
|
|
682
|
+
# verify the required parameter 'uid' is set
|
|
683
|
+
if @api_client.config.client_side_validation && uid.nil?
|
|
684
|
+
fail ArgumentError, "Missing the required parameter 'uid' when calling ClientManagementApi.get_superpdp_vat_regime_api_v1_clients_uid_superpdp_vat_regime_get"
|
|
685
|
+
end
|
|
686
|
+
# resource path
|
|
687
|
+
local_var_path = '/api/v1/clients/{uid}/superpdp/vat-regime'.sub('{' + 'uid' + '}', CGI.escape(uid.to_s))
|
|
688
|
+
|
|
689
|
+
# query parameters
|
|
690
|
+
query_params = opts[:query_params] || {}
|
|
691
|
+
|
|
692
|
+
# header parameters
|
|
693
|
+
header_params = opts[:header_params] || {}
|
|
694
|
+
# HTTP header 'Accept' (if needed)
|
|
695
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
696
|
+
|
|
697
|
+
# form parameters
|
|
698
|
+
form_params = opts[:form_params] || {}
|
|
699
|
+
|
|
700
|
+
# http body (model)
|
|
701
|
+
post_body = opts[:debug_body]
|
|
702
|
+
|
|
703
|
+
# return_type
|
|
704
|
+
return_type = opts[:debug_return_type] || 'SuperPDPVatRegimeResponse'
|
|
705
|
+
|
|
706
|
+
# auth_names
|
|
707
|
+
auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'HTTPBearer']
|
|
708
|
+
|
|
709
|
+
new_options = opts.merge(
|
|
710
|
+
:operation => :"ClientManagementApi.get_superpdp_vat_regime_api_v1_clients_uid_superpdp_vat_regime_get",
|
|
711
|
+
:header_params => header_params,
|
|
712
|
+
:query_params => query_params,
|
|
713
|
+
:form_params => form_params,
|
|
714
|
+
:body => post_body,
|
|
715
|
+
:auth_names => auth_names,
|
|
716
|
+
:return_type => return_type
|
|
717
|
+
)
|
|
718
|
+
|
|
719
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
720
|
+
if @api_client.config.debugging
|
|
721
|
+
@api_client.config.logger.debug "API called: ClientManagementApi#get_superpdp_vat_regime_api_v1_clients_uid_superpdp_vat_regime_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
722
|
+
end
|
|
723
|
+
return data, status_code, headers
|
|
724
|
+
end
|
|
725
|
+
|
|
663
726
|
# Get webhook secret status
|
|
664
727
|
# Check if a webhook secret is configured for a client. **Scope**: Client level (JWT with client_uid that must match {uid}) **Response**: - `hasSecret`: Whether a webhook secret is configured - `createdAt`: When the secret was created (if exists) **Note**: The secret value is never returned, only its status.
|
|
665
728
|
# @param uid [String] Client unique identifier (UUID)
|
|
@@ -1022,5 +1085,79 @@ module FactPulse
|
|
|
1022
1085
|
end
|
|
1023
1086
|
return data, status_code, headers
|
|
1024
1087
|
end
|
|
1088
|
+
|
|
1089
|
+
# Set the SuperPDP VAT regime
|
|
1090
|
+
# Set the VAT regime of the client's company at SuperPDP. When `hasVatOnDebits` is omitted, its current value is kept. SuperPDP refuses e-reporting (\"The VAT regime needs to be setup at the company level\") until the VAT regime of the company is set: it defines the e-reporting transmission periods, and the Flux 10 file does not carry it. This setting is not part of the AFNOR API; FactPulse sets it with the client's SuperPDP connection. **Scope**: Client level (JWT with client_uid that must match {uid}) **Errors**: - `404 not_connected`: the client has not connected its SuperPDP account - `400 superpdp_error`: SuperPDP refused the request (`superpdp_status`, `message`) - `502`: SuperPDP unreachable, or the SuperPDP connection must be redone
|
|
1091
|
+
# @param uid [String] Client unique identifier (UUID)
|
|
1092
|
+
# @param super_pdp_vat_regime_update_request [SuperPDPVatRegimeUpdateRequest]
|
|
1093
|
+
# @param [Hash] opts the optional parameters
|
|
1094
|
+
# @return [SuperPDPVatRegimeResponse]
|
|
1095
|
+
def update_superpdp_vat_regime_api_v1_clients_uid_superpdp_vat_regime_patch(uid, super_pdp_vat_regime_update_request, opts = {})
|
|
1096
|
+
data, _status_code, _headers = update_superpdp_vat_regime_api_v1_clients_uid_superpdp_vat_regime_patch_with_http_info(uid, super_pdp_vat_regime_update_request, opts)
|
|
1097
|
+
data
|
|
1098
|
+
end
|
|
1099
|
+
|
|
1100
|
+
# Set the SuperPDP VAT regime
|
|
1101
|
+
# Set the VAT regime of the client's company at SuperPDP. When `hasVatOnDebits` is omitted, its current value is kept. SuperPDP refuses e-reporting (\"The VAT regime needs to be setup at the company level\") until the VAT regime of the company is set: it defines the e-reporting transmission periods, and the Flux 10 file does not carry it. This setting is not part of the AFNOR API; FactPulse sets it with the client's SuperPDP connection. **Scope**: Client level (JWT with client_uid that must match {uid}) **Errors**: - `404 not_connected`: the client has not connected its SuperPDP account - `400 superpdp_error`: SuperPDP refused the request (`superpdp_status`, `message`) - `502`: SuperPDP unreachable, or the SuperPDP connection must be redone
|
|
1102
|
+
# @param uid [String] Client unique identifier (UUID)
|
|
1103
|
+
# @param super_pdp_vat_regime_update_request [SuperPDPVatRegimeUpdateRequest]
|
|
1104
|
+
# @param [Hash] opts the optional parameters
|
|
1105
|
+
# @return [Array<(SuperPDPVatRegimeResponse, Integer, Hash)>] SuperPDPVatRegimeResponse data, response status code and response headers
|
|
1106
|
+
def update_superpdp_vat_regime_api_v1_clients_uid_superpdp_vat_regime_patch_with_http_info(uid, super_pdp_vat_regime_update_request, opts = {})
|
|
1107
|
+
if @api_client.config.debugging
|
|
1108
|
+
@api_client.config.logger.debug 'Calling API: ClientManagementApi.update_superpdp_vat_regime_api_v1_clients_uid_superpdp_vat_regime_patch ...'
|
|
1109
|
+
end
|
|
1110
|
+
# verify the required parameter 'uid' is set
|
|
1111
|
+
if @api_client.config.client_side_validation && uid.nil?
|
|
1112
|
+
fail ArgumentError, "Missing the required parameter 'uid' when calling ClientManagementApi.update_superpdp_vat_regime_api_v1_clients_uid_superpdp_vat_regime_patch"
|
|
1113
|
+
end
|
|
1114
|
+
# verify the required parameter 'super_pdp_vat_regime_update_request' is set
|
|
1115
|
+
if @api_client.config.client_side_validation && super_pdp_vat_regime_update_request.nil?
|
|
1116
|
+
fail ArgumentError, "Missing the required parameter 'super_pdp_vat_regime_update_request' when calling ClientManagementApi.update_superpdp_vat_regime_api_v1_clients_uid_superpdp_vat_regime_patch"
|
|
1117
|
+
end
|
|
1118
|
+
# resource path
|
|
1119
|
+
local_var_path = '/api/v1/clients/{uid}/superpdp/vat-regime'.sub('{' + 'uid' + '}', CGI.escape(uid.to_s))
|
|
1120
|
+
|
|
1121
|
+
# query parameters
|
|
1122
|
+
query_params = opts[:query_params] || {}
|
|
1123
|
+
|
|
1124
|
+
# header parameters
|
|
1125
|
+
header_params = opts[:header_params] || {}
|
|
1126
|
+
# HTTP header 'Accept' (if needed)
|
|
1127
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
1128
|
+
# HTTP header 'Content-Type'
|
|
1129
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
1130
|
+
if !content_type.nil?
|
|
1131
|
+
header_params['Content-Type'] = content_type
|
|
1132
|
+
end
|
|
1133
|
+
|
|
1134
|
+
# form parameters
|
|
1135
|
+
form_params = opts[:form_params] || {}
|
|
1136
|
+
|
|
1137
|
+
# http body (model)
|
|
1138
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(super_pdp_vat_regime_update_request)
|
|
1139
|
+
|
|
1140
|
+
# return_type
|
|
1141
|
+
return_type = opts[:debug_return_type] || 'SuperPDPVatRegimeResponse'
|
|
1142
|
+
|
|
1143
|
+
# auth_names
|
|
1144
|
+
auth_names = opts[:debug_auth_names] || ['APIKeyHeader', 'HTTPBearer']
|
|
1145
|
+
|
|
1146
|
+
new_options = opts.merge(
|
|
1147
|
+
:operation => :"ClientManagementApi.update_superpdp_vat_regime_api_v1_clients_uid_superpdp_vat_regime_patch",
|
|
1148
|
+
:header_params => header_params,
|
|
1149
|
+
:query_params => query_params,
|
|
1150
|
+
:form_params => form_params,
|
|
1151
|
+
:body => post_body,
|
|
1152
|
+
:auth_names => auth_names,
|
|
1153
|
+
:return_type => return_type
|
|
1154
|
+
)
|
|
1155
|
+
|
|
1156
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
1157
|
+
if @api_client.config.debugging
|
|
1158
|
+
@api_client.config.logger.debug "API called: ClientManagementApi#update_superpdp_vat_regime_api_v1_clients_uid_superpdp_vat_regime_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1159
|
+
end
|
|
1160
|
+
return data, status_code, headers
|
|
1161
|
+
end
|
|
1025
1162
|
end
|
|
1026
1163
|
end
|
|
@@ -89,7 +89,7 @@ module FactPulse
|
|
|
89
89
|
|
|
90
90
|
# Sign a PDF with client's certificate (PAdES-B-LT)
|
|
91
91
|
# Signs an uploaded PDF with the electronic certificate configured for the client (via client_uid from JWT). **Supported standards**: PAdES-B-B, PAdES-B-T (timestamping), PAdES-B-LT (long-term archiving). **eIDAS levels**: SES (self-signed), AdES (commercial CA), QES (PSCO - out of scope). **Security**: Double authentication X-Internal-Secret + JWT Bearer to retrieve the certificate. **⚠️ Legal disclaimer**: Generated signatures are electronic seals as defined by the eIDAS regulation. The level of legal validity depends on the certificate used (SES/AdES/QES). FactPulse does not provide QES qualified certificates - you must obtain a certificate from a PSCO (qualified Trust Service Provider) for maximum legal validity.
|
|
92
|
-
# @param pdf_file [
|
|
92
|
+
# @param pdf_file [String] PDF file to sign (will be processed and returned signed in base64)
|
|
93
93
|
# @param [Hash] opts the optional parameters
|
|
94
94
|
# @option opts [String] :reason
|
|
95
95
|
# @option opts [String] :location
|
|
@@ -105,7 +105,7 @@ module FactPulse
|
|
|
105
105
|
|
|
106
106
|
# Sign a PDF with client's certificate (PAdES-B-LT)
|
|
107
107
|
# Signs an uploaded PDF with the electronic certificate configured for the client (via client_uid from JWT). **Supported standards**: PAdES-B-B, PAdES-B-T (timestamping), PAdES-B-LT (long-term archiving). **eIDAS levels**: SES (self-signed), AdES (commercial CA), QES (PSCO - out of scope). **Security**: Double authentication X-Internal-Secret + JWT Bearer to retrieve the certificate. **⚠️ Legal disclaimer**: Generated signatures are electronic seals as defined by the eIDAS regulation. The level of legal validity depends on the certificate used (SES/AdES/QES). FactPulse does not provide QES qualified certificates - you must obtain a certificate from a PSCO (qualified Trust Service Provider) for maximum legal validity.
|
|
108
|
-
# @param pdf_file [
|
|
108
|
+
# @param pdf_file [String] PDF file to sign (will be processed and returned signed in base64)
|
|
109
109
|
# @param [Hash] opts the optional parameters
|
|
110
110
|
# @option opts [String] :reason
|
|
111
111
|
# @option opts [String] :location
|
|
@@ -176,7 +176,7 @@ module FactPulse
|
|
|
176
176
|
|
|
177
177
|
# Sign a PDF asynchronously (Celery)
|
|
178
178
|
# Signs an uploaded PDF asynchronously via a Celery task. **Difference with /sign-pdf**: - `/sign-pdf`: Synchronous signature (blocking until completion) - `/sign-pdf-async`: Asynchronous signature (returns immediately with task_id) **Async advantages**: - No timeout for large files - No blocking of FastAPI worker - Progress tracking via task_id - Ideal for batch processing **Supported standards**: PAdES-B-B, PAdES-B-T (timestamping), PAdES-B-LT (long-term archiving). **⚠️ Legal disclaimer**: Same as /sign-pdf (see that endpoint's documentation).
|
|
179
|
-
# @param pdf_file [
|
|
179
|
+
# @param pdf_file [String] PDF file to sign (processed asynchronously)
|
|
180
180
|
# @param [Hash] opts the optional parameters
|
|
181
181
|
# @option opts [String] :callback_url
|
|
182
182
|
# @option opts [String] :webhook_mode Webhook content delivery: 'inline' (base64 in payload) or 'download_url' (temporary URL, 1h TTL) (default to 'inline')
|
|
@@ -194,7 +194,7 @@ module FactPulse
|
|
|
194
194
|
|
|
195
195
|
# Sign a PDF asynchronously (Celery)
|
|
196
196
|
# Signs an uploaded PDF asynchronously via a Celery task. **Difference with /sign-pdf**: - `/sign-pdf`: Synchronous signature (blocking until completion) - `/sign-pdf-async`: Asynchronous signature (returns immediately with task_id) **Async advantages**: - No timeout for large files - No blocking of FastAPI worker - Progress tracking via task_id - Ideal for batch processing **Supported standards**: PAdES-B-B, PAdES-B-T (timestamping), PAdES-B-LT (long-term archiving). **⚠️ Legal disclaimer**: Same as /sign-pdf (see that endpoint's documentation).
|
|
197
|
-
# @param pdf_file [
|
|
197
|
+
# @param pdf_file [String] PDF file to sign (processed asynchronously)
|
|
198
198
|
# @param [Hash] opts the optional parameters
|
|
199
199
|
# @option opts [String] :callback_url
|
|
200
200
|
# @option opts [String] :webhook_mode Webhook content delivery: 'inline' (base64 in payload) or 'download_url' (temporary URL, 1h TTL) (default to 'inline')
|
|
@@ -269,7 +269,7 @@ module FactPulse
|
|
|
269
269
|
|
|
270
270
|
# Validate electronic signatures of a PDF
|
|
271
271
|
# Validates electronic signatures present in an uploaded PDF. **Verifications performed**: - Presence of signatures - Document integrity (not modified since signing) - Certificate validity - Chain of trust (if available) - Presence of timestamp (PAdES-B-T) - Validation data (PAdES-B-LT) **Supported standards**: PAdES-B-B, PAdES-B-T, PAdES-B-LT, ISO 32000-2. **⚠️ Note**: This validation is technical (cryptographic integrity). Legal validity depends on the eIDAS level of the certificate (SES/AdES/QES) and the context of use.
|
|
272
|
-
# @param pdf_file [
|
|
272
|
+
# @param pdf_file [String] PDF file to validate (will be analyzed to detect and validate signatures)
|
|
273
273
|
# @param [Hash] opts the optional parameters
|
|
274
274
|
# @return [Object]
|
|
275
275
|
def validate_pdf_signature_endpoint_api_v1_processing_validate_pdf_signature_post(pdf_file, opts = {})
|
|
@@ -279,7 +279,7 @@ module FactPulse
|
|
|
279
279
|
|
|
280
280
|
# Validate electronic signatures of a PDF
|
|
281
281
|
# Validates electronic signatures present in an uploaded PDF. **Verifications performed**: - Presence of signatures - Document integrity (not modified since signing) - Certificate validity - Chain of trust (if available) - Presence of timestamp (PAdES-B-T) - Validation data (PAdES-B-LT) **Supported standards**: PAdES-B-B, PAdES-B-T, PAdES-B-LT, ISO 32000-2. **⚠️ Note**: This validation is technical (cryptographic integrity). Legal validity depends on the eIDAS level of the certificate (SES/AdES/QES) and the context of use.
|
|
282
|
-
# @param pdf_file [
|
|
282
|
+
# @param pdf_file [String] PDF file to validate (will be analyzed to detect and validate signatures)
|
|
283
283
|
# @param [Hash] opts the optional parameters
|
|
284
284
|
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
|
285
285
|
def validate_pdf_signature_endpoint_api_v1_processing_validate_pdf_signature_post_with_http_info(pdf_file, opts = {})
|
|
@@ -21,7 +21,7 @@ module FactPulse
|
|
|
21
21
|
end
|
|
22
22
|
# Convert a document to Factur-X (async mode)
|
|
23
23
|
# Launch an asynchronous conversion via Celery. ## Workflow 1. **Upload**: Document is sent as multipart/form-data 2. **Celery Task**: Task is queued for processing 3. **Callback**: Webhook notification on completion ## Possible responses - **202**: Task accepted, processing - **400**: Invalid file
|
|
24
|
-
# @param file [
|
|
24
|
+
# @param file [String] Document to convert (PDF, DOCX, XLSX, JPG, PNG)
|
|
25
25
|
# @param [Hash] opts the optional parameters
|
|
26
26
|
# @option opts [String] :output Output format: pdf, xml, both (default to 'pdf')
|
|
27
27
|
# @option opts [String] :callback_url
|
|
@@ -34,7 +34,7 @@ module FactPulse
|
|
|
34
34
|
|
|
35
35
|
# Convert a document to Factur-X (async mode)
|
|
36
36
|
# Launch an asynchronous conversion via Celery. ## Workflow 1. **Upload**: Document is sent as multipart/form-data 2. **Celery Task**: Task is queued for processing 3. **Callback**: Webhook notification on completion ## Possible responses - **202**: Task accepted, processing - **400**: Invalid file
|
|
37
|
-
# @param file [
|
|
37
|
+
# @param file [String] Document to convert (PDF, DOCX, XLSX, JPG, PNG)
|
|
38
38
|
# @param [Hash] opts the optional parameters
|
|
39
39
|
# @option opts [String] :output Output format: pdf, xml, both (default to 'pdf')
|
|
40
40
|
# @option opts [String] :callback_url
|
|
@@ -21,7 +21,7 @@ module FactPulse
|
|
|
21
21
|
end
|
|
22
22
|
# Validate a complete Factur-X PDF
|
|
23
23
|
# 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)
|
|
24
|
-
# @param pdf_file [
|
|
24
|
+
# @param pdf_file [String] Factur-X PDF file to validate (.pdf format).
|
|
25
25
|
# @param [Hash] opts the optional parameters
|
|
26
26
|
# @option opts [APIProfile] :profile
|
|
27
27
|
# @option opts [Boolean] :use_verapdf Enable strict PDF/A validation with VeraPDF (recommended for production). If False, uses basic metadata validation. (default to false)
|
|
@@ -34,7 +34,7 @@ module FactPulse
|
|
|
34
34
|
|
|
35
35
|
# Validate a complete Factur-X PDF
|
|
36
36
|
# 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)
|
|
37
|
-
# @param pdf_file [
|
|
37
|
+
# @param pdf_file [String] Factur-X PDF file to validate (.pdf format).
|
|
38
38
|
# @param [Hash] opts the optional parameters
|
|
39
39
|
# @option opts [APIProfile] :profile
|
|
40
40
|
# @option opts [Boolean] :use_verapdf Enable strict PDF/A validation with VeraPDF (recommended for production). If False, uses basic metadata validation. (default to false)
|
|
@@ -99,7 +99,7 @@ module FactPulse
|
|
|
99
99
|
|
|
100
100
|
# Validate a Factur-X PDF (asynchronous with polling)
|
|
101
101
|
# 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 ## Webhook notification (recommended) Instead of polling, you can receive a webhook notification when validation completes: ``` callback_url=https://your-server.com/webhook webhook_mode=download_url # Optional: get download URL instead of base64 ``` The webhook will POST a JSON payload with: - `event_type`: `validation.completed` or `validation.failed` - `data.is_compliant`: Whether the PDF is Factur-X compliant - `data.detected_profile`: The detected Factur-X profile - `X-Webhook-Signature` header for HMAC verification ## 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
|
|
102
|
-
# @param pdf_file [
|
|
102
|
+
# @param pdf_file [String] Factur-X PDF file to validate (.pdf format).
|
|
103
103
|
# @param [Hash] opts the optional parameters
|
|
104
104
|
# @option opts [APIProfile] :profile
|
|
105
105
|
# @option opts [Boolean] :use_verapdf Enable strict PDF/A validation with VeraPDF (recommended for production). May take several seconds. (default to false)
|
|
@@ -113,7 +113,7 @@ module FactPulse
|
|
|
113
113
|
|
|
114
114
|
# Validate a Factur-X PDF (asynchronous with polling)
|
|
115
115
|
# 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 ## Webhook notification (recommended) Instead of polling, you can receive a webhook notification when validation completes: ``` callback_url=https://your-server.com/webhook webhook_mode=download_url # Optional: get download URL instead of base64 ``` The webhook will POST a JSON payload with: - `event_type`: `validation.completed` or `validation.failed` - `data.is_compliant`: Whether the PDF is Factur-X compliant - `data.detected_profile`: The detected Factur-X profile - `X-Webhook-Signature` header for HMAC verification ## 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
|
|
116
|
-
# @param pdf_file [
|
|
116
|
+
# @param pdf_file [String] Factur-X PDF file to validate (.pdf format).
|
|
117
117
|
# @param [Hash] opts the optional parameters
|
|
118
118
|
# @option opts [APIProfile] :profile
|
|
119
119
|
# @option opts [Boolean] :use_verapdf Enable strict PDF/A validation with VeraPDF (recommended for production). May take several seconds. (default to false)
|
|
@@ -147,7 +147,7 @@ module FactPulse
|
|
|
147
147
|
|
|
148
148
|
# Verify PDF/XML Factur-X compliance (asynchronous)
|
|
149
149
|
# Verifies PDF/XML Factur-X compliance asynchronously. **IMPORTANT**: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will return a `NOT_FACTURX` error in the result. This version uses a Celery task and can call the OCR service if the PDF is an image or if `force_ocr=true`. **Returns immediately** a task ID. Use `/verify-async/{task_id}/status` to retrieve the result. **Verification principle (Factur-X 1.08):** - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF **Verified fields:** - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency **Advantages over synchronous version:** - OCR support for image PDFs (via DocTR service) - Longer timeout for large documents - Doesn't block the server ## Webhook notification (recommended) Instead of polling, you can receive a webhook notification when verification completes: ``` callback_url=https://your-server.com/webhook ``` The webhook will POST a JSON payload with: - `event_type`: `verification.completed` or `verification.failed` - `data.is_compliant`: Whether the PDF/XML are consistent - `data.compliance_score`: Compliance score (0-1) - `X-Webhook-Signature` header for HMAC verification
|
|
150
|
-
# @param pdf_file [
|
|
150
|
+
# @param pdf_file [String] Factur-X PDF file to verify
|
|
151
151
|
# @param [Hash] opts the optional parameters
|
|
152
152
|
# @option opts [Boolean] :force_ocr Force OCR usage even if PDF contains native text (default to false)
|
|
153
153
|
# @option opts [String] :callback_url
|
|
@@ -160,7 +160,7 @@ module FactPulse
|
|
|
160
160
|
|
|
161
161
|
# Verify PDF/XML Factur-X compliance (asynchronous)
|
|
162
162
|
# Verifies PDF/XML Factur-X compliance asynchronously. **IMPORTANT**: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will return a `NOT_FACTURX` error in the result. This version uses a Celery task and can call the OCR service if the PDF is an image or if `force_ocr=true`. **Returns immediately** a task ID. Use `/verify-async/{task_id}/status` to retrieve the result. **Verification principle (Factur-X 1.08):** - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF **Verified fields:** - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency **Advantages over synchronous version:** - OCR support for image PDFs (via DocTR service) - Longer timeout for large documents - Doesn't block the server ## Webhook notification (recommended) Instead of polling, you can receive a webhook notification when verification completes: ``` callback_url=https://your-server.com/webhook ``` The webhook will POST a JSON payload with: - `event_type`: `verification.completed` or `verification.failed` - `data.is_compliant`: Whether the PDF/XML are consistent - `data.compliance_score`: Compliance score (0-1) - `X-Webhook-Signature` header for HMAC verification
|
|
163
|
-
# @param pdf_file [
|
|
163
|
+
# @param pdf_file [String] Factur-X PDF file to verify
|
|
164
164
|
# @param [Hash] opts the optional parameters
|
|
165
165
|
# @option opts [Boolean] :force_ocr Force OCR usage even if PDF contains native text (default to false)
|
|
166
166
|
# @option opts [String] :callback_url
|
|
@@ -225,7 +225,7 @@ module FactPulse
|
|
|
225
225
|
|
|
226
226
|
# Verify PDF/XML Factur-X compliance (synchronous)
|
|
227
227
|
# Verifies compliance between the PDF and its embedded Factur-X XML. **IMPORTANT**: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will be rejected with a 400 error. This synchronous version uses only native PDF extraction (pdfplumber). For image PDFs requiring OCR, use the `/verify-async` endpoint. **Verification principle (Factur-X 1.08):** - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF **Verified fields:** - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency
|
|
228
|
-
# @param pdf_file [
|
|
228
|
+
# @param pdf_file [String] Factur-X PDF file to verify
|
|
229
229
|
# @param [Hash] opts the optional parameters
|
|
230
230
|
# @return [VerificationSuccessResponse]
|
|
231
231
|
def verify_pdf_sync_api_v1_verification_verify_post(pdf_file, opts = {})
|
|
@@ -235,7 +235,7 @@ module FactPulse
|
|
|
235
235
|
|
|
236
236
|
# Verify PDF/XML Factur-X compliance (synchronous)
|
|
237
237
|
# Verifies compliance between the PDF and its embedded Factur-X XML. **IMPORTANT**: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will be rejected with a 400 error. This synchronous version uses only native PDF extraction (pdfplumber). For image PDFs requiring OCR, use the `/verify-async` endpoint. **Verification principle (Factur-X 1.08):** - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF **Verified fields:** - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency
|
|
238
|
-
# @param pdf_file [
|
|
238
|
+
# @param pdf_file [String] Factur-X PDF file to verify
|
|
239
239
|
# @param [Hash] opts the optional parameters
|
|
240
240
|
# @return [Array<(VerificationSuccessResponse, Integer, Hash)>] VerificationSuccessResponse data, response status code and response headers
|
|
241
241
|
def verify_pdf_sync_api_v1_verification_verify_post_with_http_info(pdf_file, opts = {})
|