factpulse 3.0.7__py3-none-any.whl → 3.0.23__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.

Files changed (305) hide show
  1. factpulse/__init__.py +289 -12
  2. factpulse/api/__init__.py +2 -0
  3. factpulse/api/afnorpdppa_api.py +16 -14
  4. factpulse/api/afnorpdppa_directory_service_api.py +1224 -309
  5. factpulse/api/afnorpdppa_flow_service_api.py +199 -68
  6. factpulse/api/chorus_pro_api.py +61 -8
  7. factpulse/api/document_conversion_api.py +54 -338
  8. factpulse/api/downloads_api.py +1171 -0
  9. factpulse/api/e_reporting_api.py +3254 -0
  10. factpulse/api/health_api.py +8 -1
  11. factpulse/api/invoice_processing_api.py +234 -37
  12. factpulse/api/pdfxml_verification_api.py +98 -19
  13. factpulse/api/user_api.py +5 -1
  14. factpulse/api_client.py +3 -2
  15. factpulse/configuration.py +10 -5
  16. factpulse/exceptions.py +2 -1
  17. factpulse/models/__init__.py +143 -6
  18. factpulse/models/accept_language.py +38 -0
  19. factpulse/models/acknowledgment_status.py +2 -1
  20. factpulse/models/additional_document.py +2 -1
  21. factpulse/models/afnor_acknowledgement.py +100 -0
  22. factpulse/models/afnor_acknowledgement_detail.py +105 -0
  23. factpulse/models/afnor_address_edit.py +111 -0
  24. factpulse/models/afnor_address_patch.py +141 -0
  25. factpulse/models/afnor_address_put.py +129 -0
  26. factpulse/models/afnor_address_read.py +113 -0
  27. factpulse/models/afnor_algorithm.py +41 -0
  28. factpulse/models/afnor_contains_operator.py +37 -0
  29. factpulse/models/afnor_create_directory_line_body.py +98 -0
  30. factpulse/models/afnor_create_directory_line_body_addressing_information.py +122 -0
  31. factpulse/models/afnor_create_directory_line_body_period.py +91 -0
  32. factpulse/models/afnor_create_routing_code_body.py +153 -0
  33. factpulse/models/afnor_credentials.py +2 -1
  34. factpulse/models/afnor_destination.py +15 -15
  35. factpulse/models/afnor_diffusion_status.py +38 -0
  36. factpulse/models/afnor_directory_line_field.py +42 -0
  37. factpulse/models/afnor_directory_line_payload_history_legal_unit_facility_routing_code.py +139 -0
  38. factpulse/models/afnor_directory_line_payload_history_legal_unit_facility_routing_code_platform.py +92 -0
  39. factpulse/models/afnor_directory_line_payload_history_legal_unit_facility_routing_code_routing_code.py +134 -0
  40. factpulse/models/afnor_directory_line_post201_response.py +94 -0
  41. factpulse/models/afnor_directory_line_search_post200_response.py +104 -0
  42. factpulse/models/afnor_entity_type.py +38 -0
  43. factpulse/models/afnor_error.py +97 -0
  44. factpulse/models/afnor_facility_administrative_status.py +38 -0
  45. factpulse/models/afnor_facility_nature.py +38 -0
  46. factpulse/models/afnor_facility_payload_history.py +140 -0
  47. factpulse/models/afnor_facility_payload_history_ule_b2g_additional_data.py +98 -0
  48. factpulse/models/afnor_facility_payload_included.py +134 -0
  49. factpulse/models/afnor_facility_type.py +38 -0
  50. factpulse/models/afnor_flow.py +129 -0
  51. factpulse/models/afnor_flow_ack_status.py +39 -0
  52. factpulse/models/afnor_flow_direction.py +38 -0
  53. factpulse/models/afnor_flow_info.py +112 -0
  54. factpulse/models/afnor_flow_profile.py +39 -0
  55. factpulse/models/afnor_flow_syntax.py +41 -0
  56. factpulse/models/afnor_flow_type.py +49 -0
  57. factpulse/models/afnor_full_flow_info.py +117 -0
  58. factpulse/models/afnor_health_check_response.py +2 -1
  59. factpulse/models/afnor_legal_unit_administrative_status.py +38 -0
  60. factpulse/models/afnor_legal_unit_payload_history.py +107 -0
  61. factpulse/models/afnor_legal_unit_payload_included.py +107 -0
  62. factpulse/models/afnor_legal_unit_payload_included_no_siren.py +95 -0
  63. factpulse/models/afnor_platform_status.py +38 -0
  64. factpulse/models/afnor_processing_rule.py +42 -0
  65. factpulse/models/afnor_reason_code.py +141 -0
  66. factpulse/models/afnor_reason_code_enum.py +51 -0
  67. factpulse/models/afnor_recipient_platform_type.py +38 -0
  68. factpulse/models/afnor_result.py +25 -3
  69. factpulse/models/afnor_routing_code_administrative_status.py +38 -0
  70. factpulse/models/afnor_routing_code_field.py +44 -0
  71. factpulse/models/afnor_routing_code_payload_history_legal_unit_facility.py +158 -0
  72. factpulse/models/afnor_routing_code_post201_response.py +113 -0
  73. factpulse/models/afnor_routing_code_search.py +122 -0
  74. factpulse/models/afnor_routing_code_search_filters.py +128 -0
  75. factpulse/models/afnor_routing_code_search_filters_administrative_status.py +92 -0
  76. factpulse/models/afnor_routing_code_search_filters_routing_code_name.py +102 -0
  77. factpulse/models/afnor_routing_code_search_filters_routing_identifier.py +102 -0
  78. factpulse/models/afnor_routing_code_search_post200_response.py +104 -0
  79. factpulse/models/afnor_routing_code_search_sorting_inner.py +92 -0
  80. factpulse/models/afnor_search_directory_line.py +109 -0
  81. factpulse/models/afnor_search_directory_line_filters.py +116 -0
  82. factpulse/models/afnor_search_directory_line_filters_addressing_identifier.py +92 -0
  83. factpulse/models/afnor_search_directory_line_filters_addressing_suffix.py +92 -0
  84. factpulse/models/afnor_search_directory_line_sorting_inner.py +92 -0
  85. factpulse/models/afnor_search_flow_content.py +104 -0
  86. factpulse/models/afnor_search_flow_filters.py +106 -0
  87. factpulse/models/afnor_search_flow_params.py +95 -0
  88. factpulse/models/afnor_search_siren.py +109 -0
  89. factpulse/models/afnor_search_siren_filters.py +110 -0
  90. factpulse/models/afnor_search_siren_filters_administrative_status.py +92 -0
  91. factpulse/models/afnor_search_siren_filters_business_name.py +92 -0
  92. factpulse/models/afnor_search_siren_filters_entity_type.py +92 -0
  93. factpulse/models/afnor_search_siren_filters_siren.py +102 -0
  94. factpulse/models/afnor_search_siren_sorting_inner.py +92 -0
  95. factpulse/models/afnor_search_siret.py +122 -0
  96. factpulse/models/afnor_search_siret_filters.py +140 -0
  97. factpulse/models/afnor_search_siret_filters_address_lines.py +92 -0
  98. factpulse/models/afnor_search_siret_filters_administrative_status.py +92 -0
  99. factpulse/models/afnor_search_siret_filters_country_subdivision.py +92 -0
  100. factpulse/models/afnor_search_siret_filters_facility_type.py +92 -0
  101. factpulse/models/afnor_search_siret_filters_locality.py +92 -0
  102. factpulse/models/afnor_search_siret_filters_name.py +92 -0
  103. factpulse/models/afnor_search_siret_filters_postal_code.py +102 -0
  104. factpulse/models/afnor_search_siret_filters_siret.py +102 -0
  105. factpulse/models/afnor_search_siret_sorting_inner.py +92 -0
  106. factpulse/models/afnor_siren_field.py +41 -0
  107. factpulse/models/afnor_siren_search_post200_response.py +104 -0
  108. factpulse/models/afnor_siret_field.py +50 -0
  109. factpulse/models/afnor_siret_search_post200_response.py +104 -0
  110. factpulse/models/afnor_sorting_order.py +38 -0
  111. factpulse/models/afnor_strict_operator.py +37 -0
  112. factpulse/models/afnor_update_patch_directory_line_body.py +89 -0
  113. factpulse/models/afnor_update_patch_routing_code_body.py +120 -0
  114. factpulse/models/afnor_update_put_routing_code_body.py +114 -0
  115. factpulse/models/afnor_webhook_callback_content.py +92 -0
  116. factpulse/models/aggregated_payment_input.py +106 -0
  117. factpulse/models/aggregated_transaction_input.py +136 -0
  118. factpulse/models/allowance_charge.py +9 -6
  119. factpulse/models/allowance_charge_reason_code.py +74 -0
  120. factpulse/models/allowance_reason_code.py +2 -1
  121. factpulse/models/allowance_total_amount.py +2 -1
  122. factpulse/models/amount.py +3 -2
  123. factpulse/models/amount1.py +140 -0
  124. factpulse/models/amount_due.py +2 -1
  125. factpulse/models/api_error.py +2 -1
  126. factpulse/models/api_profile.py +41 -0
  127. factpulse/models/async_task_status.py +2 -1
  128. factpulse/models/base_amount.py +2 -1
  129. factpulse/models/bounding_box_schema.py +2 -1
  130. factpulse/models/buyercountry.py +137 -0
  131. factpulse/models/celery_status.py +2 -1
  132. factpulse/models/certificate_info_response.py +2 -1
  133. factpulse/models/charge_total_amount.py +2 -1
  134. factpulse/models/{facture_electronique_rest_api_schemas_chorus_pro_chorus_pro_credentials.py → chorus_pro_credentials.py} +5 -4
  135. factpulse/models/chorus_pro_destination.py +2 -1
  136. factpulse/models/chorus_pro_result.py +2 -1
  137. factpulse/models/contact.py +2 -1
  138. factpulse/models/convert_resume_request.py +2 -1
  139. factpulse/models/convert_success_response.py +2 -1
  140. factpulse/models/convert_validation_failed_response.py +7 -6
  141. factpulse/models/country_code.py +206 -0
  142. factpulse/models/create_aggregated_report_request.py +170 -0
  143. factpulse/models/create_e_reporting_request.py +173 -0
  144. factpulse/models/currency.py +137 -0
  145. factpulse/models/currency_code.py +89 -0
  146. factpulse/models/delivery_party.py +2 -1
  147. factpulse/models/destination.py +2 -1
  148. factpulse/models/directory_line_include.py +40 -0
  149. factpulse/models/doc_type.py +40 -0
  150. factpulse/models/document_type_info.py +2 -1
  151. factpulse/models/e_reporting_flow_type.py +40 -0
  152. factpulse/models/{convert_error_response.py → e_reporting_validation_error.py} +15 -23
  153. factpulse/models/electronic_address.py +4 -3
  154. factpulse/models/enriched_invoice_info.py +8 -7
  155. factpulse/models/error_level.py +2 -1
  156. factpulse/models/error_source.py +2 -1
  157. factpulse/models/extraction_info.py +2 -1
  158. factpulse/models/factur_x_invoice.py +2 -1
  159. factpulse/models/factur_xpdf_info.py +2 -1
  160. factpulse/models/facture_electronique_rest_api_schemas_ereporting_invoice_type_code.py +41 -0
  161. factpulse/models/facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.py +2 -1
  162. factpulse/models/field_status.py +2 -1
  163. factpulse/models/file_info.py +2 -1
  164. factpulse/models/files_info.py +2 -1
  165. factpulse/models/flow_direction.py +2 -1
  166. factpulse/models/flow_profile.py +2 -1
  167. factpulse/models/flow_summary.py +5 -4
  168. factpulse/models/flow_syntax.py +2 -1
  169. factpulse/models/flow_type.py +12 -3
  170. factpulse/models/generate_aggregated_report_response.py +100 -0
  171. factpulse/models/generate_certificate_request.py +2 -1
  172. factpulse/models/generate_certificate_response.py +2 -1
  173. factpulse/models/generate_e_reporting_response.py +96 -0
  174. factpulse/models/get_chorus_pro_id_request.py +5 -4
  175. factpulse/models/get_chorus_pro_id_response.py +2 -1
  176. factpulse/models/get_invoice_request.py +5 -4
  177. factpulse/models/get_invoice_response.py +4 -3
  178. factpulse/models/get_structure_request.py +5 -4
  179. factpulse/models/get_structure_response.py +4 -3
  180. factpulse/models/global_allowance_amount.py +2 -1
  181. factpulse/models/gross_unit_price.py +2 -1
  182. factpulse/models/http_validation_error.py +2 -1
  183. factpulse/models/incoming_invoice.py +8 -29
  184. factpulse/models/incoming_supplier.py +2 -1
  185. factpulse/models/invoice_format.py +2 -1
  186. factpulse/models/invoice_input.py +179 -0
  187. factpulse/models/invoice_line.py +18 -2
  188. factpulse/models/invoice_line_allowance_amount.py +2 -1
  189. factpulse/models/invoice_note.py +4 -3
  190. factpulse/models/invoice_payment_input.py +110 -0
  191. factpulse/models/invoice_references.py +2 -1
  192. factpulse/models/invoice_status.py +2 -1
  193. factpulse/models/invoice_totals.py +2 -1
  194. factpulse/models/invoice_totals_prepayment.py +2 -1
  195. factpulse/models/invoice_type_code.py +2 -1
  196. factpulse/models/invoice_type_code_output.py +52 -0
  197. factpulse/models/invoicing_framework.py +4 -3
  198. factpulse/models/invoicing_framework_code.py +2 -1
  199. factpulse/models/line_net_amount.py +2 -1
  200. factpulse/models/line_sub_type.py +39 -0
  201. factpulse/models/line_total_amount.py +2 -1
  202. factpulse/models/{validation_error_loc_inner.py → location_inner.py} +8 -7
  203. factpulse/models/mandatory_note_schema.py +2 -1
  204. factpulse/models/manual_rate.py +2 -1
  205. factpulse/models/manual_vat_rate.py +2 -1
  206. factpulse/models/missing_field.py +2 -1
  207. factpulse/models/operation_nature.py +2 -1
  208. factpulse/models/output_format.py +2 -1
  209. factpulse/models/page_dimensions_schema.py +2 -1
  210. factpulse/models/payee.py +2 -1
  211. factpulse/models/payment_amount_by_rate.py +98 -0
  212. factpulse/models/payment_card.py +2 -1
  213. factpulse/models/payment_means.py +2 -1
  214. factpulse/models/pdf_validation_result_api.py +2 -1
  215. factpulse/models/pdp_credentials.py +2 -1
  216. factpulse/models/percentage.py +2 -1
  217. factpulse/models/postal_address.py +2 -1
  218. factpulse/models/price_allowance_amount.py +2 -1
  219. factpulse/models/price_basis_quantity.py +2 -1
  220. factpulse/models/processing_options.py +4 -3
  221. factpulse/models/processing_rule.py +42 -0
  222. factpulse/models/product_characteristic.py +2 -1
  223. factpulse/models/product_classification.py +2 -1
  224. factpulse/models/quantity.py +2 -1
  225. factpulse/models/rate.py +140 -0
  226. factpulse/models/rate1.py +140 -0
  227. factpulse/models/recipient.py +2 -1
  228. factpulse/models/report_period.py +91 -0
  229. factpulse/models/report_sender.py +98 -0
  230. factpulse/models/rounding_amount.py +2 -1
  231. factpulse/models/routing_code_include.py +38 -0
  232. factpulse/models/schematron_validation_error.py +128 -0
  233. factpulse/models/scheme_id.py +9 -1
  234. factpulse/models/search_flow_request.py +2 -1
  235. factpulse/models/search_flow_response.py +2 -1
  236. factpulse/models/search_services_response.py +5 -4
  237. factpulse/models/search_structure_request.py +5 -4
  238. factpulse/models/search_structure_response.py +2 -1
  239. factpulse/models/sellercountry.py +137 -0
  240. factpulse/models/signature_info.py +2 -1
  241. factpulse/models/signature_info_api.py +2 -1
  242. factpulse/models/signature_parameters.py +2 -1
  243. factpulse/models/simplified_invoice_data.py +30 -3
  244. factpulse/models/siret_include.py +37 -0
  245. factpulse/models/structure_info.py +2 -1
  246. factpulse/models/structure_parameters.py +2 -1
  247. factpulse/models/structure_service.py +2 -1
  248. factpulse/models/submission_mode.py +2 -1
  249. factpulse/models/submit_aggregated_report_request.py +127 -0
  250. factpulse/models/submit_complete_invoice_request.py +2 -1
  251. factpulse/models/submit_complete_invoice_response.py +2 -1
  252. factpulse/models/submit_e_reporting_request.py +127 -0
  253. factpulse/models/submit_e_reporting_response.py +117 -0
  254. factpulse/models/submit_flow_request.py +2 -1
  255. factpulse/models/submit_flow_response.py +2 -1
  256. factpulse/models/submit_gross_amount.py +2 -1
  257. factpulse/models/submit_invoice_request.py +5 -4
  258. factpulse/models/submit_invoice_response.py +2 -1
  259. factpulse/models/submit_net_amount.py +2 -1
  260. factpulse/models/submit_vat_amount.py +2 -1
  261. factpulse/models/supplementary_attachment.py +7 -6
  262. factpulse/models/supplier.py +2 -1
  263. factpulse/models/task_response.py +2 -1
  264. factpulse/models/tax_breakdown_input.py +104 -0
  265. factpulse/models/tax_due_date_type.py +42 -0
  266. factpulse/models/tax_representative.py +2 -1
  267. factpulse/models/taxable_amount.py +2 -1
  268. factpulse/models/taxableamount.py +140 -0
  269. factpulse/models/taxamount.py +140 -0
  270. factpulse/models/taxamount1.py +140 -0
  271. factpulse/models/taxamount2.py +140 -0
  272. factpulse/models/taxexclusiveamount.py +140 -0
  273. factpulse/models/taxexclusiveamount1.py +140 -0
  274. factpulse/models/total_gross_amount.py +2 -1
  275. factpulse/models/total_net_amount.py +2 -1
  276. factpulse/models/total_vat_amount.py +2 -1
  277. factpulse/models/transaction_category.py +40 -0
  278. factpulse/models/transmission_type_code.py +38 -0
  279. factpulse/models/unit_net_price.py +2 -1
  280. factpulse/models/unit_of_measure.py +2 -1
  281. factpulse/models/validate_e_reporting_request.py +92 -0
  282. factpulse/models/validate_e_reporting_response.py +113 -0
  283. factpulse/models/validation_error.py +5 -4
  284. factpulse/models/validation_error_detail.py +2 -1
  285. factpulse/models/validation_error_response.py +2 -1
  286. factpulse/models/validation_info.py +5 -4
  287. factpulse/models/validation_success_response.py +2 -1
  288. factpulse/models/vat_accounting_code.py +2 -1
  289. factpulse/models/vat_amount.py +2 -1
  290. factpulse/models/vat_category.py +2 -1
  291. factpulse/models/vat_line.py +2 -1
  292. factpulse/models/vat_point_date_code.py +2 -1
  293. factpulse/models/vat_rate.py +2 -1
  294. factpulse/models/verification_success_response.py +2 -1
  295. factpulse/models/verified_field_schema.py +2 -1
  296. factpulse/rest.py +2 -1
  297. {factpulse-3.0.7.dist-info → factpulse-3.0.23.dist-info}/METADATA +42 -40
  298. factpulse-3.0.23.dist-info/RECORD +306 -0
  299. {factpulse-3.0.7.dist-info → factpulse-3.0.23.dist-info}/licenses/LICENSE +1 -1
  300. factpulse_helpers/client.py +2 -1
  301. factpulse/models/convert_pending_input_response.py +0 -114
  302. factpulse/models/factur_x_profile.py +0 -39
  303. factpulse-3.0.7.dist-info/RECORD +0 -168
  304. {factpulse-3.0.7.dist-info → factpulse-3.0.23.dist-info}/WHEEL +0 -0
  305. {factpulse-3.0.7.dist-info → factpulse-3.0.23.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,140 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ FactPulse REST API
5
+
6
+ REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://factpulse.fr/api/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://factpulse.fr/documentation-api/
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: contact@factpulse.fr
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing_extensions import Annotated
24
+ from factpulse.models.afnor_address_read import AFNORAddressRead
25
+ from factpulse.models.afnor_diffusion_status import AFNORDiffusionStatus
26
+ from factpulse.models.afnor_facility_administrative_status import AFNORFacilityAdministrativeStatus
27
+ from factpulse.models.afnor_facility_payload_history_ule_b2g_additional_data import AFNORFacilityPayloadHistoryUleB2gAdditionalData
28
+ from factpulse.models.afnor_facility_type import AFNORFacilityType
29
+ from factpulse.models.afnor_legal_unit_payload_included_no_siren import AFNORLegalUnitPayloadIncludedNoSiren
30
+ from typing import Optional, Set
31
+ from typing_extensions import Self
32
+
33
+ class AFNORFacilityPayloadHistory(BaseModel):
34
+ """
35
+ AFNORFacilityPayloadHistory
36
+ """ # noqa: E501
37
+ siret: Optional[Annotated[str, Field(strict=True, max_length=14)]] = Field(default=None, description="SIRET Number")
38
+ siren: Optional[Annotated[str, Field(strict=True, max_length=9)]] = Field(default=None, description="SIREN number")
39
+ name: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="business name")
40
+ facility_type: Optional[AFNORFacilityType] = Field(default=None, alias="facilityType")
41
+ diffusible: Optional[AFNORDiffusionStatus] = None
42
+ administrative_status: Optional[AFNORFacilityAdministrativeStatus] = Field(default=None, alias="administrativeStatus")
43
+ address: Optional[AFNORAddressRead] = None
44
+ b2g_additional_data: Optional[AFNORFacilityPayloadHistoryUleB2gAdditionalData] = Field(default=None, alias="b2gAdditionalData")
45
+ legal_unit: Optional[AFNORLegalUnitPayloadIncludedNoSiren] = Field(default=None, alias="legalUnit")
46
+ __properties: ClassVar[List[str]] = ["siret", "siren", "name", "facilityType", "diffusible", "administrativeStatus", "address", "b2gAdditionalData", "legalUnit"]
47
+
48
+ @field_validator('siret')
49
+ def siret_validate_regular_expression(cls, value):
50
+ """Validates the regular expression"""
51
+ if value is None:
52
+ return value
53
+
54
+ if not re.match(r"^([0-9]{14})$", value):
55
+ raise ValueError(r"must validate the regular expression /^([0-9]{14})$/")
56
+ return value
57
+
58
+ @field_validator('siren')
59
+ def siren_validate_regular_expression(cls, value):
60
+ """Validates the regular expression"""
61
+ if value is None:
62
+ return value
63
+
64
+ if not re.match(r"^([0-9]{9})$", value):
65
+ raise ValueError(r"must validate the regular expression /^([0-9]{9})$/")
66
+ return value
67
+
68
+ model_config = ConfigDict(
69
+ populate_by_name=True,
70
+ validate_assignment=True,
71
+ protected_namespaces=(),
72
+ )
73
+
74
+
75
+ def to_str(self) -> str:
76
+ """Returns the string representation of the model using alias"""
77
+ return pprint.pformat(self.model_dump(by_alias=True))
78
+
79
+ def to_json(self) -> str:
80
+ """Returns the JSON representation of the model using alias"""
81
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
82
+ return json.dumps(self.to_dict())
83
+
84
+ @classmethod
85
+ def from_json(cls, json_str: str) -> Optional[Self]:
86
+ """Create an instance of AFNORFacilityPayloadHistory from a JSON string"""
87
+ return cls.from_dict(json.loads(json_str))
88
+
89
+ def to_dict(self) -> Dict[str, Any]:
90
+ """Return the dictionary representation of the model using alias.
91
+
92
+ This has the following differences from calling pydantic's
93
+ `self.model_dump(by_alias=True)`:
94
+
95
+ * `None` is only added to the output dict for nullable fields that
96
+ were set at model initialization. Other fields with value `None`
97
+ are ignored.
98
+ """
99
+ excluded_fields: Set[str] = set([
100
+ ])
101
+
102
+ _dict = self.model_dump(
103
+ by_alias=True,
104
+ exclude=excluded_fields,
105
+ exclude_none=True,
106
+ )
107
+ # override the default output from pydantic by calling `to_dict()` of address
108
+ if self.address:
109
+ _dict['address'] = self.address.to_dict()
110
+ # override the default output from pydantic by calling `to_dict()` of b2g_additional_data
111
+ if self.b2g_additional_data:
112
+ _dict['b2gAdditionalData'] = self.b2g_additional_data.to_dict()
113
+ # override the default output from pydantic by calling `to_dict()` of legal_unit
114
+ if self.legal_unit:
115
+ _dict['legalUnit'] = self.legal_unit.to_dict()
116
+ return _dict
117
+
118
+ @classmethod
119
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
120
+ """Create an instance of AFNORFacilityPayloadHistory from a dict"""
121
+ if obj is None:
122
+ return None
123
+
124
+ if not isinstance(obj, dict):
125
+ return cls.model_validate(obj)
126
+
127
+ _obj = cls.model_validate({
128
+ "siret": obj.get("siret"),
129
+ "siren": obj.get("siren"),
130
+ "name": obj.get("name"),
131
+ "facilityType": obj.get("facilityType"),
132
+ "diffusible": obj.get("diffusible"),
133
+ "administrativeStatus": obj.get("administrativeStatus"),
134
+ "address": AFNORAddressRead.from_dict(obj["address"]) if obj.get("address") is not None else None,
135
+ "b2gAdditionalData": AFNORFacilityPayloadHistoryUleB2gAdditionalData.from_dict(obj["b2gAdditionalData"]) if obj.get("b2gAdditionalData") is not None else None,
136
+ "legalUnit": AFNORLegalUnitPayloadIncludedNoSiren.from_dict(obj["legalUnit"]) if obj.get("legalUnit") is not None else None
137
+ })
138
+ return _obj
139
+
140
+
@@ -0,0 +1,98 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ FactPulse REST API
5
+
6
+ REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://factpulse.fr/api/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://factpulse.fr/documentation-api/
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: contact@factpulse.fr
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class AFNORFacilityPayloadHistoryUleB2gAdditionalData(BaseModel):
27
+ """
28
+ AFNORFacilityPayloadHistoryUleB2gAdditionalData
29
+ """ # noqa: E501
30
+ pm: Optional[StrictBool] = Field(default=None, description="Indicates whether the public structure acts as project manager for work invoices in addition to receiving simple invoices. This attribute is only returned if the directory line is defined for a public structure at the SIREN / SIRET or SIREN / SIRET / Routing code level.")
31
+ pm_only: Optional[StrictBool] = Field(default=None, description="Indicates whether the public structure only acts as a project manager; if so, it can only receive invoices for work. This attribute is only returned if the directory line is defined for a public structure at the SIREN/SIRET or SIREN/SIRET/Routing code level.", alias="pmOnly")
32
+ manages_payment_status: Optional[StrictBool] = Field(default=None, description="Indicates whether the public structure manages the payment status of invoices. This attribute is only returned if the directory line is defined for a public structure at the SIREN / SIRET or SIREN / SIRET / Routing code level.", alias="managesPaymentStatus")
33
+ manages_legal_commitment_code: Optional[StrictBool] = Field(default=None, description="Indicates whether the public structure requires a legal commitment number. This attribute is only returned if the directory line is defined for a public structure at the SIREN / SIRET or SIREN / SIRET / Routing code level.", alias="managesLegalCommitmentCode")
34
+ manages_legal_commitment_or_service_code: Optional[StrictBool] = Field(default=None, description="Indicates whether the public structure requires a service code or a commitment code in its exchanges. This attribute is only returned if the directory line is defined for a public structure at the SIREN / SIRET or SIREN / SIRET / Routing code level.", alias="managesLegalCommitmentOrServiceCode")
35
+ service_code_status: Optional[StrictBool] = Field(default=None, description="Indicates whether the structure requires a service code. This attribute is only returned if the directory line is defined for a public structure at the SIREN / SIRET or SIREN / SIRET / Routing code level.", alias="serviceCodeStatus")
36
+ __properties: ClassVar[List[str]] = ["pm", "pmOnly", "managesPaymentStatus", "managesLegalCommitmentCode", "managesLegalCommitmentOrServiceCode", "serviceCodeStatus"]
37
+
38
+ model_config = ConfigDict(
39
+ populate_by_name=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
+ return json.dumps(self.to_dict())
53
+
54
+ @classmethod
55
+ def from_json(cls, json_str: str) -> Optional[Self]:
56
+ """Create an instance of AFNORFacilityPayloadHistoryUleB2gAdditionalData from a JSON string"""
57
+ return cls.from_dict(json.loads(json_str))
58
+
59
+ def to_dict(self) -> Dict[str, Any]:
60
+ """Return the dictionary representation of the model using alias.
61
+
62
+ This has the following differences from calling pydantic's
63
+ `self.model_dump(by_alias=True)`:
64
+
65
+ * `None` is only added to the output dict for nullable fields that
66
+ were set at model initialization. Other fields with value `None`
67
+ are ignored.
68
+ """
69
+ excluded_fields: Set[str] = set([
70
+ ])
71
+
72
+ _dict = self.model_dump(
73
+ by_alias=True,
74
+ exclude=excluded_fields,
75
+ exclude_none=True,
76
+ )
77
+ return _dict
78
+
79
+ @classmethod
80
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
81
+ """Create an instance of AFNORFacilityPayloadHistoryUleB2gAdditionalData from a dict"""
82
+ if obj is None:
83
+ return None
84
+
85
+ if not isinstance(obj, dict):
86
+ return cls.model_validate(obj)
87
+
88
+ _obj = cls.model_validate({
89
+ "pm": obj.get("pm"),
90
+ "pmOnly": obj.get("pmOnly"),
91
+ "managesPaymentStatus": obj.get("managesPaymentStatus"),
92
+ "managesLegalCommitmentCode": obj.get("managesLegalCommitmentCode"),
93
+ "managesLegalCommitmentOrServiceCode": obj.get("managesLegalCommitmentOrServiceCode"),
94
+ "serviceCodeStatus": obj.get("serviceCodeStatus")
95
+ })
96
+ return _obj
97
+
98
+
@@ -0,0 +1,134 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ FactPulse REST API
5
+
6
+ REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://factpulse.fr/api/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://factpulse.fr/documentation-api/
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: contact@factpulse.fr
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing_extensions import Annotated
24
+ from factpulse.models.afnor_address_read import AFNORAddressRead
25
+ from factpulse.models.afnor_diffusion_status import AFNORDiffusionStatus
26
+ from factpulse.models.afnor_facility_administrative_status import AFNORFacilityAdministrativeStatus
27
+ from factpulse.models.afnor_facility_payload_history_ule_b2g_additional_data import AFNORFacilityPayloadHistoryUleB2gAdditionalData
28
+ from factpulse.models.afnor_facility_type import AFNORFacilityType
29
+ from typing import Optional, Set
30
+ from typing_extensions import Self
31
+
32
+ class AFNORFacilityPayloadIncluded(BaseModel):
33
+ """
34
+ AFNORFacilityPayloadIncluded
35
+ """ # noqa: E501
36
+ siret: Optional[Annotated[str, Field(strict=True, max_length=14)]] = Field(default=None, description="SIRET Number")
37
+ siren: Optional[Annotated[str, Field(strict=True, max_length=9)]] = Field(default=None, description="SIREN number")
38
+ name: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field(default=None, description="business name")
39
+ facility_type: Optional[AFNORFacilityType] = Field(default=None, alias="facilityType")
40
+ diffusible: Optional[AFNORDiffusionStatus] = None
41
+ administrative_status: Optional[AFNORFacilityAdministrativeStatus] = Field(default=None, alias="administrativeStatus")
42
+ address: Optional[AFNORAddressRead] = None
43
+ b2g_additional_data: Optional[AFNORFacilityPayloadHistoryUleB2gAdditionalData] = Field(default=None, alias="b2gAdditionalData")
44
+ __properties: ClassVar[List[str]] = ["siret", "siren", "name", "facilityType", "diffusible", "administrativeStatus", "address", "b2gAdditionalData"]
45
+
46
+ @field_validator('siret')
47
+ def siret_validate_regular_expression(cls, value):
48
+ """Validates the regular expression"""
49
+ if value is None:
50
+ return value
51
+
52
+ if not re.match(r"^([0-9]{14})$", value):
53
+ raise ValueError(r"must validate the regular expression /^([0-9]{14})$/")
54
+ return value
55
+
56
+ @field_validator('siren')
57
+ def siren_validate_regular_expression(cls, value):
58
+ """Validates the regular expression"""
59
+ if value is None:
60
+ return value
61
+
62
+ if not re.match(r"^([0-9]{9})$", value):
63
+ raise ValueError(r"must validate the regular expression /^([0-9]{9})$/")
64
+ return value
65
+
66
+ model_config = ConfigDict(
67
+ populate_by_name=True,
68
+ validate_assignment=True,
69
+ protected_namespaces=(),
70
+ )
71
+
72
+
73
+ def to_str(self) -> str:
74
+ """Returns the string representation of the model using alias"""
75
+ return pprint.pformat(self.model_dump(by_alias=True))
76
+
77
+ def to_json(self) -> str:
78
+ """Returns the JSON representation of the model using alias"""
79
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
80
+ return json.dumps(self.to_dict())
81
+
82
+ @classmethod
83
+ def from_json(cls, json_str: str) -> Optional[Self]:
84
+ """Create an instance of AFNORFacilityPayloadIncluded from a JSON string"""
85
+ return cls.from_dict(json.loads(json_str))
86
+
87
+ def to_dict(self) -> Dict[str, Any]:
88
+ """Return the dictionary representation of the model using alias.
89
+
90
+ This has the following differences from calling pydantic's
91
+ `self.model_dump(by_alias=True)`:
92
+
93
+ * `None` is only added to the output dict for nullable fields that
94
+ were set at model initialization. Other fields with value `None`
95
+ are ignored.
96
+ """
97
+ excluded_fields: Set[str] = set([
98
+ ])
99
+
100
+ _dict = self.model_dump(
101
+ by_alias=True,
102
+ exclude=excluded_fields,
103
+ exclude_none=True,
104
+ )
105
+ # override the default output from pydantic by calling `to_dict()` of address
106
+ if self.address:
107
+ _dict['address'] = self.address.to_dict()
108
+ # override the default output from pydantic by calling `to_dict()` of b2g_additional_data
109
+ if self.b2g_additional_data:
110
+ _dict['b2gAdditionalData'] = self.b2g_additional_data.to_dict()
111
+ return _dict
112
+
113
+ @classmethod
114
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
115
+ """Create an instance of AFNORFacilityPayloadIncluded from a dict"""
116
+ if obj is None:
117
+ return None
118
+
119
+ if not isinstance(obj, dict):
120
+ return cls.model_validate(obj)
121
+
122
+ _obj = cls.model_validate({
123
+ "siret": obj.get("siret"),
124
+ "siren": obj.get("siren"),
125
+ "name": obj.get("name"),
126
+ "facilityType": obj.get("facilityType"),
127
+ "diffusible": obj.get("diffusible"),
128
+ "administrativeStatus": obj.get("administrativeStatus"),
129
+ "address": AFNORAddressRead.from_dict(obj["address"]) if obj.get("address") is not None else None,
130
+ "b2gAdditionalData": AFNORFacilityPayloadHistoryUleB2gAdditionalData.from_dict(obj["b2gAdditionalData"]) if obj.get("b2gAdditionalData") is not None else None
131
+ })
132
+ return _obj
133
+
134
+
@@ -0,0 +1,38 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ FactPulse REST API
5
+
6
+ REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://factpulse.fr/api/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://factpulse.fr/documentation-api/
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: contact@factpulse.fr
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import json
18
+ from enum import Enum
19
+ from typing_extensions import Self
20
+
21
+
22
+ class AFNORFacilityType(str, Enum):
23
+ """
24
+ Indicates whether the facility is listed as the main facility or not [P - Main facility , S - Secondary facility]
25
+ """
26
+
27
+ """
28
+ allowed enum values
29
+ """
30
+ P = 'P'
31
+ S = 'S'
32
+
33
+ @classmethod
34
+ def from_json(cls, json_str: str) -> Self:
35
+ """Create an instance of AFNORFacilityType from a JSON string"""
36
+ return cls(json.loads(json_str))
37
+
38
+
@@ -0,0 +1,129 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ FactPulse REST API
5
+
6
+ REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://factpulse.fr/api/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://factpulse.fr/documentation-api/
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: contact@factpulse.fr
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from datetime import datetime
22
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
23
+ from typing import Any, ClassVar, Dict, List, Optional
24
+ from typing_extensions import Annotated
25
+ from factpulse.models.afnor_acknowledgement import AFNORAcknowledgement
26
+ from factpulse.models.afnor_flow_direction import AFNORFlowDirection
27
+ from factpulse.models.afnor_flow_profile import AFNORFlowProfile
28
+ from factpulse.models.afnor_flow_syntax import AFNORFlowSyntax
29
+ from factpulse.models.afnor_flow_type import AFNORFlowType
30
+ from factpulse.models.afnor_processing_rule import AFNORProcessingRule
31
+ from typing import Optional, Set
32
+ from typing_extensions import Self
33
+
34
+ class AFNORFlow(BaseModel):
35
+ """
36
+ The properties of a Flow resource
37
+ """ # noqa: E501
38
+ submitted_at: Optional[datetime] = Field(default=None, description="The flow submission date and time (the date and time when the flow was created on the system) ", alias="submittedAt")
39
+ updated_at: Optional[datetime] = Field(default=None, description="The last update date and time of the flow. When the flow is submitted updatedAt is equal to submittedAt. When the flow acknowledgment status is changed updatedAt date and time is updated. ", alias="updatedAt")
40
+ flow_id: Optional[Annotated[str, Field(strict=True, max_length=36)]] = Field(default=None, description="Unique identifier supporting UUID but not only, for flexibility purpose", alias="flowId")
41
+ tracking_id: Optional[Annotated[str, Field(strict=True, max_length=36)]] = Field(default=None, description="Unique identifier supporting UUID but not only, for flexibility purpose", alias="trackingId")
42
+ flow_type: Optional[AFNORFlowType] = Field(default=None, alias="flowType")
43
+ processing_rule: Optional[AFNORProcessingRule] = Field(default=None, alias="processingRule")
44
+ processing_rule_source: Optional[StrictStr] = Field(default=None, description="Says whether the processing rule has been computed or the processing rule was an input parameter", alias="processingRuleSource")
45
+ flow_direction: Optional[AFNORFlowDirection] = Field(default=None, alias="flowDirection")
46
+ flow_syntax: Optional[AFNORFlowSyntax] = Field(default=None, alias="flowSyntax")
47
+ flow_profile: Optional[AFNORFlowProfile] = Field(default=None, alias="flowProfile")
48
+ acknowledgement: Optional[AFNORAcknowledgement] = None
49
+ __properties: ClassVar[List[str]] = ["submittedAt", "updatedAt", "flowId", "trackingId", "flowType", "processingRule", "processingRuleSource", "flowDirection", "flowSyntax", "flowProfile", "acknowledgement"]
50
+
51
+ @field_validator('processing_rule_source')
52
+ def processing_rule_source_validate_enum(cls, value):
53
+ """Validates the enum"""
54
+ if value is None:
55
+ return value
56
+
57
+ if value not in set(['Input', 'Computed']):
58
+ raise ValueError("must be one of enum values ('Input', 'Computed')")
59
+ return value
60
+
61
+ model_config = ConfigDict(
62
+ populate_by_name=True,
63
+ validate_assignment=True,
64
+ protected_namespaces=(),
65
+ )
66
+
67
+
68
+ def to_str(self) -> str:
69
+ """Returns the string representation of the model using alias"""
70
+ return pprint.pformat(self.model_dump(by_alias=True))
71
+
72
+ def to_json(self) -> str:
73
+ """Returns the JSON representation of the model using alias"""
74
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
75
+ return json.dumps(self.to_dict())
76
+
77
+ @classmethod
78
+ def from_json(cls, json_str: str) -> Optional[Self]:
79
+ """Create an instance of AFNORFlow from a JSON string"""
80
+ return cls.from_dict(json.loads(json_str))
81
+
82
+ def to_dict(self) -> Dict[str, Any]:
83
+ """Return the dictionary representation of the model using alias.
84
+
85
+ This has the following differences from calling pydantic's
86
+ `self.model_dump(by_alias=True)`:
87
+
88
+ * `None` is only added to the output dict for nullable fields that
89
+ were set at model initialization. Other fields with value `None`
90
+ are ignored.
91
+ """
92
+ excluded_fields: Set[str] = set([
93
+ ])
94
+
95
+ _dict = self.model_dump(
96
+ by_alias=True,
97
+ exclude=excluded_fields,
98
+ exclude_none=True,
99
+ )
100
+ # override the default output from pydantic by calling `to_dict()` of acknowledgement
101
+ if self.acknowledgement:
102
+ _dict['acknowledgement'] = self.acknowledgement.to_dict()
103
+ return _dict
104
+
105
+ @classmethod
106
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
107
+ """Create an instance of AFNORFlow from a dict"""
108
+ if obj is None:
109
+ return None
110
+
111
+ if not isinstance(obj, dict):
112
+ return cls.model_validate(obj)
113
+
114
+ _obj = cls.model_validate({
115
+ "submittedAt": obj.get("submittedAt"),
116
+ "updatedAt": obj.get("updatedAt"),
117
+ "flowId": obj.get("flowId"),
118
+ "trackingId": obj.get("trackingId"),
119
+ "flowType": obj.get("flowType"),
120
+ "processingRule": obj.get("processingRule"),
121
+ "processingRuleSource": obj.get("processingRuleSource"),
122
+ "flowDirection": obj.get("flowDirection"),
123
+ "flowSyntax": obj.get("flowSyntax"),
124
+ "flowProfile": obj.get("flowProfile"),
125
+ "acknowledgement": AFNORAcknowledgement.from_dict(obj["acknowledgement"]) if obj.get("acknowledgement") is not None else None
126
+ })
127
+ return _obj
128
+
129
+
@@ -0,0 +1,39 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ FactPulse REST API
5
+
6
+ REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://factpulse.fr/api/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://factpulse.fr/documentation-api/
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: contact@factpulse.fr
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import json
18
+ from enum import Enum
19
+ from typing_extensions import Self
20
+
21
+
22
+ class AFNORFlowAckStatus(str, Enum):
23
+ """
24
+ - `Ok`: the following checks have passed: - Anti virus - Integrity checks - Technical rules checks - Unicity checks - `Error`: one of the previous test has failed - `Pending` : the flow is not yet integrated
25
+ """
26
+
27
+ """
28
+ allowed enum values
29
+ """
30
+ PENDING = 'Pending'
31
+ OK = 'Ok'
32
+ ERROR = 'Error'
33
+
34
+ @classmethod
35
+ def from_json(cls, json_str: str) -> Self:
36
+ """Create an instance of AFNORFlowAckStatus from a JSON string"""
37
+ return cls(json.loads(json_str))
38
+
39
+