factpulse 1.0.0 → 1.0.8

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.
Files changed (194) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +3 -3
  3. data/Gemfile.lock +1 -1
  4. data/README.md +73 -119
  5. data/docs/AFNORPDPPADirectoryServiceApi.md +31 -1148
  6. data/docs/BodyAjouterFichierApiV1ChorusProTransversesAjouterFichierPost.md +22 -0
  7. data/docs/BodyCompleterFactureApiV1ChorusProFacturesCompleterPost.md +22 -0
  8. data/docs/BodyListerServicesStructureApiV1ChorusProStructuresIdStructureCppServicesGet.md +20 -0
  9. data/docs/BodyRechercherFacturesDestinataireApiV1ChorusProFacturesRechercherDestinatairePost.md +22 -0
  10. data/docs/BodyRechercherFacturesFournisseurApiV1ChorusProFacturesRechercherFournisseurPost.md +22 -0
  11. data/docs/BodyRecyclerFactureApiV1ChorusProFacturesRecyclerPost.md +22 -0
  12. data/docs/BodyTelechargerGroupeFacturesApiV1ChorusProFacturesTelechargerGroupePost.md +22 -0
  13. data/docs/BodyTraiterFactureRecueApiV1ChorusProFacturesTraiterFactureRecuePost.md +22 -0
  14. data/docs/BodyValideurConsulterFactureApiV1ChorusProFacturesValideurConsulterPost.md +22 -0
  15. data/docs/BodyValideurRechercherFacturesApiV1ChorusProFacturesValideurRechercherPost.md +22 -0
  16. data/docs/BodyValideurTraiterFactureApiV1ChorusProFacturesValideurTraiterPost.md +22 -0
  17. data/docs/ChorusProApi.md +70 -66
  18. data/docs/Destinataire.md +0 -4
  19. data/docs/{MontantAPayer.md → DirectionFlux.md} +2 -2
  20. data/docs/FactureEnrichieInfoInput.md +32 -0
  21. data/docs/{FactureEnrichieInfo.md → FactureEnrichieInfoOutput.md} +2 -2
  22. data/docs/FactureFacturX.md +0 -2
  23. data/docs/FluxResume.md +32 -0
  24. data/docs/Fournisseur.md +0 -2
  25. data/docs/LigneDePoste.md +2 -2
  26. data/docs/LigneDePosteMontantTotalLigneHt.md +15 -0
  27. data/docs/LigneDeTVA.md +2 -2
  28. data/docs/MontantTotal.md +5 -5
  29. data/docs/MontantTotalMontantRemiseGlobaleTtc.md +15 -0
  30. data/docs/{MontantBaseHt.md → Montantapayer.md} +2 -2
  31. data/docs/Montantbaseht.md +15 -0
  32. data/docs/Montanthttotal.md +15 -0
  33. data/docs/Montantttctotal.md +15 -0
  34. data/docs/{ErrorLevel.md → Montanttva.md} +2 -2
  35. data/docs/{ErrorSource.md → Montanttva1.md} +2 -2
  36. data/docs/Montantunitaireht.md +15 -0
  37. data/docs/OptionsProcessing.md +1 -1
  38. data/docs/PDPCredentials.md +24 -0
  39. data/docs/ProcessingEndpointsUnifisApi.md +147 -0
  40. data/docs/{StatutCelery.md → ProfilFlux.md} +2 -2
  41. data/docs/QuotaInfo.md +26 -0
  42. data/docs/ReponseHealthcheckAFNOR.md +22 -0
  43. data/docs/ReponseRechercheFlux.md +24 -0
  44. data/docs/ReponseSoumissionFlux.md +30 -0
  45. data/docs/RequeteRechercheFlux.md +34 -0
  46. data/docs/RequeteSoumissionFlux.md +28 -0
  47. data/docs/SantApi.md +0 -62
  48. data/docs/SignatureLectroniqueApi.md +315 -0
  49. data/docs/SoumettreFactureCompleteResponse.md +1 -1
  50. data/docs/SoumettreFactureRequest.md +3 -3
  51. data/docs/StatutAcquittement.md +15 -0
  52. data/docs/StatutTache.md +2 -2
  53. data/docs/SyntaxeFlux.md +15 -0
  54. data/docs/TraitementFactureApi.md +2 -2
  55. data/docs/TypeFlux.md +15 -0
  56. data/docs/Utilisateur.md +40 -0
  57. data/factpulse.gemspec +2 -2
  58. data/lib/factpulse/api/afnorpdppa_api.rb +1 -1
  59. data/lib/factpulse/api/afnorpdppa_directory_service_api.rb +30 -1014
  60. data/lib/factpulse/api/afnorpdppa_flow_service_api.rb +1 -1
  61. data/lib/factpulse/api/chorus_pro_api.rb +108 -95
  62. data/lib/factpulse/api/processing_endpoints_unifis_api.rb +158 -0
  63. data/lib/factpulse/api/sant_api.rb +1 -58
  64. data/lib/factpulse/api/signature_lectronique_api.rb +333 -0
  65. data/lib/factpulse/api/traitement_facture_api.rb +5 -5
  66. data/lib/factpulse/api/utilisateur_api.rb +1 -1
  67. data/lib/factpulse/api_client.rb +3 -7
  68. data/lib/factpulse/api_error.rb +1 -1
  69. data/lib/factpulse/api_model_base.rb +1 -1
  70. data/lib/factpulse/configuration.rb +1 -1
  71. data/lib/factpulse/models/adresse_electronique.rb +1 -1
  72. data/lib/factpulse/models/adresse_postale.rb +1 -1
  73. data/lib/factpulse/models/body_ajouter_fichier_api_v1_chorus_pro_transverses_ajouter_fichier_post.rb +202 -0
  74. data/lib/factpulse/models/body_completer_facture_api_v1_chorus_pro_factures_completer_post.rb +202 -0
  75. data/lib/factpulse/models/body_lister_services_structure_api_v1_chorus_pro_structures_id_structure_cpp_services_get.rb +174 -0
  76. data/lib/factpulse/models/body_rechercher_factures_destinataire_api_v1_chorus_pro_factures_rechercher_destinataire_post.rb +202 -0
  77. data/lib/factpulse/models/body_rechercher_factures_fournisseur_api_v1_chorus_pro_factures_rechercher_fournisseur_post.rb +202 -0
  78. data/lib/factpulse/models/body_recycler_facture_api_v1_chorus_pro_factures_recycler_post.rb +202 -0
  79. data/lib/factpulse/models/{api_error.rb → body_telecharger_groupe_factures_api_v1_chorus_pro_factures_telecharger_groupe_post.rb} +44 -47
  80. data/lib/factpulse/models/{note.rb → body_traiter_facture_recue_api_v1_chorus_pro_factures_traiter_facture_recue_post.rb} +55 -28
  81. data/lib/factpulse/models/body_valideur_consulter_facture_api_v1_chorus_pro_factures_valideur_consulter_post.rb +202 -0
  82. data/lib/factpulse/models/body_valideur_rechercher_factures_api_v1_chorus_pro_factures_valideur_rechercher_post.rb +202 -0
  83. data/lib/factpulse/models/body_valideur_traiter_facture_api_v1_chorus_pro_factures_valideur_traiter_post.rb +202 -0
  84. data/lib/factpulse/models/cadre_de_facturation.rb +1 -1
  85. data/lib/factpulse/models/categorie_tva.rb +11 -11
  86. data/lib/factpulse/models/certificate_info_response.rb +1 -1
  87. data/lib/factpulse/models/chorus_pro_credentials.rb +1 -1
  88. data/lib/factpulse/models/code_cadre_facturation.rb +1 -1
  89. data/lib/factpulse/models/code_raison_reduction.rb +9 -9
  90. data/lib/factpulse/models/consulter_facture_request.rb +1 -1
  91. data/lib/factpulse/models/consulter_facture_response.rb +1 -1
  92. data/lib/factpulse/models/consulter_structure_request.rb +1 -1
  93. data/lib/factpulse/models/consulter_structure_response.rb +1 -1
  94. data/lib/factpulse/models/credentials_afnor.rb +1 -1
  95. data/lib/factpulse/models/credentials_chorus_pro.rb +1 -1
  96. data/lib/factpulse/models/destinataire.rb +2 -22
  97. data/lib/factpulse/models/destination.rb +1 -1
  98. data/lib/factpulse/models/destination_afnor.rb +1 -1
  99. data/lib/factpulse/models/destination_chorus_pro.rb +1 -1
  100. data/lib/factpulse/models/{statut_celery.rb → direction_flux.rb} +7 -10
  101. data/lib/factpulse/models/donnees_facture_simplifiees.rb +1 -1
  102. data/lib/factpulse/models/facture_enrichie_info_input.rb +315 -0
  103. data/lib/factpulse/models/{facture_enrichie_info.rb → facture_enrichie_info_output.rb} +4 -4
  104. data/lib/factpulse/models/facture_factur_x.rb +2 -13
  105. data/lib/factpulse/models/flux_resume.rb +251 -0
  106. data/lib/factpulse/models/format_sortie.rb +1 -1
  107. data/lib/factpulse/models/fournisseur.rb +2 -12
  108. data/lib/factpulse/models/generate_certificate_request.rb +1 -1
  109. data/lib/factpulse/models/generate_certificate_response.rb +1 -1
  110. data/lib/factpulse/models/http_validation_error.rb +1 -1
  111. data/lib/factpulse/models/information_signature_api.rb +1 -1
  112. data/lib/factpulse/models/ligne_de_poste.rb +4 -3
  113. data/lib/factpulse/models/ligne_de_poste_montant_remise_ht.rb +2 -2
  114. data/lib/factpulse/models/{montant_total_ligne_ht.rb → ligne_de_poste_montant_total_ligne_ht.rb} +3 -3
  115. data/lib/factpulse/models/ligne_de_poste_taux_tva_manuel.rb +2 -2
  116. data/lib/factpulse/models/ligne_de_tva.rb +3 -3
  117. data/lib/factpulse/models/mode_depot.rb +1 -1
  118. data/lib/factpulse/models/mode_paiement.rb +1 -1
  119. data/lib/factpulse/models/montant_ht_total.rb +1 -2
  120. data/lib/factpulse/models/montant_total.rb +7 -6
  121. data/lib/factpulse/models/montant_total_acompte.rb +2 -2
  122. data/lib/factpulse/models/{montant_a_payer.rb → montant_total_montant_remise_globale_ttc.rb} +3 -3
  123. data/lib/factpulse/models/montant_ttc_total.rb +1 -2
  124. data/lib/factpulse/models/montant_tva.rb +1 -2
  125. data/lib/factpulse/models/{montant_tva_total.rb → montantapayer.rb} +3 -3
  126. data/lib/factpulse/models/{montant_tva_ligne.rb → montantbaseht.rb} +3 -3
  127. data/lib/factpulse/models/montanthttotal.rb +104 -0
  128. data/lib/factpulse/models/montantttctotal.rb +104 -0
  129. data/lib/factpulse/models/montanttva.rb +104 -0
  130. data/lib/factpulse/models/montanttva1.rb +104 -0
  131. data/lib/factpulse/models/{montant_unitaire_ht.rb → montantunitaireht.rb} +2 -2
  132. data/lib/factpulse/models/obtenir_id_chorus_pro_request.rb +1 -1
  133. data/lib/factpulse/models/obtenir_id_chorus_pro_response.rb +1 -1
  134. data/lib/factpulse/models/options_processing.rb +16 -2
  135. data/lib/factpulse/models/parametres_signature.rb +1 -1
  136. data/lib/factpulse/models/parametres_structure.rb +1 -1
  137. data/lib/factpulse/models/pdf_factur_x_info.rb +1 -1
  138. data/lib/factpulse/models/pdp_credentials.rb +247 -0
  139. data/lib/factpulse/models/piece_jointe_complementaire.rb +1 -1
  140. data/lib/factpulse/models/profil_api.rb +1 -1
  141. data/lib/factpulse/models/profil_flux.rb +41 -0
  142. data/lib/factpulse/models/quantite.rb +1 -1
  143. data/lib/factpulse/models/quota_info.rb +269 -0
  144. data/lib/factpulse/models/rechercher_services_response.rb +1 -1
  145. data/lib/factpulse/models/rechercher_structure_request.rb +1 -1
  146. data/lib/factpulse/models/rechercher_structure_response.rb +1 -1
  147. data/lib/factpulse/models/references.rb +1 -1
  148. data/lib/factpulse/models/reponse_healthcheck_afnor.rb +220 -0
  149. data/lib/factpulse/models/reponse_recherche_flux.rb +249 -0
  150. data/lib/factpulse/models/reponse_soumission_flux.rb +294 -0
  151. data/lib/factpulse/models/reponse_tache.rb +1 -1
  152. data/lib/factpulse/models/reponse_validation_erreur.rb +1 -1
  153. data/lib/factpulse/models/reponse_validation_succes.rb +1 -1
  154. data/lib/factpulse/models/requete_recherche_flux.rb +306 -0
  155. data/lib/factpulse/models/{validation_error_detail.rb → requete_soumission_flux.rb} +61 -68
  156. data/lib/factpulse/models/resultat_afnor.rb +1 -1
  157. data/lib/factpulse/models/resultat_chorus_pro.rb +1 -1
  158. data/lib/factpulse/models/resultat_validation_pdfapi.rb +1 -1
  159. data/lib/factpulse/models/scheme_id.rb +7 -7
  160. data/lib/factpulse/models/service_structure.rb +1 -1
  161. data/lib/factpulse/models/signature_info.rb +1 -1
  162. data/lib/factpulse/models/soumettre_facture_complete_request.rb +1 -1
  163. data/lib/factpulse/models/soumettre_facture_complete_response.rb +2 -2
  164. data/lib/factpulse/models/soumettre_facture_request.rb +7 -4
  165. data/lib/factpulse/models/soumettre_facture_response.rb +1 -1
  166. data/lib/factpulse/models/{error_level.rb → statut_acquittement.rb} +7 -6
  167. data/lib/factpulse/models/statut_facture.rb +1 -1
  168. data/lib/factpulse/models/statut_tache.rb +5 -30
  169. data/lib/factpulse/models/structure_info.rb +1 -1
  170. data/lib/factpulse/models/{error_source.rb → syntaxe_flux.rb} +10 -13
  171. data/lib/factpulse/models/tauxmanuel.rb +2 -2
  172. data/lib/factpulse/models/type_facture.rb +1 -1
  173. data/lib/factpulse/models/type_flux.rb +43 -0
  174. data/lib/factpulse/models/type_tva.rb +1 -1
  175. data/lib/factpulse/models/unite.rb +1 -1
  176. data/lib/factpulse/models/utilisateur.rb +328 -0
  177. data/lib/factpulse/models/validation_error.rb +1 -1
  178. data/lib/factpulse/models/validation_error_loc_inner.rb +1 -1
  179. data/lib/factpulse/version.rb +2 -2
  180. data/lib/factpulse.rb +39 -15
  181. metadata +79 -42
  182. data/docs/APIError.md +0 -22
  183. data/docs/MontantRemiseGlobaleTtc.md +0 -15
  184. data/docs/MontantTotalLigneHt.md +0 -15
  185. data/docs/MontantTvaLigne.md +0 -15
  186. data/docs/MontantTvaTotal.md +0 -15
  187. data/docs/MontantUnitaireHt.md +0 -15
  188. data/docs/Note.md +0 -20
  189. data/docs/ValidationErrorDetail.md +0 -26
  190. data/lib/factpulse/helpers/client.rb +0 -300
  191. data/lib/factpulse/helpers/exceptions.rb +0 -21
  192. data/lib/factpulse/helpers.rb +0 -13
  193. data/lib/factpulse/models/montant_base_ht.rb +0 -104
  194. data/lib/factpulse/models/montant_remise_globale_ttc.rb +0 -104
@@ -0,0 +1,306 @@
1
+ =begin
2
+ #API REST FactPulse
3
+
4
+ # 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/
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.18.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module FactPulse
17
+ # Requête pour rechercher des flux soumis
18
+ class RequeteRechercheFlux < ApiModelBase
19
+ attr_accessor :date_maj_apres
20
+
21
+ attr_accessor :date_maj_avant
22
+
23
+ attr_accessor :type_flux
24
+
25
+ attr_accessor :direction_flux
26
+
27
+ attr_accessor :tracking_id
28
+
29
+ attr_accessor :flow_id
30
+
31
+ attr_accessor :statut_acquittement
32
+
33
+ # Décalage pour la pagination
34
+ attr_accessor :offset
35
+
36
+ # Nombre maximum de résultats (max 100)
37
+ attr_accessor :limit
38
+
39
+ class EnumAttributeValidator
40
+ attr_reader :datatype
41
+ attr_reader :allowable_values
42
+
43
+ def initialize(datatype, allowable_values)
44
+ @allowable_values = allowable_values.map do |value|
45
+ case datatype.to_s
46
+ when /Integer/i
47
+ value.to_i
48
+ when /Float/i
49
+ value.to_f
50
+ else
51
+ value
52
+ end
53
+ end
54
+ end
55
+
56
+ def valid?(value)
57
+ !value || allowable_values.include?(value)
58
+ end
59
+ end
60
+
61
+ # Attribute mapping from ruby-style variable name to JSON key.
62
+ def self.attribute_map
63
+ {
64
+ :'date_maj_apres' => :'date_maj_apres',
65
+ :'date_maj_avant' => :'date_maj_avant',
66
+ :'type_flux' => :'type_flux',
67
+ :'direction_flux' => :'direction_flux',
68
+ :'tracking_id' => :'tracking_id',
69
+ :'flow_id' => :'flow_id',
70
+ :'statut_acquittement' => :'statut_acquittement',
71
+ :'offset' => :'offset',
72
+ :'limit' => :'limit'
73
+ }
74
+ end
75
+
76
+ # Returns attribute mapping this model knows about
77
+ def self.acceptable_attribute_map
78
+ attribute_map
79
+ end
80
+
81
+ # Returns all the JSON keys this model knows about
82
+ def self.acceptable_attributes
83
+ acceptable_attribute_map.values
84
+ end
85
+
86
+ # Attribute type mapping.
87
+ def self.openapi_types
88
+ {
89
+ :'date_maj_apres' => :'Time',
90
+ :'date_maj_avant' => :'Time',
91
+ :'type_flux' => :'Array<TypeFlux>',
92
+ :'direction_flux' => :'Array<DirectionFlux>',
93
+ :'tracking_id' => :'String',
94
+ :'flow_id' => :'String',
95
+ :'statut_acquittement' => :'StatutAcquittement',
96
+ :'offset' => :'Integer',
97
+ :'limit' => :'Integer'
98
+ }
99
+ end
100
+
101
+ # List of attributes with nullable: true
102
+ def self.openapi_nullable
103
+ Set.new([
104
+ :'date_maj_apres',
105
+ :'date_maj_avant',
106
+ :'type_flux',
107
+ :'direction_flux',
108
+ :'tracking_id',
109
+ :'flow_id',
110
+ :'statut_acquittement',
111
+ ])
112
+ end
113
+
114
+ # Initializes the object
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ def initialize(attributes = {})
117
+ if (!attributes.is_a?(Hash))
118
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::RequeteRechercheFlux` initialize method"
119
+ end
120
+
121
+ # check to see if the attribute exists and convert string to symbol for hash key
122
+ acceptable_attribute_map = self.class.acceptable_attribute_map
123
+ attributes = attributes.each_with_object({}) { |(k, v), h|
124
+ if (!acceptable_attribute_map.key?(k.to_sym))
125
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::RequeteRechercheFlux`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
126
+ end
127
+ h[k.to_sym] = v
128
+ }
129
+
130
+ if attributes.key?(:'date_maj_apres')
131
+ self.date_maj_apres = attributes[:'date_maj_apres']
132
+ end
133
+
134
+ if attributes.key?(:'date_maj_avant')
135
+ self.date_maj_avant = attributes[:'date_maj_avant']
136
+ end
137
+
138
+ if attributes.key?(:'type_flux')
139
+ if (value = attributes[:'type_flux']).is_a?(Array)
140
+ self.type_flux = value
141
+ end
142
+ end
143
+
144
+ if attributes.key?(:'direction_flux')
145
+ if (value = attributes[:'direction_flux']).is_a?(Array)
146
+ self.direction_flux = value
147
+ end
148
+ end
149
+
150
+ if attributes.key?(:'tracking_id')
151
+ self.tracking_id = attributes[:'tracking_id']
152
+ end
153
+
154
+ if attributes.key?(:'flow_id')
155
+ self.flow_id = attributes[:'flow_id']
156
+ end
157
+
158
+ if attributes.key?(:'statut_acquittement')
159
+ self.statut_acquittement = attributes[:'statut_acquittement']
160
+ end
161
+
162
+ if attributes.key?(:'offset')
163
+ self.offset = attributes[:'offset']
164
+ else
165
+ self.offset = 0
166
+ end
167
+
168
+ if attributes.key?(:'limit')
169
+ self.limit = attributes[:'limit']
170
+ else
171
+ self.limit = 25
172
+ end
173
+ end
174
+
175
+ # Show invalid properties with the reasons. Usually used together with valid?
176
+ # @return Array for valid properties with the reasons
177
+ def list_invalid_properties
178
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
179
+ invalid_properties = Array.new
180
+ if !@offset.nil? && @offset < 0
181
+ invalid_properties.push('invalid value for "offset", must be greater than or equal to 0.')
182
+ end
183
+
184
+ if !@limit.nil? && @limit > 100
185
+ invalid_properties.push('invalid value for "limit", must be smaller than or equal to 100.')
186
+ end
187
+
188
+ if !@limit.nil? && @limit < 1
189
+ invalid_properties.push('invalid value for "limit", must be greater than or equal to 1.')
190
+ end
191
+
192
+ invalid_properties
193
+ end
194
+
195
+ # Check to see if the all the properties in the model are valid
196
+ # @return true if the model is valid
197
+ def valid?
198
+ warn '[DEPRECATED] the `valid?` method is obsolete'
199
+ return false if !@offset.nil? && @offset < 0
200
+ return false if !@limit.nil? && @limit > 100
201
+ return false if !@limit.nil? && @limit < 1
202
+ true
203
+ end
204
+
205
+ # Custom attribute writer method with validation
206
+ # @param [Object] offset Value to be assigned
207
+ def offset=(offset)
208
+ if offset.nil?
209
+ fail ArgumentError, 'offset cannot be nil'
210
+ end
211
+
212
+ if offset < 0
213
+ fail ArgumentError, 'invalid value for "offset", must be greater than or equal to 0.'
214
+ end
215
+
216
+ @offset = offset
217
+ end
218
+
219
+ # Custom attribute writer method with validation
220
+ # @param [Object] limit Value to be assigned
221
+ def limit=(limit)
222
+ if limit.nil?
223
+ fail ArgumentError, 'limit cannot be nil'
224
+ end
225
+
226
+ if limit > 100
227
+ fail ArgumentError, 'invalid value for "limit", must be smaller than or equal to 100.'
228
+ end
229
+
230
+ if limit < 1
231
+ fail ArgumentError, 'invalid value for "limit", must be greater than or equal to 1.'
232
+ end
233
+
234
+ @limit = limit
235
+ end
236
+
237
+ # Checks equality by comparing each attribute.
238
+ # @param [Object] Object to be compared
239
+ def ==(o)
240
+ return true if self.equal?(o)
241
+ self.class == o.class &&
242
+ date_maj_apres == o.date_maj_apres &&
243
+ date_maj_avant == o.date_maj_avant &&
244
+ type_flux == o.type_flux &&
245
+ direction_flux == o.direction_flux &&
246
+ tracking_id == o.tracking_id &&
247
+ flow_id == o.flow_id &&
248
+ statut_acquittement == o.statut_acquittement &&
249
+ offset == o.offset &&
250
+ limit == o.limit
251
+ end
252
+
253
+ # @see the `==` method
254
+ # @param [Object] Object to be compared
255
+ def eql?(o)
256
+ self == o
257
+ end
258
+
259
+ # Calculates hash code according to all attributes.
260
+ # @return [Integer] Hash code
261
+ def hash
262
+ [date_maj_apres, date_maj_avant, type_flux, direction_flux, tracking_id, flow_id, statut_acquittement, offset, limit].hash
263
+ end
264
+
265
+ # Builds the object from hash
266
+ # @param [Hash] attributes Model attributes in the form of hash
267
+ # @return [Object] Returns the model itself
268
+ def self.build_from_hash(attributes)
269
+ return nil unless attributes.is_a?(Hash)
270
+ attributes = attributes.transform_keys(&:to_sym)
271
+ transformed_hash = {}
272
+ openapi_types.each_pair do |key, type|
273
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
274
+ transformed_hash["#{key}"] = nil
275
+ elsif type =~ /\AArray<(.*)>/i
276
+ # check to ensure the input is an array given that the attribute
277
+ # is documented as an array but the input is not
278
+ if attributes[attribute_map[key]].is_a?(Array)
279
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
280
+ end
281
+ elsif !attributes[attribute_map[key]].nil?
282
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
283
+ end
284
+ end
285
+ new(transformed_hash)
286
+ end
287
+
288
+ # Returns the object in the form of hash
289
+ # @return [Hash] Returns the object in the form of hash
290
+ def to_hash
291
+ hash = {}
292
+ self.class.attribute_map.each_pair do |attr, param|
293
+ value = self.send(attr)
294
+ if value.nil?
295
+ is_nullable = self.class.openapi_nullable.include?(attr)
296
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
297
+ end
298
+
299
+ hash[param] = _to_hash(value)
300
+ end
301
+ hash
302
+ end
303
+
304
+ end
305
+
306
+ end
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #API REST FactPulse
3
3
 
4
- # 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\" }' ``` **Paramètre optionnel `client_uid` :** Pour sélectionner les credentials d'un client spécifique (PA/PDP, Chorus Pro, certificats de signature), ajoutez `client_uid` : ```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\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` Le `client_uid` sera inclus dans le JWT et permettra à l'API d'utiliser automatiquement : - Les credentials AFNOR/PDP configurés pour ce client - Les credentials Chorus Pro configurés pour ce client - Les certificats de signature électronique configurés pour ce client **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/
4
+ # 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/
5
5
 
6
6
  The version of the OpenAPI document: 1.0.0
7
7
 
@@ -14,20 +14,21 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module FactPulse
17
- # Détail d'une erreur de validation (aligné sur AFNOR AcknowledgementDetail). Format unifié pour toutes les erreurs de validation Factur-X, compatible avec la norme AFNOR XP Z12-013.
18
- class ValidationErrorDetail < ApiModelBase
19
- # Niveau de gravité : 'Error' ou 'Warning'
20
- attr_accessor :level
17
+ # Requête pour soumettre une facture à une PDP/PA via AFNOR
18
+ class RequeteSoumissionFlux < ApiModelBase
19
+ # Nom du flux (ex: 'Facture 2025-001')
20
+ attr_accessor :nom_flux
21
21
 
22
- # Identifiant de l'élément concerné (XPath, champ, règle BR-FR, etc.)
23
- attr_accessor :item
22
+ # Syntaxe du flux (CII pour Factur-X)
23
+ attr_accessor :syntaxe_flux
24
24
 
25
- # Description de l'erreur
26
- attr_accessor :reason
25
+ attr_accessor :profil_flux
27
26
 
28
- attr_accessor :source
27
+ attr_accessor :tracking_id
29
28
 
30
- attr_accessor :code
29
+ attr_accessor :request_id
30
+
31
+ attr_accessor :pdp_credentials
31
32
 
32
33
  class EnumAttributeValidator
33
34
  attr_reader :datatype
@@ -54,11 +55,12 @@ module FactPulse
54
55
  # Attribute mapping from ruby-style variable name to JSON key.
55
56
  def self.attribute_map
56
57
  {
57
- :'level' => :'level',
58
- :'item' => :'item',
59
- :'reason' => :'reason',
60
- :'source' => :'source',
61
- :'code' => :'code'
58
+ :'nom_flux' => :'nom_flux',
59
+ :'syntaxe_flux' => :'syntaxe_flux',
60
+ :'profil_flux' => :'profil_flux',
61
+ :'tracking_id' => :'tracking_id',
62
+ :'request_id' => :'request_id',
63
+ :'pdp_credentials' => :'pdp_credentials'
62
64
  }
63
65
  end
64
66
 
@@ -75,19 +77,22 @@ module FactPulse
75
77
  # Attribute type mapping.
76
78
  def self.openapi_types
77
79
  {
78
- :'level' => :'ErrorLevel',
79
- :'item' => :'String',
80
- :'reason' => :'String',
81
- :'source' => :'ErrorSource',
82
- :'code' => :'String'
80
+ :'nom_flux' => :'String',
81
+ :'syntaxe_flux' => :'SyntaxeFlux',
82
+ :'profil_flux' => :'ProfilFlux',
83
+ :'tracking_id' => :'String',
84
+ :'request_id' => :'String',
85
+ :'pdp_credentials' => :'PDPCredentials'
83
86
  }
84
87
  end
85
88
 
86
89
  # List of attributes with nullable: true
87
90
  def self.openapi_nullable
88
91
  Set.new([
89
- :'source',
90
- :'code'
92
+ :'profil_flux',
93
+ :'tracking_id',
94
+ :'request_id',
95
+ :'pdp_credentials'
91
96
  ])
92
97
  end
93
98
 
@@ -95,40 +100,42 @@ module FactPulse
95
100
  # @param [Hash] attributes Model attributes in the form of hash
96
101
  def initialize(attributes = {})
97
102
  if (!attributes.is_a?(Hash))
98
- fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::ValidationErrorDetail` initialize method"
103
+ fail ArgumentError, "The input argument (attributes) must be a hash in `FactPulse::RequeteSoumissionFlux` initialize method"
99
104
  end
100
105
 
101
106
  # check to see if the attribute exists and convert string to symbol for hash key
102
107
  acceptable_attribute_map = self.class.acceptable_attribute_map
103
108
  attributes = attributes.each_with_object({}) { |(k, v), h|
104
109
  if (!acceptable_attribute_map.key?(k.to_sym))
105
- fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::ValidationErrorDetail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
110
+ fail ArgumentError, "`#{k}` is not a valid attribute in `FactPulse::RequeteSoumissionFlux`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
106
111
  end
107
112
  h[k.to_sym] = v
108
113
  }
109
114
 
110
- if attributes.key?(:'level')
111
- self.level = attributes[:'level']
115
+ if attributes.key?(:'nom_flux')
116
+ self.nom_flux = attributes[:'nom_flux']
117
+ else
118
+ self.nom_flux = nil
112
119
  end
113
120
 
114
- if attributes.key?(:'item')
115
- self.item = attributes[:'item']
116
- else
117
- self.item = nil
121
+ if attributes.key?(:'syntaxe_flux')
122
+ self.syntaxe_flux = attributes[:'syntaxe_flux']
118
123
  end
119
124
 
120
- if attributes.key?(:'reason')
121
- self.reason = attributes[:'reason']
122
- else
123
- self.reason = nil
125
+ if attributes.key?(:'profil_flux')
126
+ self.profil_flux = attributes[:'profil_flux']
124
127
  end
125
128
 
126
- if attributes.key?(:'source')
127
- self.source = attributes[:'source']
129
+ if attributes.key?(:'tracking_id')
130
+ self.tracking_id = attributes[:'tracking_id']
128
131
  end
129
132
 
130
- if attributes.key?(:'code')
131
- self.code = attributes[:'code']
133
+ if attributes.key?(:'request_id')
134
+ self.request_id = attributes[:'request_id']
135
+ end
136
+
137
+ if attributes.key?(:'pdp_credentials')
138
+ self.pdp_credentials = attributes[:'pdp_credentials']
132
139
  end
133
140
  end
134
141
 
@@ -137,12 +144,8 @@ module FactPulse
137
144
  def list_invalid_properties
138
145
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
139
146
  invalid_properties = Array.new
140
- if @item.nil?
141
- invalid_properties.push('invalid value for "item", item cannot be nil.')
142
- end
143
-
144
- if @reason.nil?
145
- invalid_properties.push('invalid value for "reason", reason cannot be nil.')
147
+ if @nom_flux.nil?
148
+ invalid_properties.push('invalid value for "nom_flux", nom_flux cannot be nil.')
146
149
  end
147
150
 
148
151
  invalid_properties
@@ -152,29 +155,18 @@ module FactPulse
152
155
  # @return true if the model is valid
153
156
  def valid?
154
157
  warn '[DEPRECATED] the `valid?` method is obsolete'
155
- return false if @item.nil?
156
- return false if @reason.nil?
158
+ return false if @nom_flux.nil?
157
159
  true
158
160
  end
159
161
 
160
162
  # Custom attribute writer method with validation
161
- # @param [Object] item Value to be assigned
162
- def item=(item)
163
- if item.nil?
164
- fail ArgumentError, 'item cannot be nil'
165
- end
166
-
167
- @item = item
168
- end
169
-
170
- # Custom attribute writer method with validation
171
- # @param [Object] reason Value to be assigned
172
- def reason=(reason)
173
- if reason.nil?
174
- fail ArgumentError, 'reason cannot be nil'
163
+ # @param [Object] nom_flux Value to be assigned
164
+ def nom_flux=(nom_flux)
165
+ if nom_flux.nil?
166
+ fail ArgumentError, 'nom_flux cannot be nil'
175
167
  end
176
168
 
177
- @reason = reason
169
+ @nom_flux = nom_flux
178
170
  end
179
171
 
180
172
  # Checks equality by comparing each attribute.
@@ -182,11 +174,12 @@ module FactPulse
182
174
  def ==(o)
183
175
  return true if self.equal?(o)
184
176
  self.class == o.class &&
185
- level == o.level &&
186
- item == o.item &&
187
- reason == o.reason &&
188
- source == o.source &&
189
- code == o.code
177
+ nom_flux == o.nom_flux &&
178
+ syntaxe_flux == o.syntaxe_flux &&
179
+ profil_flux == o.profil_flux &&
180
+ tracking_id == o.tracking_id &&
181
+ request_id == o.request_id &&
182
+ pdp_credentials == o.pdp_credentials
190
183
  end
191
184
 
192
185
  # @see the `==` method
@@ -198,7 +191,7 @@ module FactPulse
198
191
  # Calculates hash code according to all attributes.
199
192
  # @return [Integer] Hash code
200
193
  def hash
201
- [level, item, reason, source, code].hash
194
+ [nom_flux, syntaxe_flux, profil_flux, tracking_id, request_id, pdp_credentials].hash
202
195
  end
203
196
 
204
197
  # Builds the object from hash
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #API REST FactPulse
3
3
 
4
- # 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\" }' ``` **Paramètre optionnel `client_uid` :** Pour sélectionner les credentials d'un client spécifique (PA/PDP, Chorus Pro, certificats de signature), ajoutez `client_uid` : ```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\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` Le `client_uid` sera inclus dans le JWT et permettra à l'API d'utiliser automatiquement : - Les credentials AFNOR/PDP configurés pour ce client - Les credentials Chorus Pro configurés pour ce client - Les certificats de signature électronique configurés pour ce client **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/
4
+ # 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/
5
5
 
6
6
  The version of the OpenAPI document: 1.0.0
7
7
 
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #API REST FactPulse
3
3
 
4
- # 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\" }' ``` **Paramètre optionnel `client_uid` :** Pour sélectionner les credentials d'un client spécifique (PA/PDP, Chorus Pro, certificats de signature), ajoutez `client_uid` : ```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\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` Le `client_uid` sera inclus dans le JWT et permettra à l'API d'utiliser automatiquement : - Les credentials AFNOR/PDP configurés pour ce client - Les credentials Chorus Pro configurés pour ce client - Les certificats de signature électronique configurés pour ce client **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/
4
+ # 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/
5
5
 
6
6
  The version of the OpenAPI document: 1.0.0
7
7
 
@@ -1,7 +1,7 @@
1
1
  =begin
2
2
  #API REST FactPulse
3
3
 
4
- # 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\" }' ``` **Paramètre optionnel `client_uid` :** Pour sélectionner les credentials d'un client spécifique (PA/PDP, Chorus Pro, certificats de signature), ajoutez `client_uid` : ```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\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` Le `client_uid` sera inclus dans le JWT et permettra à l'API d'utiliser automatiquement : - Les credentials AFNOR/PDP configurés pour ce client - Les credentials Chorus Pro configurés pour ce client - Les certificats de signature électronique configurés pour ce client **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/
4
+ # 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/
5
5
 
6
6
  The version of the OpenAPI document: 1.0.0
7
7