factpulse 1.0.9__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 +275 -203
- factpulse/api/__init__.py +5 -3
- factpulse/api/afnorpdppa_api.py +559 -9
- factpulse/api/afnorpdppa_directory_service_api.py +4313 -66
- factpulse/api/afnorpdppa_flow_service_api.py +23 -23
- factpulse/api/chorus_pro_api.py +362 -404
- factpulse/api/{signature_lectronique_api.py → document_conversion_api.py} +519 -371
- factpulse/api/health_api.py +526 -0
- factpulse/api/invoice_processing_api.py +3437 -0
- factpulse/api/pdfxml_verification_api.py +1719 -0
- factpulse/api/{sant_api.py → user_api.py} +18 -17
- factpulse/api_client.py +6 -6
- factpulse/configuration.py +6 -4
- factpulse/exceptions.py +8 -5
- factpulse/models/__init__.py +133 -99
- 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 +104 -0
- factpulse/models/async_task_status.py +97 -0
- factpulse/models/base_amount.py +145 -0
- factpulse/models/bounding_box_schema.py +100 -0
- 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 +37 -0
- factpulse/models/error_source.py +43 -0
- 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 +20 -13
- 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 +14 -8
- 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 +107 -0
- 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 +9 -4
- factpulse-3.0.7.dist-info/METADATA +292 -0
- factpulse-3.0.7.dist-info/RECORD +168 -0
- factpulse-3.0.7.dist-info/top_level.txt +2 -0
- factpulse_helpers/__init__.py +96 -0
- factpulse_helpers/client.py +2111 -0
- factpulse_helpers/exceptions.py +253 -0
- factpulse/api/processing_endpoints_unifis_api.py +0 -592
- factpulse/api/traitement_facture_api.py +0 -3439
- factpulse/api/utilisateur_api.py +0 -282
- factpulse/models/adresse_electronique.py +0 -90
- factpulse/models/adresse_postale.py +0 -120
- factpulse/models/body_ajouter_fichier_api_v1_chorus_pro_transverses_ajouter_fichier_post.py +0 -104
- factpulse/models/body_completer_facture_api_v1_chorus_pro_factures_completer_post.py +0 -104
- factpulse/models/body_lister_services_structure_api_v1_chorus_pro_structures_id_structure_cpp_services_get.py +0 -102
- factpulse/models/body_rechercher_factures_destinataire_api_v1_chorus_pro_factures_rechercher_destinataire_post.py +0 -104
- factpulse/models/body_rechercher_factures_fournisseur_api_v1_chorus_pro_factures_rechercher_fournisseur_post.py +0 -104
- factpulse/models/body_recycler_facture_api_v1_chorus_pro_factures_recycler_post.py +0 -104
- factpulse/models/body_telecharger_groupe_factures_api_v1_chorus_pro_factures_telecharger_groupe_post.py +0 -104
- factpulse/models/body_traiter_facture_recue_api_v1_chorus_pro_factures_traiter_facture_recue_post.py +0 -104
- factpulse/models/body_valideur_consulter_facture_api_v1_chorus_pro_factures_valideur_consulter_post.py +0 -104
- factpulse/models/body_valideur_rechercher_factures_api_v1_chorus_pro_factures_valideur_rechercher_post.py +0 -104
- factpulse/models/body_valideur_traiter_facture_api_v1_chorus_pro_factures_valideur_traiter_post.py +0 -104
- factpulse/models/cadre_de_facturation.py +0 -102
- factpulse/models/categorie_tva.py +0 -44
- 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 -116
- factpulse/models/destination_afnor.py +0 -127
- factpulse/models/destination_chorus_pro.py +0 -108
- factpulse/models/direction_flux.py +0 -37
- factpulse/models/donnees_facture_simplifiees.py +0 -124
- factpulse/models/facture_enrichie_info_input.py +0 -123
- factpulse/models/facture_enrichie_info_output.py +0 -133
- factpulse/models/facture_factur_x.py +0 -173
- factpulse/models/flux_resume.py +0 -131
- factpulse/models/format_sortie.py +0 -37
- factpulse/models/fournisseur.py +0 -146
- factpulse/models/information_signature_api.py +0 -122
- factpulse/models/ligne_de_poste.py +0 -188
- factpulse/models/ligne_de_poste_montant_remise_ht.py +0 -145
- factpulse/models/ligne_de_poste_montant_total_ligne_ht.py +0 -145
- factpulse/models/ligne_de_poste_taux_tva_manuel.py +0 -145
- factpulse/models/ligne_de_tva.py +0 -118
- factpulse/models/mode_depot.py +0 -38
- factpulse/models/mode_paiement.py +0 -41
- factpulse/models/montant_ht_total.py +0 -139
- factpulse/models/montant_total.py +0 -138
- factpulse/models/montant_total_acompte.py +0 -145
- factpulse/models/montant_total_montant_remise_globale_ttc.py +0 -145
- factpulse/models/montant_ttc_total.py +0 -139
- factpulse/models/montant_tva.py +0 -139
- factpulse/models/montantapayer.py +0 -139
- factpulse/models/montantbaseht.py +0 -139
- factpulse/models/montanthttotal.py +0 -139
- factpulse/models/montantttctotal.py +0 -139
- factpulse/models/montanttva.py +0 -139
- factpulse/models/montanttva1.py +0 -139
- factpulse/models/montantunitaireht.py +0 -139
- 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/quota_info.py +0 -95
- 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/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 -164
- factpulse/models/soumettre_facture_response.py +0 -103
- factpulse/models/statut_acquittement.py +0 -38
- factpulse/models/statut_facture.py +0 -96
- factpulse/models/statut_tache.py +0 -99
- factpulse/models/syntaxe_flux.py +0 -40
- factpulse/models/tauxmanuel.py +0 -139
- 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/models/utilisateur.py +0 -128
- factpulse-1.0.9.dist-info/METADATA +0 -182
- factpulse-1.0.9.dist-info/RECORD +0 -131
- factpulse-1.0.9.dist-info/top_level.txt +0 -1
- {factpulse-1.0.9.dist-info → factpulse-3.0.7.dist-info}/WHEEL +0 -0
- {factpulse-1.0.9.dist-info → factpulse-3.0.7.dist-info}/licenses/LICENSE +0 -0
factpulse/api/utilisateur_api.py
DELETED
|
@@ -1,282 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
API REST FactPulse
|
|
5
|
-
|
|
6
|
-
API REST pour la facturation électronique en France : Factur-X, AFNOR PDP/PA, signatures électroniques. ## 🎯 Fonctionnalités principales ### 📄 Génération de factures Factur-X - **Formats** : XML seul ou PDF/A-3 avec XML embarqué - **Profils** : MINIMUM, BASIC, EN16931, EXTENDED - **Normes** : EN 16931 (directive UE 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Format simplifié** : Génération à partir de SIRET + auto-enrichissement (API Chorus Pro + Recherche Entreprises) ### ✅ Validation et conformité - **Validation XML** : Schematron (45 à 210+ règles selon profil) - **Validation PDF** : PDF/A-3, métadonnées XMP Factur-X, signatures électroniques - **VeraPDF** : Validation stricte PDF/A (146+ règles ISO 19005-3) - **Traitement asynchrone** : Support Celery pour validations lourdes (VeraPDF) ### 📡 Intégration AFNOR PDP/PA (XP Z12-013) - **Soumission de flux** : Envoi de factures vers Plateformes de Dématérialisation Partenaires - **Recherche de flux** : Consultation des factures soumises - **Téléchargement** : Récupération des PDF/A-3 avec XML - **Directory Service** : Recherche d'entreprises (SIREN/SIRET) - **Multi-client** : Support de plusieurs configs PDP par utilisateur (stored credentials ou zero-storage) ### ✍️ Signature électronique PDF - **Standards** : PAdES-B-B, PAdES-B-T (horodatage RFC 3161), PAdES-B-LT (archivage long terme) - **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO) - **Validation** : Vérification intégrité cryptographique et certificats - **Génération de certificats** : Certificats X.509 auto-signés pour tests ### 🔄 Traitement asynchrone - **Celery** : Génération, validation et signature asynchrones - **Polling** : Suivi d'état via `/taches/{id_tache}/statut` - **Pas de timeout** : Idéal pour gros fichiers ou validations lourdes ## 🔒 Authentification Toutes les requêtes nécessitent un **token JWT** dans le header Authorization : ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### Comment obtenir un token JWT ? #### 🔑 Méthode 1 : API `/api/token/` (Recommandée) **URL :** `https://www.factpulse.fr/api/token/` Cette méthode est **recommandée** pour l'intégration dans vos applications et workflows CI/CD. **Prérequis :** Avoir défini un mot de passe sur votre compte **Pour les utilisateurs inscrits via email/password :** - Vous avez déjà un mot de passe, utilisez-le directement **Pour les utilisateurs inscrits via OAuth (Google/GitHub) :** - Vous devez d'abord définir un mot de passe sur : https://www.factpulse.fr/accounts/password/set/ - Une fois le mot de passe créé, vous pourrez utiliser l'API **Exemple de requête :** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\" }' ``` **Réponse :** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Token d'accès (validité: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Token de rafraîchissement (validité: 7 jours) } ``` **Avantages :** - ✅ Automatisation complète (CI/CD, scripts) - ✅ Gestion programmatique des tokens - ✅ Support du refresh token pour renouveler automatiquement l'accès - ✅ Intégration facile dans n'importe quel langage/outil #### 🖥️ Méthode 2 : Génération via Dashboard (Alternative) **URL :** https://www.factpulse.fr/dashboard/ Cette méthode convient pour des tests rapides ou une utilisation occasionnelle via l'interface graphique. **Fonctionnement :** - Connectez-vous au dashboard - Utilisez les boutons \"Generate Test Token\" ou \"Generate Production Token\" - Fonctionne pour **tous** les utilisateurs (OAuth et email/password), sans nécessiter de mot de passe **Types de tokens :** - **Token Test** : Validité 24h, quota 1000 appels/jour (gratuit) - **Token Production** : Validité 7 jours, quota selon votre forfait **Avantages :** - ✅ Rapide pour tester l'API - ✅ Aucun mot de passe requis - ✅ Interface visuelle simple **Inconvénients :** - ❌ Nécessite une action manuelle - ❌ Pas de refresh token - ❌ Moins adapté pour l'automatisation ### 📚 Documentation complète Pour plus d'informations sur l'authentification et l'utilisation de l'API : 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
|
-
import warnings
|
|
15
|
-
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
16
|
-
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
17
|
-
from typing_extensions import Annotated
|
|
18
|
-
|
|
19
|
-
from typing import Any
|
|
20
|
-
|
|
21
|
-
from factpulse.api_client import ApiClient, RequestSerialized
|
|
22
|
-
from factpulse.api_response import ApiResponse
|
|
23
|
-
from factpulse.rest import RESTResponseType
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
class UtilisateurApi:
|
|
27
|
-
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
28
|
-
Ref: https://openapi-generator.tech
|
|
29
|
-
|
|
30
|
-
Do not edit the class manually.
|
|
31
|
-
"""
|
|
32
|
-
|
|
33
|
-
def __init__(self, api_client=None) -> None:
|
|
34
|
-
if api_client is None:
|
|
35
|
-
api_client = ApiClient.get_default()
|
|
36
|
-
self.api_client = api_client
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
@validate_call
|
|
40
|
-
def obtenir_infos_utilisateur_api_v1_moi_get(
|
|
41
|
-
self,
|
|
42
|
-
_request_timeout: Union[
|
|
43
|
-
None,
|
|
44
|
-
Annotated[StrictFloat, Field(gt=0)],
|
|
45
|
-
Tuple[
|
|
46
|
-
Annotated[StrictFloat, Field(gt=0)],
|
|
47
|
-
Annotated[StrictFloat, Field(gt=0)]
|
|
48
|
-
]
|
|
49
|
-
] = None,
|
|
50
|
-
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
51
|
-
_content_type: Optional[StrictStr] = None,
|
|
52
|
-
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
53
|
-
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
54
|
-
) -> object:
|
|
55
|
-
"""Obtenir les informations de l'utilisateur connecté
|
|
56
|
-
|
|
57
|
-
Retourne les informations de l'utilisateur authentifié. Cet endpoint permet de : - Vérifier que l'authentification fonctionne - Obtenir les détails du compte connecté - Tester la validité du token JWT - Consulter son quota de consommation **Nécessite une authentification valide.**
|
|
58
|
-
|
|
59
|
-
:param _request_timeout: timeout setting for this request. If one
|
|
60
|
-
number provided, it will be total request
|
|
61
|
-
timeout. It can also be a pair (tuple) of
|
|
62
|
-
(connection, read) timeouts.
|
|
63
|
-
:type _request_timeout: int, tuple(int, int), optional
|
|
64
|
-
:param _request_auth: set to override the auth_settings for an a single
|
|
65
|
-
request; this effectively ignores the
|
|
66
|
-
authentication in the spec for a single request.
|
|
67
|
-
:type _request_auth: dict, optional
|
|
68
|
-
:param _content_type: force content-type for the request.
|
|
69
|
-
:type _content_type: str, Optional
|
|
70
|
-
:param _headers: set to override the headers for a single
|
|
71
|
-
request; this effectively ignores the headers
|
|
72
|
-
in the spec for a single request.
|
|
73
|
-
:type _headers: dict, optional
|
|
74
|
-
:param _host_index: set to override the host_index for a single
|
|
75
|
-
request; this effectively ignores the host_index
|
|
76
|
-
in the spec for a single request.
|
|
77
|
-
:type _host_index: int, optional
|
|
78
|
-
:return: Returns the result object.
|
|
79
|
-
""" # noqa: E501
|
|
80
|
-
|
|
81
|
-
_param = self._obtenir_infos_utilisateur_api_v1_moi_get_serialize(
|
|
82
|
-
_request_auth=_request_auth,
|
|
83
|
-
_content_type=_content_type,
|
|
84
|
-
_headers=_headers,
|
|
85
|
-
_host_index=_host_index
|
|
86
|
-
)
|
|
87
|
-
|
|
88
|
-
_response_types_map: Dict[str, Optional[str]] = {
|
|
89
|
-
'200': "object",
|
|
90
|
-
}
|
|
91
|
-
response_data = self.api_client.call_api(
|
|
92
|
-
*_param,
|
|
93
|
-
_request_timeout=_request_timeout
|
|
94
|
-
)
|
|
95
|
-
response_data.read()
|
|
96
|
-
return self.api_client.response_deserialize(
|
|
97
|
-
response_data=response_data,
|
|
98
|
-
response_types_map=_response_types_map,
|
|
99
|
-
).data
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
@validate_call
|
|
103
|
-
def obtenir_infos_utilisateur_api_v1_moi_get_with_http_info(
|
|
104
|
-
self,
|
|
105
|
-
_request_timeout: Union[
|
|
106
|
-
None,
|
|
107
|
-
Annotated[StrictFloat, Field(gt=0)],
|
|
108
|
-
Tuple[
|
|
109
|
-
Annotated[StrictFloat, Field(gt=0)],
|
|
110
|
-
Annotated[StrictFloat, Field(gt=0)]
|
|
111
|
-
]
|
|
112
|
-
] = None,
|
|
113
|
-
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
114
|
-
_content_type: Optional[StrictStr] = None,
|
|
115
|
-
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
116
|
-
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
117
|
-
) -> ApiResponse[object]:
|
|
118
|
-
"""Obtenir les informations de l'utilisateur connecté
|
|
119
|
-
|
|
120
|
-
Retourne les informations de l'utilisateur authentifié. Cet endpoint permet de : - Vérifier que l'authentification fonctionne - Obtenir les détails du compte connecté - Tester la validité du token JWT - Consulter son quota de consommation **Nécessite une authentification valide.**
|
|
121
|
-
|
|
122
|
-
:param _request_timeout: timeout setting for this request. If one
|
|
123
|
-
number provided, it will be total request
|
|
124
|
-
timeout. It can also be a pair (tuple) of
|
|
125
|
-
(connection, read) timeouts.
|
|
126
|
-
:type _request_timeout: int, tuple(int, int), optional
|
|
127
|
-
:param _request_auth: set to override the auth_settings for an a single
|
|
128
|
-
request; this effectively ignores the
|
|
129
|
-
authentication in the spec for a single request.
|
|
130
|
-
:type _request_auth: dict, optional
|
|
131
|
-
:param _content_type: force content-type for the request.
|
|
132
|
-
:type _content_type: str, Optional
|
|
133
|
-
:param _headers: set to override the headers for a single
|
|
134
|
-
request; this effectively ignores the headers
|
|
135
|
-
in the spec for a single request.
|
|
136
|
-
:type _headers: dict, optional
|
|
137
|
-
:param _host_index: set to override the host_index for a single
|
|
138
|
-
request; this effectively ignores the host_index
|
|
139
|
-
in the spec for a single request.
|
|
140
|
-
:type _host_index: int, optional
|
|
141
|
-
:return: Returns the result object.
|
|
142
|
-
""" # noqa: E501
|
|
143
|
-
|
|
144
|
-
_param = self._obtenir_infos_utilisateur_api_v1_moi_get_serialize(
|
|
145
|
-
_request_auth=_request_auth,
|
|
146
|
-
_content_type=_content_type,
|
|
147
|
-
_headers=_headers,
|
|
148
|
-
_host_index=_host_index
|
|
149
|
-
)
|
|
150
|
-
|
|
151
|
-
_response_types_map: Dict[str, Optional[str]] = {
|
|
152
|
-
'200': "object",
|
|
153
|
-
}
|
|
154
|
-
response_data = self.api_client.call_api(
|
|
155
|
-
*_param,
|
|
156
|
-
_request_timeout=_request_timeout
|
|
157
|
-
)
|
|
158
|
-
response_data.read()
|
|
159
|
-
return self.api_client.response_deserialize(
|
|
160
|
-
response_data=response_data,
|
|
161
|
-
response_types_map=_response_types_map,
|
|
162
|
-
)
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
@validate_call
|
|
166
|
-
def obtenir_infos_utilisateur_api_v1_moi_get_without_preload_content(
|
|
167
|
-
self,
|
|
168
|
-
_request_timeout: Union[
|
|
169
|
-
None,
|
|
170
|
-
Annotated[StrictFloat, Field(gt=0)],
|
|
171
|
-
Tuple[
|
|
172
|
-
Annotated[StrictFloat, Field(gt=0)],
|
|
173
|
-
Annotated[StrictFloat, Field(gt=0)]
|
|
174
|
-
]
|
|
175
|
-
] = None,
|
|
176
|
-
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
177
|
-
_content_type: Optional[StrictStr] = None,
|
|
178
|
-
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
179
|
-
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
180
|
-
) -> RESTResponseType:
|
|
181
|
-
"""Obtenir les informations de l'utilisateur connecté
|
|
182
|
-
|
|
183
|
-
Retourne les informations de l'utilisateur authentifié. Cet endpoint permet de : - Vérifier que l'authentification fonctionne - Obtenir les détails du compte connecté - Tester la validité du token JWT - Consulter son quota de consommation **Nécessite une authentification valide.**
|
|
184
|
-
|
|
185
|
-
:param _request_timeout: timeout setting for this request. If one
|
|
186
|
-
number provided, it will be total request
|
|
187
|
-
timeout. It can also be a pair (tuple) of
|
|
188
|
-
(connection, read) timeouts.
|
|
189
|
-
:type _request_timeout: int, tuple(int, int), optional
|
|
190
|
-
:param _request_auth: set to override the auth_settings for an a single
|
|
191
|
-
request; this effectively ignores the
|
|
192
|
-
authentication in the spec for a single request.
|
|
193
|
-
:type _request_auth: dict, optional
|
|
194
|
-
:param _content_type: force content-type for the request.
|
|
195
|
-
:type _content_type: str, Optional
|
|
196
|
-
:param _headers: set to override the headers for a single
|
|
197
|
-
request; this effectively ignores the headers
|
|
198
|
-
in the spec for a single request.
|
|
199
|
-
:type _headers: dict, optional
|
|
200
|
-
:param _host_index: set to override the host_index for a single
|
|
201
|
-
request; this effectively ignores the host_index
|
|
202
|
-
in the spec for a single request.
|
|
203
|
-
:type _host_index: int, optional
|
|
204
|
-
:return: Returns the result object.
|
|
205
|
-
""" # noqa: E501
|
|
206
|
-
|
|
207
|
-
_param = self._obtenir_infos_utilisateur_api_v1_moi_get_serialize(
|
|
208
|
-
_request_auth=_request_auth,
|
|
209
|
-
_content_type=_content_type,
|
|
210
|
-
_headers=_headers,
|
|
211
|
-
_host_index=_host_index
|
|
212
|
-
)
|
|
213
|
-
|
|
214
|
-
_response_types_map: Dict[str, Optional[str]] = {
|
|
215
|
-
'200': "object",
|
|
216
|
-
}
|
|
217
|
-
response_data = self.api_client.call_api(
|
|
218
|
-
*_param,
|
|
219
|
-
_request_timeout=_request_timeout
|
|
220
|
-
)
|
|
221
|
-
return response_data.response
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
def _obtenir_infos_utilisateur_api_v1_moi_get_serialize(
|
|
225
|
-
self,
|
|
226
|
-
_request_auth,
|
|
227
|
-
_content_type,
|
|
228
|
-
_headers,
|
|
229
|
-
_host_index,
|
|
230
|
-
) -> RequestSerialized:
|
|
231
|
-
|
|
232
|
-
_host = None
|
|
233
|
-
|
|
234
|
-
_collection_formats: Dict[str, str] = {
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
_path_params: Dict[str, str] = {}
|
|
238
|
-
_query_params: List[Tuple[str, str]] = []
|
|
239
|
-
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
240
|
-
_form_params: List[Tuple[str, str]] = []
|
|
241
|
-
_files: Dict[
|
|
242
|
-
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
243
|
-
] = {}
|
|
244
|
-
_body_params: Optional[bytes] = None
|
|
245
|
-
|
|
246
|
-
# process the path parameters
|
|
247
|
-
# process the query parameters
|
|
248
|
-
# process the header parameters
|
|
249
|
-
# process the form parameters
|
|
250
|
-
# process the body parameter
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
# set the HTTP header `Accept`
|
|
254
|
-
if 'Accept' not in _header_params:
|
|
255
|
-
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
256
|
-
[
|
|
257
|
-
'application/json'
|
|
258
|
-
]
|
|
259
|
-
)
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
# authentication setting
|
|
263
|
-
_auth_settings: List[str] = [
|
|
264
|
-
'HTTPBearer'
|
|
265
|
-
]
|
|
266
|
-
|
|
267
|
-
return self.api_client.param_serialize(
|
|
268
|
-
method='GET',
|
|
269
|
-
resource_path='/api/v1/moi',
|
|
270
|
-
path_params=_path_params,
|
|
271
|
-
query_params=_query_params,
|
|
272
|
-
header_params=_header_params,
|
|
273
|
-
body=_body_params,
|
|
274
|
-
post_params=_form_params,
|
|
275
|
-
files=_files,
|
|
276
|
-
auth_settings=_auth_settings,
|
|
277
|
-
collection_formats=_collection_formats,
|
|
278
|
-
_host=_host,
|
|
279
|
-
_request_auth=_request_auth
|
|
280
|
-
)
|
|
281
|
-
|
|
282
|
-
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
API REST FactPulse
|
|
5
|
-
|
|
6
|
-
API REST pour la facturation électronique en France : Factur-X, AFNOR PDP/PA, signatures électroniques. ## 🎯 Fonctionnalités principales ### 📄 Génération de factures Factur-X - **Formats** : XML seul ou PDF/A-3 avec XML embarqué - **Profils** : MINIMUM, BASIC, EN16931, EXTENDED - **Normes** : EN 16931 (directive UE 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Format simplifié** : Génération à partir de SIRET + auto-enrichissement (API Chorus Pro + Recherche Entreprises) ### ✅ Validation et conformité - **Validation XML** : Schematron (45 à 210+ règles selon profil) - **Validation PDF** : PDF/A-3, métadonnées XMP Factur-X, signatures électroniques - **VeraPDF** : Validation stricte PDF/A (146+ règles ISO 19005-3) - **Traitement asynchrone** : Support Celery pour validations lourdes (VeraPDF) ### 📡 Intégration AFNOR PDP/PA (XP Z12-013) - **Soumission de flux** : Envoi de factures vers Plateformes de Dématérialisation Partenaires - **Recherche de flux** : Consultation des factures soumises - **Téléchargement** : Récupération des PDF/A-3 avec XML - **Directory Service** : Recherche d'entreprises (SIREN/SIRET) - **Multi-client** : Support de plusieurs configs PDP par utilisateur (stored credentials ou zero-storage) ### ✍️ Signature électronique PDF - **Standards** : PAdES-B-B, PAdES-B-T (horodatage RFC 3161), PAdES-B-LT (archivage long terme) - **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO) - **Validation** : Vérification intégrité cryptographique et certificats - **Génération de certificats** : Certificats X.509 auto-signés pour tests ### 🔄 Traitement asynchrone - **Celery** : Génération, validation et signature asynchrones - **Polling** : Suivi d'état via `/taches/{id_tache}/statut` - **Pas de timeout** : Idéal pour gros fichiers ou validations lourdes ## 🔒 Authentification Toutes les requêtes nécessitent un **token JWT** dans le header Authorization : ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### Comment obtenir un token JWT ? #### 🔑 Méthode 1 : API `/api/token/` (Recommandée) **URL :** `https://www.factpulse.fr/api/token/` Cette méthode est **recommandée** pour l'intégration dans vos applications et workflows CI/CD. **Prérequis :** Avoir défini un mot de passe sur votre compte **Pour les utilisateurs inscrits via email/password :** - Vous avez déjà un mot de passe, utilisez-le directement **Pour les utilisateurs inscrits via OAuth (Google/GitHub) :** - Vous devez d'abord définir un mot de passe sur : https://www.factpulse.fr/accounts/password/set/ - Une fois le mot de passe créé, vous pourrez utiliser l'API **Exemple de requête :** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\" }' ``` **Réponse :** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Token d'accès (validité: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Token de rafraîchissement (validité: 7 jours) } ``` **Avantages :** - ✅ Automatisation complète (CI/CD, scripts) - ✅ Gestion programmatique des tokens - ✅ Support du refresh token pour renouveler automatiquement l'accès - ✅ Intégration facile dans n'importe quel langage/outil #### 🖥️ Méthode 2 : Génération via Dashboard (Alternative) **URL :** https://www.factpulse.fr/dashboard/ Cette méthode convient pour des tests rapides ou une utilisation occasionnelle via l'interface graphique. **Fonctionnement :** - Connectez-vous au dashboard - Utilisez les boutons \"Generate Test Token\" ou \"Generate Production Token\" - Fonctionne pour **tous** les utilisateurs (OAuth et email/password), sans nécessiter de mot de passe **Types de tokens :** - **Token Test** : Validité 24h, quota 1000 appels/jour (gratuit) - **Token Production** : Validité 7 jours, quota selon votre forfait **Avantages :** - ✅ Rapide pour tester l'API - ✅ Aucun mot de passe requis - ✅ Interface visuelle simple **Inconvénients :** - ❌ Nécessite une action manuelle - ❌ Pas de refresh token - ❌ Moins adapté pour l'automatisation ### 📚 Documentation complète Pour plus d'informations sur l'authentification et l'utilisation de l'API : 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 factpulse.models.scheme_id import SchemeID
|
|
23
|
-
from typing import Optional, Set
|
|
24
|
-
from typing_extensions import Self
|
|
25
|
-
|
|
26
|
-
class AdresseElectronique(BaseModel):
|
|
27
|
-
"""
|
|
28
|
-
Représente une adresse de facturation électronique, composée d'un identifiant et de son schéma (SchemeID) conformément à la norme EN16931. Exemple: { \"identifiant\": \"123456789\", \"scheme_id\": \"0225\" }
|
|
29
|
-
""" # noqa: E501
|
|
30
|
-
identifiant: StrictStr
|
|
31
|
-
scheme_id: Optional[SchemeID] = Field(default=None, alias="schemeId")
|
|
32
|
-
__properties: ClassVar[List[str]] = ["identifiant", "schemeId"]
|
|
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 AdresseElectronique 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
|
-
return _dict
|
|
74
|
-
|
|
75
|
-
@classmethod
|
|
76
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
77
|
-
"""Create an instance of AdresseElectronique from a dict"""
|
|
78
|
-
if obj is None:
|
|
79
|
-
return None
|
|
80
|
-
|
|
81
|
-
if not isinstance(obj, dict):
|
|
82
|
-
return cls.model_validate(obj)
|
|
83
|
-
|
|
84
|
-
_obj = cls.model_validate({
|
|
85
|
-
"identifiant": obj.get("identifiant"),
|
|
86
|
-
"schemeId": obj.get("schemeId")
|
|
87
|
-
})
|
|
88
|
-
return _obj
|
|
89
|
-
|
|
90
|
-
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
API REST FactPulse
|
|
5
|
-
|
|
6
|
-
API REST pour la facturation électronique en France : Factur-X, AFNOR PDP/PA, signatures électroniques. ## 🎯 Fonctionnalités principales ### 📄 Génération de factures Factur-X - **Formats** : XML seul ou PDF/A-3 avec XML embarqué - **Profils** : MINIMUM, BASIC, EN16931, EXTENDED - **Normes** : EN 16931 (directive UE 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Format simplifié** : Génération à partir de SIRET + auto-enrichissement (API Chorus Pro + Recherche Entreprises) ### ✅ Validation et conformité - **Validation XML** : Schematron (45 à 210+ règles selon profil) - **Validation PDF** : PDF/A-3, métadonnées XMP Factur-X, signatures électroniques - **VeraPDF** : Validation stricte PDF/A (146+ règles ISO 19005-3) - **Traitement asynchrone** : Support Celery pour validations lourdes (VeraPDF) ### 📡 Intégration AFNOR PDP/PA (XP Z12-013) - **Soumission de flux** : Envoi de factures vers Plateformes de Dématérialisation Partenaires - **Recherche de flux** : Consultation des factures soumises - **Téléchargement** : Récupération des PDF/A-3 avec XML - **Directory Service** : Recherche d'entreprises (SIREN/SIRET) - **Multi-client** : Support de plusieurs configs PDP par utilisateur (stored credentials ou zero-storage) ### ✍️ Signature électronique PDF - **Standards** : PAdES-B-B, PAdES-B-T (horodatage RFC 3161), PAdES-B-LT (archivage long terme) - **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO) - **Validation** : Vérification intégrité cryptographique et certificats - **Génération de certificats** : Certificats X.509 auto-signés pour tests ### 🔄 Traitement asynchrone - **Celery** : Génération, validation et signature asynchrones - **Polling** : Suivi d'état via `/taches/{id_tache}/statut` - **Pas de timeout** : Idéal pour gros fichiers ou validations lourdes ## 🔒 Authentification Toutes les requêtes nécessitent un **token JWT** dans le header Authorization : ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### Comment obtenir un token JWT ? #### 🔑 Méthode 1 : API `/api/token/` (Recommandée) **URL :** `https://www.factpulse.fr/api/token/` Cette méthode est **recommandée** pour l'intégration dans vos applications et workflows CI/CD. **Prérequis :** Avoir défini un mot de passe sur votre compte **Pour les utilisateurs inscrits via email/password :** - Vous avez déjà un mot de passe, utilisez-le directement **Pour les utilisateurs inscrits via OAuth (Google/GitHub) :** - Vous devez d'abord définir un mot de passe sur : https://www.factpulse.fr/accounts/password/set/ - Une fois le mot de passe créé, vous pourrez utiliser l'API **Exemple de requête :** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\" }' ``` **Réponse :** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Token d'accès (validité: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Token de rafraîchissement (validité: 7 jours) } ``` **Avantages :** - ✅ Automatisation complète (CI/CD, scripts) - ✅ Gestion programmatique des tokens - ✅ Support du refresh token pour renouveler automatiquement l'accès - ✅ Intégration facile dans n'importe quel langage/outil #### 🖥️ Méthode 2 : Génération via Dashboard (Alternative) **URL :** https://www.factpulse.fr/dashboard/ Cette méthode convient pour des tests rapides ou une utilisation occasionnelle via l'interface graphique. **Fonctionnement :** - Connectez-vous au dashboard - Utilisez les boutons \"Generate Test Token\" ou \"Generate Production Token\" - Fonctionne pour **tous** les utilisateurs (OAuth et email/password), sans nécessiter de mot de passe **Types de tokens :** - **Token Test** : Validité 24h, quota 1000 appels/jour (gratuit) - **Token Production** : Validité 7 jours, quota selon votre forfait **Avantages :** - ✅ Rapide pour tester l'API - ✅ Aucun mot de passe requis - ✅ Interface visuelle simple **Inconvénients :** - ❌ Nécessite une action manuelle - ❌ Pas de refresh token - ❌ Moins adapté pour l'automatisation ### 📚 Documentation complète Pour plus d'informations sur l'authentification et l'utilisation de l'API : 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 AdressePostale(BaseModel):
|
|
26
|
-
"""
|
|
27
|
-
Représente une adresse postale.
|
|
28
|
-
""" # noqa: E501
|
|
29
|
-
code_postal: Optional[StrictStr] = Field(default=None, alias="codePostal")
|
|
30
|
-
ligne_un: Optional[StrictStr] = Field(default=None, alias="ligneUn")
|
|
31
|
-
ligne_deux: Optional[StrictStr] = Field(default=None, alias="ligneDeux")
|
|
32
|
-
nom_ville: Optional[StrictStr] = Field(default=None, alias="nomVille")
|
|
33
|
-
pays_code_iso: Optional[StrictStr] = Field(default=None, alias="paysCodeIso")
|
|
34
|
-
__properties: ClassVar[List[str]] = ["codePostal", "ligneUn", "ligneDeux", "nomVille", "paysCodeIso"]
|
|
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 AdressePostale 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 code_postal (nullable) is None
|
|
76
|
-
# and model_fields_set contains the field
|
|
77
|
-
if self.code_postal is None and "code_postal" in self.model_fields_set:
|
|
78
|
-
_dict['codePostal'] = None
|
|
79
|
-
|
|
80
|
-
# set to None if ligne_un (nullable) is None
|
|
81
|
-
# and model_fields_set contains the field
|
|
82
|
-
if self.ligne_un is None and "ligne_un" in self.model_fields_set:
|
|
83
|
-
_dict['ligneUn'] = None
|
|
84
|
-
|
|
85
|
-
# set to None if ligne_deux (nullable) is None
|
|
86
|
-
# and model_fields_set contains the field
|
|
87
|
-
if self.ligne_deux is None and "ligne_deux" in self.model_fields_set:
|
|
88
|
-
_dict['ligneDeux'] = None
|
|
89
|
-
|
|
90
|
-
# set to None if nom_ville (nullable) is None
|
|
91
|
-
# and model_fields_set contains the field
|
|
92
|
-
if self.nom_ville is None and "nom_ville" in self.model_fields_set:
|
|
93
|
-
_dict['nomVille'] = None
|
|
94
|
-
|
|
95
|
-
# set to None if pays_code_iso (nullable) is None
|
|
96
|
-
# and model_fields_set contains the field
|
|
97
|
-
if self.pays_code_iso is None and "pays_code_iso" in self.model_fields_set:
|
|
98
|
-
_dict['paysCodeIso'] = None
|
|
99
|
-
|
|
100
|
-
return _dict
|
|
101
|
-
|
|
102
|
-
@classmethod
|
|
103
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
104
|
-
"""Create an instance of AdressePostale from a dict"""
|
|
105
|
-
if obj is None:
|
|
106
|
-
return None
|
|
107
|
-
|
|
108
|
-
if not isinstance(obj, dict):
|
|
109
|
-
return cls.model_validate(obj)
|
|
110
|
-
|
|
111
|
-
_obj = cls.model_validate({
|
|
112
|
-
"codePostal": obj.get("codePostal"),
|
|
113
|
-
"ligneUn": obj.get("ligneUn"),
|
|
114
|
-
"ligneDeux": obj.get("ligneDeux"),
|
|
115
|
-
"nomVille": obj.get("nomVille"),
|
|
116
|
-
"paysCodeIso": obj.get("paysCodeIso")
|
|
117
|
-
})
|
|
118
|
-
return _obj
|
|
119
|
-
|
|
120
|
-
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
"""
|
|
4
|
-
API REST FactPulse
|
|
5
|
-
|
|
6
|
-
API REST pour la facturation électronique en France : Factur-X, AFNOR PDP/PA, signatures électroniques. ## 🎯 Fonctionnalités principales ### 📄 Génération de factures Factur-X - **Formats** : XML seul ou PDF/A-3 avec XML embarqué - **Profils** : MINIMUM, BASIC, EN16931, EXTENDED - **Normes** : EN 16931 (directive UE 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Format simplifié** : Génération à partir de SIRET + auto-enrichissement (API Chorus Pro + Recherche Entreprises) ### ✅ Validation et conformité - **Validation XML** : Schematron (45 à 210+ règles selon profil) - **Validation PDF** : PDF/A-3, métadonnées XMP Factur-X, signatures électroniques - **VeraPDF** : Validation stricte PDF/A (146+ règles ISO 19005-3) - **Traitement asynchrone** : Support Celery pour validations lourdes (VeraPDF) ### 📡 Intégration AFNOR PDP/PA (XP Z12-013) - **Soumission de flux** : Envoi de factures vers Plateformes de Dématérialisation Partenaires - **Recherche de flux** : Consultation des factures soumises - **Téléchargement** : Récupération des PDF/A-3 avec XML - **Directory Service** : Recherche d'entreprises (SIREN/SIRET) - **Multi-client** : Support de plusieurs configs PDP par utilisateur (stored credentials ou zero-storage) ### ✍️ Signature électronique PDF - **Standards** : PAdES-B-B, PAdES-B-T (horodatage RFC 3161), PAdES-B-LT (archivage long terme) - **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO) - **Validation** : Vérification intégrité cryptographique et certificats - **Génération de certificats** : Certificats X.509 auto-signés pour tests ### 🔄 Traitement asynchrone - **Celery** : Génération, validation et signature asynchrones - **Polling** : Suivi d'état via `/taches/{id_tache}/statut` - **Pas de timeout** : Idéal pour gros fichiers ou validations lourdes ## 🔒 Authentification Toutes les requêtes nécessitent un **token JWT** dans le header Authorization : ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### Comment obtenir un token JWT ? #### 🔑 Méthode 1 : API `/api/token/` (Recommandée) **URL :** `https://www.factpulse.fr/api/token/` Cette méthode est **recommandée** pour l'intégration dans vos applications et workflows CI/CD. **Prérequis :** Avoir défini un mot de passe sur votre compte **Pour les utilisateurs inscrits via email/password :** - Vous avez déjà un mot de passe, utilisez-le directement **Pour les utilisateurs inscrits via OAuth (Google/GitHub) :** - Vous devez d'abord définir un mot de passe sur : https://www.factpulse.fr/accounts/password/set/ - Une fois le mot de passe créé, vous pourrez utiliser l'API **Exemple de requête :** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\" }' ``` **Réponse :** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Token d'accès (validité: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Token de rafraîchissement (validité: 7 jours) } ``` **Avantages :** - ✅ Automatisation complète (CI/CD, scripts) - ✅ Gestion programmatique des tokens - ✅ Support du refresh token pour renouveler automatiquement l'accès - ✅ Intégration facile dans n'importe quel langage/outil #### 🖥️ Méthode 2 : Génération via Dashboard (Alternative) **URL :** https://www.factpulse.fr/dashboard/ Cette méthode convient pour des tests rapides ou une utilisation occasionnelle via l'interface graphique. **Fonctionnement :** - Connectez-vous au dashboard - Utilisez les boutons \"Generate Test Token\" ou \"Generate Production Token\" - Fonctionne pour **tous** les utilisateurs (OAuth et email/password), sans nécessiter de mot de passe **Types de tokens :** - **Token Test** : Validité 24h, quota 1000 appels/jour (gratuit) - **Token Production** : Validité 7 jours, quota selon votre forfait **Avantages :** - ✅ Rapide pour tester l'API - ✅ Aucun mot de passe requis - ✅ Interface visuelle simple **Inconvénients :** - ❌ Nécessite une action manuelle - ❌ Pas de refresh token - ❌ Moins adapté pour l'automatisation ### 📚 Documentation complète Pour plus d'informations sur l'authentification et l'utilisation de l'API : 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
|
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from factpulse.models.chorus_pro_credentials import ChorusProCredentials
|
|
23
|
-
from factpulse.models.utilisateur import Utilisateur
|
|
24
|
-
from typing import Optional, Set
|
|
25
|
-
from typing_extensions import Self
|
|
26
|
-
|
|
27
|
-
class BodyAjouterFichierApiV1ChorusProTransversesAjouterFichierPost(BaseModel):
|
|
28
|
-
"""
|
|
29
|
-
BodyAjouterFichierApiV1ChorusProTransversesAjouterFichierPost
|
|
30
|
-
""" # noqa: E501
|
|
31
|
-
payload: Dict[str, Any]
|
|
32
|
-
user_info: Utilisateur
|
|
33
|
-
credentials: Optional[ChorusProCredentials] = None
|
|
34
|
-
__properties: ClassVar[List[str]] = ["payload", "user_info", "credentials"]
|
|
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 BodyAjouterFichierApiV1ChorusProTransversesAjouterFichierPost 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
|
-
# override the default output from pydantic by calling `to_dict()` of user_info
|
|
76
|
-
if self.user_info:
|
|
77
|
-
_dict['user_info'] = self.user_info.to_dict()
|
|
78
|
-
# override the default output from pydantic by calling `to_dict()` of credentials
|
|
79
|
-
if self.credentials:
|
|
80
|
-
_dict['credentials'] = self.credentials.to_dict()
|
|
81
|
-
# set to None if credentials (nullable) is None
|
|
82
|
-
# and model_fields_set contains the field
|
|
83
|
-
if self.credentials is None and "credentials" in self.model_fields_set:
|
|
84
|
-
_dict['credentials'] = None
|
|
85
|
-
|
|
86
|
-
return _dict
|
|
87
|
-
|
|
88
|
-
@classmethod
|
|
89
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
90
|
-
"""Create an instance of BodyAjouterFichierApiV1ChorusProTransversesAjouterFichierPost from a dict"""
|
|
91
|
-
if obj is None:
|
|
92
|
-
return None
|
|
93
|
-
|
|
94
|
-
if not isinstance(obj, dict):
|
|
95
|
-
return cls.model_validate(obj)
|
|
96
|
-
|
|
97
|
-
_obj = cls.model_validate({
|
|
98
|
-
"payload": obj.get("payload"),
|
|
99
|
-
"user_info": Utilisateur.from_dict(obj["user_info"]) if obj.get("user_info") is not None else None,
|
|
100
|
-
"credentials": ChorusProCredentials.from_dict(obj["credentials"]) if obj.get("credentials") is not None else None
|
|
101
|
-
})
|
|
102
|
-
return _obj
|
|
103
|
-
|
|
104
|
-
|