factpulse 2.0.37__py3-none-any.whl → 3.0.7__py3-none-any.whl
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.
Potentially problematic release.
This version of factpulse might be problematic. Click here for more details.
- factpulse/__init__.py +265 -197
- factpulse/api/__init__.py +5 -4
- factpulse/api/afnorpdppa_api.py +34 -34
- factpulse/api/afnorpdppa_directory_service_api.py +59 -59
- factpulse/api/afnorpdppa_flow_service_api.py +23 -23
- factpulse/api/chorus_pro_api.py +211 -211
- factpulse/api/document_conversion_api.py +1506 -0
- factpulse/api/{sant_api.py → health_api.py} +22 -22
- factpulse/api/invoice_processing_api.py +3437 -0
- factpulse/api/{vrification_pdfxml_api.py → pdfxml_verification_api.py} +240 -240
- factpulse/api/{utilisateur_api.py → user_api.py} +17 -17
- factpulse/api_client.py +3 -3
- factpulse/configuration.py +3 -3
- factpulse/exceptions.py +2 -2
- factpulse/models/__init__.py +128 -95
- factpulse/models/acknowledgment_status.py +38 -0
- factpulse/models/additional_document.py +115 -0
- factpulse/models/afnor_credentials.py +106 -0
- factpulse/models/afnor_destination.py +127 -0
- factpulse/models/afnor_health_check_response.py +91 -0
- factpulse/models/afnor_result.py +105 -0
- factpulse/models/allowance_charge.py +147 -0
- factpulse/models/allowance_reason_code.py +42 -0
- factpulse/models/allowance_total_amount.py +145 -0
- factpulse/models/amount.py +139 -0
- factpulse/models/amount_due.py +139 -0
- factpulse/models/api_error.py +5 -5
- factpulse/models/async_task_status.py +97 -0
- factpulse/models/base_amount.py +145 -0
- factpulse/models/bounding_box_schema.py +10 -10
- factpulse/models/celery_status.py +40 -0
- factpulse/models/certificate_info_response.py +24 -24
- factpulse/models/charge_total_amount.py +145 -0
- factpulse/models/chorus_pro_destination.py +108 -0
- factpulse/models/chorus_pro_result.py +101 -0
- factpulse/models/contact.py +113 -0
- factpulse/models/convert_error_response.py +105 -0
- factpulse/models/convert_pending_input_response.py +114 -0
- factpulse/models/convert_resume_request.py +87 -0
- factpulse/models/convert_success_response.py +126 -0
- factpulse/models/convert_validation_failed_response.py +120 -0
- factpulse/models/delivery_party.py +121 -0
- factpulse/models/destination.py +27 -27
- factpulse/models/document_type_info.py +91 -0
- factpulse/models/electronic_address.py +90 -0
- factpulse/models/enriched_invoice_info.py +133 -0
- factpulse/models/error_level.py +2 -2
- factpulse/models/error_source.py +2 -2
- factpulse/models/extraction_info.py +93 -0
- factpulse/models/factur_x_invoice.py +320 -0
- factpulse/models/factur_x_profile.py +39 -0
- factpulse/models/factur_xpdf_info.py +91 -0
- factpulse/models/facture_electronique_rest_api_schemas_chorus_pro_chorus_pro_credentials.py +95 -0
- factpulse/models/facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.py +115 -0
- factpulse/models/field_status.py +40 -0
- factpulse/models/file_info.py +94 -0
- factpulse/models/files_info.py +106 -0
- factpulse/models/flow_direction.py +37 -0
- factpulse/models/flow_profile.py +38 -0
- factpulse/models/flow_summary.py +131 -0
- factpulse/models/flow_syntax.py +40 -0
- factpulse/models/flow_type.py +40 -0
- factpulse/models/generate_certificate_request.py +26 -26
- factpulse/models/generate_certificate_response.py +15 -15
- factpulse/models/get_chorus_pro_id_request.py +100 -0
- factpulse/models/get_chorus_pro_id_response.py +98 -0
- factpulse/models/get_invoice_request.py +98 -0
- factpulse/models/get_invoice_response.py +142 -0
- factpulse/models/get_structure_request.py +100 -0
- factpulse/models/get_structure_response.py +142 -0
- factpulse/models/global_allowance_amount.py +139 -0
- factpulse/models/gross_unit_price.py +145 -0
- factpulse/models/http_validation_error.py +2 -2
- factpulse/models/incoming_invoice.py +196 -0
- factpulse/models/incoming_supplier.py +144 -0
- factpulse/models/invoice_format.py +38 -0
- factpulse/models/invoice_line.py +354 -0
- factpulse/models/invoice_line_allowance_amount.py +145 -0
- factpulse/models/invoice_note.py +94 -0
- factpulse/models/invoice_references.py +194 -0
- factpulse/models/invoice_status.py +96 -0
- factpulse/models/invoice_totals.py +177 -0
- factpulse/models/invoice_totals_prepayment.py +145 -0
- factpulse/models/invoice_type_code.py +51 -0
- factpulse/models/invoicing_framework.py +110 -0
- factpulse/models/invoicing_framework_code.py +39 -0
- factpulse/models/line_net_amount.py +145 -0
- factpulse/models/line_total_amount.py +145 -0
- factpulse/models/mandatory_note_schema.py +124 -0
- factpulse/models/manual_rate.py +139 -0
- factpulse/models/manual_vat_rate.py +139 -0
- factpulse/models/missing_field.py +107 -0
- factpulse/models/operation_nature.py +49 -0
- factpulse/models/output_format.py +37 -0
- factpulse/models/page_dimensions_schema.py +89 -0
- factpulse/models/payee.py +168 -0
- factpulse/models/payment_card.py +99 -0
- factpulse/models/payment_means.py +41 -0
- factpulse/models/pdf_validation_result_api.py +169 -0
- factpulse/models/pdp_credentials.py +15 -15
- factpulse/models/percentage.py +145 -0
- factpulse/models/postal_address.py +134 -0
- factpulse/models/price_allowance_amount.py +145 -0
- factpulse/models/price_basis_quantity.py +145 -0
- factpulse/models/processing_options.py +94 -0
- factpulse/models/product_characteristic.py +89 -0
- factpulse/models/product_classification.py +101 -0
- factpulse/models/quantity.py +139 -0
- factpulse/models/recipient.py +167 -0
- factpulse/models/rounding_amount.py +145 -0
- factpulse/models/scheme_id.py +10 -4
- factpulse/models/search_flow_request.py +143 -0
- factpulse/models/search_flow_response.py +101 -0
- factpulse/models/search_services_response.py +101 -0
- factpulse/models/search_structure_request.py +119 -0
- factpulse/models/search_structure_response.py +101 -0
- factpulse/models/signature_info.py +6 -6
- factpulse/models/signature_info_api.py +122 -0
- factpulse/models/signature_parameters.py +133 -0
- factpulse/models/simplified_invoice_data.py +124 -0
- factpulse/models/structure_info.py +14 -14
- factpulse/models/structure_parameters.py +91 -0
- factpulse/models/structure_service.py +93 -0
- factpulse/models/submission_mode.py +38 -0
- factpulse/models/submit_complete_invoice_request.py +116 -0
- factpulse/models/submit_complete_invoice_response.py +145 -0
- factpulse/models/submit_flow_request.py +123 -0
- factpulse/models/submit_flow_response.py +109 -0
- factpulse/models/submit_gross_amount.py +139 -0
- factpulse/models/submit_invoice_request.py +176 -0
- factpulse/models/submit_invoice_response.py +103 -0
- factpulse/models/submit_net_amount.py +139 -0
- factpulse/models/submit_vat_amount.py +139 -0
- factpulse/models/supplementary_attachment.py +95 -0
- factpulse/models/supplier.py +225 -0
- factpulse/models/task_response.py +87 -0
- factpulse/models/tax_representative.py +95 -0
- factpulse/models/taxable_amount.py +139 -0
- factpulse/models/total_gross_amount.py +139 -0
- factpulse/models/total_net_amount.py +139 -0
- factpulse/models/total_vat_amount.py +139 -0
- factpulse/models/unit_net_price.py +139 -0
- factpulse/models/unit_of_measure.py +41 -0
- factpulse/models/validation_error.py +2 -2
- factpulse/models/validation_error_detail.py +6 -6
- factpulse/models/validation_error_loc_inner.py +2 -2
- factpulse/models/validation_error_response.py +87 -0
- factpulse/models/validation_info.py +105 -0
- factpulse/models/validation_success_response.py +87 -0
- factpulse/models/vat_accounting_code.py +39 -0
- factpulse/models/vat_amount.py +139 -0
- factpulse/models/vat_category.py +44 -0
- factpulse/models/vat_line.py +140 -0
- factpulse/models/vat_point_date_code.py +38 -0
- factpulse/models/vat_rate.py +145 -0
- factpulse/models/verification_success_response.py +135 -0
- factpulse/models/verified_field_schema.py +129 -0
- factpulse/rest.py +2 -2
- factpulse-3.0.7.dist-info/METADATA +292 -0
- factpulse-3.0.7.dist-info/RECORD +168 -0
- factpulse_helpers/__init__.py +34 -34
- factpulse_helpers/client.py +1019 -795
- factpulse_helpers/exceptions.py +68 -68
- factpulse/api/traitement_facture_api.py +0 -3437
- factpulse/models/adresse_electronique.py +0 -90
- factpulse/models/adresse_postale.py +0 -120
- factpulse/models/cadre_de_facturation.py +0 -110
- factpulse/models/categorie_tva.py +0 -44
- factpulse/models/champ_verifie_schema.py +0 -129
- factpulse/models/chorus_pro_credentials.py +0 -95
- factpulse/models/code_cadre_facturation.py +0 -39
- factpulse/models/code_raison_reduction.py +0 -42
- factpulse/models/consulter_facture_request.py +0 -98
- factpulse/models/consulter_facture_response.py +0 -142
- factpulse/models/consulter_structure_request.py +0 -100
- factpulse/models/consulter_structure_response.py +0 -142
- factpulse/models/credentials_afnor.py +0 -106
- factpulse/models/credentials_chorus_pro.py +0 -115
- factpulse/models/destinataire.py +0 -130
- factpulse/models/destination_afnor.py +0 -127
- factpulse/models/destination_chorus_pro.py +0 -108
- factpulse/models/dimension_page_schema.py +0 -89
- factpulse/models/direction_flux.py +0 -37
- factpulse/models/donnees_facture_simplifiees.py +0 -124
- factpulse/models/facture_enrichie_info.py +0 -133
- factpulse/models/facture_entrante.py +0 -196
- factpulse/models/facture_factur_x.py +0 -183
- factpulse/models/flux_resume.py +0 -131
- factpulse/models/format_facture.py +0 -38
- factpulse/models/format_sortie.py +0 -37
- factpulse/models/fournisseur.py +0 -153
- factpulse/models/fournisseur_entrant.py +0 -144
- factpulse/models/information_signature_api.py +0 -122
- factpulse/models/ligne_de_poste.py +0 -183
- factpulse/models/ligne_de_poste_montant_remise_ht.py +0 -145
- factpulse/models/ligne_de_poste_taux_tva_manuel.py +0 -145
- factpulse/models/ligne_de_tva.py +0 -132
- factpulse/models/mode_depot.py +0 -38
- factpulse/models/mode_paiement.py +0 -41
- factpulse/models/montant_a_payer.py +0 -139
- factpulse/models/montant_base_ht.py +0 -139
- factpulse/models/montant_ht_total.py +0 -139
- factpulse/models/montant_remise_globale_ttc.py +0 -139
- factpulse/models/montant_total.py +0 -133
- factpulse/models/montant_total_acompte.py +0 -145
- factpulse/models/montant_total_ligne_ht.py +0 -139
- factpulse/models/montant_ttc_total.py +0 -139
- factpulse/models/montant_tva.py +0 -139
- factpulse/models/montant_tva_ligne.py +0 -139
- factpulse/models/montant_tva_total.py +0 -139
- factpulse/models/montant_unitaire_ht.py +0 -139
- factpulse/models/nature_operation.py +0 -49
- factpulse/models/note.py +0 -94
- factpulse/models/note_obligatoire_schema.py +0 -124
- factpulse/models/obtenir_id_chorus_pro_request.py +0 -100
- factpulse/models/obtenir_id_chorus_pro_response.py +0 -98
- factpulse/models/options_processing.py +0 -94
- factpulse/models/parametres_signature.py +0 -133
- factpulse/models/parametres_structure.py +0 -91
- factpulse/models/pdf_factur_x_info.py +0 -91
- factpulse/models/piece_jointe_complementaire.py +0 -95
- factpulse/models/profil_api.py +0 -39
- factpulse/models/profil_flux.py +0 -38
- factpulse/models/quantite.py +0 -139
- factpulse/models/rechercher_services_response.py +0 -101
- factpulse/models/rechercher_structure_request.py +0 -119
- factpulse/models/rechercher_structure_response.py +0 -101
- factpulse/models/references.py +0 -124
- factpulse/models/reponse_healthcheck_afnor.py +0 -91
- factpulse/models/reponse_recherche_flux.py +0 -101
- factpulse/models/reponse_soumission_flux.py +0 -109
- factpulse/models/reponse_tache.py +0 -87
- factpulse/models/reponse_validation_erreur.py +0 -87
- factpulse/models/reponse_validation_succes.py +0 -87
- factpulse/models/reponse_verification_succes.py +0 -135
- factpulse/models/requete_recherche_flux.py +0 -143
- factpulse/models/requete_soumission_flux.py +0 -123
- factpulse/models/resultat_afnor.py +0 -105
- factpulse/models/resultat_chorus_pro.py +0 -101
- factpulse/models/resultat_validation_pdfapi.py +0 -169
- factpulse/models/service_structure.py +0 -93
- factpulse/models/soumettre_facture_complete_request.py +0 -116
- factpulse/models/soumettre_facture_complete_response.py +0 -145
- factpulse/models/soumettre_facture_request.py +0 -176
- factpulse/models/soumettre_facture_response.py +0 -103
- factpulse/models/statut_acquittement.py +0 -38
- factpulse/models/statut_celery.py +0 -40
- factpulse/models/statut_champ_api.py +0 -40
- factpulse/models/statut_facture.py +0 -96
- factpulse/models/statut_tache.py +0 -97
- factpulse/models/syntaxe_flux.py +0 -40
- factpulse/models/tauxmanuel.py +0 -139
- factpulse/models/type_document.py +0 -40
- factpulse/models/type_facture.py +0 -37
- factpulse/models/type_flux.py +0 -40
- factpulse/models/type_tva.py +0 -39
- factpulse/models/unite.py +0 -41
- factpulse-2.0.37.dist-info/METADATA +0 -292
- factpulse-2.0.37.dist-info/RECORD +0 -134
- {factpulse-2.0.37.dist-info → factpulse-3.0.7.dist-info}/WHEEL +0 -0
- {factpulse-2.0.37.dist-info → factpulse-3.0.7.dist-info}/licenses/LICENSE +0 -0
- {factpulse-2.0.37.dist-info → factpulse-3.0.7.dist-info}/top_level.txt +0 -0
factpulse/models/__init__.py
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# flake8: noqa
|
|
4
4
|
"""
|
|
5
|
-
|
|
5
|
+
FactPulse REST API
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
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/
|
|
8
8
|
|
|
9
9
|
The version of the OpenAPI document: 1.0.0
|
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
@@ -13,113 +13,146 @@
|
|
|
13
13
|
""" # noqa: E501
|
|
14
14
|
|
|
15
15
|
# import models into model package
|
|
16
|
+
from factpulse.models.afnor_credentials import AFNORCredentials
|
|
17
|
+
from factpulse.models.afnor_destination import AFNORDestination
|
|
18
|
+
from factpulse.models.afnor_health_check_response import AFNORHealthCheckResponse
|
|
19
|
+
from factpulse.models.afnor_result import AFNORResult
|
|
16
20
|
from factpulse.models.api_error import APIError
|
|
17
|
-
from factpulse.models.
|
|
18
|
-
from factpulse.models.
|
|
21
|
+
from factpulse.models.acknowledgment_status import AcknowledgmentStatus
|
|
22
|
+
from factpulse.models.additional_document import AdditionalDocument
|
|
23
|
+
from factpulse.models.allowance_charge import AllowanceCharge
|
|
24
|
+
from factpulse.models.allowance_reason_code import AllowanceReasonCode
|
|
25
|
+
from factpulse.models.allowance_total_amount import AllowanceTotalAmount
|
|
26
|
+
from factpulse.models.amount import Amount
|
|
27
|
+
from factpulse.models.amount_due import AmountDue
|
|
28
|
+
from factpulse.models.async_task_status import AsyncTaskStatus
|
|
29
|
+
from factpulse.models.base_amount import BaseAmount
|
|
19
30
|
from factpulse.models.bounding_box_schema import BoundingBoxSchema
|
|
20
|
-
from factpulse.models.
|
|
21
|
-
from factpulse.models.categorie_tva import CategorieTVA
|
|
31
|
+
from factpulse.models.celery_status import CeleryStatus
|
|
22
32
|
from factpulse.models.certificate_info_response import CertificateInfoResponse
|
|
23
|
-
from factpulse.models.
|
|
24
|
-
from factpulse.models.
|
|
25
|
-
from factpulse.models.
|
|
26
|
-
from factpulse.models.
|
|
27
|
-
from factpulse.models.
|
|
28
|
-
from factpulse.models.
|
|
29
|
-
from factpulse.models.
|
|
30
|
-
from factpulse.models.
|
|
31
|
-
from factpulse.models.
|
|
32
|
-
from factpulse.models.
|
|
33
|
-
from factpulse.models.destinataire import Destinataire
|
|
33
|
+
from factpulse.models.charge_total_amount import ChargeTotalAmount
|
|
34
|
+
from factpulse.models.chorus_pro_destination import ChorusProDestination
|
|
35
|
+
from factpulse.models.chorus_pro_result import ChorusProResult
|
|
36
|
+
from factpulse.models.contact import Contact
|
|
37
|
+
from factpulse.models.convert_error_response import ConvertErrorResponse
|
|
38
|
+
from factpulse.models.convert_pending_input_response import ConvertPendingInputResponse
|
|
39
|
+
from factpulse.models.convert_resume_request import ConvertResumeRequest
|
|
40
|
+
from factpulse.models.convert_success_response import ConvertSuccessResponse
|
|
41
|
+
from factpulse.models.convert_validation_failed_response import ConvertValidationFailedResponse
|
|
42
|
+
from factpulse.models.delivery_party import DeliveryParty
|
|
34
43
|
from factpulse.models.destination import Destination
|
|
35
|
-
from factpulse.models.
|
|
36
|
-
from factpulse.models.
|
|
37
|
-
from factpulse.models.
|
|
38
|
-
from factpulse.models.direction_flux import DirectionFlux
|
|
39
|
-
from factpulse.models.donnees_facture_simplifiees import DonneesFactureSimplifiees
|
|
44
|
+
from factpulse.models.document_type_info import DocumentTypeInfo
|
|
45
|
+
from factpulse.models.electronic_address import ElectronicAddress
|
|
46
|
+
from factpulse.models.enriched_invoice_info import EnrichedInvoiceInfo
|
|
40
47
|
from factpulse.models.error_level import ErrorLevel
|
|
41
48
|
from factpulse.models.error_source import ErrorSource
|
|
42
|
-
from factpulse.models.
|
|
43
|
-
from factpulse.models.
|
|
44
|
-
from factpulse.models.
|
|
45
|
-
from factpulse.models.
|
|
46
|
-
from factpulse.models.
|
|
47
|
-
from factpulse.models.
|
|
48
|
-
from factpulse.models.
|
|
49
|
-
from factpulse.models.
|
|
49
|
+
from factpulse.models.extraction_info import ExtractionInfo
|
|
50
|
+
from factpulse.models.factur_x_invoice import FacturXInvoice
|
|
51
|
+
from factpulse.models.factur_xpdf_info import FacturXPDFInfo
|
|
52
|
+
from factpulse.models.factur_x_profile import FacturXProfile
|
|
53
|
+
from factpulse.models.facture_electronique_rest_api_schemas_chorus_pro_chorus_pro_credentials import FactureElectroniqueRestApiSchemasChorusProChorusProCredentials
|
|
54
|
+
from factpulse.models.facture_electronique_rest_api_schemas_processing_chorus_pro_credentials import FactureElectroniqueRestApiSchemasProcessingChorusProCredentials
|
|
55
|
+
from factpulse.models.field_status import FieldStatus
|
|
56
|
+
from factpulse.models.file_info import FileInfo
|
|
57
|
+
from factpulse.models.files_info import FilesInfo
|
|
58
|
+
from factpulse.models.flow_direction import FlowDirection
|
|
59
|
+
from factpulse.models.flow_profile import FlowProfile
|
|
60
|
+
from factpulse.models.flow_summary import FlowSummary
|
|
61
|
+
from factpulse.models.flow_syntax import FlowSyntax
|
|
62
|
+
from factpulse.models.flow_type import FlowType
|
|
50
63
|
from factpulse.models.generate_certificate_request import GenerateCertificateRequest
|
|
51
64
|
from factpulse.models.generate_certificate_response import GenerateCertificateResponse
|
|
65
|
+
from factpulse.models.get_chorus_pro_id_request import GetChorusProIdRequest
|
|
66
|
+
from factpulse.models.get_chorus_pro_id_response import GetChorusProIdResponse
|
|
67
|
+
from factpulse.models.get_invoice_request import GetInvoiceRequest
|
|
68
|
+
from factpulse.models.get_invoice_response import GetInvoiceResponse
|
|
69
|
+
from factpulse.models.get_structure_request import GetStructureRequest
|
|
70
|
+
from factpulse.models.get_structure_response import GetStructureResponse
|
|
71
|
+
from factpulse.models.global_allowance_amount import GlobalAllowanceAmount
|
|
72
|
+
from factpulse.models.gross_unit_price import GrossUnitPrice
|
|
52
73
|
from factpulse.models.http_validation_error import HTTPValidationError
|
|
53
|
-
from factpulse.models.
|
|
54
|
-
from factpulse.models.
|
|
55
|
-
from factpulse.models.
|
|
56
|
-
from factpulse.models.
|
|
57
|
-
from factpulse.models.
|
|
58
|
-
from factpulse.models.
|
|
59
|
-
from factpulse.models.
|
|
60
|
-
from factpulse.models.
|
|
61
|
-
from factpulse.models.
|
|
62
|
-
from factpulse.models.
|
|
63
|
-
from factpulse.models.
|
|
64
|
-
from factpulse.models.
|
|
65
|
-
from factpulse.models.
|
|
66
|
-
from factpulse.models.
|
|
67
|
-
from factpulse.models.
|
|
68
|
-
from factpulse.models.
|
|
69
|
-
from factpulse.models.
|
|
70
|
-
from factpulse.models.
|
|
71
|
-
from factpulse.models.
|
|
72
|
-
from factpulse.models.
|
|
73
|
-
from factpulse.models.
|
|
74
|
-
from factpulse.models.
|
|
75
|
-
from factpulse.models.obtenir_id_chorus_pro_request import ObtenirIdChorusProRequest
|
|
76
|
-
from factpulse.models.obtenir_id_chorus_pro_response import ObtenirIdChorusProResponse
|
|
77
|
-
from factpulse.models.options_processing import OptionsProcessing
|
|
78
|
-
from factpulse.models.pdf_factur_x_info import PDFFacturXInfo
|
|
74
|
+
from factpulse.models.incoming_invoice import IncomingInvoice
|
|
75
|
+
from factpulse.models.incoming_supplier import IncomingSupplier
|
|
76
|
+
from factpulse.models.invoice_format import InvoiceFormat
|
|
77
|
+
from factpulse.models.invoice_line import InvoiceLine
|
|
78
|
+
from factpulse.models.invoice_line_allowance_amount import InvoiceLineAllowanceAmount
|
|
79
|
+
from factpulse.models.invoice_note import InvoiceNote
|
|
80
|
+
from factpulse.models.invoice_references import InvoiceReferences
|
|
81
|
+
from factpulse.models.invoice_status import InvoiceStatus
|
|
82
|
+
from factpulse.models.invoice_totals import InvoiceTotals
|
|
83
|
+
from factpulse.models.invoice_totals_prepayment import InvoiceTotalsPrepayment
|
|
84
|
+
from factpulse.models.invoice_type_code import InvoiceTypeCode
|
|
85
|
+
from factpulse.models.invoicing_framework import InvoicingFramework
|
|
86
|
+
from factpulse.models.invoicing_framework_code import InvoicingFrameworkCode
|
|
87
|
+
from factpulse.models.line_net_amount import LineNetAmount
|
|
88
|
+
from factpulse.models.line_total_amount import LineTotalAmount
|
|
89
|
+
from factpulse.models.mandatory_note_schema import MandatoryNoteSchema
|
|
90
|
+
from factpulse.models.manual_rate import ManualRate
|
|
91
|
+
from factpulse.models.manual_vat_rate import ManualVatRate
|
|
92
|
+
from factpulse.models.missing_field import MissingField
|
|
93
|
+
from factpulse.models.operation_nature import OperationNature
|
|
94
|
+
from factpulse.models.output_format import OutputFormat
|
|
95
|
+
from factpulse.models.pdf_validation_result_api import PDFValidationResultAPI
|
|
79
96
|
from factpulse.models.pdp_credentials import PDPCredentials
|
|
80
|
-
from factpulse.models.
|
|
81
|
-
from factpulse.models.
|
|
82
|
-
from factpulse.models.
|
|
83
|
-
from factpulse.models.
|
|
84
|
-
from factpulse.models.
|
|
85
|
-
from factpulse.models.
|
|
86
|
-
from factpulse.models.
|
|
87
|
-
from factpulse.models.
|
|
88
|
-
from factpulse.models.
|
|
89
|
-
from factpulse.models.
|
|
90
|
-
from factpulse.models.
|
|
91
|
-
from factpulse.models.
|
|
92
|
-
from factpulse.models.
|
|
93
|
-
from factpulse.models.
|
|
94
|
-
from factpulse.models.reponse_validation_erreur import ReponseValidationErreur
|
|
95
|
-
from factpulse.models.reponse_validation_succes import ReponseValidationSucces
|
|
96
|
-
from factpulse.models.reponse_verification_succes import ReponseVerificationSucces
|
|
97
|
-
from factpulse.models.requete_recherche_flux import RequeteRechercheFlux
|
|
98
|
-
from factpulse.models.requete_soumission_flux import RequeteSoumissionFlux
|
|
99
|
-
from factpulse.models.resultat_afnor import ResultatAFNOR
|
|
100
|
-
from factpulse.models.resultat_chorus_pro import ResultatChorusPro
|
|
101
|
-
from factpulse.models.resultat_validation_pdfapi import ResultatValidationPDFAPI
|
|
97
|
+
from factpulse.models.page_dimensions_schema import PageDimensionsSchema
|
|
98
|
+
from factpulse.models.payee import Payee
|
|
99
|
+
from factpulse.models.payment_card import PaymentCard
|
|
100
|
+
from factpulse.models.payment_means import PaymentMeans
|
|
101
|
+
from factpulse.models.percentage import Percentage
|
|
102
|
+
from factpulse.models.postal_address import PostalAddress
|
|
103
|
+
from factpulse.models.price_allowance_amount import PriceAllowanceAmount
|
|
104
|
+
from factpulse.models.price_basis_quantity import PriceBasisQuantity
|
|
105
|
+
from factpulse.models.processing_options import ProcessingOptions
|
|
106
|
+
from factpulse.models.product_characteristic import ProductCharacteristic
|
|
107
|
+
from factpulse.models.product_classification import ProductClassification
|
|
108
|
+
from factpulse.models.quantity import Quantity
|
|
109
|
+
from factpulse.models.recipient import Recipient
|
|
110
|
+
from factpulse.models.rounding_amount import RoundingAmount
|
|
102
111
|
from factpulse.models.scheme_id import SchemeID
|
|
103
|
-
from factpulse.models.
|
|
112
|
+
from factpulse.models.search_flow_request import SearchFlowRequest
|
|
113
|
+
from factpulse.models.search_flow_response import SearchFlowResponse
|
|
114
|
+
from factpulse.models.search_services_response import SearchServicesResponse
|
|
115
|
+
from factpulse.models.search_structure_request import SearchStructureRequest
|
|
116
|
+
from factpulse.models.search_structure_response import SearchStructureResponse
|
|
104
117
|
from factpulse.models.signature_info import SignatureInfo
|
|
105
|
-
from factpulse.models.
|
|
106
|
-
from factpulse.models.
|
|
107
|
-
from factpulse.models.
|
|
108
|
-
from factpulse.models.soumettre_facture_response import SoumettreFactureResponse
|
|
109
|
-
from factpulse.models.statut_acquittement import StatutAcquittement
|
|
110
|
-
from factpulse.models.statut_celery import StatutCelery
|
|
111
|
-
from factpulse.models.statut_champ_api import StatutChampAPI
|
|
112
|
-
from factpulse.models.statut_facture import StatutFacture
|
|
113
|
-
from factpulse.models.statut_tache import StatutTache
|
|
118
|
+
from factpulse.models.signature_info_api import SignatureInfoAPI
|
|
119
|
+
from factpulse.models.signature_parameters import SignatureParameters
|
|
120
|
+
from factpulse.models.simplified_invoice_data import SimplifiedInvoiceData
|
|
114
121
|
from factpulse.models.structure_info import StructureInfo
|
|
115
|
-
from factpulse.models.
|
|
116
|
-
from factpulse.models.
|
|
117
|
-
from factpulse.models.
|
|
118
|
-
from factpulse.models.
|
|
119
|
-
from factpulse.models.
|
|
120
|
-
from factpulse.models.
|
|
121
|
-
from factpulse.models.
|
|
122
|
+
from factpulse.models.structure_parameters import StructureParameters
|
|
123
|
+
from factpulse.models.structure_service import StructureService
|
|
124
|
+
from factpulse.models.submission_mode import SubmissionMode
|
|
125
|
+
from factpulse.models.submit_complete_invoice_request import SubmitCompleteInvoiceRequest
|
|
126
|
+
from factpulse.models.submit_complete_invoice_response import SubmitCompleteInvoiceResponse
|
|
127
|
+
from factpulse.models.submit_flow_request import SubmitFlowRequest
|
|
128
|
+
from factpulse.models.submit_flow_response import SubmitFlowResponse
|
|
129
|
+
from factpulse.models.submit_gross_amount import SubmitGrossAmount
|
|
130
|
+
from factpulse.models.submit_invoice_request import SubmitInvoiceRequest
|
|
131
|
+
from factpulse.models.submit_invoice_response import SubmitInvoiceResponse
|
|
132
|
+
from factpulse.models.submit_net_amount import SubmitNetAmount
|
|
133
|
+
from factpulse.models.submit_vat_amount import SubmitVatAmount
|
|
134
|
+
from factpulse.models.supplementary_attachment import SupplementaryAttachment
|
|
135
|
+
from factpulse.models.supplier import Supplier
|
|
136
|
+
from factpulse.models.task_response import TaskResponse
|
|
137
|
+
from factpulse.models.tax_representative import TaxRepresentative
|
|
138
|
+
from factpulse.models.taxable_amount import TaxableAmount
|
|
139
|
+
from factpulse.models.total_gross_amount import TotalGrossAmount
|
|
140
|
+
from factpulse.models.total_net_amount import TotalNetAmount
|
|
141
|
+
from factpulse.models.total_vat_amount import TotalVATAmount
|
|
142
|
+
from factpulse.models.unit_net_price import UnitNetPrice
|
|
143
|
+
from factpulse.models.unit_of_measure import UnitOfMeasure
|
|
144
|
+
from factpulse.models.vat_accounting_code import VATAccountingCode
|
|
145
|
+
from factpulse.models.vat_amount import VATAmount
|
|
146
|
+
from factpulse.models.vat_category import VATCategory
|
|
147
|
+
from factpulse.models.vat_line import VATLine
|
|
148
|
+
from factpulse.models.vat_point_date_code import VATPointDateCode
|
|
122
149
|
from factpulse.models.validation_error import ValidationError
|
|
123
150
|
from factpulse.models.validation_error_detail import ValidationErrorDetail
|
|
124
151
|
from factpulse.models.validation_error_loc_inner import ValidationErrorLocInner
|
|
152
|
+
from factpulse.models.validation_error_response import ValidationErrorResponse
|
|
153
|
+
from factpulse.models.validation_info import ValidationInfo
|
|
154
|
+
from factpulse.models.validation_success_response import ValidationSuccessResponse
|
|
155
|
+
from factpulse.models.vat_rate import VatRate
|
|
156
|
+
from factpulse.models.verification_success_response import VerificationSuccessResponse
|
|
157
|
+
from factpulse.models.verified_field_schema import VerifiedFieldSchema
|
|
125
158
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
FactPulse REST API
|
|
5
|
+
|
|
6
|
+
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/
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import json
|
|
17
|
+
from enum import Enum
|
|
18
|
+
from typing_extensions import Self
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class AcknowledgmentStatus(str, Enum):
|
|
22
|
+
"""
|
|
23
|
+
Flow acknowledgment status.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
allowed enum values
|
|
28
|
+
"""
|
|
29
|
+
PENDING = 'Pending'
|
|
30
|
+
OK = 'Ok'
|
|
31
|
+
ERROR = 'Error'
|
|
32
|
+
|
|
33
|
+
@classmethod
|
|
34
|
+
def from_json(cls, json_str: str) -> Self:
|
|
35
|
+
"""Create an instance of AcknowledgmentStatus from a JSON string"""
|
|
36
|
+
return cls(json.loads(json_str))
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
FactPulse REST API
|
|
5
|
+
|
|
6
|
+
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/
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class AdditionalDocument(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
Additional supporting document (BG-24). References to external documents or embedded attachments.
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
id: StrictStr = Field(description="Document reference identifier (BT-122).")
|
|
30
|
+
type_code: Optional[StrictStr] = None
|
|
31
|
+
name: Optional[StrictStr] = None
|
|
32
|
+
uri: Optional[StrictStr] = None
|
|
33
|
+
reference_type_code: Optional[StrictStr] = None
|
|
34
|
+
__properties: ClassVar[List[str]] = ["id", "type_code", "name", "uri", "reference_type_code"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
populate_by_name=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_str(self) -> str:
|
|
44
|
+
"""Returns the string representation of the model using alias"""
|
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
+
|
|
47
|
+
def to_json(self) -> str:
|
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
|
49
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
50
|
+
return json.dumps(self.to_dict())
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of AdditionalDocument from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set([
|
|
68
|
+
])
|
|
69
|
+
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
# set to None if type_code (nullable) is None
|
|
76
|
+
# and model_fields_set contains the field
|
|
77
|
+
if self.type_code is None and "type_code" in self.model_fields_set:
|
|
78
|
+
_dict['type_code'] = None
|
|
79
|
+
|
|
80
|
+
# set to None if name (nullable) is None
|
|
81
|
+
# and model_fields_set contains the field
|
|
82
|
+
if self.name is None and "name" in self.model_fields_set:
|
|
83
|
+
_dict['name'] = None
|
|
84
|
+
|
|
85
|
+
# set to None if uri (nullable) is None
|
|
86
|
+
# and model_fields_set contains the field
|
|
87
|
+
if self.uri is None and "uri" in self.model_fields_set:
|
|
88
|
+
_dict['uri'] = None
|
|
89
|
+
|
|
90
|
+
# set to None if reference_type_code (nullable) is None
|
|
91
|
+
# and model_fields_set contains the field
|
|
92
|
+
if self.reference_type_code is None and "reference_type_code" in self.model_fields_set:
|
|
93
|
+
_dict['reference_type_code'] = None
|
|
94
|
+
|
|
95
|
+
return _dict
|
|
96
|
+
|
|
97
|
+
@classmethod
|
|
98
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
99
|
+
"""Create an instance of AdditionalDocument from a dict"""
|
|
100
|
+
if obj is None:
|
|
101
|
+
return None
|
|
102
|
+
|
|
103
|
+
if not isinstance(obj, dict):
|
|
104
|
+
return cls.model_validate(obj)
|
|
105
|
+
|
|
106
|
+
_obj = cls.model_validate({
|
|
107
|
+
"id": obj.get("id"),
|
|
108
|
+
"type_code": obj.get("type_code"),
|
|
109
|
+
"name": obj.get("name"),
|
|
110
|
+
"uri": obj.get("uri"),
|
|
111
|
+
"reference_type_code": obj.get("reference_type_code")
|
|
112
|
+
})
|
|
113
|
+
return _obj
|
|
114
|
+
|
|
115
|
+
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
FactPulse REST API
|
|
5
|
+
|
|
6
|
+
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/
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class AFNORCredentials(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
Optional AFNOR PDP credentials. **MODE 1 - JWT retrieval (recommended):** Do not provide this `credentials` field in the payload. PDP credentials will be automatically retrieved via client_uid from JWT (0-trust). **MODE 2 - Credentials in payload (zero-storage):** Provide all required fields below. Useful for tests or third-party integrations.
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
client_id: Optional[StrictStr] = Field(default=None, alias="clientId")
|
|
30
|
+
client_secret: Optional[StrictStr] = Field(default=None, alias="clientSecret")
|
|
31
|
+
flow_service_url: Optional[StrictStr] = Field(default=None, alias="flowServiceUrl")
|
|
32
|
+
__properties: ClassVar[List[str]] = ["clientId", "clientSecret", "flowServiceUrl"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of AFNORCredentials from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
# set to None if client_id (nullable) is None
|
|
74
|
+
# and model_fields_set contains the field
|
|
75
|
+
if self.client_id is None and "client_id" in self.model_fields_set:
|
|
76
|
+
_dict['clientId'] = None
|
|
77
|
+
|
|
78
|
+
# set to None if client_secret (nullable) is None
|
|
79
|
+
# and model_fields_set contains the field
|
|
80
|
+
if self.client_secret is None and "client_secret" in self.model_fields_set:
|
|
81
|
+
_dict['clientSecret'] = None
|
|
82
|
+
|
|
83
|
+
# set to None if flow_service_url (nullable) is None
|
|
84
|
+
# and model_fields_set contains the field
|
|
85
|
+
if self.flow_service_url is None and "flow_service_url" in self.model_fields_set:
|
|
86
|
+
_dict['flowServiceUrl'] = None
|
|
87
|
+
|
|
88
|
+
return _dict
|
|
89
|
+
|
|
90
|
+
@classmethod
|
|
91
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
92
|
+
"""Create an instance of AFNORCredentials from a dict"""
|
|
93
|
+
if obj is None:
|
|
94
|
+
return None
|
|
95
|
+
|
|
96
|
+
if not isinstance(obj, dict):
|
|
97
|
+
return cls.model_validate(obj)
|
|
98
|
+
|
|
99
|
+
_obj = cls.model_validate({
|
|
100
|
+
"clientId": obj.get("clientId"),
|
|
101
|
+
"clientSecret": obj.get("clientSecret"),
|
|
102
|
+
"flowServiceUrl": obj.get("flowServiceUrl")
|
|
103
|
+
})
|
|
104
|
+
return _obj
|
|
105
|
+
|
|
106
|
+
|