factpulse 2.0.37__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 (400) hide show
  1. factpulse/__init__.py +542 -197
  2. factpulse/api/__init__.py +7 -4
  3. factpulse/api/afnorpdppa_api.py +49 -47
  4. factpulse/api/afnorpdppa_directory_service_api.py +1225 -310
  5. factpulse/api/afnorpdppa_flow_service_api.py +212 -81
  6. factpulse/api/chorus_pro_api.py +271 -218
  7. factpulse/api/document_conversion_api.py +1222 -0
  8. factpulse/api/downloads_api.py +1171 -0
  9. factpulse/api/e_reporting_api.py +3254 -0
  10. factpulse/api/{sant_api.py → health_api.py} +29 -22
  11. factpulse/api/invoice_processing_api.py +3634 -0
  12. factpulse/api/{vrification_pdfxml_api.py → pdfxml_verification_api.py} +331 -252
  13. factpulse/api/{utilisateur_api.py → user_api.py} +21 -17
  14. factpulse/api_client.py +4 -3
  15. factpulse/configuration.py +11 -6
  16. factpulse/exceptions.py +3 -2
  17. factpulse/models/__init__.py +265 -95
  18. factpulse/models/accept_language.py +38 -0
  19. factpulse/models/acknowledgment_status.py +39 -0
  20. factpulse/models/additional_document.py +116 -0
  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 +107 -0
  34. factpulse/models/afnor_destination.py +127 -0
  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 +92 -0
  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 +127 -0
  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 +150 -0
  119. factpulse/models/allowance_charge_reason_code.py +74 -0
  120. factpulse/models/allowance_reason_code.py +43 -0
  121. factpulse/models/allowance_total_amount.py +146 -0
  122. factpulse/models/amount.py +140 -0
  123. factpulse/models/amount1.py +140 -0
  124. factpulse/models/amount_due.py +140 -0
  125. factpulse/models/api_error.py +6 -5
  126. factpulse/models/api_profile.py +41 -0
  127. factpulse/models/async_task_status.py +98 -0
  128. factpulse/models/base_amount.py +146 -0
  129. factpulse/models/bounding_box_schema.py +11 -10
  130. factpulse/models/buyercountry.py +137 -0
  131. factpulse/models/celery_status.py +41 -0
  132. factpulse/models/certificate_info_response.py +25 -24
  133. factpulse/models/charge_total_amount.py +146 -0
  134. factpulse/models/chorus_pro_credentials.py +14 -13
  135. factpulse/models/chorus_pro_destination.py +109 -0
  136. factpulse/models/chorus_pro_result.py +102 -0
  137. factpulse/models/contact.py +114 -0
  138. factpulse/models/convert_resume_request.py +88 -0
  139. factpulse/models/convert_success_response.py +127 -0
  140. factpulse/models/convert_validation_failed_response.py +121 -0
  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 +122 -0
  147. factpulse/models/destination.py +28 -27
  148. factpulse/models/directory_line_include.py +40 -0
  149. factpulse/models/doc_type.py +40 -0
  150. factpulse/models/document_type_info.py +92 -0
  151. factpulse/models/e_reporting_flow_type.py +40 -0
  152. factpulse/models/e_reporting_validation_error.py +97 -0
  153. factpulse/models/electronic_address.py +91 -0
  154. factpulse/models/enriched_invoice_info.py +134 -0
  155. factpulse/models/error_level.py +3 -2
  156. factpulse/models/error_source.py +3 -2
  157. factpulse/models/extraction_info.py +94 -0
  158. factpulse/models/factur_x_invoice.py +321 -0
  159. factpulse/models/factur_xpdf_info.py +92 -0
  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 +116 -0
  162. factpulse/models/field_status.py +41 -0
  163. factpulse/models/file_info.py +95 -0
  164. factpulse/models/files_info.py +107 -0
  165. factpulse/models/flow_direction.py +38 -0
  166. factpulse/models/flow_profile.py +39 -0
  167. factpulse/models/flow_summary.py +132 -0
  168. factpulse/models/flow_syntax.py +41 -0
  169. factpulse/models/flow_type.py +49 -0
  170. factpulse/models/generate_aggregated_report_response.py +100 -0
  171. factpulse/models/generate_certificate_request.py +27 -26
  172. factpulse/models/generate_certificate_response.py +16 -15
  173. factpulse/models/generate_e_reporting_response.py +96 -0
  174. factpulse/models/get_chorus_pro_id_request.py +101 -0
  175. factpulse/models/get_chorus_pro_id_response.py +99 -0
  176. factpulse/models/get_invoice_request.py +99 -0
  177. factpulse/models/get_invoice_response.py +143 -0
  178. factpulse/models/get_structure_request.py +101 -0
  179. factpulse/models/get_structure_response.py +143 -0
  180. factpulse/models/global_allowance_amount.py +140 -0
  181. factpulse/models/gross_unit_price.py +146 -0
  182. factpulse/models/http_validation_error.py +3 -2
  183. factpulse/models/incoming_invoice.py +175 -0
  184. factpulse/models/incoming_supplier.py +145 -0
  185. factpulse/models/invoice_format.py +39 -0
  186. factpulse/models/invoice_input.py +179 -0
  187. factpulse/models/invoice_line.py +370 -0
  188. factpulse/models/invoice_line_allowance_amount.py +146 -0
  189. factpulse/models/invoice_note.py +95 -0
  190. factpulse/models/invoice_payment_input.py +110 -0
  191. factpulse/models/invoice_references.py +195 -0
  192. factpulse/models/invoice_status.py +97 -0
  193. factpulse/models/invoice_totals.py +178 -0
  194. factpulse/models/invoice_totals_prepayment.py +146 -0
  195. factpulse/models/invoice_type_code.py +52 -0
  196. factpulse/models/invoice_type_code_output.py +52 -0
  197. factpulse/models/invoicing_framework.py +111 -0
  198. factpulse/models/invoicing_framework_code.py +40 -0
  199. factpulse/models/line_net_amount.py +146 -0
  200. factpulse/models/line_sub_type.py +39 -0
  201. factpulse/models/line_total_amount.py +146 -0
  202. factpulse/models/location_inner.py +139 -0
  203. factpulse/models/mandatory_note_schema.py +125 -0
  204. factpulse/models/manual_rate.py +140 -0
  205. factpulse/models/manual_vat_rate.py +140 -0
  206. factpulse/models/missing_field.py +108 -0
  207. factpulse/models/operation_nature.py +50 -0
  208. factpulse/models/output_format.py +38 -0
  209. factpulse/models/page_dimensions_schema.py +90 -0
  210. factpulse/models/payee.py +169 -0
  211. factpulse/models/payment_amount_by_rate.py +98 -0
  212. factpulse/models/payment_card.py +100 -0
  213. factpulse/models/payment_means.py +42 -0
  214. factpulse/models/pdf_validation_result_api.py +170 -0
  215. factpulse/models/pdp_credentials.py +16 -15
  216. factpulse/models/percentage.py +146 -0
  217. factpulse/models/postal_address.py +135 -0
  218. factpulse/models/price_allowance_amount.py +146 -0
  219. factpulse/models/price_basis_quantity.py +146 -0
  220. factpulse/models/processing_options.py +95 -0
  221. factpulse/models/processing_rule.py +42 -0
  222. factpulse/models/product_characteristic.py +90 -0
  223. factpulse/models/product_classification.py +102 -0
  224. factpulse/models/quantity.py +140 -0
  225. factpulse/models/rate.py +140 -0
  226. factpulse/models/rate1.py +140 -0
  227. factpulse/models/recipient.py +168 -0
  228. factpulse/models/report_period.py +91 -0
  229. factpulse/models/report_sender.py +98 -0
  230. factpulse/models/rounding_amount.py +146 -0
  231. factpulse/models/routing_code_include.py +38 -0
  232. factpulse/models/schematron_validation_error.py +128 -0
  233. factpulse/models/scheme_id.py +18 -4
  234. factpulse/models/search_flow_request.py +144 -0
  235. factpulse/models/search_flow_response.py +102 -0
  236. factpulse/models/search_services_response.py +102 -0
  237. factpulse/models/search_structure_request.py +120 -0
  238. factpulse/models/search_structure_response.py +102 -0
  239. factpulse/models/sellercountry.py +137 -0
  240. factpulse/models/signature_info.py +7 -6
  241. factpulse/models/signature_info_api.py +123 -0
  242. factpulse/models/signature_parameters.py +134 -0
  243. factpulse/models/simplified_invoice_data.py +151 -0
  244. factpulse/models/siret_include.py +37 -0
  245. factpulse/models/structure_info.py +15 -14
  246. factpulse/models/structure_parameters.py +92 -0
  247. factpulse/models/structure_service.py +94 -0
  248. factpulse/models/submission_mode.py +39 -0
  249. factpulse/models/submit_aggregated_report_request.py +127 -0
  250. factpulse/models/submit_complete_invoice_request.py +117 -0
  251. factpulse/models/submit_complete_invoice_response.py +146 -0
  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 +124 -0
  255. factpulse/models/submit_flow_response.py +110 -0
  256. factpulse/models/submit_gross_amount.py +140 -0
  257. factpulse/models/submit_invoice_request.py +177 -0
  258. factpulse/models/submit_invoice_response.py +104 -0
  259. factpulse/models/submit_net_amount.py +140 -0
  260. factpulse/models/submit_vat_amount.py +140 -0
  261. factpulse/models/supplementary_attachment.py +96 -0
  262. factpulse/models/supplier.py +226 -0
  263. factpulse/models/task_response.py +88 -0
  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 +96 -0
  267. factpulse/models/taxable_amount.py +140 -0
  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 +140 -0
  275. factpulse/models/total_net_amount.py +140 -0
  276. factpulse/models/total_vat_amount.py +140 -0
  277. factpulse/models/transaction_category.py +40 -0
  278. factpulse/models/transmission_type_code.py +38 -0
  279. factpulse/models/unit_net_price.py +140 -0
  280. factpulse/models/unit_of_measure.py +42 -0
  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 +6 -5
  284. factpulse/models/validation_error_detail.py +7 -6
  285. factpulse/models/validation_error_response.py +88 -0
  286. factpulse/models/validation_info.py +106 -0
  287. factpulse/models/validation_success_response.py +88 -0
  288. factpulse/models/vat_accounting_code.py +40 -0
  289. factpulse/models/vat_amount.py +140 -0
  290. factpulse/models/vat_category.py +45 -0
  291. factpulse/models/vat_line.py +141 -0
  292. factpulse/models/vat_point_date_code.py +39 -0
  293. factpulse/models/vat_rate.py +146 -0
  294. factpulse/models/verification_success_response.py +136 -0
  295. factpulse/models/verified_field_schema.py +130 -0
  296. factpulse/rest.py +3 -2
  297. factpulse-3.0.23.dist-info/METADATA +294 -0
  298. factpulse-3.0.23.dist-info/RECORD +306 -0
  299. {factpulse-2.0.37.dist-info → factpulse-3.0.23.dist-info}/licenses/LICENSE +1 -1
  300. factpulse_helpers/__init__.py +34 -34
  301. factpulse_helpers/client.py +1020 -795
  302. factpulse_helpers/exceptions.py +68 -68
  303. factpulse/api/traitement_facture_api.py +0 -3437
  304. factpulse/models/adresse_electronique.py +0 -90
  305. factpulse/models/adresse_postale.py +0 -120
  306. factpulse/models/cadre_de_facturation.py +0 -110
  307. factpulse/models/categorie_tva.py +0 -44
  308. factpulse/models/champ_verifie_schema.py +0 -129
  309. factpulse/models/code_cadre_facturation.py +0 -39
  310. factpulse/models/code_raison_reduction.py +0 -42
  311. factpulse/models/consulter_facture_request.py +0 -98
  312. factpulse/models/consulter_facture_response.py +0 -142
  313. factpulse/models/consulter_structure_request.py +0 -100
  314. factpulse/models/consulter_structure_response.py +0 -142
  315. factpulse/models/credentials_afnor.py +0 -106
  316. factpulse/models/credentials_chorus_pro.py +0 -115
  317. factpulse/models/destinataire.py +0 -130
  318. factpulse/models/destination_afnor.py +0 -127
  319. factpulse/models/destination_chorus_pro.py +0 -108
  320. factpulse/models/dimension_page_schema.py +0 -89
  321. factpulse/models/direction_flux.py +0 -37
  322. factpulse/models/donnees_facture_simplifiees.py +0 -124
  323. factpulse/models/facture_enrichie_info.py +0 -133
  324. factpulse/models/facture_entrante.py +0 -196
  325. factpulse/models/facture_factur_x.py +0 -183
  326. factpulse/models/flux_resume.py +0 -131
  327. factpulse/models/format_facture.py +0 -38
  328. factpulse/models/format_sortie.py +0 -37
  329. factpulse/models/fournisseur.py +0 -153
  330. factpulse/models/fournisseur_entrant.py +0 -144
  331. factpulse/models/information_signature_api.py +0 -122
  332. factpulse/models/ligne_de_poste.py +0 -183
  333. factpulse/models/ligne_de_poste_montant_remise_ht.py +0 -145
  334. factpulse/models/ligne_de_poste_taux_tva_manuel.py +0 -145
  335. factpulse/models/ligne_de_tva.py +0 -132
  336. factpulse/models/mode_depot.py +0 -38
  337. factpulse/models/mode_paiement.py +0 -41
  338. factpulse/models/montant_a_payer.py +0 -139
  339. factpulse/models/montant_base_ht.py +0 -139
  340. factpulse/models/montant_ht_total.py +0 -139
  341. factpulse/models/montant_remise_globale_ttc.py +0 -139
  342. factpulse/models/montant_total.py +0 -133
  343. factpulse/models/montant_total_acompte.py +0 -145
  344. factpulse/models/montant_total_ligne_ht.py +0 -139
  345. factpulse/models/montant_ttc_total.py +0 -139
  346. factpulse/models/montant_tva.py +0 -139
  347. factpulse/models/montant_tva_ligne.py +0 -139
  348. factpulse/models/montant_tva_total.py +0 -139
  349. factpulse/models/montant_unitaire_ht.py +0 -139
  350. factpulse/models/nature_operation.py +0 -49
  351. factpulse/models/note.py +0 -94
  352. factpulse/models/note_obligatoire_schema.py +0 -124
  353. factpulse/models/obtenir_id_chorus_pro_request.py +0 -100
  354. factpulse/models/obtenir_id_chorus_pro_response.py +0 -98
  355. factpulse/models/options_processing.py +0 -94
  356. factpulse/models/parametres_signature.py +0 -133
  357. factpulse/models/parametres_structure.py +0 -91
  358. factpulse/models/pdf_factur_x_info.py +0 -91
  359. factpulse/models/piece_jointe_complementaire.py +0 -95
  360. factpulse/models/profil_api.py +0 -39
  361. factpulse/models/profil_flux.py +0 -38
  362. factpulse/models/quantite.py +0 -139
  363. factpulse/models/rechercher_services_response.py +0 -101
  364. factpulse/models/rechercher_structure_request.py +0 -119
  365. factpulse/models/rechercher_structure_response.py +0 -101
  366. factpulse/models/references.py +0 -124
  367. factpulse/models/reponse_healthcheck_afnor.py +0 -91
  368. factpulse/models/reponse_recherche_flux.py +0 -101
  369. factpulse/models/reponse_soumission_flux.py +0 -109
  370. factpulse/models/reponse_tache.py +0 -87
  371. factpulse/models/reponse_validation_erreur.py +0 -87
  372. factpulse/models/reponse_validation_succes.py +0 -87
  373. factpulse/models/reponse_verification_succes.py +0 -135
  374. factpulse/models/requete_recherche_flux.py +0 -143
  375. factpulse/models/requete_soumission_flux.py +0 -123
  376. factpulse/models/resultat_afnor.py +0 -105
  377. factpulse/models/resultat_chorus_pro.py +0 -101
  378. factpulse/models/resultat_validation_pdfapi.py +0 -169
  379. factpulse/models/service_structure.py +0 -93
  380. factpulse/models/soumettre_facture_complete_request.py +0 -116
  381. factpulse/models/soumettre_facture_complete_response.py +0 -145
  382. factpulse/models/soumettre_facture_request.py +0 -176
  383. factpulse/models/soumettre_facture_response.py +0 -103
  384. factpulse/models/statut_acquittement.py +0 -38
  385. factpulse/models/statut_celery.py +0 -40
  386. factpulse/models/statut_champ_api.py +0 -40
  387. factpulse/models/statut_facture.py +0 -96
  388. factpulse/models/statut_tache.py +0 -97
  389. factpulse/models/syntaxe_flux.py +0 -40
  390. factpulse/models/tauxmanuel.py +0 -139
  391. factpulse/models/type_document.py +0 -40
  392. factpulse/models/type_facture.py +0 -37
  393. factpulse/models/type_flux.py +0 -40
  394. factpulse/models/type_tva.py +0 -39
  395. factpulse/models/unite.py +0 -41
  396. factpulse/models/validation_error_loc_inner.py +0 -138
  397. factpulse-2.0.37.dist-info/METADATA +0 -292
  398. factpulse-2.0.37.dist-info/RECORD +0 -134
  399. {factpulse-2.0.37.dist-info → factpulse-3.0.23.dist-info}/WHEEL +0 -0
  400. {factpulse-2.0.37.dist-info → factpulse-3.0.23.dist-info}/top_level.txt +0 -0
@@ -1,3437 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- API REST FactPulse
5
-
6
- API REST pour la facturation électronique en France : Factur-X, AFNOR PDP/PA, signatures électroniques. ## 🎯 Fonctionnalités principales ### 📄 Génération de factures Factur-X - **Formats** : XML seul ou PDF/A-3 avec XML embarqué - **Profils** : MINIMUM, BASIC, EN16931, EXTENDED - **Normes** : EN 16931 (directive UE 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Format simplifié** : Génération à partir de SIRET + auto-enrichissement (API Chorus Pro + Recherche Entreprises) ### ✅ Validation et conformité - **Validation XML** : Schematron (45 à 210+ règles selon profil) - **Validation PDF** : PDF/A-3, métadonnées XMP Factur-X, signatures électroniques - **VeraPDF** : Validation stricte PDF/A (146+ règles ISO 19005-3) - **Traitement asynchrone** : Support Celery pour validations lourdes (VeraPDF) ### 📡 Intégration AFNOR PDP/PA (XP Z12-013) - **Soumission de flux** : Envoi de factures vers Plateformes de Dématérialisation Partenaires - **Recherche de flux** : Consultation des factures soumises - **Téléchargement** : Récupération des PDF/A-3 avec XML - **Directory Service** : Recherche d'entreprises (SIREN/SIRET) - **Multi-client** : Support de plusieurs configs PDP par utilisateur (stored credentials ou zero-storage) ### ✍️ Signature électronique PDF - **Standards** : PAdES-B-B, PAdES-B-T (horodatage RFC 3161), PAdES-B-LT (archivage long terme) - **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO) - **Validation** : Vérification intégrité cryptographique et certificats - **Génération de certificats** : Certificats X.509 auto-signés pour tests ### 🔄 Traitement asynchrone - **Celery** : Génération, validation et signature asynchrones - **Polling** : Suivi d'état via `/taches/{id_tache}/statut` - **Pas de timeout** : Idéal pour gros fichiers ou validations lourdes ## 🔒 Authentification Toutes les requêtes nécessitent un **token JWT** dans le header Authorization : ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### Comment obtenir un token JWT ? #### 🔑 Méthode 1 : API `/api/token/` (Recommandée) **URL :** `https://www.factpulse.fr/api/token/` Cette méthode est **recommandée** pour l'intégration dans vos applications et workflows CI/CD. **Prérequis :** Avoir défini un mot de passe sur votre compte **Pour les utilisateurs inscrits via email/password :** - Vous avez déjà un mot de passe, utilisez-le directement **Pour les utilisateurs inscrits via OAuth (Google/GitHub) :** - Vous devez d'abord définir un mot de passe sur : https://www.factpulse.fr/accounts/password/set/ - Une fois le mot de passe créé, vous pourrez utiliser l'API **Exemple de requête :** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\" }' ``` **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/
7
-
8
- The version of the OpenAPI document: 1.0.0
9
- Generated by OpenAPI Generator (https://openapi-generator.tech)
10
-
11
- Do not edit the class manually.
12
- """ # noqa: E501
13
-
14
- import warnings
15
- from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
- from typing import Any, Dict, List, Optional, Tuple, Union
17
- from typing_extensions import Annotated
18
-
19
- from pydantic import Field, StrictBool, StrictBytes, StrictStr
20
- from typing import Any, Optional, Tuple, Union
21
- from typing_extensions import Annotated
22
- from factpulse.models.generate_certificate_request import GenerateCertificateRequest
23
- from factpulse.models.generate_certificate_response import GenerateCertificateResponse
24
- from factpulse.models.reponse_tache import ReponseTache
25
- from factpulse.models.reponse_validation_succes import ReponseValidationSucces
26
- from factpulse.models.resultat_validation_pdfapi import ResultatValidationPDFAPI
27
- from factpulse.models.soumettre_facture_complete_request import SoumettreFactureCompleteRequest
28
- from factpulse.models.soumettre_facture_complete_response import SoumettreFactureCompleteResponse
29
- from factpulse.models.statut_tache import StatutTache
30
-
31
- from factpulse.api_client import ApiClient, RequestSerialized
32
- from factpulse.api_response import ApiResponse
33
- from factpulse.rest import RESTResponseType
34
-
35
-
36
- class TraitementFactureApi:
37
- """NOTE: This class is auto generated by OpenAPI Generator
38
- Ref: https://openapi-generator.tech
39
-
40
- Do not edit the class manually.
41
- """
42
-
43
- def __init__(self, api_client=None) -> None:
44
- if api_client is None:
45
- api_client = ApiClient.get_default()
46
- self.api_client = api_client
47
-
48
-
49
- @validate_call
50
- def generer_certificat_test_api_v1_traitement_generer_certificat_test_post(
51
- self,
52
- generate_certificate_request: GenerateCertificateRequest,
53
- _request_timeout: Union[
54
- None,
55
- Annotated[StrictFloat, Field(gt=0)],
56
- Tuple[
57
- Annotated[StrictFloat, Field(gt=0)],
58
- Annotated[StrictFloat, Field(gt=0)]
59
- ]
60
- ] = None,
61
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
62
- _content_type: Optional[StrictStr] = None,
63
- _headers: Optional[Dict[StrictStr, Any]] = None,
64
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
65
- ) -> GenerateCertificateResponse:
66
- """Générer un certificat X.509 auto-signé de test
67
-
68
- Génère un certificat X.509 auto-signé pour les tests de signature électronique PDF. **⚠️ ATTENTION : Certificat de TEST uniquement !** Ce certificat est : - ✅ Adapté pour tests et développement - ✅ Compatible signature PDF (PAdES) - ✅ Conforme eIDAS niveau **SES** (Simple Electronic Signature) - ❌ **JAMAIS utilisable en production** - ❌ **Non reconnu** par les navigateurs et lecteurs PDF - ❌ **Aucune valeur juridique** ## Niveaux eIDAS - **SES** (Simple) : Certificat auto-signé ← Généré par cet endpoint - **AdES** (Advanced) : Certificat CA commerciale (Let's Encrypt, etc.) - **QES** (Qualified) : Certificat qualifié PSCO (CertEurope, Universign, etc.) ## Utilisation Une fois généré, le certificat peut être : 1. **Enregistré dans Django** (recommandé) : - Django Admin > Certificats de signature - Upload `certificat_pem` et `cle_privee_pem` 2. **Utilisé directement** : - Signer un PDF avec `/signer-pdf` - Le certificat sera automatiquement utilisé ## Exemple d'appel ```bash curl -X POST \"https://www.factpulse.fr/api/facturation/generer-certificat-test\" \\ -H \"Authorization: Bearer eyJ0eXAi...\" \\ -H \"Content-Type: application/json\" \\ -d '{ \"cn\": \"Test Client XYZ\", \"organisation\": \"Client XYZ SARL\", \"email\": \"contact@xyz.fr\", \"duree_jours\": 365 }' ``` ## Cas d'usage - Tests de signature PDF en développement - POC de signature électronique - Formation et démos - Tests d'intégration automatisés ## Conformité technique Certificat généré avec : - Clé RSA 2048 ou 4096 bits - Algorithme SHA-256 - Extensions Key Usage : `digitalSignature`, `contentCommitment` (non-repudiation) - Extensions Extended Key Usage : `codeSigning`, `emailProtection` - Validité : 1 jour à 10 ans (configurable) - Format : PEM (certificat et clé) - Optionnel : PKCS#12 (.p12)
69
-
70
- :param generate_certificate_request: (required)
71
- :type generate_certificate_request: GenerateCertificateRequest
72
- :param _request_timeout: timeout setting for this request. If one
73
- number provided, it will be total request
74
- timeout. It can also be a pair (tuple) of
75
- (connection, read) timeouts.
76
- :type _request_timeout: int, tuple(int, int), optional
77
- :param _request_auth: set to override the auth_settings for an a single
78
- request; this effectively ignores the
79
- authentication in the spec for a single request.
80
- :type _request_auth: dict, optional
81
- :param _content_type: force content-type for the request.
82
- :type _content_type: str, Optional
83
- :param _headers: set to override the headers for a single
84
- request; this effectively ignores the headers
85
- in the spec for a single request.
86
- :type _headers: dict, optional
87
- :param _host_index: set to override the host_index for a single
88
- request; this effectively ignores the host_index
89
- in the spec for a single request.
90
- :type _host_index: int, optional
91
- :return: Returns the result object.
92
- """ # noqa: E501
93
-
94
- _param = self._generer_certificat_test_api_v1_traitement_generer_certificat_test_post_serialize(
95
- generate_certificate_request=generate_certificate_request,
96
- _request_auth=_request_auth,
97
- _content_type=_content_type,
98
- _headers=_headers,
99
- _host_index=_host_index
100
- )
101
-
102
- _response_types_map: Dict[str, Optional[str]] = {
103
- '200': "GenerateCertificateResponse",
104
- '400': None,
105
- '500': None,
106
- '422': "HTTPValidationError",
107
- }
108
- response_data = self.api_client.call_api(
109
- *_param,
110
- _request_timeout=_request_timeout
111
- )
112
- response_data.read()
113
- return self.api_client.response_deserialize(
114
- response_data=response_data,
115
- response_types_map=_response_types_map,
116
- ).data
117
-
118
-
119
- @validate_call
120
- def generer_certificat_test_api_v1_traitement_generer_certificat_test_post_with_http_info(
121
- self,
122
- generate_certificate_request: GenerateCertificateRequest,
123
- _request_timeout: Union[
124
- None,
125
- Annotated[StrictFloat, Field(gt=0)],
126
- Tuple[
127
- Annotated[StrictFloat, Field(gt=0)],
128
- Annotated[StrictFloat, Field(gt=0)]
129
- ]
130
- ] = None,
131
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
132
- _content_type: Optional[StrictStr] = None,
133
- _headers: Optional[Dict[StrictStr, Any]] = None,
134
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
135
- ) -> ApiResponse[GenerateCertificateResponse]:
136
- """Générer un certificat X.509 auto-signé de test
137
-
138
- Génère un certificat X.509 auto-signé pour les tests de signature électronique PDF. **⚠️ ATTENTION : Certificat de TEST uniquement !** Ce certificat est : - ✅ Adapté pour tests et développement - ✅ Compatible signature PDF (PAdES) - ✅ Conforme eIDAS niveau **SES** (Simple Electronic Signature) - ❌ **JAMAIS utilisable en production** - ❌ **Non reconnu** par les navigateurs et lecteurs PDF - ❌ **Aucune valeur juridique** ## Niveaux eIDAS - **SES** (Simple) : Certificat auto-signé ← Généré par cet endpoint - **AdES** (Advanced) : Certificat CA commerciale (Let's Encrypt, etc.) - **QES** (Qualified) : Certificat qualifié PSCO (CertEurope, Universign, etc.) ## Utilisation Une fois généré, le certificat peut être : 1. **Enregistré dans Django** (recommandé) : - Django Admin > Certificats de signature - Upload `certificat_pem` et `cle_privee_pem` 2. **Utilisé directement** : - Signer un PDF avec `/signer-pdf` - Le certificat sera automatiquement utilisé ## Exemple d'appel ```bash curl -X POST \"https://www.factpulse.fr/api/facturation/generer-certificat-test\" \\ -H \"Authorization: Bearer eyJ0eXAi...\" \\ -H \"Content-Type: application/json\" \\ -d '{ \"cn\": \"Test Client XYZ\", \"organisation\": \"Client XYZ SARL\", \"email\": \"contact@xyz.fr\", \"duree_jours\": 365 }' ``` ## Cas d'usage - Tests de signature PDF en développement - POC de signature électronique - Formation et démos - Tests d'intégration automatisés ## Conformité technique Certificat généré avec : - Clé RSA 2048 ou 4096 bits - Algorithme SHA-256 - Extensions Key Usage : `digitalSignature`, `contentCommitment` (non-repudiation) - Extensions Extended Key Usage : `codeSigning`, `emailProtection` - Validité : 1 jour à 10 ans (configurable) - Format : PEM (certificat et clé) - Optionnel : PKCS#12 (.p12)
139
-
140
- :param generate_certificate_request: (required)
141
- :type generate_certificate_request: GenerateCertificateRequest
142
- :param _request_timeout: timeout setting for this request. If one
143
- number provided, it will be total request
144
- timeout. It can also be a pair (tuple) of
145
- (connection, read) timeouts.
146
- :type _request_timeout: int, tuple(int, int), optional
147
- :param _request_auth: set to override the auth_settings for an a single
148
- request; this effectively ignores the
149
- authentication in the spec for a single request.
150
- :type _request_auth: dict, optional
151
- :param _content_type: force content-type for the request.
152
- :type _content_type: str, Optional
153
- :param _headers: set to override the headers for a single
154
- request; this effectively ignores the headers
155
- in the spec for a single request.
156
- :type _headers: dict, optional
157
- :param _host_index: set to override the host_index for a single
158
- request; this effectively ignores the host_index
159
- in the spec for a single request.
160
- :type _host_index: int, optional
161
- :return: Returns the result object.
162
- """ # noqa: E501
163
-
164
- _param = self._generer_certificat_test_api_v1_traitement_generer_certificat_test_post_serialize(
165
- generate_certificate_request=generate_certificate_request,
166
- _request_auth=_request_auth,
167
- _content_type=_content_type,
168
- _headers=_headers,
169
- _host_index=_host_index
170
- )
171
-
172
- _response_types_map: Dict[str, Optional[str]] = {
173
- '200': "GenerateCertificateResponse",
174
- '400': None,
175
- '500': None,
176
- '422': "HTTPValidationError",
177
- }
178
- response_data = self.api_client.call_api(
179
- *_param,
180
- _request_timeout=_request_timeout
181
- )
182
- response_data.read()
183
- return self.api_client.response_deserialize(
184
- response_data=response_data,
185
- response_types_map=_response_types_map,
186
- )
187
-
188
-
189
- @validate_call
190
- def generer_certificat_test_api_v1_traitement_generer_certificat_test_post_without_preload_content(
191
- self,
192
- generate_certificate_request: GenerateCertificateRequest,
193
- _request_timeout: Union[
194
- None,
195
- Annotated[StrictFloat, Field(gt=0)],
196
- Tuple[
197
- Annotated[StrictFloat, Field(gt=0)],
198
- Annotated[StrictFloat, Field(gt=0)]
199
- ]
200
- ] = None,
201
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
202
- _content_type: Optional[StrictStr] = None,
203
- _headers: Optional[Dict[StrictStr, Any]] = None,
204
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
205
- ) -> RESTResponseType:
206
- """Générer un certificat X.509 auto-signé de test
207
-
208
- Génère un certificat X.509 auto-signé pour les tests de signature électronique PDF. **⚠️ ATTENTION : Certificat de TEST uniquement !** Ce certificat est : - ✅ Adapté pour tests et développement - ✅ Compatible signature PDF (PAdES) - ✅ Conforme eIDAS niveau **SES** (Simple Electronic Signature) - ❌ **JAMAIS utilisable en production** - ❌ **Non reconnu** par les navigateurs et lecteurs PDF - ❌ **Aucune valeur juridique** ## Niveaux eIDAS - **SES** (Simple) : Certificat auto-signé ← Généré par cet endpoint - **AdES** (Advanced) : Certificat CA commerciale (Let's Encrypt, etc.) - **QES** (Qualified) : Certificat qualifié PSCO (CertEurope, Universign, etc.) ## Utilisation Une fois généré, le certificat peut être : 1. **Enregistré dans Django** (recommandé) : - Django Admin > Certificats de signature - Upload `certificat_pem` et `cle_privee_pem` 2. **Utilisé directement** : - Signer un PDF avec `/signer-pdf` - Le certificat sera automatiquement utilisé ## Exemple d'appel ```bash curl -X POST \"https://www.factpulse.fr/api/facturation/generer-certificat-test\" \\ -H \"Authorization: Bearer eyJ0eXAi...\" \\ -H \"Content-Type: application/json\" \\ -d '{ \"cn\": \"Test Client XYZ\", \"organisation\": \"Client XYZ SARL\", \"email\": \"contact@xyz.fr\", \"duree_jours\": 365 }' ``` ## Cas d'usage - Tests de signature PDF en développement - POC de signature électronique - Formation et démos - Tests d'intégration automatisés ## Conformité technique Certificat généré avec : - Clé RSA 2048 ou 4096 bits - Algorithme SHA-256 - Extensions Key Usage : `digitalSignature`, `contentCommitment` (non-repudiation) - Extensions Extended Key Usage : `codeSigning`, `emailProtection` - Validité : 1 jour à 10 ans (configurable) - Format : PEM (certificat et clé) - Optionnel : PKCS#12 (.p12)
209
-
210
- :param generate_certificate_request: (required)
211
- :type generate_certificate_request: GenerateCertificateRequest
212
- :param _request_timeout: timeout setting for this request. If one
213
- number provided, it will be total request
214
- timeout. It can also be a pair (tuple) of
215
- (connection, read) timeouts.
216
- :type _request_timeout: int, tuple(int, int), optional
217
- :param _request_auth: set to override the auth_settings for an a single
218
- request; this effectively ignores the
219
- authentication in the spec for a single request.
220
- :type _request_auth: dict, optional
221
- :param _content_type: force content-type for the request.
222
- :type _content_type: str, Optional
223
- :param _headers: set to override the headers for a single
224
- request; this effectively ignores the headers
225
- in the spec for a single request.
226
- :type _headers: dict, optional
227
- :param _host_index: set to override the host_index for a single
228
- request; this effectively ignores the host_index
229
- in the spec for a single request.
230
- :type _host_index: int, optional
231
- :return: Returns the result object.
232
- """ # noqa: E501
233
-
234
- _param = self._generer_certificat_test_api_v1_traitement_generer_certificat_test_post_serialize(
235
- generate_certificate_request=generate_certificate_request,
236
- _request_auth=_request_auth,
237
- _content_type=_content_type,
238
- _headers=_headers,
239
- _host_index=_host_index
240
- )
241
-
242
- _response_types_map: Dict[str, Optional[str]] = {
243
- '200': "GenerateCertificateResponse",
244
- '400': None,
245
- '500': None,
246
- '422': "HTTPValidationError",
247
- }
248
- response_data = self.api_client.call_api(
249
- *_param,
250
- _request_timeout=_request_timeout
251
- )
252
- return response_data.response
253
-
254
-
255
- def _generer_certificat_test_api_v1_traitement_generer_certificat_test_post_serialize(
256
- self,
257
- generate_certificate_request,
258
- _request_auth,
259
- _content_type,
260
- _headers,
261
- _host_index,
262
- ) -> RequestSerialized:
263
-
264
- _host = None
265
-
266
- _collection_formats: Dict[str, str] = {
267
- }
268
-
269
- _path_params: Dict[str, str] = {}
270
- _query_params: List[Tuple[str, str]] = []
271
- _header_params: Dict[str, Optional[str]] = _headers or {}
272
- _form_params: List[Tuple[str, str]] = []
273
- _files: Dict[
274
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
275
- ] = {}
276
- _body_params: Optional[bytes] = None
277
-
278
- # process the path parameters
279
- # process the query parameters
280
- # process the header parameters
281
- # process the form parameters
282
- # process the body parameter
283
- if generate_certificate_request is not None:
284
- _body_params = generate_certificate_request
285
-
286
-
287
- # set the HTTP header `Accept`
288
- if 'Accept' not in _header_params:
289
- _header_params['Accept'] = self.api_client.select_header_accept(
290
- [
291
- 'application/json'
292
- ]
293
- )
294
-
295
- # set the HTTP header `Content-Type`
296
- if _content_type:
297
- _header_params['Content-Type'] = _content_type
298
- else:
299
- _default_content_type = (
300
- self.api_client.select_header_content_type(
301
- [
302
- 'application/json'
303
- ]
304
- )
305
- )
306
- if _default_content_type is not None:
307
- _header_params['Content-Type'] = _default_content_type
308
-
309
- # authentication setting
310
- _auth_settings: List[str] = [
311
- 'HTTPBearer'
312
- ]
313
-
314
- return self.api_client.param_serialize(
315
- method='POST',
316
- resource_path='/api/v1/traitement/generer-certificat-test',
317
- path_params=_path_params,
318
- query_params=_query_params,
319
- header_params=_header_params,
320
- body=_body_params,
321
- post_params=_form_params,
322
- files=_files,
323
- auth_settings=_auth_settings,
324
- collection_formats=_collection_formats,
325
- _host=_host,
326
- _request_auth=_request_auth
327
- )
328
-
329
-
330
-
331
-
332
- @validate_call
333
- def generer_facture_api_v1_traitement_generer_facture_post(
334
- self,
335
- donnees_facture: Annotated[StrictStr, Field(description="Données de la facture au format JSON. Deux formats acceptés : 1. **Format classique** : Structure complète FactureFacturX (tous les champs) 2. **Format simplifié** (🆕 P0.1) : Structure minimale avec auto-enrichissement Le format est détecté automatiquement ! ")],
336
- profil: Annotated[Optional[Any], Field(description="Profil Factur-X : MINIMUM, BASIC, EN16931 ou EXTENDED.")] = None,
337
- format_sortie: Annotated[Optional[Any], Field(description="Format de sortie : 'xml' (XML seul) ou 'pdf' (PDF Factur-X avec XML embarqué).")] = None,
338
- auto_enrichir: Annotated[Optional[StrictBool], Field(description="🆕 Activer l'auto-enrichissement depuis SIRET/SIREN (format simplifié uniquement)")] = None,
339
- source_pdf: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = None,
340
- _request_timeout: Union[
341
- None,
342
- Annotated[StrictFloat, Field(gt=0)],
343
- Tuple[
344
- Annotated[StrictFloat, Field(gt=0)],
345
- Annotated[StrictFloat, Field(gt=0)]
346
- ]
347
- ] = None,
348
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
349
- _content_type: Optional[StrictStr] = None,
350
- _headers: Optional[Dict[StrictStr, Any]] = None,
351
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
352
- ) -> ReponseTache:
353
- """Générer une facture Factur-X
354
-
355
- Génère une facture électronique au format Factur-X conforme aux normes européennes. ## Normes appliquées - **Factur-X** (France) : Norme FNFE-MPE (Forum National de la Facture Électronique) - **ZUGFeRD** (Allemagne) : Format allemand compatible Factur-X - **EN 16931** : Norme sémantique européenne pour la facturation électronique - **ISO 19005-3** (PDF/A-3) : Archivage électronique à long terme - **Cross Industry Invoice (CII)** : Syntaxe XML UN/CEFACT ## 🆕 Nouveau : Format simplifié avec auto-enrichissement (P0.1) Vous pouvez désormais créer une facture en fournissant uniquement : - Un numéro de facture - Un SIRET émetteur + **IBAN** (obligatoire) - Un SIRET destinataire - Les lignes de facture (description, quantité, prix HT) **Exemple format simplifié** : ```json { \"numero\": \"FACT-2025-001\", \"emetteur\": { \"siret\": \"92019522900017\", \"iban\": \"FR7630001007941234567890185\" }, \"destinataire\": {\"siret\": \"35600000000048\"}, \"lignes\": [ {\"description\": \"Prestation\", \"quantite\": 10, \"prix_ht\": 100.00, \"tva\": 20.0} ] } ``` **⚠️ Champs obligatoires (format simplifié)** : - `numero` : Numéro de facture unique - `emetteur.siret` : SIRET de l'émetteur (14 chiffres) - `emetteur.iban` : IBAN du compte bancaire (pas d'API publique pour le récupérer) - `destinataire.siret` : SIRET du destinataire - `lignes[]` : Au moins une ligne de facture **Ce qui se passe automatiquement avec `auto_enrichir=True`** : - ✅ Enrichissement des noms depuis API Chorus Pro - ✅ Enrichissement des adresses depuis API Recherche Entreprises (gratuite, publique) - ✅ Calcul automatique de la TVA intracommunautaire (FR + clé + SIREN) - ✅ Récupération de l'ID Chorus Pro pour la facturation électronique - ✅ Calcul des totaux HT/TVA/TTC - ✅ Génération des dates (aujourd'hui + échéance 30j) - ✅ Gestion multi-taux de TVA **Identifiants supportés** : - SIRET (14 chiffres) : Établissement précis ⭐ Recommandé - SIREN (9 chiffres) : Entreprise (sélection auto du siège) - Types spéciaux : UE_HORS_FRANCE, RIDET, TAHITI, etc. ## Contrôles effectués lors de la génération ### 1. Validation des données (Pydantic) - Types de données (montants en Decimal, dates ISO 8601) - Formats (SIRET 14 chiffres, SIREN 9 chiffres, IBAN) - Champs obligatoires selon le profil - Cohérence des montants (HT + TVA = TTC) ### 2. Génération XML conforme CII - Sérialisation selon schéma XSD Cross Industry Invoice - Namespaces UN/CEFACT corrects - Structure hiérarchique respectée - Encodage UTF-8 sans BOM ### 3. Validation Schematron - Règles métier du profil sélectionné (MINIMUM, BASIC, EN16931, EXTENDED) - Cardinalité des éléments (obligatoire, optionnel, répétable) - Règles de calcul (totaux, TVA, remises) - Conformité européenne EN 16931 ### 4. Conversion PDF/A-3 (si format_sortie='pdf') - Conversion du PDF source en PDF/A-3 via Ghostscript - Embarquement du XML Factur-X dans le PDF - Métadonnées XMP conformes - Profil ICC sRGB pour les couleurs - Suppression des éléments interdits (JavaScript, formulaires) ## Fonctionnement 1. **Soumission** : La facture est mise en file d'attente Celery pour traitement asynchrone 2. **Retour immédiat** : Vous recevez un `id_tache` (HTTP 202 Accepted) 3. **Suivi** : Utilisez l'endpoint `/taches/{id_tache}/statut` pour suivre l'avancement ## Formats de sortie - **xml** : Génère uniquement le XML Factur-X (recommandé pour les tests) - **pdf** : Génère un PDF/A-3 avec XML embarqué (nécessite `source_pdf`) ## Profils Factur-X - **MINIMUM** : Données minimales (facture simplifiée) - **BASIC** : Informations de base (PME) - **EN16931** : Standard européen (recommandé, conforme directive 2014/55/UE) - **EXTENDED** : Toutes les données disponibles (grands comptes) ## Ce que vous obtenez Après traitement réussi (statut `completed`) : - **XML seul** : Fichier XML encodé base64 conforme Factur-X - **PDF/A-3** : PDF avec XML embarqué, prêt pour envoi/archivage - **Métadonnées** : Profil, version Factur-X, taille fichier - **Validation** : Confirmation de conformité Schematron ## Validation Les données sont validées automatiquement selon le format détecté. En cas d'erreur, un statut 422 est retourné avec les détails des champs invalides.
356
-
357
- :param donnees_facture: Données de la facture au format JSON. Deux formats acceptés : 1. **Format classique** : Structure complète FactureFacturX (tous les champs) 2. **Format simplifié** (🆕 P0.1) : Structure minimale avec auto-enrichissement Le format est détecté automatiquement ! (required)
358
- :type donnees_facture: str
359
- :param profil: Profil Factur-X : MINIMUM, BASIC, EN16931 ou EXTENDED.
360
- :type profil: ProfilAPI
361
- :param format_sortie: Format de sortie : 'xml' (XML seul) ou 'pdf' (PDF Factur-X avec XML embarqué).
362
- :type format_sortie: FormatSortie
363
- :param auto_enrichir: 🆕 Activer l'auto-enrichissement depuis SIRET/SIREN (format simplifié uniquement)
364
- :type auto_enrichir: bool
365
- :param source_pdf:
366
- :type source_pdf: bytearray
367
- :param _request_timeout: timeout setting for this request. If one
368
- number provided, it will be total request
369
- timeout. It can also be a pair (tuple) of
370
- (connection, read) timeouts.
371
- :type _request_timeout: int, tuple(int, int), optional
372
- :param _request_auth: set to override the auth_settings for an a single
373
- request; this effectively ignores the
374
- authentication in the spec for a single request.
375
- :type _request_auth: dict, optional
376
- :param _content_type: force content-type for the request.
377
- :type _content_type: str, Optional
378
- :param _headers: set to override the headers for a single
379
- request; this effectively ignores the headers
380
- in the spec for a single request.
381
- :type _headers: dict, optional
382
- :param _host_index: set to override the host_index for a single
383
- request; this effectively ignores the host_index
384
- in the spec for a single request.
385
- :type _host_index: int, optional
386
- :return: Returns the result object.
387
- """ # noqa: E501
388
-
389
- _param = self._generer_facture_api_v1_traitement_generer_facture_post_serialize(
390
- donnees_facture=donnees_facture,
391
- profil=profil,
392
- format_sortie=format_sortie,
393
- auto_enrichir=auto_enrichir,
394
- source_pdf=source_pdf,
395
- _request_auth=_request_auth,
396
- _content_type=_content_type,
397
- _headers=_headers,
398
- _host_index=_host_index
399
- )
400
-
401
- _response_types_map: Dict[str, Optional[str]] = {
402
- '202': "ReponseTache",
403
- '400': None,
404
- '422': None,
405
- }
406
- response_data = self.api_client.call_api(
407
- *_param,
408
- _request_timeout=_request_timeout
409
- )
410
- response_data.read()
411
- return self.api_client.response_deserialize(
412
- response_data=response_data,
413
- response_types_map=_response_types_map,
414
- ).data
415
-
416
-
417
- @validate_call
418
- def generer_facture_api_v1_traitement_generer_facture_post_with_http_info(
419
- self,
420
- donnees_facture: Annotated[StrictStr, Field(description="Données de la facture au format JSON. Deux formats acceptés : 1. **Format classique** : Structure complète FactureFacturX (tous les champs) 2. **Format simplifié** (🆕 P0.1) : Structure minimale avec auto-enrichissement Le format est détecté automatiquement ! ")],
421
- profil: Annotated[Optional[Any], Field(description="Profil Factur-X : MINIMUM, BASIC, EN16931 ou EXTENDED.")] = None,
422
- format_sortie: Annotated[Optional[Any], Field(description="Format de sortie : 'xml' (XML seul) ou 'pdf' (PDF Factur-X avec XML embarqué).")] = None,
423
- auto_enrichir: Annotated[Optional[StrictBool], Field(description="🆕 Activer l'auto-enrichissement depuis SIRET/SIREN (format simplifié uniquement)")] = None,
424
- source_pdf: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = None,
425
- _request_timeout: Union[
426
- None,
427
- Annotated[StrictFloat, Field(gt=0)],
428
- Tuple[
429
- Annotated[StrictFloat, Field(gt=0)],
430
- Annotated[StrictFloat, Field(gt=0)]
431
- ]
432
- ] = None,
433
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
434
- _content_type: Optional[StrictStr] = None,
435
- _headers: Optional[Dict[StrictStr, Any]] = None,
436
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
437
- ) -> ApiResponse[ReponseTache]:
438
- """Générer une facture Factur-X
439
-
440
- Génère une facture électronique au format Factur-X conforme aux normes européennes. ## Normes appliquées - **Factur-X** (France) : Norme FNFE-MPE (Forum National de la Facture Électronique) - **ZUGFeRD** (Allemagne) : Format allemand compatible Factur-X - **EN 16931** : Norme sémantique européenne pour la facturation électronique - **ISO 19005-3** (PDF/A-3) : Archivage électronique à long terme - **Cross Industry Invoice (CII)** : Syntaxe XML UN/CEFACT ## 🆕 Nouveau : Format simplifié avec auto-enrichissement (P0.1) Vous pouvez désormais créer une facture en fournissant uniquement : - Un numéro de facture - Un SIRET émetteur + **IBAN** (obligatoire) - Un SIRET destinataire - Les lignes de facture (description, quantité, prix HT) **Exemple format simplifié** : ```json { \"numero\": \"FACT-2025-001\", \"emetteur\": { \"siret\": \"92019522900017\", \"iban\": \"FR7630001007941234567890185\" }, \"destinataire\": {\"siret\": \"35600000000048\"}, \"lignes\": [ {\"description\": \"Prestation\", \"quantite\": 10, \"prix_ht\": 100.00, \"tva\": 20.0} ] } ``` **⚠️ Champs obligatoires (format simplifié)** : - `numero` : Numéro de facture unique - `emetteur.siret` : SIRET de l'émetteur (14 chiffres) - `emetteur.iban` : IBAN du compte bancaire (pas d'API publique pour le récupérer) - `destinataire.siret` : SIRET du destinataire - `lignes[]` : Au moins une ligne de facture **Ce qui se passe automatiquement avec `auto_enrichir=True`** : - ✅ Enrichissement des noms depuis API Chorus Pro - ✅ Enrichissement des adresses depuis API Recherche Entreprises (gratuite, publique) - ✅ Calcul automatique de la TVA intracommunautaire (FR + clé + SIREN) - ✅ Récupération de l'ID Chorus Pro pour la facturation électronique - ✅ Calcul des totaux HT/TVA/TTC - ✅ Génération des dates (aujourd'hui + échéance 30j) - ✅ Gestion multi-taux de TVA **Identifiants supportés** : - SIRET (14 chiffres) : Établissement précis ⭐ Recommandé - SIREN (9 chiffres) : Entreprise (sélection auto du siège) - Types spéciaux : UE_HORS_FRANCE, RIDET, TAHITI, etc. ## Contrôles effectués lors de la génération ### 1. Validation des données (Pydantic) - Types de données (montants en Decimal, dates ISO 8601) - Formats (SIRET 14 chiffres, SIREN 9 chiffres, IBAN) - Champs obligatoires selon le profil - Cohérence des montants (HT + TVA = TTC) ### 2. Génération XML conforme CII - Sérialisation selon schéma XSD Cross Industry Invoice - Namespaces UN/CEFACT corrects - Structure hiérarchique respectée - Encodage UTF-8 sans BOM ### 3. Validation Schematron - Règles métier du profil sélectionné (MINIMUM, BASIC, EN16931, EXTENDED) - Cardinalité des éléments (obligatoire, optionnel, répétable) - Règles de calcul (totaux, TVA, remises) - Conformité européenne EN 16931 ### 4. Conversion PDF/A-3 (si format_sortie='pdf') - Conversion du PDF source en PDF/A-3 via Ghostscript - Embarquement du XML Factur-X dans le PDF - Métadonnées XMP conformes - Profil ICC sRGB pour les couleurs - Suppression des éléments interdits (JavaScript, formulaires) ## Fonctionnement 1. **Soumission** : La facture est mise en file d'attente Celery pour traitement asynchrone 2. **Retour immédiat** : Vous recevez un `id_tache` (HTTP 202 Accepted) 3. **Suivi** : Utilisez l'endpoint `/taches/{id_tache}/statut` pour suivre l'avancement ## Formats de sortie - **xml** : Génère uniquement le XML Factur-X (recommandé pour les tests) - **pdf** : Génère un PDF/A-3 avec XML embarqué (nécessite `source_pdf`) ## Profils Factur-X - **MINIMUM** : Données minimales (facture simplifiée) - **BASIC** : Informations de base (PME) - **EN16931** : Standard européen (recommandé, conforme directive 2014/55/UE) - **EXTENDED** : Toutes les données disponibles (grands comptes) ## Ce que vous obtenez Après traitement réussi (statut `completed`) : - **XML seul** : Fichier XML encodé base64 conforme Factur-X - **PDF/A-3** : PDF avec XML embarqué, prêt pour envoi/archivage - **Métadonnées** : Profil, version Factur-X, taille fichier - **Validation** : Confirmation de conformité Schematron ## Validation Les données sont validées automatiquement selon le format détecté. En cas d'erreur, un statut 422 est retourné avec les détails des champs invalides.
441
-
442
- :param donnees_facture: Données de la facture au format JSON. Deux formats acceptés : 1. **Format classique** : Structure complète FactureFacturX (tous les champs) 2. **Format simplifié** (🆕 P0.1) : Structure minimale avec auto-enrichissement Le format est détecté automatiquement ! (required)
443
- :type donnees_facture: str
444
- :param profil: Profil Factur-X : MINIMUM, BASIC, EN16931 ou EXTENDED.
445
- :type profil: ProfilAPI
446
- :param format_sortie: Format de sortie : 'xml' (XML seul) ou 'pdf' (PDF Factur-X avec XML embarqué).
447
- :type format_sortie: FormatSortie
448
- :param auto_enrichir: 🆕 Activer l'auto-enrichissement depuis SIRET/SIREN (format simplifié uniquement)
449
- :type auto_enrichir: bool
450
- :param source_pdf:
451
- :type source_pdf: bytearray
452
- :param _request_timeout: timeout setting for this request. If one
453
- number provided, it will be total request
454
- timeout. It can also be a pair (tuple) of
455
- (connection, read) timeouts.
456
- :type _request_timeout: int, tuple(int, int), optional
457
- :param _request_auth: set to override the auth_settings for an a single
458
- request; this effectively ignores the
459
- authentication in the spec for a single request.
460
- :type _request_auth: dict, optional
461
- :param _content_type: force content-type for the request.
462
- :type _content_type: str, Optional
463
- :param _headers: set to override the headers for a single
464
- request; this effectively ignores the headers
465
- in the spec for a single request.
466
- :type _headers: dict, optional
467
- :param _host_index: set to override the host_index for a single
468
- request; this effectively ignores the host_index
469
- in the spec for a single request.
470
- :type _host_index: int, optional
471
- :return: Returns the result object.
472
- """ # noqa: E501
473
-
474
- _param = self._generer_facture_api_v1_traitement_generer_facture_post_serialize(
475
- donnees_facture=donnees_facture,
476
- profil=profil,
477
- format_sortie=format_sortie,
478
- auto_enrichir=auto_enrichir,
479
- source_pdf=source_pdf,
480
- _request_auth=_request_auth,
481
- _content_type=_content_type,
482
- _headers=_headers,
483
- _host_index=_host_index
484
- )
485
-
486
- _response_types_map: Dict[str, Optional[str]] = {
487
- '202': "ReponseTache",
488
- '400': None,
489
- '422': None,
490
- }
491
- response_data = self.api_client.call_api(
492
- *_param,
493
- _request_timeout=_request_timeout
494
- )
495
- response_data.read()
496
- return self.api_client.response_deserialize(
497
- response_data=response_data,
498
- response_types_map=_response_types_map,
499
- )
500
-
501
-
502
- @validate_call
503
- def generer_facture_api_v1_traitement_generer_facture_post_without_preload_content(
504
- self,
505
- donnees_facture: Annotated[StrictStr, Field(description="Données de la facture au format JSON. Deux formats acceptés : 1. **Format classique** : Structure complète FactureFacturX (tous les champs) 2. **Format simplifié** (🆕 P0.1) : Structure minimale avec auto-enrichissement Le format est détecté automatiquement ! ")],
506
- profil: Annotated[Optional[Any], Field(description="Profil Factur-X : MINIMUM, BASIC, EN16931 ou EXTENDED.")] = None,
507
- format_sortie: Annotated[Optional[Any], Field(description="Format de sortie : 'xml' (XML seul) ou 'pdf' (PDF Factur-X avec XML embarqué).")] = None,
508
- auto_enrichir: Annotated[Optional[StrictBool], Field(description="🆕 Activer l'auto-enrichissement depuis SIRET/SIREN (format simplifié uniquement)")] = None,
509
- source_pdf: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = None,
510
- _request_timeout: Union[
511
- None,
512
- Annotated[StrictFloat, Field(gt=0)],
513
- Tuple[
514
- Annotated[StrictFloat, Field(gt=0)],
515
- Annotated[StrictFloat, Field(gt=0)]
516
- ]
517
- ] = None,
518
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
519
- _content_type: Optional[StrictStr] = None,
520
- _headers: Optional[Dict[StrictStr, Any]] = None,
521
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
522
- ) -> RESTResponseType:
523
- """Générer une facture Factur-X
524
-
525
- Génère une facture électronique au format Factur-X conforme aux normes européennes. ## Normes appliquées - **Factur-X** (France) : Norme FNFE-MPE (Forum National de la Facture Électronique) - **ZUGFeRD** (Allemagne) : Format allemand compatible Factur-X - **EN 16931** : Norme sémantique européenne pour la facturation électronique - **ISO 19005-3** (PDF/A-3) : Archivage électronique à long terme - **Cross Industry Invoice (CII)** : Syntaxe XML UN/CEFACT ## 🆕 Nouveau : Format simplifié avec auto-enrichissement (P0.1) Vous pouvez désormais créer une facture en fournissant uniquement : - Un numéro de facture - Un SIRET émetteur + **IBAN** (obligatoire) - Un SIRET destinataire - Les lignes de facture (description, quantité, prix HT) **Exemple format simplifié** : ```json { \"numero\": \"FACT-2025-001\", \"emetteur\": { \"siret\": \"92019522900017\", \"iban\": \"FR7630001007941234567890185\" }, \"destinataire\": {\"siret\": \"35600000000048\"}, \"lignes\": [ {\"description\": \"Prestation\", \"quantite\": 10, \"prix_ht\": 100.00, \"tva\": 20.0} ] } ``` **⚠️ Champs obligatoires (format simplifié)** : - `numero` : Numéro de facture unique - `emetteur.siret` : SIRET de l'émetteur (14 chiffres) - `emetteur.iban` : IBAN du compte bancaire (pas d'API publique pour le récupérer) - `destinataire.siret` : SIRET du destinataire - `lignes[]` : Au moins une ligne de facture **Ce qui se passe automatiquement avec `auto_enrichir=True`** : - ✅ Enrichissement des noms depuis API Chorus Pro - ✅ Enrichissement des adresses depuis API Recherche Entreprises (gratuite, publique) - ✅ Calcul automatique de la TVA intracommunautaire (FR + clé + SIREN) - ✅ Récupération de l'ID Chorus Pro pour la facturation électronique - ✅ Calcul des totaux HT/TVA/TTC - ✅ Génération des dates (aujourd'hui + échéance 30j) - ✅ Gestion multi-taux de TVA **Identifiants supportés** : - SIRET (14 chiffres) : Établissement précis ⭐ Recommandé - SIREN (9 chiffres) : Entreprise (sélection auto du siège) - Types spéciaux : UE_HORS_FRANCE, RIDET, TAHITI, etc. ## Contrôles effectués lors de la génération ### 1. Validation des données (Pydantic) - Types de données (montants en Decimal, dates ISO 8601) - Formats (SIRET 14 chiffres, SIREN 9 chiffres, IBAN) - Champs obligatoires selon le profil - Cohérence des montants (HT + TVA = TTC) ### 2. Génération XML conforme CII - Sérialisation selon schéma XSD Cross Industry Invoice - Namespaces UN/CEFACT corrects - Structure hiérarchique respectée - Encodage UTF-8 sans BOM ### 3. Validation Schematron - Règles métier du profil sélectionné (MINIMUM, BASIC, EN16931, EXTENDED) - Cardinalité des éléments (obligatoire, optionnel, répétable) - Règles de calcul (totaux, TVA, remises) - Conformité européenne EN 16931 ### 4. Conversion PDF/A-3 (si format_sortie='pdf') - Conversion du PDF source en PDF/A-3 via Ghostscript - Embarquement du XML Factur-X dans le PDF - Métadonnées XMP conformes - Profil ICC sRGB pour les couleurs - Suppression des éléments interdits (JavaScript, formulaires) ## Fonctionnement 1. **Soumission** : La facture est mise en file d'attente Celery pour traitement asynchrone 2. **Retour immédiat** : Vous recevez un `id_tache` (HTTP 202 Accepted) 3. **Suivi** : Utilisez l'endpoint `/taches/{id_tache}/statut` pour suivre l'avancement ## Formats de sortie - **xml** : Génère uniquement le XML Factur-X (recommandé pour les tests) - **pdf** : Génère un PDF/A-3 avec XML embarqué (nécessite `source_pdf`) ## Profils Factur-X - **MINIMUM** : Données minimales (facture simplifiée) - **BASIC** : Informations de base (PME) - **EN16931** : Standard européen (recommandé, conforme directive 2014/55/UE) - **EXTENDED** : Toutes les données disponibles (grands comptes) ## Ce que vous obtenez Après traitement réussi (statut `completed`) : - **XML seul** : Fichier XML encodé base64 conforme Factur-X - **PDF/A-3** : PDF avec XML embarqué, prêt pour envoi/archivage - **Métadonnées** : Profil, version Factur-X, taille fichier - **Validation** : Confirmation de conformité Schematron ## Validation Les données sont validées automatiquement selon le format détecté. En cas d'erreur, un statut 422 est retourné avec les détails des champs invalides.
526
-
527
- :param donnees_facture: Données de la facture au format JSON. Deux formats acceptés : 1. **Format classique** : Structure complète FactureFacturX (tous les champs) 2. **Format simplifié** (🆕 P0.1) : Structure minimale avec auto-enrichissement Le format est détecté automatiquement ! (required)
528
- :type donnees_facture: str
529
- :param profil: Profil Factur-X : MINIMUM, BASIC, EN16931 ou EXTENDED.
530
- :type profil: ProfilAPI
531
- :param format_sortie: Format de sortie : 'xml' (XML seul) ou 'pdf' (PDF Factur-X avec XML embarqué).
532
- :type format_sortie: FormatSortie
533
- :param auto_enrichir: 🆕 Activer l'auto-enrichissement depuis SIRET/SIREN (format simplifié uniquement)
534
- :type auto_enrichir: bool
535
- :param source_pdf:
536
- :type source_pdf: bytearray
537
- :param _request_timeout: timeout setting for this request. If one
538
- number provided, it will be total request
539
- timeout. It can also be a pair (tuple) of
540
- (connection, read) timeouts.
541
- :type _request_timeout: int, tuple(int, int), optional
542
- :param _request_auth: set to override the auth_settings for an a single
543
- request; this effectively ignores the
544
- authentication in the spec for a single request.
545
- :type _request_auth: dict, optional
546
- :param _content_type: force content-type for the request.
547
- :type _content_type: str, Optional
548
- :param _headers: set to override the headers for a single
549
- request; this effectively ignores the headers
550
- in the spec for a single request.
551
- :type _headers: dict, optional
552
- :param _host_index: set to override the host_index for a single
553
- request; this effectively ignores the host_index
554
- in the spec for a single request.
555
- :type _host_index: int, optional
556
- :return: Returns the result object.
557
- """ # noqa: E501
558
-
559
- _param = self._generer_facture_api_v1_traitement_generer_facture_post_serialize(
560
- donnees_facture=donnees_facture,
561
- profil=profil,
562
- format_sortie=format_sortie,
563
- auto_enrichir=auto_enrichir,
564
- source_pdf=source_pdf,
565
- _request_auth=_request_auth,
566
- _content_type=_content_type,
567
- _headers=_headers,
568
- _host_index=_host_index
569
- )
570
-
571
- _response_types_map: Dict[str, Optional[str]] = {
572
- '202': "ReponseTache",
573
- '400': None,
574
- '422': None,
575
- }
576
- response_data = self.api_client.call_api(
577
- *_param,
578
- _request_timeout=_request_timeout
579
- )
580
- return response_data.response
581
-
582
-
583
- def _generer_facture_api_v1_traitement_generer_facture_post_serialize(
584
- self,
585
- donnees_facture,
586
- profil,
587
- format_sortie,
588
- auto_enrichir,
589
- source_pdf,
590
- _request_auth,
591
- _content_type,
592
- _headers,
593
- _host_index,
594
- ) -> RequestSerialized:
595
-
596
- _host = None
597
-
598
- _collection_formats: Dict[str, str] = {
599
- }
600
-
601
- _path_params: Dict[str, str] = {}
602
- _query_params: List[Tuple[str, str]] = []
603
- _header_params: Dict[str, Optional[str]] = _headers or {}
604
- _form_params: List[Tuple[str, str]] = []
605
- _files: Dict[
606
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
607
- ] = {}
608
- _body_params: Optional[bytes] = None
609
-
610
- # process the path parameters
611
- # process the query parameters
612
- # process the header parameters
613
- # process the form parameters
614
- if donnees_facture is not None:
615
- _form_params.append(('donnees_facture', donnees_facture))
616
- if profil is not None:
617
- _form_params.append(('profil', profil))
618
- if format_sortie is not None:
619
- _form_params.append(('format_sortie', format_sortie))
620
- if auto_enrichir is not None:
621
- _form_params.append(('auto_enrichir', auto_enrichir))
622
- if source_pdf is not None:
623
- _files['source_pdf'] = source_pdf
624
- # process the body parameter
625
-
626
-
627
- # set the HTTP header `Accept`
628
- if 'Accept' not in _header_params:
629
- _header_params['Accept'] = self.api_client.select_header_accept(
630
- [
631
- 'application/json'
632
- ]
633
- )
634
-
635
- # set the HTTP header `Content-Type`
636
- if _content_type:
637
- _header_params['Content-Type'] = _content_type
638
- else:
639
- _default_content_type = (
640
- self.api_client.select_header_content_type(
641
- [
642
- 'multipart/form-data'
643
- ]
644
- )
645
- )
646
- if _default_content_type is not None:
647
- _header_params['Content-Type'] = _default_content_type
648
-
649
- # authentication setting
650
- _auth_settings: List[str] = [
651
- 'HTTPBearer'
652
- ]
653
-
654
- return self.api_client.param_serialize(
655
- method='POST',
656
- resource_path='/api/v1/traitement/generer-facture',
657
- path_params=_path_params,
658
- query_params=_query_params,
659
- header_params=_header_params,
660
- body=_body_params,
661
- post_params=_form_params,
662
- files=_files,
663
- auth_settings=_auth_settings,
664
- collection_formats=_collection_formats,
665
- _host=_host,
666
- _request_auth=_request_auth
667
- )
668
-
669
-
670
-
671
-
672
- @validate_call
673
- def obtenir_statut_tache_api_v1_traitement_taches_id_tache_statut_get(
674
- self,
675
- id_tache: StrictStr,
676
- _request_timeout: Union[
677
- None,
678
- Annotated[StrictFloat, Field(gt=0)],
679
- Tuple[
680
- Annotated[StrictFloat, Field(gt=0)],
681
- Annotated[StrictFloat, Field(gt=0)]
682
- ]
683
- ] = None,
684
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
685
- _content_type: Optional[StrictStr] = None,
686
- _headers: Optional[Dict[StrictStr, Any]] = None,
687
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
688
- ) -> StatutTache:
689
- """Obtenir le statut d'une tâche de génération
690
-
691
- Récupère l'état d'avancement d'une tâche de génération de facture. ## États possibles Le champ `statut` utilise l'enum `StatutCelery` avec les valeurs : - **PENDING, STARTED, SUCCESS, FAILURE, RETRY** Voir la documentation du schéma `StatutCelery` pour les détails. ## Résultat métier Quand `statut=\"SUCCESS\"`, le champ `resultat` contient : - `statut` : \"SUCCES\" ou \"ERREUR\" (résultat métier) - `chemin_fichier` : Chemin du fichier généré (si succès) - `errorCode`, `errorMessage`, `details` : Format AFNOR (si échec métier) ## Usage Appelez cet endpoint en boucle (polling) toutes les 2-3 secondes jusqu'à ce que `statut` soit `SUCCESS` ou `FAILURE`.
692
-
693
- :param id_tache: (required)
694
- :type id_tache: str
695
- :param _request_timeout: timeout setting for this request. If one
696
- number provided, it will be total request
697
- timeout. It can also be a pair (tuple) of
698
- (connection, read) timeouts.
699
- :type _request_timeout: int, tuple(int, int), optional
700
- :param _request_auth: set to override the auth_settings for an a single
701
- request; this effectively ignores the
702
- authentication in the spec for a single request.
703
- :type _request_auth: dict, optional
704
- :param _content_type: force content-type for the request.
705
- :type _content_type: str, Optional
706
- :param _headers: set to override the headers for a single
707
- request; this effectively ignores the headers
708
- in the spec for a single request.
709
- :type _headers: dict, optional
710
- :param _host_index: set to override the host_index for a single
711
- request; this effectively ignores the host_index
712
- in the spec for a single request.
713
- :type _host_index: int, optional
714
- :return: Returns the result object.
715
- """ # noqa: E501
716
-
717
- _param = self._obtenir_statut_tache_api_v1_traitement_taches_id_tache_statut_get_serialize(
718
- id_tache=id_tache,
719
- _request_auth=_request_auth,
720
- _content_type=_content_type,
721
- _headers=_headers,
722
- _host_index=_host_index
723
- )
724
-
725
- _response_types_map: Dict[str, Optional[str]] = {
726
- '200': "StatutTache",
727
- '422': "HTTPValidationError",
728
- }
729
- response_data = self.api_client.call_api(
730
- *_param,
731
- _request_timeout=_request_timeout
732
- )
733
- response_data.read()
734
- return self.api_client.response_deserialize(
735
- response_data=response_data,
736
- response_types_map=_response_types_map,
737
- ).data
738
-
739
-
740
- @validate_call
741
- def obtenir_statut_tache_api_v1_traitement_taches_id_tache_statut_get_with_http_info(
742
- self,
743
- id_tache: StrictStr,
744
- _request_timeout: Union[
745
- None,
746
- Annotated[StrictFloat, Field(gt=0)],
747
- Tuple[
748
- Annotated[StrictFloat, Field(gt=0)],
749
- Annotated[StrictFloat, Field(gt=0)]
750
- ]
751
- ] = None,
752
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
753
- _content_type: Optional[StrictStr] = None,
754
- _headers: Optional[Dict[StrictStr, Any]] = None,
755
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
756
- ) -> ApiResponse[StatutTache]:
757
- """Obtenir le statut d'une tâche de génération
758
-
759
- Récupère l'état d'avancement d'une tâche de génération de facture. ## États possibles Le champ `statut` utilise l'enum `StatutCelery` avec les valeurs : - **PENDING, STARTED, SUCCESS, FAILURE, RETRY** Voir la documentation du schéma `StatutCelery` pour les détails. ## Résultat métier Quand `statut=\"SUCCESS\"`, le champ `resultat` contient : - `statut` : \"SUCCES\" ou \"ERREUR\" (résultat métier) - `chemin_fichier` : Chemin du fichier généré (si succès) - `errorCode`, `errorMessage`, `details` : Format AFNOR (si échec métier) ## Usage Appelez cet endpoint en boucle (polling) toutes les 2-3 secondes jusqu'à ce que `statut` soit `SUCCESS` ou `FAILURE`.
760
-
761
- :param id_tache: (required)
762
- :type id_tache: str
763
- :param _request_timeout: timeout setting for this request. If one
764
- number provided, it will be total request
765
- timeout. It can also be a pair (tuple) of
766
- (connection, read) timeouts.
767
- :type _request_timeout: int, tuple(int, int), optional
768
- :param _request_auth: set to override the auth_settings for an a single
769
- request; this effectively ignores the
770
- authentication in the spec for a single request.
771
- :type _request_auth: dict, optional
772
- :param _content_type: force content-type for the request.
773
- :type _content_type: str, Optional
774
- :param _headers: set to override the headers for a single
775
- request; this effectively ignores the headers
776
- in the spec for a single request.
777
- :type _headers: dict, optional
778
- :param _host_index: set to override the host_index for a single
779
- request; this effectively ignores the host_index
780
- in the spec for a single request.
781
- :type _host_index: int, optional
782
- :return: Returns the result object.
783
- """ # noqa: E501
784
-
785
- _param = self._obtenir_statut_tache_api_v1_traitement_taches_id_tache_statut_get_serialize(
786
- id_tache=id_tache,
787
- _request_auth=_request_auth,
788
- _content_type=_content_type,
789
- _headers=_headers,
790
- _host_index=_host_index
791
- )
792
-
793
- _response_types_map: Dict[str, Optional[str]] = {
794
- '200': "StatutTache",
795
- '422': "HTTPValidationError",
796
- }
797
- response_data = self.api_client.call_api(
798
- *_param,
799
- _request_timeout=_request_timeout
800
- )
801
- response_data.read()
802
- return self.api_client.response_deserialize(
803
- response_data=response_data,
804
- response_types_map=_response_types_map,
805
- )
806
-
807
-
808
- @validate_call
809
- def obtenir_statut_tache_api_v1_traitement_taches_id_tache_statut_get_without_preload_content(
810
- self,
811
- id_tache: StrictStr,
812
- _request_timeout: Union[
813
- None,
814
- Annotated[StrictFloat, Field(gt=0)],
815
- Tuple[
816
- Annotated[StrictFloat, Field(gt=0)],
817
- Annotated[StrictFloat, Field(gt=0)]
818
- ]
819
- ] = None,
820
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
821
- _content_type: Optional[StrictStr] = None,
822
- _headers: Optional[Dict[StrictStr, Any]] = None,
823
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
824
- ) -> RESTResponseType:
825
- """Obtenir le statut d'une tâche de génération
826
-
827
- Récupère l'état d'avancement d'une tâche de génération de facture. ## États possibles Le champ `statut` utilise l'enum `StatutCelery` avec les valeurs : - **PENDING, STARTED, SUCCESS, FAILURE, RETRY** Voir la documentation du schéma `StatutCelery` pour les détails. ## Résultat métier Quand `statut=\"SUCCESS\"`, le champ `resultat` contient : - `statut` : \"SUCCES\" ou \"ERREUR\" (résultat métier) - `chemin_fichier` : Chemin du fichier généré (si succès) - `errorCode`, `errorMessage`, `details` : Format AFNOR (si échec métier) ## Usage Appelez cet endpoint en boucle (polling) toutes les 2-3 secondes jusqu'à ce que `statut` soit `SUCCESS` ou `FAILURE`.
828
-
829
- :param id_tache: (required)
830
- :type id_tache: str
831
- :param _request_timeout: timeout setting for this request. If one
832
- number provided, it will be total request
833
- timeout. It can also be a pair (tuple) of
834
- (connection, read) timeouts.
835
- :type _request_timeout: int, tuple(int, int), optional
836
- :param _request_auth: set to override the auth_settings for an a single
837
- request; this effectively ignores the
838
- authentication in the spec for a single request.
839
- :type _request_auth: dict, optional
840
- :param _content_type: force content-type for the request.
841
- :type _content_type: str, Optional
842
- :param _headers: set to override the headers for a single
843
- request; this effectively ignores the headers
844
- in the spec for a single request.
845
- :type _headers: dict, optional
846
- :param _host_index: set to override the host_index for a single
847
- request; this effectively ignores the host_index
848
- in the spec for a single request.
849
- :type _host_index: int, optional
850
- :return: Returns the result object.
851
- """ # noqa: E501
852
-
853
- _param = self._obtenir_statut_tache_api_v1_traitement_taches_id_tache_statut_get_serialize(
854
- id_tache=id_tache,
855
- _request_auth=_request_auth,
856
- _content_type=_content_type,
857
- _headers=_headers,
858
- _host_index=_host_index
859
- )
860
-
861
- _response_types_map: Dict[str, Optional[str]] = {
862
- '200': "StatutTache",
863
- '422': "HTTPValidationError",
864
- }
865
- response_data = self.api_client.call_api(
866
- *_param,
867
- _request_timeout=_request_timeout
868
- )
869
- return response_data.response
870
-
871
-
872
- def _obtenir_statut_tache_api_v1_traitement_taches_id_tache_statut_get_serialize(
873
- self,
874
- id_tache,
875
- _request_auth,
876
- _content_type,
877
- _headers,
878
- _host_index,
879
- ) -> RequestSerialized:
880
-
881
- _host = None
882
-
883
- _collection_formats: Dict[str, str] = {
884
- }
885
-
886
- _path_params: Dict[str, str] = {}
887
- _query_params: List[Tuple[str, str]] = []
888
- _header_params: Dict[str, Optional[str]] = _headers or {}
889
- _form_params: List[Tuple[str, str]] = []
890
- _files: Dict[
891
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
892
- ] = {}
893
- _body_params: Optional[bytes] = None
894
-
895
- # process the path parameters
896
- if id_tache is not None:
897
- _path_params['id_tache'] = id_tache
898
- # process the query parameters
899
- # process the header parameters
900
- # process the form parameters
901
- # process the body parameter
902
-
903
-
904
- # set the HTTP header `Accept`
905
- if 'Accept' not in _header_params:
906
- _header_params['Accept'] = self.api_client.select_header_accept(
907
- [
908
- 'application/json'
909
- ]
910
- )
911
-
912
-
913
- # authentication setting
914
- _auth_settings: List[str] = [
915
- 'HTTPBearer'
916
- ]
917
-
918
- return self.api_client.param_serialize(
919
- method='GET',
920
- resource_path='/api/v1/traitement/taches/{id_tache}/statut',
921
- path_params=_path_params,
922
- query_params=_query_params,
923
- header_params=_header_params,
924
- body=_body_params,
925
- post_params=_form_params,
926
- files=_files,
927
- auth_settings=_auth_settings,
928
- collection_formats=_collection_formats,
929
- _host=_host,
930
- _request_auth=_request_auth
931
- )
932
-
933
-
934
-
935
-
936
- @validate_call
937
- def signer_pdf_api_v1_traitement_signer_pdf_post(
938
- self,
939
- fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF à signer (sera traité puis retourné signé en base64)")],
940
- raison: Optional[StrictStr] = None,
941
- localisation: Optional[StrictStr] = None,
942
- contact: Optional[StrictStr] = None,
943
- field_name: Annotated[Optional[StrictStr], Field(description="Nom du champ de signature PDF")] = None,
944
- use_pades_lt: Annotated[Optional[StrictBool], Field(description="Activer PAdES-B-LT (archivage long terme avec données de validation embarquées). NÉCESSITE un certificat avec accès OCSP/CRL.")] = None,
945
- use_timestamp: Annotated[Optional[StrictBool], Field(description="Activer l'horodatage RFC 3161 avec FreeTSA (PAdES-B-T)")] = None,
946
- _request_timeout: Union[
947
- None,
948
- Annotated[StrictFloat, Field(gt=0)],
949
- Tuple[
950
- Annotated[StrictFloat, Field(gt=0)],
951
- Annotated[StrictFloat, Field(gt=0)]
952
- ]
953
- ] = None,
954
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
955
- _content_type: Optional[StrictStr] = None,
956
- _headers: Optional[Dict[StrictStr, Any]] = None,
957
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
958
- ) -> object:
959
- """Signer un PDF avec le certificat du client (PAdES-B-LT)
960
-
961
- Signe un PDF uploadé avec le certificat électronique configuré pour le client (via client_uid du JWT). **Standards supportés** : PAdES-B-B, PAdES-B-T (horodatage), PAdES-B-LT (archivage long terme). **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO - hors scope). **Sécurité** : Double authentification X-Internal-Secret + JWT Bearer pour récupérer le certificat. **⚠️ Disclaimer légal** : Les signatures générées sont des cachets électroniques au sens du règlement eIDAS. Le niveau de validité juridique dépend du certificat utilisé (SES/AdES/QES). FactPulse ne fournit pas de certificats qualifiés QES - vous devez obtenir un certificat auprès d'un PSCO (Prestataire de Services de Confiance qualifié) pour une validité juridique maximale.
962
-
963
- :param fichier_pdf: Fichier PDF à signer (sera traité puis retourné signé en base64) (required)
964
- :type fichier_pdf: bytearray
965
- :param raison:
966
- :type raison: str
967
- :param localisation:
968
- :type localisation: str
969
- :param contact:
970
- :type contact: str
971
- :param field_name: Nom du champ de signature PDF
972
- :type field_name: str
973
- :param use_pades_lt: Activer PAdES-B-LT (archivage long terme avec données de validation embarquées). NÉCESSITE un certificat avec accès OCSP/CRL.
974
- :type use_pades_lt: bool
975
- :param use_timestamp: Activer l'horodatage RFC 3161 avec FreeTSA (PAdES-B-T)
976
- :type use_timestamp: bool
977
- :param _request_timeout: timeout setting for this request. If one
978
- number provided, it will be total request
979
- timeout. It can also be a pair (tuple) of
980
- (connection, read) timeouts.
981
- :type _request_timeout: int, tuple(int, int), optional
982
- :param _request_auth: set to override the auth_settings for an a single
983
- request; this effectively ignores the
984
- authentication in the spec for a single request.
985
- :type _request_auth: dict, optional
986
- :param _content_type: force content-type for the request.
987
- :type _content_type: str, Optional
988
- :param _headers: set to override the headers for a single
989
- request; this effectively ignores the headers
990
- in the spec for a single request.
991
- :type _headers: dict, optional
992
- :param _host_index: set to override the host_index for a single
993
- request; this effectively ignores the host_index
994
- in the spec for a single request.
995
- :type _host_index: int, optional
996
- :return: Returns the result object.
997
- """ # noqa: E501
998
-
999
- _param = self._signer_pdf_api_v1_traitement_signer_pdf_post_serialize(
1000
- fichier_pdf=fichier_pdf,
1001
- raison=raison,
1002
- localisation=localisation,
1003
- contact=contact,
1004
- field_name=field_name,
1005
- use_pades_lt=use_pades_lt,
1006
- use_timestamp=use_timestamp,
1007
- _request_auth=_request_auth,
1008
- _content_type=_content_type,
1009
- _headers=_headers,
1010
- _host_index=_host_index
1011
- )
1012
-
1013
- _response_types_map: Dict[str, Optional[str]] = {
1014
- '200': "object",
1015
- '400': None,
1016
- '404': None,
1017
- '401': None,
1018
- '503': None,
1019
- '422': "HTTPValidationError",
1020
- }
1021
- response_data = self.api_client.call_api(
1022
- *_param,
1023
- _request_timeout=_request_timeout
1024
- )
1025
- response_data.read()
1026
- return self.api_client.response_deserialize(
1027
- response_data=response_data,
1028
- response_types_map=_response_types_map,
1029
- ).data
1030
-
1031
-
1032
- @validate_call
1033
- def signer_pdf_api_v1_traitement_signer_pdf_post_with_http_info(
1034
- self,
1035
- fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF à signer (sera traité puis retourné signé en base64)")],
1036
- raison: Optional[StrictStr] = None,
1037
- localisation: Optional[StrictStr] = None,
1038
- contact: Optional[StrictStr] = None,
1039
- field_name: Annotated[Optional[StrictStr], Field(description="Nom du champ de signature PDF")] = None,
1040
- use_pades_lt: Annotated[Optional[StrictBool], Field(description="Activer PAdES-B-LT (archivage long terme avec données de validation embarquées). NÉCESSITE un certificat avec accès OCSP/CRL.")] = None,
1041
- use_timestamp: Annotated[Optional[StrictBool], Field(description="Activer l'horodatage RFC 3161 avec FreeTSA (PAdES-B-T)")] = None,
1042
- _request_timeout: Union[
1043
- None,
1044
- Annotated[StrictFloat, Field(gt=0)],
1045
- Tuple[
1046
- Annotated[StrictFloat, Field(gt=0)],
1047
- Annotated[StrictFloat, Field(gt=0)]
1048
- ]
1049
- ] = None,
1050
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1051
- _content_type: Optional[StrictStr] = None,
1052
- _headers: Optional[Dict[StrictStr, Any]] = None,
1053
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1054
- ) -> ApiResponse[object]:
1055
- """Signer un PDF avec le certificat du client (PAdES-B-LT)
1056
-
1057
- Signe un PDF uploadé avec le certificat électronique configuré pour le client (via client_uid du JWT). **Standards supportés** : PAdES-B-B, PAdES-B-T (horodatage), PAdES-B-LT (archivage long terme). **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO - hors scope). **Sécurité** : Double authentification X-Internal-Secret + JWT Bearer pour récupérer le certificat. **⚠️ Disclaimer légal** : Les signatures générées sont des cachets électroniques au sens du règlement eIDAS. Le niveau de validité juridique dépend du certificat utilisé (SES/AdES/QES). FactPulse ne fournit pas de certificats qualifiés QES - vous devez obtenir un certificat auprès d'un PSCO (Prestataire de Services de Confiance qualifié) pour une validité juridique maximale.
1058
-
1059
- :param fichier_pdf: Fichier PDF à signer (sera traité puis retourné signé en base64) (required)
1060
- :type fichier_pdf: bytearray
1061
- :param raison:
1062
- :type raison: str
1063
- :param localisation:
1064
- :type localisation: str
1065
- :param contact:
1066
- :type contact: str
1067
- :param field_name: Nom du champ de signature PDF
1068
- :type field_name: str
1069
- :param use_pades_lt: Activer PAdES-B-LT (archivage long terme avec données de validation embarquées). NÉCESSITE un certificat avec accès OCSP/CRL.
1070
- :type use_pades_lt: bool
1071
- :param use_timestamp: Activer l'horodatage RFC 3161 avec FreeTSA (PAdES-B-T)
1072
- :type use_timestamp: bool
1073
- :param _request_timeout: timeout setting for this request. If one
1074
- number provided, it will be total request
1075
- timeout. It can also be a pair (tuple) of
1076
- (connection, read) timeouts.
1077
- :type _request_timeout: int, tuple(int, int), optional
1078
- :param _request_auth: set to override the auth_settings for an a single
1079
- request; this effectively ignores the
1080
- authentication in the spec for a single request.
1081
- :type _request_auth: dict, optional
1082
- :param _content_type: force content-type for the request.
1083
- :type _content_type: str, Optional
1084
- :param _headers: set to override the headers for a single
1085
- request; this effectively ignores the headers
1086
- in the spec for a single request.
1087
- :type _headers: dict, optional
1088
- :param _host_index: set to override the host_index for a single
1089
- request; this effectively ignores the host_index
1090
- in the spec for a single request.
1091
- :type _host_index: int, optional
1092
- :return: Returns the result object.
1093
- """ # noqa: E501
1094
-
1095
- _param = self._signer_pdf_api_v1_traitement_signer_pdf_post_serialize(
1096
- fichier_pdf=fichier_pdf,
1097
- raison=raison,
1098
- localisation=localisation,
1099
- contact=contact,
1100
- field_name=field_name,
1101
- use_pades_lt=use_pades_lt,
1102
- use_timestamp=use_timestamp,
1103
- _request_auth=_request_auth,
1104
- _content_type=_content_type,
1105
- _headers=_headers,
1106
- _host_index=_host_index
1107
- )
1108
-
1109
- _response_types_map: Dict[str, Optional[str]] = {
1110
- '200': "object",
1111
- '400': None,
1112
- '404': None,
1113
- '401': None,
1114
- '503': None,
1115
- '422': "HTTPValidationError",
1116
- }
1117
- response_data = self.api_client.call_api(
1118
- *_param,
1119
- _request_timeout=_request_timeout
1120
- )
1121
- response_data.read()
1122
- return self.api_client.response_deserialize(
1123
- response_data=response_data,
1124
- response_types_map=_response_types_map,
1125
- )
1126
-
1127
-
1128
- @validate_call
1129
- def signer_pdf_api_v1_traitement_signer_pdf_post_without_preload_content(
1130
- self,
1131
- fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF à signer (sera traité puis retourné signé en base64)")],
1132
- raison: Optional[StrictStr] = None,
1133
- localisation: Optional[StrictStr] = None,
1134
- contact: Optional[StrictStr] = None,
1135
- field_name: Annotated[Optional[StrictStr], Field(description="Nom du champ de signature PDF")] = None,
1136
- use_pades_lt: Annotated[Optional[StrictBool], Field(description="Activer PAdES-B-LT (archivage long terme avec données de validation embarquées). NÉCESSITE un certificat avec accès OCSP/CRL.")] = None,
1137
- use_timestamp: Annotated[Optional[StrictBool], Field(description="Activer l'horodatage RFC 3161 avec FreeTSA (PAdES-B-T)")] = None,
1138
- _request_timeout: Union[
1139
- None,
1140
- Annotated[StrictFloat, Field(gt=0)],
1141
- Tuple[
1142
- Annotated[StrictFloat, Field(gt=0)],
1143
- Annotated[StrictFloat, Field(gt=0)]
1144
- ]
1145
- ] = None,
1146
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1147
- _content_type: Optional[StrictStr] = None,
1148
- _headers: Optional[Dict[StrictStr, Any]] = None,
1149
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1150
- ) -> RESTResponseType:
1151
- """Signer un PDF avec le certificat du client (PAdES-B-LT)
1152
-
1153
- Signe un PDF uploadé avec le certificat électronique configuré pour le client (via client_uid du JWT). **Standards supportés** : PAdES-B-B, PAdES-B-T (horodatage), PAdES-B-LT (archivage long terme). **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO - hors scope). **Sécurité** : Double authentification X-Internal-Secret + JWT Bearer pour récupérer le certificat. **⚠️ Disclaimer légal** : Les signatures générées sont des cachets électroniques au sens du règlement eIDAS. Le niveau de validité juridique dépend du certificat utilisé (SES/AdES/QES). FactPulse ne fournit pas de certificats qualifiés QES - vous devez obtenir un certificat auprès d'un PSCO (Prestataire de Services de Confiance qualifié) pour une validité juridique maximale.
1154
-
1155
- :param fichier_pdf: Fichier PDF à signer (sera traité puis retourné signé en base64) (required)
1156
- :type fichier_pdf: bytearray
1157
- :param raison:
1158
- :type raison: str
1159
- :param localisation:
1160
- :type localisation: str
1161
- :param contact:
1162
- :type contact: str
1163
- :param field_name: Nom du champ de signature PDF
1164
- :type field_name: str
1165
- :param use_pades_lt: Activer PAdES-B-LT (archivage long terme avec données de validation embarquées). NÉCESSITE un certificat avec accès OCSP/CRL.
1166
- :type use_pades_lt: bool
1167
- :param use_timestamp: Activer l'horodatage RFC 3161 avec FreeTSA (PAdES-B-T)
1168
- :type use_timestamp: bool
1169
- :param _request_timeout: timeout setting for this request. If one
1170
- number provided, it will be total request
1171
- timeout. It can also be a pair (tuple) of
1172
- (connection, read) timeouts.
1173
- :type _request_timeout: int, tuple(int, int), optional
1174
- :param _request_auth: set to override the auth_settings for an a single
1175
- request; this effectively ignores the
1176
- authentication in the spec for a single request.
1177
- :type _request_auth: dict, optional
1178
- :param _content_type: force content-type for the request.
1179
- :type _content_type: str, Optional
1180
- :param _headers: set to override the headers for a single
1181
- request; this effectively ignores the headers
1182
- in the spec for a single request.
1183
- :type _headers: dict, optional
1184
- :param _host_index: set to override the host_index for a single
1185
- request; this effectively ignores the host_index
1186
- in the spec for a single request.
1187
- :type _host_index: int, optional
1188
- :return: Returns the result object.
1189
- """ # noqa: E501
1190
-
1191
- _param = self._signer_pdf_api_v1_traitement_signer_pdf_post_serialize(
1192
- fichier_pdf=fichier_pdf,
1193
- raison=raison,
1194
- localisation=localisation,
1195
- contact=contact,
1196
- field_name=field_name,
1197
- use_pades_lt=use_pades_lt,
1198
- use_timestamp=use_timestamp,
1199
- _request_auth=_request_auth,
1200
- _content_type=_content_type,
1201
- _headers=_headers,
1202
- _host_index=_host_index
1203
- )
1204
-
1205
- _response_types_map: Dict[str, Optional[str]] = {
1206
- '200': "object",
1207
- '400': None,
1208
- '404': None,
1209
- '401': None,
1210
- '503': None,
1211
- '422': "HTTPValidationError",
1212
- }
1213
- response_data = self.api_client.call_api(
1214
- *_param,
1215
- _request_timeout=_request_timeout
1216
- )
1217
- return response_data.response
1218
-
1219
-
1220
- def _signer_pdf_api_v1_traitement_signer_pdf_post_serialize(
1221
- self,
1222
- fichier_pdf,
1223
- raison,
1224
- localisation,
1225
- contact,
1226
- field_name,
1227
- use_pades_lt,
1228
- use_timestamp,
1229
- _request_auth,
1230
- _content_type,
1231
- _headers,
1232
- _host_index,
1233
- ) -> RequestSerialized:
1234
-
1235
- _host = None
1236
-
1237
- _collection_formats: Dict[str, str] = {
1238
- }
1239
-
1240
- _path_params: Dict[str, str] = {}
1241
- _query_params: List[Tuple[str, str]] = []
1242
- _header_params: Dict[str, Optional[str]] = _headers or {}
1243
- _form_params: List[Tuple[str, str]] = []
1244
- _files: Dict[
1245
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1246
- ] = {}
1247
- _body_params: Optional[bytes] = None
1248
-
1249
- # process the path parameters
1250
- # process the query parameters
1251
- # process the header parameters
1252
- # process the form parameters
1253
- if fichier_pdf is not None:
1254
- _files['fichier_pdf'] = fichier_pdf
1255
- if raison is not None:
1256
- _form_params.append(('raison', raison))
1257
- if localisation is not None:
1258
- _form_params.append(('localisation', localisation))
1259
- if contact is not None:
1260
- _form_params.append(('contact', contact))
1261
- if field_name is not None:
1262
- _form_params.append(('field_name', field_name))
1263
- if use_pades_lt is not None:
1264
- _form_params.append(('use_pades_lt', use_pades_lt))
1265
- if use_timestamp is not None:
1266
- _form_params.append(('use_timestamp', use_timestamp))
1267
- # process the body parameter
1268
-
1269
-
1270
- # set the HTTP header `Accept`
1271
- if 'Accept' not in _header_params:
1272
- _header_params['Accept'] = self.api_client.select_header_accept(
1273
- [
1274
- 'application/json'
1275
- ]
1276
- )
1277
-
1278
- # set the HTTP header `Content-Type`
1279
- if _content_type:
1280
- _header_params['Content-Type'] = _content_type
1281
- else:
1282
- _default_content_type = (
1283
- self.api_client.select_header_content_type(
1284
- [
1285
- 'multipart/form-data'
1286
- ]
1287
- )
1288
- )
1289
- if _default_content_type is not None:
1290
- _header_params['Content-Type'] = _default_content_type
1291
-
1292
- # authentication setting
1293
- _auth_settings: List[str] = [
1294
- 'HTTPBearer'
1295
- ]
1296
-
1297
- return self.api_client.param_serialize(
1298
- method='POST',
1299
- resource_path='/api/v1/traitement/signer-pdf',
1300
- path_params=_path_params,
1301
- query_params=_query_params,
1302
- header_params=_header_params,
1303
- body=_body_params,
1304
- post_params=_form_params,
1305
- files=_files,
1306
- auth_settings=_auth_settings,
1307
- collection_formats=_collection_formats,
1308
- _host=_host,
1309
- _request_auth=_request_auth
1310
- )
1311
-
1312
-
1313
-
1314
-
1315
- @validate_call
1316
- def signer_pdf_async_api_v1_traitement_signer_pdf_async_post(
1317
- self,
1318
- fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF à signer (traité de manière asynchrone)")],
1319
- raison: Optional[StrictStr] = None,
1320
- localisation: Optional[StrictStr] = None,
1321
- contact: Optional[StrictStr] = None,
1322
- field_name: Annotated[Optional[StrictStr], Field(description="Nom du champ de signature PDF")] = None,
1323
- use_pades_lt: Annotated[Optional[StrictBool], Field(description="Activer PAdES-B-LT (archivage long terme avec données de validation embarquées). NÉCESSITE un certificat avec accès OCSP/CRL.")] = None,
1324
- use_timestamp: Annotated[Optional[StrictBool], Field(description="Activer l'horodatage RFC 3161 avec FreeTSA (PAdES-B-T)")] = None,
1325
- _request_timeout: Union[
1326
- None,
1327
- Annotated[StrictFloat, Field(gt=0)],
1328
- Tuple[
1329
- Annotated[StrictFloat, Field(gt=0)],
1330
- Annotated[StrictFloat, Field(gt=0)]
1331
- ]
1332
- ] = None,
1333
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1334
- _content_type: Optional[StrictStr] = None,
1335
- _headers: Optional[Dict[StrictStr, Any]] = None,
1336
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1337
- ) -> object:
1338
- """Signer un PDF de manière asynchrone (Celery)
1339
-
1340
- Signe un PDF uploadé de manière asynchrone via une tâche Celery. **Différence avec /signer-pdf** : - `/signer-pdf` : Signature synchrone (blocage jusqu'à la fin) - `/signer-pdf-async` : Signature asynchrone (retourne immédiatement un task_id) **Avantages de l'async** : - Pas de timeout pour les gros fichiers - Pas de blocage du worker FastAPI - Possibilité de suivre la progression via le task_id - Idéal pour les traitements par lot **Standards supportés** : PAdES-B-B, PAdES-B-T (horodatage), PAdES-B-LT (archivage long terme). **⚠️ Disclaimer légal** : Identique à /signer-pdf (voir documentation de cet endpoint).
1341
-
1342
- :param fichier_pdf: Fichier PDF à signer (traité de manière asynchrone) (required)
1343
- :type fichier_pdf: bytearray
1344
- :param raison:
1345
- :type raison: str
1346
- :param localisation:
1347
- :type localisation: str
1348
- :param contact:
1349
- :type contact: str
1350
- :param field_name: Nom du champ de signature PDF
1351
- :type field_name: str
1352
- :param use_pades_lt: Activer PAdES-B-LT (archivage long terme avec données de validation embarquées). NÉCESSITE un certificat avec accès OCSP/CRL.
1353
- :type use_pades_lt: bool
1354
- :param use_timestamp: Activer l'horodatage RFC 3161 avec FreeTSA (PAdES-B-T)
1355
- :type use_timestamp: bool
1356
- :param _request_timeout: timeout setting for this request. If one
1357
- number provided, it will be total request
1358
- timeout. It can also be a pair (tuple) of
1359
- (connection, read) timeouts.
1360
- :type _request_timeout: int, tuple(int, int), optional
1361
- :param _request_auth: set to override the auth_settings for an a single
1362
- request; this effectively ignores the
1363
- authentication in the spec for a single request.
1364
- :type _request_auth: dict, optional
1365
- :param _content_type: force content-type for the request.
1366
- :type _content_type: str, Optional
1367
- :param _headers: set to override the headers for a single
1368
- request; this effectively ignores the headers
1369
- in the spec for a single request.
1370
- :type _headers: dict, optional
1371
- :param _host_index: set to override the host_index for a single
1372
- request; this effectively ignores the host_index
1373
- in the spec for a single request.
1374
- :type _host_index: int, optional
1375
- :return: Returns the result object.
1376
- """ # noqa: E501
1377
-
1378
- _param = self._signer_pdf_async_api_v1_traitement_signer_pdf_async_post_serialize(
1379
- fichier_pdf=fichier_pdf,
1380
- raison=raison,
1381
- localisation=localisation,
1382
- contact=contact,
1383
- field_name=field_name,
1384
- use_pades_lt=use_pades_lt,
1385
- use_timestamp=use_timestamp,
1386
- _request_auth=_request_auth,
1387
- _content_type=_content_type,
1388
- _headers=_headers,
1389
- _host_index=_host_index
1390
- )
1391
-
1392
- _response_types_map: Dict[str, Optional[str]] = {
1393
- '200': "object",
1394
- '202': None,
1395
- '400': None,
1396
- '401': None,
1397
- '422': "HTTPValidationError",
1398
- }
1399
- response_data = self.api_client.call_api(
1400
- *_param,
1401
- _request_timeout=_request_timeout
1402
- )
1403
- response_data.read()
1404
- return self.api_client.response_deserialize(
1405
- response_data=response_data,
1406
- response_types_map=_response_types_map,
1407
- ).data
1408
-
1409
-
1410
- @validate_call
1411
- def signer_pdf_async_api_v1_traitement_signer_pdf_async_post_with_http_info(
1412
- self,
1413
- fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF à signer (traité de manière asynchrone)")],
1414
- raison: Optional[StrictStr] = None,
1415
- localisation: Optional[StrictStr] = None,
1416
- contact: Optional[StrictStr] = None,
1417
- field_name: Annotated[Optional[StrictStr], Field(description="Nom du champ de signature PDF")] = None,
1418
- use_pades_lt: Annotated[Optional[StrictBool], Field(description="Activer PAdES-B-LT (archivage long terme avec données de validation embarquées). NÉCESSITE un certificat avec accès OCSP/CRL.")] = None,
1419
- use_timestamp: Annotated[Optional[StrictBool], Field(description="Activer l'horodatage RFC 3161 avec FreeTSA (PAdES-B-T)")] = None,
1420
- _request_timeout: Union[
1421
- None,
1422
- Annotated[StrictFloat, Field(gt=0)],
1423
- Tuple[
1424
- Annotated[StrictFloat, Field(gt=0)],
1425
- Annotated[StrictFloat, Field(gt=0)]
1426
- ]
1427
- ] = None,
1428
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1429
- _content_type: Optional[StrictStr] = None,
1430
- _headers: Optional[Dict[StrictStr, Any]] = None,
1431
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1432
- ) -> ApiResponse[object]:
1433
- """Signer un PDF de manière asynchrone (Celery)
1434
-
1435
- Signe un PDF uploadé de manière asynchrone via une tâche Celery. **Différence avec /signer-pdf** : - `/signer-pdf` : Signature synchrone (blocage jusqu'à la fin) - `/signer-pdf-async` : Signature asynchrone (retourne immédiatement un task_id) **Avantages de l'async** : - Pas de timeout pour les gros fichiers - Pas de blocage du worker FastAPI - Possibilité de suivre la progression via le task_id - Idéal pour les traitements par lot **Standards supportés** : PAdES-B-B, PAdES-B-T (horodatage), PAdES-B-LT (archivage long terme). **⚠️ Disclaimer légal** : Identique à /signer-pdf (voir documentation de cet endpoint).
1436
-
1437
- :param fichier_pdf: Fichier PDF à signer (traité de manière asynchrone) (required)
1438
- :type fichier_pdf: bytearray
1439
- :param raison:
1440
- :type raison: str
1441
- :param localisation:
1442
- :type localisation: str
1443
- :param contact:
1444
- :type contact: str
1445
- :param field_name: Nom du champ de signature PDF
1446
- :type field_name: str
1447
- :param use_pades_lt: Activer PAdES-B-LT (archivage long terme avec données de validation embarquées). NÉCESSITE un certificat avec accès OCSP/CRL.
1448
- :type use_pades_lt: bool
1449
- :param use_timestamp: Activer l'horodatage RFC 3161 avec FreeTSA (PAdES-B-T)
1450
- :type use_timestamp: bool
1451
- :param _request_timeout: timeout setting for this request. If one
1452
- number provided, it will be total request
1453
- timeout. It can also be a pair (tuple) of
1454
- (connection, read) timeouts.
1455
- :type _request_timeout: int, tuple(int, int), optional
1456
- :param _request_auth: set to override the auth_settings for an a single
1457
- request; this effectively ignores the
1458
- authentication in the spec for a single request.
1459
- :type _request_auth: dict, optional
1460
- :param _content_type: force content-type for the request.
1461
- :type _content_type: str, Optional
1462
- :param _headers: set to override the headers for a single
1463
- request; this effectively ignores the headers
1464
- in the spec for a single request.
1465
- :type _headers: dict, optional
1466
- :param _host_index: set to override the host_index for a single
1467
- request; this effectively ignores the host_index
1468
- in the spec for a single request.
1469
- :type _host_index: int, optional
1470
- :return: Returns the result object.
1471
- """ # noqa: E501
1472
-
1473
- _param = self._signer_pdf_async_api_v1_traitement_signer_pdf_async_post_serialize(
1474
- fichier_pdf=fichier_pdf,
1475
- raison=raison,
1476
- localisation=localisation,
1477
- contact=contact,
1478
- field_name=field_name,
1479
- use_pades_lt=use_pades_lt,
1480
- use_timestamp=use_timestamp,
1481
- _request_auth=_request_auth,
1482
- _content_type=_content_type,
1483
- _headers=_headers,
1484
- _host_index=_host_index
1485
- )
1486
-
1487
- _response_types_map: Dict[str, Optional[str]] = {
1488
- '200': "object",
1489
- '202': None,
1490
- '400': None,
1491
- '401': None,
1492
- '422': "HTTPValidationError",
1493
- }
1494
- response_data = self.api_client.call_api(
1495
- *_param,
1496
- _request_timeout=_request_timeout
1497
- )
1498
- response_data.read()
1499
- return self.api_client.response_deserialize(
1500
- response_data=response_data,
1501
- response_types_map=_response_types_map,
1502
- )
1503
-
1504
-
1505
- @validate_call
1506
- def signer_pdf_async_api_v1_traitement_signer_pdf_async_post_without_preload_content(
1507
- self,
1508
- fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF à signer (traité de manière asynchrone)")],
1509
- raison: Optional[StrictStr] = None,
1510
- localisation: Optional[StrictStr] = None,
1511
- contact: Optional[StrictStr] = None,
1512
- field_name: Annotated[Optional[StrictStr], Field(description="Nom du champ de signature PDF")] = None,
1513
- use_pades_lt: Annotated[Optional[StrictBool], Field(description="Activer PAdES-B-LT (archivage long terme avec données de validation embarquées). NÉCESSITE un certificat avec accès OCSP/CRL.")] = None,
1514
- use_timestamp: Annotated[Optional[StrictBool], Field(description="Activer l'horodatage RFC 3161 avec FreeTSA (PAdES-B-T)")] = None,
1515
- _request_timeout: Union[
1516
- None,
1517
- Annotated[StrictFloat, Field(gt=0)],
1518
- Tuple[
1519
- Annotated[StrictFloat, Field(gt=0)],
1520
- Annotated[StrictFloat, Field(gt=0)]
1521
- ]
1522
- ] = None,
1523
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1524
- _content_type: Optional[StrictStr] = None,
1525
- _headers: Optional[Dict[StrictStr, Any]] = None,
1526
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1527
- ) -> RESTResponseType:
1528
- """Signer un PDF de manière asynchrone (Celery)
1529
-
1530
- Signe un PDF uploadé de manière asynchrone via une tâche Celery. **Différence avec /signer-pdf** : - `/signer-pdf` : Signature synchrone (blocage jusqu'à la fin) - `/signer-pdf-async` : Signature asynchrone (retourne immédiatement un task_id) **Avantages de l'async** : - Pas de timeout pour les gros fichiers - Pas de blocage du worker FastAPI - Possibilité de suivre la progression via le task_id - Idéal pour les traitements par lot **Standards supportés** : PAdES-B-B, PAdES-B-T (horodatage), PAdES-B-LT (archivage long terme). **⚠️ Disclaimer légal** : Identique à /signer-pdf (voir documentation de cet endpoint).
1531
-
1532
- :param fichier_pdf: Fichier PDF à signer (traité de manière asynchrone) (required)
1533
- :type fichier_pdf: bytearray
1534
- :param raison:
1535
- :type raison: str
1536
- :param localisation:
1537
- :type localisation: str
1538
- :param contact:
1539
- :type contact: str
1540
- :param field_name: Nom du champ de signature PDF
1541
- :type field_name: str
1542
- :param use_pades_lt: Activer PAdES-B-LT (archivage long terme avec données de validation embarquées). NÉCESSITE un certificat avec accès OCSP/CRL.
1543
- :type use_pades_lt: bool
1544
- :param use_timestamp: Activer l'horodatage RFC 3161 avec FreeTSA (PAdES-B-T)
1545
- :type use_timestamp: bool
1546
- :param _request_timeout: timeout setting for this request. If one
1547
- number provided, it will be total request
1548
- timeout. It can also be a pair (tuple) of
1549
- (connection, read) timeouts.
1550
- :type _request_timeout: int, tuple(int, int), optional
1551
- :param _request_auth: set to override the auth_settings for an a single
1552
- request; this effectively ignores the
1553
- authentication in the spec for a single request.
1554
- :type _request_auth: dict, optional
1555
- :param _content_type: force content-type for the request.
1556
- :type _content_type: str, Optional
1557
- :param _headers: set to override the headers for a single
1558
- request; this effectively ignores the headers
1559
- in the spec for a single request.
1560
- :type _headers: dict, optional
1561
- :param _host_index: set to override the host_index for a single
1562
- request; this effectively ignores the host_index
1563
- in the spec for a single request.
1564
- :type _host_index: int, optional
1565
- :return: Returns the result object.
1566
- """ # noqa: E501
1567
-
1568
- _param = self._signer_pdf_async_api_v1_traitement_signer_pdf_async_post_serialize(
1569
- fichier_pdf=fichier_pdf,
1570
- raison=raison,
1571
- localisation=localisation,
1572
- contact=contact,
1573
- field_name=field_name,
1574
- use_pades_lt=use_pades_lt,
1575
- use_timestamp=use_timestamp,
1576
- _request_auth=_request_auth,
1577
- _content_type=_content_type,
1578
- _headers=_headers,
1579
- _host_index=_host_index
1580
- )
1581
-
1582
- _response_types_map: Dict[str, Optional[str]] = {
1583
- '200': "object",
1584
- '202': None,
1585
- '400': None,
1586
- '401': None,
1587
- '422': "HTTPValidationError",
1588
- }
1589
- response_data = self.api_client.call_api(
1590
- *_param,
1591
- _request_timeout=_request_timeout
1592
- )
1593
- return response_data.response
1594
-
1595
-
1596
- def _signer_pdf_async_api_v1_traitement_signer_pdf_async_post_serialize(
1597
- self,
1598
- fichier_pdf,
1599
- raison,
1600
- localisation,
1601
- contact,
1602
- field_name,
1603
- use_pades_lt,
1604
- use_timestamp,
1605
- _request_auth,
1606
- _content_type,
1607
- _headers,
1608
- _host_index,
1609
- ) -> RequestSerialized:
1610
-
1611
- _host = None
1612
-
1613
- _collection_formats: Dict[str, str] = {
1614
- }
1615
-
1616
- _path_params: Dict[str, str] = {}
1617
- _query_params: List[Tuple[str, str]] = []
1618
- _header_params: Dict[str, Optional[str]] = _headers or {}
1619
- _form_params: List[Tuple[str, str]] = []
1620
- _files: Dict[
1621
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1622
- ] = {}
1623
- _body_params: Optional[bytes] = None
1624
-
1625
- # process the path parameters
1626
- # process the query parameters
1627
- # process the header parameters
1628
- # process the form parameters
1629
- if fichier_pdf is not None:
1630
- _files['fichier_pdf'] = fichier_pdf
1631
- if raison is not None:
1632
- _form_params.append(('raison', raison))
1633
- if localisation is not None:
1634
- _form_params.append(('localisation', localisation))
1635
- if contact is not None:
1636
- _form_params.append(('contact', contact))
1637
- if field_name is not None:
1638
- _form_params.append(('field_name', field_name))
1639
- if use_pades_lt is not None:
1640
- _form_params.append(('use_pades_lt', use_pades_lt))
1641
- if use_timestamp is not None:
1642
- _form_params.append(('use_timestamp', use_timestamp))
1643
- # process the body parameter
1644
-
1645
-
1646
- # set the HTTP header `Accept`
1647
- if 'Accept' not in _header_params:
1648
- _header_params['Accept'] = self.api_client.select_header_accept(
1649
- [
1650
- 'application/json'
1651
- ]
1652
- )
1653
-
1654
- # set the HTTP header `Content-Type`
1655
- if _content_type:
1656
- _header_params['Content-Type'] = _content_type
1657
- else:
1658
- _default_content_type = (
1659
- self.api_client.select_header_content_type(
1660
- [
1661
- 'multipart/form-data'
1662
- ]
1663
- )
1664
- )
1665
- if _default_content_type is not None:
1666
- _header_params['Content-Type'] = _default_content_type
1667
-
1668
- # authentication setting
1669
- _auth_settings: List[str] = [
1670
- 'HTTPBearer'
1671
- ]
1672
-
1673
- return self.api_client.param_serialize(
1674
- method='POST',
1675
- resource_path='/api/v1/traitement/signer-pdf-async',
1676
- path_params=_path_params,
1677
- query_params=_query_params,
1678
- header_params=_header_params,
1679
- body=_body_params,
1680
- post_params=_form_params,
1681
- files=_files,
1682
- auth_settings=_auth_settings,
1683
- collection_formats=_collection_formats,
1684
- _host=_host,
1685
- _request_auth=_request_auth
1686
- )
1687
-
1688
-
1689
-
1690
-
1691
- @validate_call
1692
- def soumettre_facture_complete_api_v1_traitement_factures_soumettre_complete_post(
1693
- self,
1694
- soumettre_facture_complete_request: SoumettreFactureCompleteRequest,
1695
- _request_timeout: Union[
1696
- None,
1697
- Annotated[StrictFloat, Field(gt=0)],
1698
- Tuple[
1699
- Annotated[StrictFloat, Field(gt=0)],
1700
- Annotated[StrictFloat, Field(gt=0)]
1701
- ]
1702
- ] = None,
1703
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1704
- _content_type: Optional[StrictStr] = None,
1705
- _headers: Optional[Dict[StrictStr, Any]] = None,
1706
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1707
- ) -> SoumettreFactureCompleteResponse:
1708
- """Soumettre une facture complète (génération + signature + soumission)
1709
-
1710
- Endpoint unifié pour soumettre une facture complète vers différentes destinations. **Workflow automatisé :** 1. **Auto-enrichissement** (optionnel) : récupère les données via APIs publiques et Chorus Pro/AFNOR 2. **Génération PDF Factur-X** : crée un PDF/A-3 avec XML embarqué 3. **Signature électronique** (optionnelle) : signe le PDF avec un certificat 4. **Soumission** : envoie vers la destination choisie (Chorus Pro ou AFNOR PDP) **Destinations supportées :** - **Chorus Pro** : plateforme B2G française (factures vers secteur public) - **AFNOR PDP** : Plateformes de Dématérialisation Partenaires **Credentials de destination - 2 modes disponibles :** **Mode 1 - Récupération via JWT (recommandé) :** - Les credentials sont récupérés automatiquement via le `client_uid` du JWT - Ne pas fournir le champ `credentials` dans `destination` - Architecture 0-trust : aucun secret dans le payload - Exemple : `\"destination\": {\"type\": \"chorus_pro\"}` **Mode 2 - Credentials dans le payload :** - Fournir les credentials directement dans le payload - Utile pour tests ou intégrations tierces - Exemple : `\"destination\": {\"type\": \"chorus_pro\", \"credentials\": {...}}` **Signature électronique (optionnelle) - 2 modes disponibles :** **Mode 1 - Certificat stocké (recommandé) :** - Le certificat est récupéré automatiquement via le `client_uid` du JWT - Aucune clé à fournir dans le payload - Signature PAdES-B-LT avec horodatage (conforme eIDAS) - Exemple : `\"signature\": {\"raison\": \"Conformité Factur-X\"}` **Mode 2 - Clés dans le payload (pour tests) :** - Fournir `key_pem` et `cert_pem` directement - Format PEM accepté : brut ou base64 - Utile pour tests ou cas spéciaux sans certificat stocké - Exemple : `\"signature\": {\"key_pem\": \"-----BEGIN...\", \"cert_pem\": \"-----BEGIN...\"}` Si `key_pem` et `cert_pem` sont fournis → Mode 2 Sinon → Mode 1 (certificat récupéré via `client_uid`)
1711
-
1712
- :param soumettre_facture_complete_request: (required)
1713
- :type soumettre_facture_complete_request: SoumettreFactureCompleteRequest
1714
- :param _request_timeout: timeout setting for this request. If one
1715
- number provided, it will be total request
1716
- timeout. It can also be a pair (tuple) of
1717
- (connection, read) timeouts.
1718
- :type _request_timeout: int, tuple(int, int), optional
1719
- :param _request_auth: set to override the auth_settings for an a single
1720
- request; this effectively ignores the
1721
- authentication in the spec for a single request.
1722
- :type _request_auth: dict, optional
1723
- :param _content_type: force content-type for the request.
1724
- :type _content_type: str, Optional
1725
- :param _headers: set to override the headers for a single
1726
- request; this effectively ignores the headers
1727
- in the spec for a single request.
1728
- :type _headers: dict, optional
1729
- :param _host_index: set to override the host_index for a single
1730
- request; this effectively ignores the host_index
1731
- in the spec for a single request.
1732
- :type _host_index: int, optional
1733
- :return: Returns the result object.
1734
- """ # noqa: E501
1735
-
1736
- _param = self._soumettre_facture_complete_api_v1_traitement_factures_soumettre_complete_post_serialize(
1737
- soumettre_facture_complete_request=soumettre_facture_complete_request,
1738
- _request_auth=_request_auth,
1739
- _content_type=_content_type,
1740
- _headers=_headers,
1741
- _host_index=_host_index
1742
- )
1743
-
1744
- _response_types_map: Dict[str, Optional[str]] = {
1745
- '200': "SoumettreFactureCompleteResponse",
1746
- '422': "HTTPValidationError",
1747
- }
1748
- response_data = self.api_client.call_api(
1749
- *_param,
1750
- _request_timeout=_request_timeout
1751
- )
1752
- response_data.read()
1753
- return self.api_client.response_deserialize(
1754
- response_data=response_data,
1755
- response_types_map=_response_types_map,
1756
- ).data
1757
-
1758
-
1759
- @validate_call
1760
- def soumettre_facture_complete_api_v1_traitement_factures_soumettre_complete_post_with_http_info(
1761
- self,
1762
- soumettre_facture_complete_request: SoumettreFactureCompleteRequest,
1763
- _request_timeout: Union[
1764
- None,
1765
- Annotated[StrictFloat, Field(gt=0)],
1766
- Tuple[
1767
- Annotated[StrictFloat, Field(gt=0)],
1768
- Annotated[StrictFloat, Field(gt=0)]
1769
- ]
1770
- ] = None,
1771
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1772
- _content_type: Optional[StrictStr] = None,
1773
- _headers: Optional[Dict[StrictStr, Any]] = None,
1774
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1775
- ) -> ApiResponse[SoumettreFactureCompleteResponse]:
1776
- """Soumettre une facture complète (génération + signature + soumission)
1777
-
1778
- Endpoint unifié pour soumettre une facture complète vers différentes destinations. **Workflow automatisé :** 1. **Auto-enrichissement** (optionnel) : récupère les données via APIs publiques et Chorus Pro/AFNOR 2. **Génération PDF Factur-X** : crée un PDF/A-3 avec XML embarqué 3. **Signature électronique** (optionnelle) : signe le PDF avec un certificat 4. **Soumission** : envoie vers la destination choisie (Chorus Pro ou AFNOR PDP) **Destinations supportées :** - **Chorus Pro** : plateforme B2G française (factures vers secteur public) - **AFNOR PDP** : Plateformes de Dématérialisation Partenaires **Credentials de destination - 2 modes disponibles :** **Mode 1 - Récupération via JWT (recommandé) :** - Les credentials sont récupérés automatiquement via le `client_uid` du JWT - Ne pas fournir le champ `credentials` dans `destination` - Architecture 0-trust : aucun secret dans le payload - Exemple : `\"destination\": {\"type\": \"chorus_pro\"}` **Mode 2 - Credentials dans le payload :** - Fournir les credentials directement dans le payload - Utile pour tests ou intégrations tierces - Exemple : `\"destination\": {\"type\": \"chorus_pro\", \"credentials\": {...}}` **Signature électronique (optionnelle) - 2 modes disponibles :** **Mode 1 - Certificat stocké (recommandé) :** - Le certificat est récupéré automatiquement via le `client_uid` du JWT - Aucune clé à fournir dans le payload - Signature PAdES-B-LT avec horodatage (conforme eIDAS) - Exemple : `\"signature\": {\"raison\": \"Conformité Factur-X\"}` **Mode 2 - Clés dans le payload (pour tests) :** - Fournir `key_pem` et `cert_pem` directement - Format PEM accepté : brut ou base64 - Utile pour tests ou cas spéciaux sans certificat stocké - Exemple : `\"signature\": {\"key_pem\": \"-----BEGIN...\", \"cert_pem\": \"-----BEGIN...\"}` Si `key_pem` et `cert_pem` sont fournis → Mode 2 Sinon → Mode 1 (certificat récupéré via `client_uid`)
1779
-
1780
- :param soumettre_facture_complete_request: (required)
1781
- :type soumettre_facture_complete_request: SoumettreFactureCompleteRequest
1782
- :param _request_timeout: timeout setting for this request. If one
1783
- number provided, it will be total request
1784
- timeout. It can also be a pair (tuple) of
1785
- (connection, read) timeouts.
1786
- :type _request_timeout: int, tuple(int, int), optional
1787
- :param _request_auth: set to override the auth_settings for an a single
1788
- request; this effectively ignores the
1789
- authentication in the spec for a single request.
1790
- :type _request_auth: dict, optional
1791
- :param _content_type: force content-type for the request.
1792
- :type _content_type: str, Optional
1793
- :param _headers: set to override the headers for a single
1794
- request; this effectively ignores the headers
1795
- in the spec for a single request.
1796
- :type _headers: dict, optional
1797
- :param _host_index: set to override the host_index for a single
1798
- request; this effectively ignores the host_index
1799
- in the spec for a single request.
1800
- :type _host_index: int, optional
1801
- :return: Returns the result object.
1802
- """ # noqa: E501
1803
-
1804
- _param = self._soumettre_facture_complete_api_v1_traitement_factures_soumettre_complete_post_serialize(
1805
- soumettre_facture_complete_request=soumettre_facture_complete_request,
1806
- _request_auth=_request_auth,
1807
- _content_type=_content_type,
1808
- _headers=_headers,
1809
- _host_index=_host_index
1810
- )
1811
-
1812
- _response_types_map: Dict[str, Optional[str]] = {
1813
- '200': "SoumettreFactureCompleteResponse",
1814
- '422': "HTTPValidationError",
1815
- }
1816
- response_data = self.api_client.call_api(
1817
- *_param,
1818
- _request_timeout=_request_timeout
1819
- )
1820
- response_data.read()
1821
- return self.api_client.response_deserialize(
1822
- response_data=response_data,
1823
- response_types_map=_response_types_map,
1824
- )
1825
-
1826
-
1827
- @validate_call
1828
- def soumettre_facture_complete_api_v1_traitement_factures_soumettre_complete_post_without_preload_content(
1829
- self,
1830
- soumettre_facture_complete_request: SoumettreFactureCompleteRequest,
1831
- _request_timeout: Union[
1832
- None,
1833
- Annotated[StrictFloat, Field(gt=0)],
1834
- Tuple[
1835
- Annotated[StrictFloat, Field(gt=0)],
1836
- Annotated[StrictFloat, Field(gt=0)]
1837
- ]
1838
- ] = None,
1839
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1840
- _content_type: Optional[StrictStr] = None,
1841
- _headers: Optional[Dict[StrictStr, Any]] = None,
1842
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1843
- ) -> RESTResponseType:
1844
- """Soumettre une facture complète (génération + signature + soumission)
1845
-
1846
- Endpoint unifié pour soumettre une facture complète vers différentes destinations. **Workflow automatisé :** 1. **Auto-enrichissement** (optionnel) : récupère les données via APIs publiques et Chorus Pro/AFNOR 2. **Génération PDF Factur-X** : crée un PDF/A-3 avec XML embarqué 3. **Signature électronique** (optionnelle) : signe le PDF avec un certificat 4. **Soumission** : envoie vers la destination choisie (Chorus Pro ou AFNOR PDP) **Destinations supportées :** - **Chorus Pro** : plateforme B2G française (factures vers secteur public) - **AFNOR PDP** : Plateformes de Dématérialisation Partenaires **Credentials de destination - 2 modes disponibles :** **Mode 1 - Récupération via JWT (recommandé) :** - Les credentials sont récupérés automatiquement via le `client_uid` du JWT - Ne pas fournir le champ `credentials` dans `destination` - Architecture 0-trust : aucun secret dans le payload - Exemple : `\"destination\": {\"type\": \"chorus_pro\"}` **Mode 2 - Credentials dans le payload :** - Fournir les credentials directement dans le payload - Utile pour tests ou intégrations tierces - Exemple : `\"destination\": {\"type\": \"chorus_pro\", \"credentials\": {...}}` **Signature électronique (optionnelle) - 2 modes disponibles :** **Mode 1 - Certificat stocké (recommandé) :** - Le certificat est récupéré automatiquement via le `client_uid` du JWT - Aucune clé à fournir dans le payload - Signature PAdES-B-LT avec horodatage (conforme eIDAS) - Exemple : `\"signature\": {\"raison\": \"Conformité Factur-X\"}` **Mode 2 - Clés dans le payload (pour tests) :** - Fournir `key_pem` et `cert_pem` directement - Format PEM accepté : brut ou base64 - Utile pour tests ou cas spéciaux sans certificat stocké - Exemple : `\"signature\": {\"key_pem\": \"-----BEGIN...\", \"cert_pem\": \"-----BEGIN...\"}` Si `key_pem` et `cert_pem` sont fournis → Mode 2 Sinon → Mode 1 (certificat récupéré via `client_uid`)
1847
-
1848
- :param soumettre_facture_complete_request: (required)
1849
- :type soumettre_facture_complete_request: SoumettreFactureCompleteRequest
1850
- :param _request_timeout: timeout setting for this request. If one
1851
- number provided, it will be total request
1852
- timeout. It can also be a pair (tuple) of
1853
- (connection, read) timeouts.
1854
- :type _request_timeout: int, tuple(int, int), optional
1855
- :param _request_auth: set to override the auth_settings for an a single
1856
- request; this effectively ignores the
1857
- authentication in the spec for a single request.
1858
- :type _request_auth: dict, optional
1859
- :param _content_type: force content-type for the request.
1860
- :type _content_type: str, Optional
1861
- :param _headers: set to override the headers for a single
1862
- request; this effectively ignores the headers
1863
- in the spec for a single request.
1864
- :type _headers: dict, optional
1865
- :param _host_index: set to override the host_index for a single
1866
- request; this effectively ignores the host_index
1867
- in the spec for a single request.
1868
- :type _host_index: int, optional
1869
- :return: Returns the result object.
1870
- """ # noqa: E501
1871
-
1872
- _param = self._soumettre_facture_complete_api_v1_traitement_factures_soumettre_complete_post_serialize(
1873
- soumettre_facture_complete_request=soumettre_facture_complete_request,
1874
- _request_auth=_request_auth,
1875
- _content_type=_content_type,
1876
- _headers=_headers,
1877
- _host_index=_host_index
1878
- )
1879
-
1880
- _response_types_map: Dict[str, Optional[str]] = {
1881
- '200': "SoumettreFactureCompleteResponse",
1882
- '422': "HTTPValidationError",
1883
- }
1884
- response_data = self.api_client.call_api(
1885
- *_param,
1886
- _request_timeout=_request_timeout
1887
- )
1888
- return response_data.response
1889
-
1890
-
1891
- def _soumettre_facture_complete_api_v1_traitement_factures_soumettre_complete_post_serialize(
1892
- self,
1893
- soumettre_facture_complete_request,
1894
- _request_auth,
1895
- _content_type,
1896
- _headers,
1897
- _host_index,
1898
- ) -> RequestSerialized:
1899
-
1900
- _host = None
1901
-
1902
- _collection_formats: Dict[str, str] = {
1903
- }
1904
-
1905
- _path_params: Dict[str, str] = {}
1906
- _query_params: List[Tuple[str, str]] = []
1907
- _header_params: Dict[str, Optional[str]] = _headers or {}
1908
- _form_params: List[Tuple[str, str]] = []
1909
- _files: Dict[
1910
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1911
- ] = {}
1912
- _body_params: Optional[bytes] = None
1913
-
1914
- # process the path parameters
1915
- # process the query parameters
1916
- # process the header parameters
1917
- # process the form parameters
1918
- # process the body parameter
1919
- if soumettre_facture_complete_request is not None:
1920
- _body_params = soumettre_facture_complete_request
1921
-
1922
-
1923
- # set the HTTP header `Accept`
1924
- if 'Accept' not in _header_params:
1925
- _header_params['Accept'] = self.api_client.select_header_accept(
1926
- [
1927
- 'application/json'
1928
- ]
1929
- )
1930
-
1931
- # set the HTTP header `Content-Type`
1932
- if _content_type:
1933
- _header_params['Content-Type'] = _content_type
1934
- else:
1935
- _default_content_type = (
1936
- self.api_client.select_header_content_type(
1937
- [
1938
- 'application/json'
1939
- ]
1940
- )
1941
- )
1942
- if _default_content_type is not None:
1943
- _header_params['Content-Type'] = _default_content_type
1944
-
1945
- # authentication setting
1946
- _auth_settings: List[str] = [
1947
- 'HTTPBearer'
1948
- ]
1949
-
1950
- return self.api_client.param_serialize(
1951
- method='POST',
1952
- resource_path='/api/v1/traitement/factures/soumettre-complete',
1953
- path_params=_path_params,
1954
- query_params=_query_params,
1955
- header_params=_header_params,
1956
- body=_body_params,
1957
- post_params=_form_params,
1958
- files=_files,
1959
- auth_settings=_auth_settings,
1960
- collection_formats=_collection_formats,
1961
- _host=_host,
1962
- _request_auth=_request_auth
1963
- )
1964
-
1965
-
1966
-
1967
-
1968
- @validate_call
1969
- def soumettre_facture_complete_async_api_v1_traitement_factures_soumettre_complete_async_post(
1970
- self,
1971
- soumettre_facture_complete_request: SoumettreFactureCompleteRequest,
1972
- _request_timeout: Union[
1973
- None,
1974
- Annotated[StrictFloat, Field(gt=0)],
1975
- Tuple[
1976
- Annotated[StrictFloat, Field(gt=0)],
1977
- Annotated[StrictFloat, Field(gt=0)]
1978
- ]
1979
- ] = None,
1980
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
1981
- _content_type: Optional[StrictStr] = None,
1982
- _headers: Optional[Dict[StrictStr, Any]] = None,
1983
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1984
- ) -> ReponseTache:
1985
- """Soumettre une facture complète (asynchrone avec Celery)
1986
-
1987
- Version asynchrone de l'endpoint `/factures/soumettre-complete` utilisant Celery pour le traitement en arrière-plan. **Workflow automatisé (identique à la version synchrone) :** 1. **Auto-enrichissement** (optionnel) : récupère les données via APIs publiques et Chorus Pro/AFNOR 2. **Génération PDF Factur-X** : crée un PDF/A-3 avec XML embarqué 3. **Signature électronique** (optionnelle) : signe le PDF avec un certificat 4. **Soumission** : envoie vers la destination choisie (Chorus Pro ou AFNOR PDP) **Destinations supportées :** - **Chorus Pro** : plateforme B2G française (factures vers secteur public) - **AFNOR PDP** : Plateformes de Dématérialisation Partenaires **Différences avec la version synchrone :** - ✅ **Non-bloquant** : Retourne immédiatement un `id_tache` (HTTP 202 Accepted) - ✅ **Traitement en arrière-plan** : La facture est traitée par un worker Celery - ✅ **Suivi d'avancement** : Utilisez `/taches/{id_tache}/statut` pour suivre le statut - ✅ **Idéal pour gros volumes** : Permet de traiter de nombreuses factures en parallèle **Comment utiliser :** 1. **Soumission** : Appelez cet endpoint avec vos données de facture 2. **Retour immédiat** : Vous recevez un `id_tache` (ex: \"abc123-def456\") 3. **Suivi** : Appelez `/taches/{id_tache}/statut` pour vérifier l'avancement 4. **Résultat** : Quand `statut = \"SUCCESS\"`, le champ `resultat` contient la réponse complète **Credentials et signature** : Mêmes modes que la version synchrone (JWT ou payload).
1988
-
1989
- :param soumettre_facture_complete_request: (required)
1990
- :type soumettre_facture_complete_request: SoumettreFactureCompleteRequest
1991
- :param _request_timeout: timeout setting for this request. If one
1992
- number provided, it will be total request
1993
- timeout. It can also be a pair (tuple) of
1994
- (connection, read) timeouts.
1995
- :type _request_timeout: int, tuple(int, int), optional
1996
- :param _request_auth: set to override the auth_settings for an a single
1997
- request; this effectively ignores the
1998
- authentication in the spec for a single request.
1999
- :type _request_auth: dict, optional
2000
- :param _content_type: force content-type for the request.
2001
- :type _content_type: str, Optional
2002
- :param _headers: set to override the headers for a single
2003
- request; this effectively ignores the headers
2004
- in the spec for a single request.
2005
- :type _headers: dict, optional
2006
- :param _host_index: set to override the host_index for a single
2007
- request; this effectively ignores the host_index
2008
- in the spec for a single request.
2009
- :type _host_index: int, optional
2010
- :return: Returns the result object.
2011
- """ # noqa: E501
2012
-
2013
- _param = self._soumettre_facture_complete_async_api_v1_traitement_factures_soumettre_complete_async_post_serialize(
2014
- soumettre_facture_complete_request=soumettre_facture_complete_request,
2015
- _request_auth=_request_auth,
2016
- _content_type=_content_type,
2017
- _headers=_headers,
2018
- _host_index=_host_index
2019
- )
2020
-
2021
- _response_types_map: Dict[str, Optional[str]] = {
2022
- '202': "ReponseTache",
2023
- '422': "HTTPValidationError",
2024
- }
2025
- response_data = self.api_client.call_api(
2026
- *_param,
2027
- _request_timeout=_request_timeout
2028
- )
2029
- response_data.read()
2030
- return self.api_client.response_deserialize(
2031
- response_data=response_data,
2032
- response_types_map=_response_types_map,
2033
- ).data
2034
-
2035
-
2036
- @validate_call
2037
- def soumettre_facture_complete_async_api_v1_traitement_factures_soumettre_complete_async_post_with_http_info(
2038
- self,
2039
- soumettre_facture_complete_request: SoumettreFactureCompleteRequest,
2040
- _request_timeout: Union[
2041
- None,
2042
- Annotated[StrictFloat, Field(gt=0)],
2043
- Tuple[
2044
- Annotated[StrictFloat, Field(gt=0)],
2045
- Annotated[StrictFloat, Field(gt=0)]
2046
- ]
2047
- ] = None,
2048
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2049
- _content_type: Optional[StrictStr] = None,
2050
- _headers: Optional[Dict[StrictStr, Any]] = None,
2051
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2052
- ) -> ApiResponse[ReponseTache]:
2053
- """Soumettre une facture complète (asynchrone avec Celery)
2054
-
2055
- Version asynchrone de l'endpoint `/factures/soumettre-complete` utilisant Celery pour le traitement en arrière-plan. **Workflow automatisé (identique à la version synchrone) :** 1. **Auto-enrichissement** (optionnel) : récupère les données via APIs publiques et Chorus Pro/AFNOR 2. **Génération PDF Factur-X** : crée un PDF/A-3 avec XML embarqué 3. **Signature électronique** (optionnelle) : signe le PDF avec un certificat 4. **Soumission** : envoie vers la destination choisie (Chorus Pro ou AFNOR PDP) **Destinations supportées :** - **Chorus Pro** : plateforme B2G française (factures vers secteur public) - **AFNOR PDP** : Plateformes de Dématérialisation Partenaires **Différences avec la version synchrone :** - ✅ **Non-bloquant** : Retourne immédiatement un `id_tache` (HTTP 202 Accepted) - ✅ **Traitement en arrière-plan** : La facture est traitée par un worker Celery - ✅ **Suivi d'avancement** : Utilisez `/taches/{id_tache}/statut` pour suivre le statut - ✅ **Idéal pour gros volumes** : Permet de traiter de nombreuses factures en parallèle **Comment utiliser :** 1. **Soumission** : Appelez cet endpoint avec vos données de facture 2. **Retour immédiat** : Vous recevez un `id_tache` (ex: \"abc123-def456\") 3. **Suivi** : Appelez `/taches/{id_tache}/statut` pour vérifier l'avancement 4. **Résultat** : Quand `statut = \"SUCCESS\"`, le champ `resultat` contient la réponse complète **Credentials et signature** : Mêmes modes que la version synchrone (JWT ou payload).
2056
-
2057
- :param soumettre_facture_complete_request: (required)
2058
- :type soumettre_facture_complete_request: SoumettreFactureCompleteRequest
2059
- :param _request_timeout: timeout setting for this request. If one
2060
- number provided, it will be total request
2061
- timeout. It can also be a pair (tuple) of
2062
- (connection, read) timeouts.
2063
- :type _request_timeout: int, tuple(int, int), optional
2064
- :param _request_auth: set to override the auth_settings for an a single
2065
- request; this effectively ignores the
2066
- authentication in the spec for a single request.
2067
- :type _request_auth: dict, optional
2068
- :param _content_type: force content-type for the request.
2069
- :type _content_type: str, Optional
2070
- :param _headers: set to override the headers for a single
2071
- request; this effectively ignores the headers
2072
- in the spec for a single request.
2073
- :type _headers: dict, optional
2074
- :param _host_index: set to override the host_index for a single
2075
- request; this effectively ignores the host_index
2076
- in the spec for a single request.
2077
- :type _host_index: int, optional
2078
- :return: Returns the result object.
2079
- """ # noqa: E501
2080
-
2081
- _param = self._soumettre_facture_complete_async_api_v1_traitement_factures_soumettre_complete_async_post_serialize(
2082
- soumettre_facture_complete_request=soumettre_facture_complete_request,
2083
- _request_auth=_request_auth,
2084
- _content_type=_content_type,
2085
- _headers=_headers,
2086
- _host_index=_host_index
2087
- )
2088
-
2089
- _response_types_map: Dict[str, Optional[str]] = {
2090
- '202': "ReponseTache",
2091
- '422': "HTTPValidationError",
2092
- }
2093
- response_data = self.api_client.call_api(
2094
- *_param,
2095
- _request_timeout=_request_timeout
2096
- )
2097
- response_data.read()
2098
- return self.api_client.response_deserialize(
2099
- response_data=response_data,
2100
- response_types_map=_response_types_map,
2101
- )
2102
-
2103
-
2104
- @validate_call
2105
- def soumettre_facture_complete_async_api_v1_traitement_factures_soumettre_complete_async_post_without_preload_content(
2106
- self,
2107
- soumettre_facture_complete_request: SoumettreFactureCompleteRequest,
2108
- _request_timeout: Union[
2109
- None,
2110
- Annotated[StrictFloat, Field(gt=0)],
2111
- Tuple[
2112
- Annotated[StrictFloat, Field(gt=0)],
2113
- Annotated[StrictFloat, Field(gt=0)]
2114
- ]
2115
- ] = None,
2116
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2117
- _content_type: Optional[StrictStr] = None,
2118
- _headers: Optional[Dict[StrictStr, Any]] = None,
2119
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2120
- ) -> RESTResponseType:
2121
- """Soumettre une facture complète (asynchrone avec Celery)
2122
-
2123
- Version asynchrone de l'endpoint `/factures/soumettre-complete` utilisant Celery pour le traitement en arrière-plan. **Workflow automatisé (identique à la version synchrone) :** 1. **Auto-enrichissement** (optionnel) : récupère les données via APIs publiques et Chorus Pro/AFNOR 2. **Génération PDF Factur-X** : crée un PDF/A-3 avec XML embarqué 3. **Signature électronique** (optionnelle) : signe le PDF avec un certificat 4. **Soumission** : envoie vers la destination choisie (Chorus Pro ou AFNOR PDP) **Destinations supportées :** - **Chorus Pro** : plateforme B2G française (factures vers secteur public) - **AFNOR PDP** : Plateformes de Dématérialisation Partenaires **Différences avec la version synchrone :** - ✅ **Non-bloquant** : Retourne immédiatement un `id_tache` (HTTP 202 Accepted) - ✅ **Traitement en arrière-plan** : La facture est traitée par un worker Celery - ✅ **Suivi d'avancement** : Utilisez `/taches/{id_tache}/statut` pour suivre le statut - ✅ **Idéal pour gros volumes** : Permet de traiter de nombreuses factures en parallèle **Comment utiliser :** 1. **Soumission** : Appelez cet endpoint avec vos données de facture 2. **Retour immédiat** : Vous recevez un `id_tache` (ex: \"abc123-def456\") 3. **Suivi** : Appelez `/taches/{id_tache}/statut` pour vérifier l'avancement 4. **Résultat** : Quand `statut = \"SUCCESS\"`, le champ `resultat` contient la réponse complète **Credentials et signature** : Mêmes modes que la version synchrone (JWT ou payload).
2124
-
2125
- :param soumettre_facture_complete_request: (required)
2126
- :type soumettre_facture_complete_request: SoumettreFactureCompleteRequest
2127
- :param _request_timeout: timeout setting for this request. If one
2128
- number provided, it will be total request
2129
- timeout. It can also be a pair (tuple) of
2130
- (connection, read) timeouts.
2131
- :type _request_timeout: int, tuple(int, int), optional
2132
- :param _request_auth: set to override the auth_settings for an a single
2133
- request; this effectively ignores the
2134
- authentication in the spec for a single request.
2135
- :type _request_auth: dict, optional
2136
- :param _content_type: force content-type for the request.
2137
- :type _content_type: str, Optional
2138
- :param _headers: set to override the headers for a single
2139
- request; this effectively ignores the headers
2140
- in the spec for a single request.
2141
- :type _headers: dict, optional
2142
- :param _host_index: set to override the host_index for a single
2143
- request; this effectively ignores the host_index
2144
- in the spec for a single request.
2145
- :type _host_index: int, optional
2146
- :return: Returns the result object.
2147
- """ # noqa: E501
2148
-
2149
- _param = self._soumettre_facture_complete_async_api_v1_traitement_factures_soumettre_complete_async_post_serialize(
2150
- soumettre_facture_complete_request=soumettre_facture_complete_request,
2151
- _request_auth=_request_auth,
2152
- _content_type=_content_type,
2153
- _headers=_headers,
2154
- _host_index=_host_index
2155
- )
2156
-
2157
- _response_types_map: Dict[str, Optional[str]] = {
2158
- '202': "ReponseTache",
2159
- '422': "HTTPValidationError",
2160
- }
2161
- response_data = self.api_client.call_api(
2162
- *_param,
2163
- _request_timeout=_request_timeout
2164
- )
2165
- return response_data.response
2166
-
2167
-
2168
- def _soumettre_facture_complete_async_api_v1_traitement_factures_soumettre_complete_async_post_serialize(
2169
- self,
2170
- soumettre_facture_complete_request,
2171
- _request_auth,
2172
- _content_type,
2173
- _headers,
2174
- _host_index,
2175
- ) -> RequestSerialized:
2176
-
2177
- _host = None
2178
-
2179
- _collection_formats: Dict[str, str] = {
2180
- }
2181
-
2182
- _path_params: Dict[str, str] = {}
2183
- _query_params: List[Tuple[str, str]] = []
2184
- _header_params: Dict[str, Optional[str]] = _headers or {}
2185
- _form_params: List[Tuple[str, str]] = []
2186
- _files: Dict[
2187
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2188
- ] = {}
2189
- _body_params: Optional[bytes] = None
2190
-
2191
- # process the path parameters
2192
- # process the query parameters
2193
- # process the header parameters
2194
- # process the form parameters
2195
- # process the body parameter
2196
- if soumettre_facture_complete_request is not None:
2197
- _body_params = soumettre_facture_complete_request
2198
-
2199
-
2200
- # set the HTTP header `Accept`
2201
- if 'Accept' not in _header_params:
2202
- _header_params['Accept'] = self.api_client.select_header_accept(
2203
- [
2204
- 'application/json'
2205
- ]
2206
- )
2207
-
2208
- # set the HTTP header `Content-Type`
2209
- if _content_type:
2210
- _header_params['Content-Type'] = _content_type
2211
- else:
2212
- _default_content_type = (
2213
- self.api_client.select_header_content_type(
2214
- [
2215
- 'application/json'
2216
- ]
2217
- )
2218
- )
2219
- if _default_content_type is not None:
2220
- _header_params['Content-Type'] = _default_content_type
2221
-
2222
- # authentication setting
2223
- _auth_settings: List[str] = [
2224
- 'HTTPBearer'
2225
- ]
2226
-
2227
- return self.api_client.param_serialize(
2228
- method='POST',
2229
- resource_path='/api/v1/traitement/factures/soumettre-complete-async',
2230
- path_params=_path_params,
2231
- query_params=_query_params,
2232
- header_params=_header_params,
2233
- body=_body_params,
2234
- post_params=_form_params,
2235
- files=_files,
2236
- auth_settings=_auth_settings,
2237
- collection_formats=_collection_formats,
2238
- _host=_host,
2239
- _request_auth=_request_auth
2240
- )
2241
-
2242
-
2243
-
2244
-
2245
- @validate_call
2246
- def valider_pdf_facturx_api_v1_traitement_valider_pdf_facturx_post(
2247
- self,
2248
- fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF Factur-X à valider (format .pdf).")],
2249
- profil: Optional[Any] = None,
2250
- use_verapdf: Annotated[Optional[StrictBool], Field(description="Active la validation stricte PDF/A avec VeraPDF (recommandé pour la production). Si False, utilise une validation basique par métadonnées.")] = None,
2251
- _request_timeout: Union[
2252
- None,
2253
- Annotated[StrictFloat, Field(gt=0)],
2254
- Tuple[
2255
- Annotated[StrictFloat, Field(gt=0)],
2256
- Annotated[StrictFloat, Field(gt=0)]
2257
- ]
2258
- ] = None,
2259
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2260
- _content_type: Optional[StrictStr] = None,
2261
- _headers: Optional[Dict[StrictStr, Any]] = None,
2262
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2263
- ) -> ResultatValidationPDFAPI:
2264
- """Valider un PDF Factur-X complet
2265
-
2266
- Valide un PDF Factur-X complet selon les normes européennes et françaises. ## Normes de validation appliquées - **EN 16931** : Norme sémantique européenne (directive 2014/55/UE) - **ISO 19005-3** (PDF/A-3) : Archivage électronique à long terme - **Factur-X / ZUGFeRD** : Spécification franco-allemande - **Schematron** : Validation des règles métier XML - **eIDAS** : Règlement européen sur l'identification électronique (signatures) ## Contrôles effectués ### 1. Extraction et validation du XML Factur-X **Contrôles réalisés :** - Présence d'un fichier XML embarqué (`factur-x.xml` ou `zugferd-invoice.xml`) - Détection automatique du profil (MINIMUM, BASIC, EN16931, EXTENDED) - Parsing XML avec validation UTF-8 - Extraction du GuidelineSpecifiedDocumentContextParameter/ID **Validation Schematron :** - Règles métier du profil détecté (MINIMUM : 45 règles, EN16931 : 178 règles) - Cardinalité des éléments obligatoires - Cohérence des calculs (montants HT, TVA, TTC, remises) - Formats des identifiants (SIRET, TVA intracommunautaire, IBAN) - Codes normalisés (codes pays ISO, unités UN/ECE, codes TVA) **Ce qui est vérifié :** - ✅ Structure XML conforme XSD Cross Industry Invoice - ✅ Namespace UN/CEFACT correct - ✅ Règles de gestion européennes (BR-xx) - ✅ Règles françaises spécifiques (FR-xx) ### 2. Conformité PDF/A-3 **Validation de base (métadonnées) :** - Présence du champ `/Type` à `Catalog` - Métadonnée `pdfaid:part` = 3 (PDF/A-3) - Métadonnée `pdfaid:conformance` = B ou U - Version PDF >= 1.4 **Validation stricte VeraPDF (si use_verapdf=True) :** - 146+ règles ISO 19005-3 (PDF/A-3B) - Absence de contenu interdit (JavaScript, multimedia, formulaires dynamiques) - Polices embarquées et sous-ensembles corrects - Espaces colorimétriques conformes (sRGB, DeviceGray) - Structure de fichier valide (cross-reference table) - Métadonnées XMP conformes ISO 16684-1 **Ce qui est vérifié :** - ✅ Fichier archivable à long terme (20+ ans) - ✅ Lisibilité garantie (polices embarquées) - ✅ Conformité légale (France, Allemagne, UE) ### 3. Métadonnées XMP (eXtensible Metadata Platform) **Contrôles réalisés :** - Présence du bloc `<?xpacket>` avec métadonnées XMP - Namespace `fx:` pour Factur-X : `urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#` - Champs Factur-X obligatoires : - `fx:ConformanceLevel` : Profil (MINIMUM, BASIC, EN16931, EXTENDED) - `fx:DocumentFileName` : Nom du XML embarqué - `fx:DocumentType` : \"INVOICE\" - `fx:Version` : Version Factur-X (1.0.07) **Ce qui est vérifié :** - ✅ Métadonnées conformes ISO 16684-1 - ✅ Profil Factur-X déclaré correct - ✅ Version Factur-X supportée ### 4. Signatures électroniques **Détection et analyse :** - Présence de dictionnaires `/Sig` dans le PDF - Type de signature : PAdES (PDF Advanced Electronic Signature) - Extraction des informations : - Nom du signataire (`/Name`) - Date de signature (`/M`) - Raison de la signature (`/Reason`) - Lieu de signature (`/Location`) - Type de signature (approval, certification) **Ce qui est vérifié :** - ✅ Présence de signatures ou cachets - ✅ Nombre de signatures (mono ou multi-signature) - ℹ️ Pas de vérification cryptographique (nécessite certificats) ## Paramètres - **fichier_pdf** (requis) : Le fichier PDF Factur-X à valider - **profil** (optionnel) : Profil attendu. Si absent, détection automatique depuis le XML - **use_verapdf** (optionnel, défaut=false) : Active la validation stricte PDF/A avec VeraPDF - `false` : Validation rapide par métadonnées (2-3 secondes) - `true` : Validation complète ISO 19005-3 (15-30 secondes, **recommandé en production**) ## Réponse détaillée ```json { \"est_conforme\": true, \"xml\": { \"present\": true, \"conforme\": true, \"profil\": \"EN16931\", \"erreurs\": [] }, \"pdfa\": { \"conforme\": true, \"version\": \"PDF/A-3B\", \"methode\": \"verapdf\", \"erreurs\": [] }, \"xmp\": { \"present\": true, \"conforme\": true, \"metadonnees\": {...} }, \"signatures\": { \"present\": true, \"nombre\": 1, \"details\": [...] } } ``` ## Cas d'usage - **Avant envoi** : Valider la facture générée avant transmission à un client - **À réception** : Vérifier la conformité d'une facture reçue d'un fournisseur - **Audit** : Contrôler la qualité de lots de factures - **Conformité légale** : S'assurer du respect des obligations B2B/B2G en France - **Debugging** : Identifier les problèmes dans le processus de génération - **Archivage** : Garantir la validité à long terme (PDF/A-3) ## Temps de traitement - Validation basique : 2-3 secondes - Validation VeraPDF : 15-30 secondes (dépend de la taille du PDF)
2267
-
2268
- :param fichier_pdf: Fichier PDF Factur-X à valider (format .pdf). (required)
2269
- :type fichier_pdf: bytearray
2270
- :param profil:
2271
- :type profil: ProfilAPI
2272
- :param use_verapdf: Active la validation stricte PDF/A avec VeraPDF (recommandé pour la production). Si False, utilise une validation basique par métadonnées.
2273
- :type use_verapdf: bool
2274
- :param _request_timeout: timeout setting for this request. If one
2275
- number provided, it will be total request
2276
- timeout. It can also be a pair (tuple) of
2277
- (connection, read) timeouts.
2278
- :type _request_timeout: int, tuple(int, int), optional
2279
- :param _request_auth: set to override the auth_settings for an a single
2280
- request; this effectively ignores the
2281
- authentication in the spec for a single request.
2282
- :type _request_auth: dict, optional
2283
- :param _content_type: force content-type for the request.
2284
- :type _content_type: str, Optional
2285
- :param _headers: set to override the headers for a single
2286
- request; this effectively ignores the headers
2287
- in the spec for a single request.
2288
- :type _headers: dict, optional
2289
- :param _host_index: set to override the host_index for a single
2290
- request; this effectively ignores the host_index
2291
- in the spec for a single request.
2292
- :type _host_index: int, optional
2293
- :return: Returns the result object.
2294
- """ # noqa: E501
2295
-
2296
- _param = self._valider_pdf_facturx_api_v1_traitement_valider_pdf_facturx_post_serialize(
2297
- fichier_pdf=fichier_pdf,
2298
- profil=profil,
2299
- use_verapdf=use_verapdf,
2300
- _request_auth=_request_auth,
2301
- _content_type=_content_type,
2302
- _headers=_headers,
2303
- _host_index=_host_index
2304
- )
2305
-
2306
- _response_types_map: Dict[str, Optional[str]] = {
2307
- '200': "ResultatValidationPDFAPI",
2308
- '400': None,
2309
- '422': "HTTPValidationError",
2310
- }
2311
- response_data = self.api_client.call_api(
2312
- *_param,
2313
- _request_timeout=_request_timeout
2314
- )
2315
- response_data.read()
2316
- return self.api_client.response_deserialize(
2317
- response_data=response_data,
2318
- response_types_map=_response_types_map,
2319
- ).data
2320
-
2321
-
2322
- @validate_call
2323
- def valider_pdf_facturx_api_v1_traitement_valider_pdf_facturx_post_with_http_info(
2324
- self,
2325
- fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF Factur-X à valider (format .pdf).")],
2326
- profil: Optional[Any] = None,
2327
- use_verapdf: Annotated[Optional[StrictBool], Field(description="Active la validation stricte PDF/A avec VeraPDF (recommandé pour la production). Si False, utilise une validation basique par métadonnées.")] = None,
2328
- _request_timeout: Union[
2329
- None,
2330
- Annotated[StrictFloat, Field(gt=0)],
2331
- Tuple[
2332
- Annotated[StrictFloat, Field(gt=0)],
2333
- Annotated[StrictFloat, Field(gt=0)]
2334
- ]
2335
- ] = None,
2336
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2337
- _content_type: Optional[StrictStr] = None,
2338
- _headers: Optional[Dict[StrictStr, Any]] = None,
2339
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2340
- ) -> ApiResponse[ResultatValidationPDFAPI]:
2341
- """Valider un PDF Factur-X complet
2342
-
2343
- Valide un PDF Factur-X complet selon les normes européennes et françaises. ## Normes de validation appliquées - **EN 16931** : Norme sémantique européenne (directive 2014/55/UE) - **ISO 19005-3** (PDF/A-3) : Archivage électronique à long terme - **Factur-X / ZUGFeRD** : Spécification franco-allemande - **Schematron** : Validation des règles métier XML - **eIDAS** : Règlement européen sur l'identification électronique (signatures) ## Contrôles effectués ### 1. Extraction et validation du XML Factur-X **Contrôles réalisés :** - Présence d'un fichier XML embarqué (`factur-x.xml` ou `zugferd-invoice.xml`) - Détection automatique du profil (MINIMUM, BASIC, EN16931, EXTENDED) - Parsing XML avec validation UTF-8 - Extraction du GuidelineSpecifiedDocumentContextParameter/ID **Validation Schematron :** - Règles métier du profil détecté (MINIMUM : 45 règles, EN16931 : 178 règles) - Cardinalité des éléments obligatoires - Cohérence des calculs (montants HT, TVA, TTC, remises) - Formats des identifiants (SIRET, TVA intracommunautaire, IBAN) - Codes normalisés (codes pays ISO, unités UN/ECE, codes TVA) **Ce qui est vérifié :** - ✅ Structure XML conforme XSD Cross Industry Invoice - ✅ Namespace UN/CEFACT correct - ✅ Règles de gestion européennes (BR-xx) - ✅ Règles françaises spécifiques (FR-xx) ### 2. Conformité PDF/A-3 **Validation de base (métadonnées) :** - Présence du champ `/Type` à `Catalog` - Métadonnée `pdfaid:part` = 3 (PDF/A-3) - Métadonnée `pdfaid:conformance` = B ou U - Version PDF >= 1.4 **Validation stricte VeraPDF (si use_verapdf=True) :** - 146+ règles ISO 19005-3 (PDF/A-3B) - Absence de contenu interdit (JavaScript, multimedia, formulaires dynamiques) - Polices embarquées et sous-ensembles corrects - Espaces colorimétriques conformes (sRGB, DeviceGray) - Structure de fichier valide (cross-reference table) - Métadonnées XMP conformes ISO 16684-1 **Ce qui est vérifié :** - ✅ Fichier archivable à long terme (20+ ans) - ✅ Lisibilité garantie (polices embarquées) - ✅ Conformité légale (France, Allemagne, UE) ### 3. Métadonnées XMP (eXtensible Metadata Platform) **Contrôles réalisés :** - Présence du bloc `<?xpacket>` avec métadonnées XMP - Namespace `fx:` pour Factur-X : `urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#` - Champs Factur-X obligatoires : - `fx:ConformanceLevel` : Profil (MINIMUM, BASIC, EN16931, EXTENDED) - `fx:DocumentFileName` : Nom du XML embarqué - `fx:DocumentType` : \"INVOICE\" - `fx:Version` : Version Factur-X (1.0.07) **Ce qui est vérifié :** - ✅ Métadonnées conformes ISO 16684-1 - ✅ Profil Factur-X déclaré correct - ✅ Version Factur-X supportée ### 4. Signatures électroniques **Détection et analyse :** - Présence de dictionnaires `/Sig` dans le PDF - Type de signature : PAdES (PDF Advanced Electronic Signature) - Extraction des informations : - Nom du signataire (`/Name`) - Date de signature (`/M`) - Raison de la signature (`/Reason`) - Lieu de signature (`/Location`) - Type de signature (approval, certification) **Ce qui est vérifié :** - ✅ Présence de signatures ou cachets - ✅ Nombre de signatures (mono ou multi-signature) - ℹ️ Pas de vérification cryptographique (nécessite certificats) ## Paramètres - **fichier_pdf** (requis) : Le fichier PDF Factur-X à valider - **profil** (optionnel) : Profil attendu. Si absent, détection automatique depuis le XML - **use_verapdf** (optionnel, défaut=false) : Active la validation stricte PDF/A avec VeraPDF - `false` : Validation rapide par métadonnées (2-3 secondes) - `true` : Validation complète ISO 19005-3 (15-30 secondes, **recommandé en production**) ## Réponse détaillée ```json { \"est_conforme\": true, \"xml\": { \"present\": true, \"conforme\": true, \"profil\": \"EN16931\", \"erreurs\": [] }, \"pdfa\": { \"conforme\": true, \"version\": \"PDF/A-3B\", \"methode\": \"verapdf\", \"erreurs\": [] }, \"xmp\": { \"present\": true, \"conforme\": true, \"metadonnees\": {...} }, \"signatures\": { \"present\": true, \"nombre\": 1, \"details\": [...] } } ``` ## Cas d'usage - **Avant envoi** : Valider la facture générée avant transmission à un client - **À réception** : Vérifier la conformité d'une facture reçue d'un fournisseur - **Audit** : Contrôler la qualité de lots de factures - **Conformité légale** : S'assurer du respect des obligations B2B/B2G en France - **Debugging** : Identifier les problèmes dans le processus de génération - **Archivage** : Garantir la validité à long terme (PDF/A-3) ## Temps de traitement - Validation basique : 2-3 secondes - Validation VeraPDF : 15-30 secondes (dépend de la taille du PDF)
2344
-
2345
- :param fichier_pdf: Fichier PDF Factur-X à valider (format .pdf). (required)
2346
- :type fichier_pdf: bytearray
2347
- :param profil:
2348
- :type profil: ProfilAPI
2349
- :param use_verapdf: Active la validation stricte PDF/A avec VeraPDF (recommandé pour la production). Si False, utilise une validation basique par métadonnées.
2350
- :type use_verapdf: bool
2351
- :param _request_timeout: timeout setting for this request. If one
2352
- number provided, it will be total request
2353
- timeout. It can also be a pair (tuple) of
2354
- (connection, read) timeouts.
2355
- :type _request_timeout: int, tuple(int, int), optional
2356
- :param _request_auth: set to override the auth_settings for an a single
2357
- request; this effectively ignores the
2358
- authentication in the spec for a single request.
2359
- :type _request_auth: dict, optional
2360
- :param _content_type: force content-type for the request.
2361
- :type _content_type: str, Optional
2362
- :param _headers: set to override the headers for a single
2363
- request; this effectively ignores the headers
2364
- in the spec for a single request.
2365
- :type _headers: dict, optional
2366
- :param _host_index: set to override the host_index for a single
2367
- request; this effectively ignores the host_index
2368
- in the spec for a single request.
2369
- :type _host_index: int, optional
2370
- :return: Returns the result object.
2371
- """ # noqa: E501
2372
-
2373
- _param = self._valider_pdf_facturx_api_v1_traitement_valider_pdf_facturx_post_serialize(
2374
- fichier_pdf=fichier_pdf,
2375
- profil=profil,
2376
- use_verapdf=use_verapdf,
2377
- _request_auth=_request_auth,
2378
- _content_type=_content_type,
2379
- _headers=_headers,
2380
- _host_index=_host_index
2381
- )
2382
-
2383
- _response_types_map: Dict[str, Optional[str]] = {
2384
- '200': "ResultatValidationPDFAPI",
2385
- '400': None,
2386
- '422': "HTTPValidationError",
2387
- }
2388
- response_data = self.api_client.call_api(
2389
- *_param,
2390
- _request_timeout=_request_timeout
2391
- )
2392
- response_data.read()
2393
- return self.api_client.response_deserialize(
2394
- response_data=response_data,
2395
- response_types_map=_response_types_map,
2396
- )
2397
-
2398
-
2399
- @validate_call
2400
- def valider_pdf_facturx_api_v1_traitement_valider_pdf_facturx_post_without_preload_content(
2401
- self,
2402
- fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF Factur-X à valider (format .pdf).")],
2403
- profil: Optional[Any] = None,
2404
- use_verapdf: Annotated[Optional[StrictBool], Field(description="Active la validation stricte PDF/A avec VeraPDF (recommandé pour la production). Si False, utilise une validation basique par métadonnées.")] = None,
2405
- _request_timeout: Union[
2406
- None,
2407
- Annotated[StrictFloat, Field(gt=0)],
2408
- Tuple[
2409
- Annotated[StrictFloat, Field(gt=0)],
2410
- Annotated[StrictFloat, Field(gt=0)]
2411
- ]
2412
- ] = None,
2413
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2414
- _content_type: Optional[StrictStr] = None,
2415
- _headers: Optional[Dict[StrictStr, Any]] = None,
2416
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2417
- ) -> RESTResponseType:
2418
- """Valider un PDF Factur-X complet
2419
-
2420
- Valide un PDF Factur-X complet selon les normes européennes et françaises. ## Normes de validation appliquées - **EN 16931** : Norme sémantique européenne (directive 2014/55/UE) - **ISO 19005-3** (PDF/A-3) : Archivage électronique à long terme - **Factur-X / ZUGFeRD** : Spécification franco-allemande - **Schematron** : Validation des règles métier XML - **eIDAS** : Règlement européen sur l'identification électronique (signatures) ## Contrôles effectués ### 1. Extraction et validation du XML Factur-X **Contrôles réalisés :** - Présence d'un fichier XML embarqué (`factur-x.xml` ou `zugferd-invoice.xml`) - Détection automatique du profil (MINIMUM, BASIC, EN16931, EXTENDED) - Parsing XML avec validation UTF-8 - Extraction du GuidelineSpecifiedDocumentContextParameter/ID **Validation Schematron :** - Règles métier du profil détecté (MINIMUM : 45 règles, EN16931 : 178 règles) - Cardinalité des éléments obligatoires - Cohérence des calculs (montants HT, TVA, TTC, remises) - Formats des identifiants (SIRET, TVA intracommunautaire, IBAN) - Codes normalisés (codes pays ISO, unités UN/ECE, codes TVA) **Ce qui est vérifié :** - ✅ Structure XML conforme XSD Cross Industry Invoice - ✅ Namespace UN/CEFACT correct - ✅ Règles de gestion européennes (BR-xx) - ✅ Règles françaises spécifiques (FR-xx) ### 2. Conformité PDF/A-3 **Validation de base (métadonnées) :** - Présence du champ `/Type` à `Catalog` - Métadonnée `pdfaid:part` = 3 (PDF/A-3) - Métadonnée `pdfaid:conformance` = B ou U - Version PDF >= 1.4 **Validation stricte VeraPDF (si use_verapdf=True) :** - 146+ règles ISO 19005-3 (PDF/A-3B) - Absence de contenu interdit (JavaScript, multimedia, formulaires dynamiques) - Polices embarquées et sous-ensembles corrects - Espaces colorimétriques conformes (sRGB, DeviceGray) - Structure de fichier valide (cross-reference table) - Métadonnées XMP conformes ISO 16684-1 **Ce qui est vérifié :** - ✅ Fichier archivable à long terme (20+ ans) - ✅ Lisibilité garantie (polices embarquées) - ✅ Conformité légale (France, Allemagne, UE) ### 3. Métadonnées XMP (eXtensible Metadata Platform) **Contrôles réalisés :** - Présence du bloc `<?xpacket>` avec métadonnées XMP - Namespace `fx:` pour Factur-X : `urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#` - Champs Factur-X obligatoires : - `fx:ConformanceLevel` : Profil (MINIMUM, BASIC, EN16931, EXTENDED) - `fx:DocumentFileName` : Nom du XML embarqué - `fx:DocumentType` : \"INVOICE\" - `fx:Version` : Version Factur-X (1.0.07) **Ce qui est vérifié :** - ✅ Métadonnées conformes ISO 16684-1 - ✅ Profil Factur-X déclaré correct - ✅ Version Factur-X supportée ### 4. Signatures électroniques **Détection et analyse :** - Présence de dictionnaires `/Sig` dans le PDF - Type de signature : PAdES (PDF Advanced Electronic Signature) - Extraction des informations : - Nom du signataire (`/Name`) - Date de signature (`/M`) - Raison de la signature (`/Reason`) - Lieu de signature (`/Location`) - Type de signature (approval, certification) **Ce qui est vérifié :** - ✅ Présence de signatures ou cachets - ✅ Nombre de signatures (mono ou multi-signature) - ℹ️ Pas de vérification cryptographique (nécessite certificats) ## Paramètres - **fichier_pdf** (requis) : Le fichier PDF Factur-X à valider - **profil** (optionnel) : Profil attendu. Si absent, détection automatique depuis le XML - **use_verapdf** (optionnel, défaut=false) : Active la validation stricte PDF/A avec VeraPDF - `false` : Validation rapide par métadonnées (2-3 secondes) - `true` : Validation complète ISO 19005-3 (15-30 secondes, **recommandé en production**) ## Réponse détaillée ```json { \"est_conforme\": true, \"xml\": { \"present\": true, \"conforme\": true, \"profil\": \"EN16931\", \"erreurs\": [] }, \"pdfa\": { \"conforme\": true, \"version\": \"PDF/A-3B\", \"methode\": \"verapdf\", \"erreurs\": [] }, \"xmp\": { \"present\": true, \"conforme\": true, \"metadonnees\": {...} }, \"signatures\": { \"present\": true, \"nombre\": 1, \"details\": [...] } } ``` ## Cas d'usage - **Avant envoi** : Valider la facture générée avant transmission à un client - **À réception** : Vérifier la conformité d'une facture reçue d'un fournisseur - **Audit** : Contrôler la qualité de lots de factures - **Conformité légale** : S'assurer du respect des obligations B2B/B2G en France - **Debugging** : Identifier les problèmes dans le processus de génération - **Archivage** : Garantir la validité à long terme (PDF/A-3) ## Temps de traitement - Validation basique : 2-3 secondes - Validation VeraPDF : 15-30 secondes (dépend de la taille du PDF)
2421
-
2422
- :param fichier_pdf: Fichier PDF Factur-X à valider (format .pdf). (required)
2423
- :type fichier_pdf: bytearray
2424
- :param profil:
2425
- :type profil: ProfilAPI
2426
- :param use_verapdf: Active la validation stricte PDF/A avec VeraPDF (recommandé pour la production). Si False, utilise une validation basique par métadonnées.
2427
- :type use_verapdf: bool
2428
- :param _request_timeout: timeout setting for this request. If one
2429
- number provided, it will be total request
2430
- timeout. It can also be a pair (tuple) of
2431
- (connection, read) timeouts.
2432
- :type _request_timeout: int, tuple(int, int), optional
2433
- :param _request_auth: set to override the auth_settings for an a single
2434
- request; this effectively ignores the
2435
- authentication in the spec for a single request.
2436
- :type _request_auth: dict, optional
2437
- :param _content_type: force content-type for the request.
2438
- :type _content_type: str, Optional
2439
- :param _headers: set to override the headers for a single
2440
- request; this effectively ignores the headers
2441
- in the spec for a single request.
2442
- :type _headers: dict, optional
2443
- :param _host_index: set to override the host_index for a single
2444
- request; this effectively ignores the host_index
2445
- in the spec for a single request.
2446
- :type _host_index: int, optional
2447
- :return: Returns the result object.
2448
- """ # noqa: E501
2449
-
2450
- _param = self._valider_pdf_facturx_api_v1_traitement_valider_pdf_facturx_post_serialize(
2451
- fichier_pdf=fichier_pdf,
2452
- profil=profil,
2453
- use_verapdf=use_verapdf,
2454
- _request_auth=_request_auth,
2455
- _content_type=_content_type,
2456
- _headers=_headers,
2457
- _host_index=_host_index
2458
- )
2459
-
2460
- _response_types_map: Dict[str, Optional[str]] = {
2461
- '200': "ResultatValidationPDFAPI",
2462
- '400': None,
2463
- '422': "HTTPValidationError",
2464
- }
2465
- response_data = self.api_client.call_api(
2466
- *_param,
2467
- _request_timeout=_request_timeout
2468
- )
2469
- return response_data.response
2470
-
2471
-
2472
- def _valider_pdf_facturx_api_v1_traitement_valider_pdf_facturx_post_serialize(
2473
- self,
2474
- fichier_pdf,
2475
- profil,
2476
- use_verapdf,
2477
- _request_auth,
2478
- _content_type,
2479
- _headers,
2480
- _host_index,
2481
- ) -> RequestSerialized:
2482
-
2483
- _host = None
2484
-
2485
- _collection_formats: Dict[str, str] = {
2486
- }
2487
-
2488
- _path_params: Dict[str, str] = {}
2489
- _query_params: List[Tuple[str, str]] = []
2490
- _header_params: Dict[str, Optional[str]] = _headers or {}
2491
- _form_params: List[Tuple[str, str]] = []
2492
- _files: Dict[
2493
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2494
- ] = {}
2495
- _body_params: Optional[bytes] = None
2496
-
2497
- # process the path parameters
2498
- # process the query parameters
2499
- # process the header parameters
2500
- # process the form parameters
2501
- if fichier_pdf is not None:
2502
- _files['fichier_pdf'] = fichier_pdf
2503
- if profil is not None:
2504
- _form_params.append(('profil', profil))
2505
- if use_verapdf is not None:
2506
- _form_params.append(('use_verapdf', use_verapdf))
2507
- # process the body parameter
2508
-
2509
-
2510
- # set the HTTP header `Accept`
2511
- if 'Accept' not in _header_params:
2512
- _header_params['Accept'] = self.api_client.select_header_accept(
2513
- [
2514
- 'application/json'
2515
- ]
2516
- )
2517
-
2518
- # set the HTTP header `Content-Type`
2519
- if _content_type:
2520
- _header_params['Content-Type'] = _content_type
2521
- else:
2522
- _default_content_type = (
2523
- self.api_client.select_header_content_type(
2524
- [
2525
- 'multipart/form-data'
2526
- ]
2527
- )
2528
- )
2529
- if _default_content_type is not None:
2530
- _header_params['Content-Type'] = _default_content_type
2531
-
2532
- # authentication setting
2533
- _auth_settings: List[str] = [
2534
- 'HTTPBearer'
2535
- ]
2536
-
2537
- return self.api_client.param_serialize(
2538
- method='POST',
2539
- resource_path='/api/v1/traitement/valider-pdf-facturx',
2540
- path_params=_path_params,
2541
- query_params=_query_params,
2542
- header_params=_header_params,
2543
- body=_body_params,
2544
- post_params=_form_params,
2545
- files=_files,
2546
- auth_settings=_auth_settings,
2547
- collection_formats=_collection_formats,
2548
- _host=_host,
2549
- _request_auth=_request_auth
2550
- )
2551
-
2552
-
2553
-
2554
-
2555
- @validate_call
2556
- def valider_pdf_facturx_async_api_v1_traitement_valider_facturx_async_post(
2557
- self,
2558
- fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF Factur-X à valider (format .pdf).")],
2559
- profil: Optional[Any] = None,
2560
- use_verapdf: Annotated[Optional[StrictBool], Field(description="Active la validation stricte PDF/A avec VeraPDF (recommandé pour la production). Peut prendre plusieurs secondes.")] = None,
2561
- _request_timeout: Union[
2562
- None,
2563
- Annotated[StrictFloat, Field(gt=0)],
2564
- Tuple[
2565
- Annotated[StrictFloat, Field(gt=0)],
2566
- Annotated[StrictFloat, Field(gt=0)]
2567
- ]
2568
- ] = None,
2569
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2570
- _content_type: Optional[StrictStr] = None,
2571
- _headers: Optional[Dict[StrictStr, Any]] = None,
2572
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2573
- ) -> ReponseTache:
2574
- """Valider un PDF Factur-X (asynchrone avec polling)
2575
-
2576
- Valide un PDF Factur-X de manière asynchrone avec système de polling. ## Fonctionnement 1. **Soumission** : Le PDF est mis en file d'attente pour validation asynchrone 2. **Retour immédiat** : Vous recevez un `id_tache` (HTTP 202) 3. **Suivi** : Utilisez l'endpoint `/taches/{id_tache}/statut` pour suivre l'avancement ## Avantages du mode asynchrone - **Pas de timeout** : Idéal pour les gros PDFs ou la validation VeraPDF (qui peut prendre plusieurs secondes) - **Scalabilité** : Les validations sont traitées par des workers Celery dédiés - **Suivi d'état** : Permet de suivre la progression de la validation - **Non-bloquant** : Votre client ne reste pas en attente pendant la validation ## Quand utiliser ce mode ? - **Validation VeraPDF activée** (`use_verapdf=True`) : La validation stricte peut prendre 2-10 secondes - **Gros fichiers PDF** : PDFs > 1 MB - **Traitement par lots** : Validation de multiples factures en parallèle - **Intégration asynchrone** : Votre système supporte le polling ## Contrôles effectués ### 1. Extraction et validation du XML Factur-X - Vérifie la présence d'un fichier XML embarqué conforme Factur-X - Détecte automatiquement le profil utilisé (MINIMUM, BASIC, EN16931, EXTENDED) - Valide le XML contre les règles Schematron du profil détecté ### 2. Conformité PDF/A - **Sans VeraPDF** : Validation basique par métadonnées (rapide, ~100ms) - **Avec VeraPDF** : Validation stricte selon ISO 19005 (146+ règles, 2-10s) - Détecte la version PDF/A (PDF/A-1, PDF/A-3, etc.) - Rapports détaillés des non-conformités ### 3. Métadonnées XMP - Vérifie la présence de métadonnées XMP dans le PDF - Valide la conformité des métadonnées Factur-X (profil, version) - Extrait toutes les métadonnées XMP disponibles ### 4. Signatures électroniques - Détecte la présence de signatures ou cachets électroniques - Extrait les informations sur chaque signature (signataire, date, raison) - Compte le nombre de signatures présentes ## Paramètres - **fichier_pdf** : Le fichier PDF Factur-X à valider - **profil** : Le profil Factur-X attendu (optionnel). Si non spécifié, le profil sera automatiquement détecté depuis le fichier XML embarqué. - **use_verapdf** : Active la validation stricte PDF/A avec VeraPDF. ⚠️ **Attention** : VeraPDF peut prendre 2-10 secondes selon la taille du PDF. Recommandé uniquement en mode asynchrone pour éviter les timeouts. ## Récupération du résultat Après soumission, utilisez l'endpoint `GET /taches/{id_tache}/statut` pour récupérer le résultat. **Exemple de polling** : ```python import requests import time # 1. Soumettre la tâche response = requests.post(\"/valider-facturx-async\", files={\"fichier_pdf\": pdf_file}) task_id = response.json()[\"id_tache\"] # 2. Polling toutes les 2 secondes while True: status_response = requests.get(f\"/taches/{task_id}/statut\") status = status_response.json() if status[\"statut\"] == \"SUCCESS\": resultat = status[\"resultat\"][\"resultat_validation\"] print(f\"Conforme: {resultat['est_conforme']}\") break elif status[\"statut\"] == \"FAILURE\": print(f\"Erreur: {status['resultat']['errorMessage']}\") break time.sleep(2) # Attendre 2 secondes avant le prochain check ``` ## Cas d'usage - Valider des factures avant envoi avec VeraPDF (validation stricte) - Traiter des lots de factures en parallèle - Intégrer la validation dans un pipeline asynchrone - Valider des PDFs volumineux sans risque de timeout
2577
-
2578
- :param fichier_pdf: Fichier PDF Factur-X à valider (format .pdf). (required)
2579
- :type fichier_pdf: bytearray
2580
- :param profil:
2581
- :type profil: ProfilAPI
2582
- :param use_verapdf: Active la validation stricte PDF/A avec VeraPDF (recommandé pour la production). Peut prendre plusieurs secondes.
2583
- :type use_verapdf: bool
2584
- :param _request_timeout: timeout setting for this request. If one
2585
- number provided, it will be total request
2586
- timeout. It can also be a pair (tuple) of
2587
- (connection, read) timeouts.
2588
- :type _request_timeout: int, tuple(int, int), optional
2589
- :param _request_auth: set to override the auth_settings for an a single
2590
- request; this effectively ignores the
2591
- authentication in the spec for a single request.
2592
- :type _request_auth: dict, optional
2593
- :param _content_type: force content-type for the request.
2594
- :type _content_type: str, Optional
2595
- :param _headers: set to override the headers for a single
2596
- request; this effectively ignores the headers
2597
- in the spec for a single request.
2598
- :type _headers: dict, optional
2599
- :param _host_index: set to override the host_index for a single
2600
- request; this effectively ignores the host_index
2601
- in the spec for a single request.
2602
- :type _host_index: int, optional
2603
- :return: Returns the result object.
2604
- """ # noqa: E501
2605
-
2606
- _param = self._valider_pdf_facturx_async_api_v1_traitement_valider_facturx_async_post_serialize(
2607
- fichier_pdf=fichier_pdf,
2608
- profil=profil,
2609
- use_verapdf=use_verapdf,
2610
- _request_auth=_request_auth,
2611
- _content_type=_content_type,
2612
- _headers=_headers,
2613
- _host_index=_host_index
2614
- )
2615
-
2616
- _response_types_map: Dict[str, Optional[str]] = {
2617
- '202': "ReponseTache",
2618
- '400': None,
2619
- '422': "HTTPValidationError",
2620
- }
2621
- response_data = self.api_client.call_api(
2622
- *_param,
2623
- _request_timeout=_request_timeout
2624
- )
2625
- response_data.read()
2626
- return self.api_client.response_deserialize(
2627
- response_data=response_data,
2628
- response_types_map=_response_types_map,
2629
- ).data
2630
-
2631
-
2632
- @validate_call
2633
- def valider_pdf_facturx_async_api_v1_traitement_valider_facturx_async_post_with_http_info(
2634
- self,
2635
- fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF Factur-X à valider (format .pdf).")],
2636
- profil: Optional[Any] = None,
2637
- use_verapdf: Annotated[Optional[StrictBool], Field(description="Active la validation stricte PDF/A avec VeraPDF (recommandé pour la production). Peut prendre plusieurs secondes.")] = None,
2638
- _request_timeout: Union[
2639
- None,
2640
- Annotated[StrictFloat, Field(gt=0)],
2641
- Tuple[
2642
- Annotated[StrictFloat, Field(gt=0)],
2643
- Annotated[StrictFloat, Field(gt=0)]
2644
- ]
2645
- ] = None,
2646
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2647
- _content_type: Optional[StrictStr] = None,
2648
- _headers: Optional[Dict[StrictStr, Any]] = None,
2649
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2650
- ) -> ApiResponse[ReponseTache]:
2651
- """Valider un PDF Factur-X (asynchrone avec polling)
2652
-
2653
- Valide un PDF Factur-X de manière asynchrone avec système de polling. ## Fonctionnement 1. **Soumission** : Le PDF est mis en file d'attente pour validation asynchrone 2. **Retour immédiat** : Vous recevez un `id_tache` (HTTP 202) 3. **Suivi** : Utilisez l'endpoint `/taches/{id_tache}/statut` pour suivre l'avancement ## Avantages du mode asynchrone - **Pas de timeout** : Idéal pour les gros PDFs ou la validation VeraPDF (qui peut prendre plusieurs secondes) - **Scalabilité** : Les validations sont traitées par des workers Celery dédiés - **Suivi d'état** : Permet de suivre la progression de la validation - **Non-bloquant** : Votre client ne reste pas en attente pendant la validation ## Quand utiliser ce mode ? - **Validation VeraPDF activée** (`use_verapdf=True`) : La validation stricte peut prendre 2-10 secondes - **Gros fichiers PDF** : PDFs > 1 MB - **Traitement par lots** : Validation de multiples factures en parallèle - **Intégration asynchrone** : Votre système supporte le polling ## Contrôles effectués ### 1. Extraction et validation du XML Factur-X - Vérifie la présence d'un fichier XML embarqué conforme Factur-X - Détecte automatiquement le profil utilisé (MINIMUM, BASIC, EN16931, EXTENDED) - Valide le XML contre les règles Schematron du profil détecté ### 2. Conformité PDF/A - **Sans VeraPDF** : Validation basique par métadonnées (rapide, ~100ms) - **Avec VeraPDF** : Validation stricte selon ISO 19005 (146+ règles, 2-10s) - Détecte la version PDF/A (PDF/A-1, PDF/A-3, etc.) - Rapports détaillés des non-conformités ### 3. Métadonnées XMP - Vérifie la présence de métadonnées XMP dans le PDF - Valide la conformité des métadonnées Factur-X (profil, version) - Extrait toutes les métadonnées XMP disponibles ### 4. Signatures électroniques - Détecte la présence de signatures ou cachets électroniques - Extrait les informations sur chaque signature (signataire, date, raison) - Compte le nombre de signatures présentes ## Paramètres - **fichier_pdf** : Le fichier PDF Factur-X à valider - **profil** : Le profil Factur-X attendu (optionnel). Si non spécifié, le profil sera automatiquement détecté depuis le fichier XML embarqué. - **use_verapdf** : Active la validation stricte PDF/A avec VeraPDF. ⚠️ **Attention** : VeraPDF peut prendre 2-10 secondes selon la taille du PDF. Recommandé uniquement en mode asynchrone pour éviter les timeouts. ## Récupération du résultat Après soumission, utilisez l'endpoint `GET /taches/{id_tache}/statut` pour récupérer le résultat. **Exemple de polling** : ```python import requests import time # 1. Soumettre la tâche response = requests.post(\"/valider-facturx-async\", files={\"fichier_pdf\": pdf_file}) task_id = response.json()[\"id_tache\"] # 2. Polling toutes les 2 secondes while True: status_response = requests.get(f\"/taches/{task_id}/statut\") status = status_response.json() if status[\"statut\"] == \"SUCCESS\": resultat = status[\"resultat\"][\"resultat_validation\"] print(f\"Conforme: {resultat['est_conforme']}\") break elif status[\"statut\"] == \"FAILURE\": print(f\"Erreur: {status['resultat']['errorMessage']}\") break time.sleep(2) # Attendre 2 secondes avant le prochain check ``` ## Cas d'usage - Valider des factures avant envoi avec VeraPDF (validation stricte) - Traiter des lots de factures en parallèle - Intégrer la validation dans un pipeline asynchrone - Valider des PDFs volumineux sans risque de timeout
2654
-
2655
- :param fichier_pdf: Fichier PDF Factur-X à valider (format .pdf). (required)
2656
- :type fichier_pdf: bytearray
2657
- :param profil:
2658
- :type profil: ProfilAPI
2659
- :param use_verapdf: Active la validation stricte PDF/A avec VeraPDF (recommandé pour la production). Peut prendre plusieurs secondes.
2660
- :type use_verapdf: bool
2661
- :param _request_timeout: timeout setting for this request. If one
2662
- number provided, it will be total request
2663
- timeout. It can also be a pair (tuple) of
2664
- (connection, read) timeouts.
2665
- :type _request_timeout: int, tuple(int, int), optional
2666
- :param _request_auth: set to override the auth_settings for an a single
2667
- request; this effectively ignores the
2668
- authentication in the spec for a single request.
2669
- :type _request_auth: dict, optional
2670
- :param _content_type: force content-type for the request.
2671
- :type _content_type: str, Optional
2672
- :param _headers: set to override the headers for a single
2673
- request; this effectively ignores the headers
2674
- in the spec for a single request.
2675
- :type _headers: dict, optional
2676
- :param _host_index: set to override the host_index for a single
2677
- request; this effectively ignores the host_index
2678
- in the spec for a single request.
2679
- :type _host_index: int, optional
2680
- :return: Returns the result object.
2681
- """ # noqa: E501
2682
-
2683
- _param = self._valider_pdf_facturx_async_api_v1_traitement_valider_facturx_async_post_serialize(
2684
- fichier_pdf=fichier_pdf,
2685
- profil=profil,
2686
- use_verapdf=use_verapdf,
2687
- _request_auth=_request_auth,
2688
- _content_type=_content_type,
2689
- _headers=_headers,
2690
- _host_index=_host_index
2691
- )
2692
-
2693
- _response_types_map: Dict[str, Optional[str]] = {
2694
- '202': "ReponseTache",
2695
- '400': None,
2696
- '422': "HTTPValidationError",
2697
- }
2698
- response_data = self.api_client.call_api(
2699
- *_param,
2700
- _request_timeout=_request_timeout
2701
- )
2702
- response_data.read()
2703
- return self.api_client.response_deserialize(
2704
- response_data=response_data,
2705
- response_types_map=_response_types_map,
2706
- )
2707
-
2708
-
2709
- @validate_call
2710
- def valider_pdf_facturx_async_api_v1_traitement_valider_facturx_async_post_without_preload_content(
2711
- self,
2712
- fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF Factur-X à valider (format .pdf).")],
2713
- profil: Optional[Any] = None,
2714
- use_verapdf: Annotated[Optional[StrictBool], Field(description="Active la validation stricte PDF/A avec VeraPDF (recommandé pour la production). Peut prendre plusieurs secondes.")] = None,
2715
- _request_timeout: Union[
2716
- None,
2717
- Annotated[StrictFloat, Field(gt=0)],
2718
- Tuple[
2719
- Annotated[StrictFloat, Field(gt=0)],
2720
- Annotated[StrictFloat, Field(gt=0)]
2721
- ]
2722
- ] = None,
2723
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2724
- _content_type: Optional[StrictStr] = None,
2725
- _headers: Optional[Dict[StrictStr, Any]] = None,
2726
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2727
- ) -> RESTResponseType:
2728
- """Valider un PDF Factur-X (asynchrone avec polling)
2729
-
2730
- Valide un PDF Factur-X de manière asynchrone avec système de polling. ## Fonctionnement 1. **Soumission** : Le PDF est mis en file d'attente pour validation asynchrone 2. **Retour immédiat** : Vous recevez un `id_tache` (HTTP 202) 3. **Suivi** : Utilisez l'endpoint `/taches/{id_tache}/statut` pour suivre l'avancement ## Avantages du mode asynchrone - **Pas de timeout** : Idéal pour les gros PDFs ou la validation VeraPDF (qui peut prendre plusieurs secondes) - **Scalabilité** : Les validations sont traitées par des workers Celery dédiés - **Suivi d'état** : Permet de suivre la progression de la validation - **Non-bloquant** : Votre client ne reste pas en attente pendant la validation ## Quand utiliser ce mode ? - **Validation VeraPDF activée** (`use_verapdf=True`) : La validation stricte peut prendre 2-10 secondes - **Gros fichiers PDF** : PDFs > 1 MB - **Traitement par lots** : Validation de multiples factures en parallèle - **Intégration asynchrone** : Votre système supporte le polling ## Contrôles effectués ### 1. Extraction et validation du XML Factur-X - Vérifie la présence d'un fichier XML embarqué conforme Factur-X - Détecte automatiquement le profil utilisé (MINIMUM, BASIC, EN16931, EXTENDED) - Valide le XML contre les règles Schematron du profil détecté ### 2. Conformité PDF/A - **Sans VeraPDF** : Validation basique par métadonnées (rapide, ~100ms) - **Avec VeraPDF** : Validation stricte selon ISO 19005 (146+ règles, 2-10s) - Détecte la version PDF/A (PDF/A-1, PDF/A-3, etc.) - Rapports détaillés des non-conformités ### 3. Métadonnées XMP - Vérifie la présence de métadonnées XMP dans le PDF - Valide la conformité des métadonnées Factur-X (profil, version) - Extrait toutes les métadonnées XMP disponibles ### 4. Signatures électroniques - Détecte la présence de signatures ou cachets électroniques - Extrait les informations sur chaque signature (signataire, date, raison) - Compte le nombre de signatures présentes ## Paramètres - **fichier_pdf** : Le fichier PDF Factur-X à valider - **profil** : Le profil Factur-X attendu (optionnel). Si non spécifié, le profil sera automatiquement détecté depuis le fichier XML embarqué. - **use_verapdf** : Active la validation stricte PDF/A avec VeraPDF. ⚠️ **Attention** : VeraPDF peut prendre 2-10 secondes selon la taille du PDF. Recommandé uniquement en mode asynchrone pour éviter les timeouts. ## Récupération du résultat Après soumission, utilisez l'endpoint `GET /taches/{id_tache}/statut` pour récupérer le résultat. **Exemple de polling** : ```python import requests import time # 1. Soumettre la tâche response = requests.post(\"/valider-facturx-async\", files={\"fichier_pdf\": pdf_file}) task_id = response.json()[\"id_tache\"] # 2. Polling toutes les 2 secondes while True: status_response = requests.get(f\"/taches/{task_id}/statut\") status = status_response.json() if status[\"statut\"] == \"SUCCESS\": resultat = status[\"resultat\"][\"resultat_validation\"] print(f\"Conforme: {resultat['est_conforme']}\") break elif status[\"statut\"] == \"FAILURE\": print(f\"Erreur: {status['resultat']['errorMessage']}\") break time.sleep(2) # Attendre 2 secondes avant le prochain check ``` ## Cas d'usage - Valider des factures avant envoi avec VeraPDF (validation stricte) - Traiter des lots de factures en parallèle - Intégrer la validation dans un pipeline asynchrone - Valider des PDFs volumineux sans risque de timeout
2731
-
2732
- :param fichier_pdf: Fichier PDF Factur-X à valider (format .pdf). (required)
2733
- :type fichier_pdf: bytearray
2734
- :param profil:
2735
- :type profil: ProfilAPI
2736
- :param use_verapdf: Active la validation stricte PDF/A avec VeraPDF (recommandé pour la production). Peut prendre plusieurs secondes.
2737
- :type use_verapdf: bool
2738
- :param _request_timeout: timeout setting for this request. If one
2739
- number provided, it will be total request
2740
- timeout. It can also be a pair (tuple) of
2741
- (connection, read) timeouts.
2742
- :type _request_timeout: int, tuple(int, int), optional
2743
- :param _request_auth: set to override the auth_settings for an a single
2744
- request; this effectively ignores the
2745
- authentication in the spec for a single request.
2746
- :type _request_auth: dict, optional
2747
- :param _content_type: force content-type for the request.
2748
- :type _content_type: str, Optional
2749
- :param _headers: set to override the headers for a single
2750
- request; this effectively ignores the headers
2751
- in the spec for a single request.
2752
- :type _headers: dict, optional
2753
- :param _host_index: set to override the host_index for a single
2754
- request; this effectively ignores the host_index
2755
- in the spec for a single request.
2756
- :type _host_index: int, optional
2757
- :return: Returns the result object.
2758
- """ # noqa: E501
2759
-
2760
- _param = self._valider_pdf_facturx_async_api_v1_traitement_valider_facturx_async_post_serialize(
2761
- fichier_pdf=fichier_pdf,
2762
- profil=profil,
2763
- use_verapdf=use_verapdf,
2764
- _request_auth=_request_auth,
2765
- _content_type=_content_type,
2766
- _headers=_headers,
2767
- _host_index=_host_index
2768
- )
2769
-
2770
- _response_types_map: Dict[str, Optional[str]] = {
2771
- '202': "ReponseTache",
2772
- '400': None,
2773
- '422': "HTTPValidationError",
2774
- }
2775
- response_data = self.api_client.call_api(
2776
- *_param,
2777
- _request_timeout=_request_timeout
2778
- )
2779
- return response_data.response
2780
-
2781
-
2782
- def _valider_pdf_facturx_async_api_v1_traitement_valider_facturx_async_post_serialize(
2783
- self,
2784
- fichier_pdf,
2785
- profil,
2786
- use_verapdf,
2787
- _request_auth,
2788
- _content_type,
2789
- _headers,
2790
- _host_index,
2791
- ) -> RequestSerialized:
2792
-
2793
- _host = None
2794
-
2795
- _collection_formats: Dict[str, str] = {
2796
- }
2797
-
2798
- _path_params: Dict[str, str] = {}
2799
- _query_params: List[Tuple[str, str]] = []
2800
- _header_params: Dict[str, Optional[str]] = _headers or {}
2801
- _form_params: List[Tuple[str, str]] = []
2802
- _files: Dict[
2803
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2804
- ] = {}
2805
- _body_params: Optional[bytes] = None
2806
-
2807
- # process the path parameters
2808
- # process the query parameters
2809
- # process the header parameters
2810
- # process the form parameters
2811
- if fichier_pdf is not None:
2812
- _files['fichier_pdf'] = fichier_pdf
2813
- if profil is not None:
2814
- _form_params.append(('profil', profil))
2815
- if use_verapdf is not None:
2816
- _form_params.append(('use_verapdf', use_verapdf))
2817
- # process the body parameter
2818
-
2819
-
2820
- # set the HTTP header `Accept`
2821
- if 'Accept' not in _header_params:
2822
- _header_params['Accept'] = self.api_client.select_header_accept(
2823
- [
2824
- 'application/json'
2825
- ]
2826
- )
2827
-
2828
- # set the HTTP header `Content-Type`
2829
- if _content_type:
2830
- _header_params['Content-Type'] = _content_type
2831
- else:
2832
- _default_content_type = (
2833
- self.api_client.select_header_content_type(
2834
- [
2835
- 'multipart/form-data'
2836
- ]
2837
- )
2838
- )
2839
- if _default_content_type is not None:
2840
- _header_params['Content-Type'] = _default_content_type
2841
-
2842
- # authentication setting
2843
- _auth_settings: List[str] = [
2844
- 'HTTPBearer'
2845
- ]
2846
-
2847
- return self.api_client.param_serialize(
2848
- method='POST',
2849
- resource_path='/api/v1/traitement/valider-facturx-async',
2850
- path_params=_path_params,
2851
- query_params=_query_params,
2852
- header_params=_header_params,
2853
- body=_body_params,
2854
- post_params=_form_params,
2855
- files=_files,
2856
- auth_settings=_auth_settings,
2857
- collection_formats=_collection_formats,
2858
- _host=_host,
2859
- _request_auth=_request_auth
2860
- )
2861
-
2862
-
2863
-
2864
-
2865
- @validate_call
2866
- def valider_signature_pdf_endpoint_api_v1_traitement_valider_signature_pdf_post(
2867
- self,
2868
- fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF à valider (sera analysé pour détecter et valider les signatures)")],
2869
- _request_timeout: Union[
2870
- None,
2871
- Annotated[StrictFloat, Field(gt=0)],
2872
- Tuple[
2873
- Annotated[StrictFloat, Field(gt=0)],
2874
- Annotated[StrictFloat, Field(gt=0)]
2875
- ]
2876
- ] = None,
2877
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2878
- _content_type: Optional[StrictStr] = None,
2879
- _headers: Optional[Dict[StrictStr, Any]] = None,
2880
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2881
- ) -> object:
2882
- """Valider les signatures électroniques d'un PDF
2883
-
2884
- Valide les signatures électroniques présentes dans un PDF uploadé. **Vérifications effectuées** : - Présence de signatures - Intégrité du document (non modifié depuis signature) - Validité des certificats - Chaîne de confiance (si disponible) - Présence d'horodatage (PAdES-B-T) - Données de validation (PAdES-B-LT) **Standards supportés** : PAdES-B-B, PAdES-B-T, PAdES-B-LT, ISO 32000-2. **⚠️ Note** : Cette validation est technique (intégrité cryptographique). La validité juridique dépend du niveau eIDAS du certificat (SES/AdES/QES) et du contexte d'utilisation.
2885
-
2886
- :param fichier_pdf: Fichier PDF à valider (sera analysé pour détecter et valider les signatures) (required)
2887
- :type fichier_pdf: bytearray
2888
- :param _request_timeout: timeout setting for this request. If one
2889
- number provided, it will be total request
2890
- timeout. It can also be a pair (tuple) of
2891
- (connection, read) timeouts.
2892
- :type _request_timeout: int, tuple(int, int), optional
2893
- :param _request_auth: set to override the auth_settings for an a single
2894
- request; this effectively ignores the
2895
- authentication in the spec for a single request.
2896
- :type _request_auth: dict, optional
2897
- :param _content_type: force content-type for the request.
2898
- :type _content_type: str, Optional
2899
- :param _headers: set to override the headers for a single
2900
- request; this effectively ignores the headers
2901
- in the spec for a single request.
2902
- :type _headers: dict, optional
2903
- :param _host_index: set to override the host_index for a single
2904
- request; this effectively ignores the host_index
2905
- in the spec for a single request.
2906
- :type _host_index: int, optional
2907
- :return: Returns the result object.
2908
- """ # noqa: E501
2909
-
2910
- _param = self._valider_signature_pdf_endpoint_api_v1_traitement_valider_signature_pdf_post_serialize(
2911
- fichier_pdf=fichier_pdf,
2912
- _request_auth=_request_auth,
2913
- _content_type=_content_type,
2914
- _headers=_headers,
2915
- _host_index=_host_index
2916
- )
2917
-
2918
- _response_types_map: Dict[str, Optional[str]] = {
2919
- '200': "object",
2920
- '400': None,
2921
- '422': "HTTPValidationError",
2922
- }
2923
- response_data = self.api_client.call_api(
2924
- *_param,
2925
- _request_timeout=_request_timeout
2926
- )
2927
- response_data.read()
2928
- return self.api_client.response_deserialize(
2929
- response_data=response_data,
2930
- response_types_map=_response_types_map,
2931
- ).data
2932
-
2933
-
2934
- @validate_call
2935
- def valider_signature_pdf_endpoint_api_v1_traitement_valider_signature_pdf_post_with_http_info(
2936
- self,
2937
- fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF à valider (sera analysé pour détecter et valider les signatures)")],
2938
- _request_timeout: Union[
2939
- None,
2940
- Annotated[StrictFloat, Field(gt=0)],
2941
- Tuple[
2942
- Annotated[StrictFloat, Field(gt=0)],
2943
- Annotated[StrictFloat, Field(gt=0)]
2944
- ]
2945
- ] = None,
2946
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
2947
- _content_type: Optional[StrictStr] = None,
2948
- _headers: Optional[Dict[StrictStr, Any]] = None,
2949
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2950
- ) -> ApiResponse[object]:
2951
- """Valider les signatures électroniques d'un PDF
2952
-
2953
- Valide les signatures électroniques présentes dans un PDF uploadé. **Vérifications effectuées** : - Présence de signatures - Intégrité du document (non modifié depuis signature) - Validité des certificats - Chaîne de confiance (si disponible) - Présence d'horodatage (PAdES-B-T) - Données de validation (PAdES-B-LT) **Standards supportés** : PAdES-B-B, PAdES-B-T, PAdES-B-LT, ISO 32000-2. **⚠️ Note** : Cette validation est technique (intégrité cryptographique). La validité juridique dépend du niveau eIDAS du certificat (SES/AdES/QES) et du contexte d'utilisation.
2954
-
2955
- :param fichier_pdf: Fichier PDF à valider (sera analysé pour détecter et valider les signatures) (required)
2956
- :type fichier_pdf: bytearray
2957
- :param _request_timeout: timeout setting for this request. If one
2958
- number provided, it will be total request
2959
- timeout. It can also be a pair (tuple) of
2960
- (connection, read) timeouts.
2961
- :type _request_timeout: int, tuple(int, int), optional
2962
- :param _request_auth: set to override the auth_settings for an a single
2963
- request; this effectively ignores the
2964
- authentication in the spec for a single request.
2965
- :type _request_auth: dict, optional
2966
- :param _content_type: force content-type for the request.
2967
- :type _content_type: str, Optional
2968
- :param _headers: set to override the headers for a single
2969
- request; this effectively ignores the headers
2970
- in the spec for a single request.
2971
- :type _headers: dict, optional
2972
- :param _host_index: set to override the host_index for a single
2973
- request; this effectively ignores the host_index
2974
- in the spec for a single request.
2975
- :type _host_index: int, optional
2976
- :return: Returns the result object.
2977
- """ # noqa: E501
2978
-
2979
- _param = self._valider_signature_pdf_endpoint_api_v1_traitement_valider_signature_pdf_post_serialize(
2980
- fichier_pdf=fichier_pdf,
2981
- _request_auth=_request_auth,
2982
- _content_type=_content_type,
2983
- _headers=_headers,
2984
- _host_index=_host_index
2985
- )
2986
-
2987
- _response_types_map: Dict[str, Optional[str]] = {
2988
- '200': "object",
2989
- '400': None,
2990
- '422': "HTTPValidationError",
2991
- }
2992
- response_data = self.api_client.call_api(
2993
- *_param,
2994
- _request_timeout=_request_timeout
2995
- )
2996
- response_data.read()
2997
- return self.api_client.response_deserialize(
2998
- response_data=response_data,
2999
- response_types_map=_response_types_map,
3000
- )
3001
-
3002
-
3003
- @validate_call
3004
- def valider_signature_pdf_endpoint_api_v1_traitement_valider_signature_pdf_post_without_preload_content(
3005
- self,
3006
- fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF à valider (sera analysé pour détecter et valider les signatures)")],
3007
- _request_timeout: Union[
3008
- None,
3009
- Annotated[StrictFloat, Field(gt=0)],
3010
- Tuple[
3011
- Annotated[StrictFloat, Field(gt=0)],
3012
- Annotated[StrictFloat, Field(gt=0)]
3013
- ]
3014
- ] = None,
3015
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3016
- _content_type: Optional[StrictStr] = None,
3017
- _headers: Optional[Dict[StrictStr, Any]] = None,
3018
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3019
- ) -> RESTResponseType:
3020
- """Valider les signatures électroniques d'un PDF
3021
-
3022
- Valide les signatures électroniques présentes dans un PDF uploadé. **Vérifications effectuées** : - Présence de signatures - Intégrité du document (non modifié depuis signature) - Validité des certificats - Chaîne de confiance (si disponible) - Présence d'horodatage (PAdES-B-T) - Données de validation (PAdES-B-LT) **Standards supportés** : PAdES-B-B, PAdES-B-T, PAdES-B-LT, ISO 32000-2. **⚠️ Note** : Cette validation est technique (intégrité cryptographique). La validité juridique dépend du niveau eIDAS du certificat (SES/AdES/QES) et du contexte d'utilisation.
3023
-
3024
- :param fichier_pdf: Fichier PDF à valider (sera analysé pour détecter et valider les signatures) (required)
3025
- :type fichier_pdf: bytearray
3026
- :param _request_timeout: timeout setting for this request. If one
3027
- number provided, it will be total request
3028
- timeout. It can also be a pair (tuple) of
3029
- (connection, read) timeouts.
3030
- :type _request_timeout: int, tuple(int, int), optional
3031
- :param _request_auth: set to override the auth_settings for an a single
3032
- request; this effectively ignores the
3033
- authentication in the spec for a single request.
3034
- :type _request_auth: dict, optional
3035
- :param _content_type: force content-type for the request.
3036
- :type _content_type: str, Optional
3037
- :param _headers: set to override the headers for a single
3038
- request; this effectively ignores the headers
3039
- in the spec for a single request.
3040
- :type _headers: dict, optional
3041
- :param _host_index: set to override the host_index for a single
3042
- request; this effectively ignores the host_index
3043
- in the spec for a single request.
3044
- :type _host_index: int, optional
3045
- :return: Returns the result object.
3046
- """ # noqa: E501
3047
-
3048
- _param = self._valider_signature_pdf_endpoint_api_v1_traitement_valider_signature_pdf_post_serialize(
3049
- fichier_pdf=fichier_pdf,
3050
- _request_auth=_request_auth,
3051
- _content_type=_content_type,
3052
- _headers=_headers,
3053
- _host_index=_host_index
3054
- )
3055
-
3056
- _response_types_map: Dict[str, Optional[str]] = {
3057
- '200': "object",
3058
- '400': None,
3059
- '422': "HTTPValidationError",
3060
- }
3061
- response_data = self.api_client.call_api(
3062
- *_param,
3063
- _request_timeout=_request_timeout
3064
- )
3065
- return response_data.response
3066
-
3067
-
3068
- def _valider_signature_pdf_endpoint_api_v1_traitement_valider_signature_pdf_post_serialize(
3069
- self,
3070
- fichier_pdf,
3071
- _request_auth,
3072
- _content_type,
3073
- _headers,
3074
- _host_index,
3075
- ) -> RequestSerialized:
3076
-
3077
- _host = None
3078
-
3079
- _collection_formats: Dict[str, str] = {
3080
- }
3081
-
3082
- _path_params: Dict[str, str] = {}
3083
- _query_params: List[Tuple[str, str]] = []
3084
- _header_params: Dict[str, Optional[str]] = _headers or {}
3085
- _form_params: List[Tuple[str, str]] = []
3086
- _files: Dict[
3087
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3088
- ] = {}
3089
- _body_params: Optional[bytes] = None
3090
-
3091
- # process the path parameters
3092
- # process the query parameters
3093
- # process the header parameters
3094
- # process the form parameters
3095
- if fichier_pdf is not None:
3096
- _files['fichier_pdf'] = fichier_pdf
3097
- # process the body parameter
3098
-
3099
-
3100
- # set the HTTP header `Accept`
3101
- if 'Accept' not in _header_params:
3102
- _header_params['Accept'] = self.api_client.select_header_accept(
3103
- [
3104
- 'application/json'
3105
- ]
3106
- )
3107
-
3108
- # set the HTTP header `Content-Type`
3109
- if _content_type:
3110
- _header_params['Content-Type'] = _content_type
3111
- else:
3112
- _default_content_type = (
3113
- self.api_client.select_header_content_type(
3114
- [
3115
- 'multipart/form-data'
3116
- ]
3117
- )
3118
- )
3119
- if _default_content_type is not None:
3120
- _header_params['Content-Type'] = _default_content_type
3121
-
3122
- # authentication setting
3123
- _auth_settings: List[str] = [
3124
- 'HTTPBearer'
3125
- ]
3126
-
3127
- return self.api_client.param_serialize(
3128
- method='POST',
3129
- resource_path='/api/v1/traitement/valider-signature-pdf',
3130
- path_params=_path_params,
3131
- query_params=_query_params,
3132
- header_params=_header_params,
3133
- body=_body_params,
3134
- post_params=_form_params,
3135
- files=_files,
3136
- auth_settings=_auth_settings,
3137
- collection_formats=_collection_formats,
3138
- _host=_host,
3139
- _request_auth=_request_auth
3140
- )
3141
-
3142
-
3143
-
3144
-
3145
- @validate_call
3146
- def valider_xml_api_v1_traitement_valider_xml_post(
3147
- self,
3148
- fichier_xml: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier XML Factur-X à valider (format .xml).")],
3149
- profil: Annotated[Optional[Any], Field(description="Profil de validation (MINIMUM, BASIC, EN16931, EXTENDED).")] = None,
3150
- _request_timeout: Union[
3151
- None,
3152
- Annotated[StrictFloat, Field(gt=0)],
3153
- Tuple[
3154
- Annotated[StrictFloat, Field(gt=0)],
3155
- Annotated[StrictFloat, Field(gt=0)]
3156
- ]
3157
- ] = None,
3158
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3159
- _content_type: Optional[StrictStr] = None,
3160
- _headers: Optional[Dict[StrictStr, Any]] = None,
3161
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3162
- ) -> ReponseValidationSucces:
3163
- """Valider un XML Factur-X existant
3164
-
3165
- Valide un fichier XML Factur-X contre les règles métier Schematron selon la norme EN 16931. ## Norme appliquée **Schematron ISO/IEC 19757-3** : Langage de validation de règles métier pour XML - Validation sémantique (au-delà de la syntaxe XSD) - Règles métier européennes EN 16931 - Règles françaises spécifiques Factur-X - Calculs arithmétiques et cohérence des données ## Profils et règles validées ### MINIMUM (45 règles) - Identifiant de facture unique - Dates (émission, échéance) - Identifiants parties (SIRET/SIREN) - Montant total TTC ### BASIC (102 règles) - Toutes les règles MINIMUM - Lignes de facture détaillées - Calculs de TVA basiques - Modes de paiement - Références (commande, contrat) ### EN16931 (178 règles) - Toutes les règles BASIC - **Règles européennes (BR-xx)** : 81 règles business - **Règles françaises (FR-xx)** : 12 règles spécifiques France - **Calculs avancés (CR-xx)** : 32 règles de calcul - **Codes normalisés (CL-xx)** : 52 listes de codes ### EXTENDED (210+ règles) - Toutes les règles EN16931 - Informations logistiques - Données comptables avancées - Références externes multiples ## Contrôles effectués ### 1. Validation syntaxique - Parsing XML correct (UTF-8, bien formé) - Namespaces UN/CEFACT présents - Structure hiérarchique respectée ### 2. Règles business (BR-xx) Exemples : - `BR-1` : Le total de la facture doit être égal à la somme des totaux de lignes + montants au niveau document - `BR-CO-10` : La somme des montants de base de TVA doit être égale au total net de la facture - `BR-16` : Le code de devise de la facture doit figurer dans la liste ISO 4217 ### 3. Règles françaises (FR-xx) Exemples : - `FR-1` : Le SIRET fournisseur doit avoir 14 chiffres - `FR-2` : Le SIRET client doit avoir 14 chiffres (si présent) - `FR-5` : Le numéro de TVA intracommunautaire doit être au format FRxx999999999 ### 4. Règles de calcul (CR-xx) - Montants HT + TVA = TTC - Somme des lignes = Total document - Remises et majorations correctement appliquées - Arrondis conformes (2 décimales pour les montants) ### 5. Codes normalisés (CL-xx) - Codes pays ISO 3166-1 alpha-2 - Codes devises ISO 4217 - Unités de mesure UN/ECE Rec 20 - Codes TVA (types, catégories, exonérations) - SchemeID pour identifiants (0002=SIREN, 0009=SIRET, etc.) ## Processus de validation 1. **Chargement XSLT** : Fichier Schematron converti en XSLT (Saxon-HE) 2. **Transformation** : Application des règles sur le XML 3. **Analyse résultats** : Extraction des erreurs (`failed-assert`) et avertissements (`successful-report`) 4. **Rapport** : Liste structurée des non-conformités ## Réponses **200 OK** : XML conforme ```json { \"message\": \"Le XML est conforme au profil EN16931\" } ``` **400 Bad Request** : XML non conforme ```json { \"detail\": [ \"[BR-1] Le total de la facture (120.00) ne correspond pas à la somme calculée (100.00 + 20.00)\", \"[FR-1] Le SIRET fournisseur doit contenir exactement 14 chiffres\" ] } ``` ## Cas d'usage - **Pré-validation** : Vérifier un XML avant intégration dans un PDF/A - **Debugging** : Identifier précisément les erreurs de génération - **Tests** : Valider des XMLs de test ou d'exemple - **Conformité** : S'assurer du respect des règles européennes et françaises - **Développement** : Tester rapidement sans générer de PDF ## Temps de traitement - Profil MINIMUM : ~0.5 seconde - Profil EN16931 : ~1-2 secondes - Profil EXTENDED : ~2-3 secondes
3166
-
3167
- :param fichier_xml: Fichier XML Factur-X à valider (format .xml). (required)
3168
- :type fichier_xml: bytearray
3169
- :param profil: Profil de validation (MINIMUM, BASIC, EN16931, EXTENDED).
3170
- :type profil: ProfilAPI
3171
- :param _request_timeout: timeout setting for this request. If one
3172
- number provided, it will be total request
3173
- timeout. It can also be a pair (tuple) of
3174
- (connection, read) timeouts.
3175
- :type _request_timeout: int, tuple(int, int), optional
3176
- :param _request_auth: set to override the auth_settings for an a single
3177
- request; this effectively ignores the
3178
- authentication in the spec for a single request.
3179
- :type _request_auth: dict, optional
3180
- :param _content_type: force content-type for the request.
3181
- :type _content_type: str, Optional
3182
- :param _headers: set to override the headers for a single
3183
- request; this effectively ignores the headers
3184
- in the spec for a single request.
3185
- :type _headers: dict, optional
3186
- :param _host_index: set to override the host_index for a single
3187
- request; this effectively ignores the host_index
3188
- in the spec for a single request.
3189
- :type _host_index: int, optional
3190
- :return: Returns the result object.
3191
- """ # noqa: E501
3192
-
3193
- _param = self._valider_xml_api_v1_traitement_valider_xml_post_serialize(
3194
- fichier_xml=fichier_xml,
3195
- profil=profil,
3196
- _request_auth=_request_auth,
3197
- _content_type=_content_type,
3198
- _headers=_headers,
3199
- _host_index=_host_index
3200
- )
3201
-
3202
- _response_types_map: Dict[str, Optional[str]] = {
3203
- '200': "ReponseValidationSucces",
3204
- '400': "ReponseValidationErreur",
3205
- '422': "HTTPValidationError",
3206
- }
3207
- response_data = self.api_client.call_api(
3208
- *_param,
3209
- _request_timeout=_request_timeout
3210
- )
3211
- response_data.read()
3212
- return self.api_client.response_deserialize(
3213
- response_data=response_data,
3214
- response_types_map=_response_types_map,
3215
- ).data
3216
-
3217
-
3218
- @validate_call
3219
- def valider_xml_api_v1_traitement_valider_xml_post_with_http_info(
3220
- self,
3221
- fichier_xml: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier XML Factur-X à valider (format .xml).")],
3222
- profil: Annotated[Optional[Any], Field(description="Profil de validation (MINIMUM, BASIC, EN16931, EXTENDED).")] = None,
3223
- _request_timeout: Union[
3224
- None,
3225
- Annotated[StrictFloat, Field(gt=0)],
3226
- Tuple[
3227
- Annotated[StrictFloat, Field(gt=0)],
3228
- Annotated[StrictFloat, Field(gt=0)]
3229
- ]
3230
- ] = None,
3231
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3232
- _content_type: Optional[StrictStr] = None,
3233
- _headers: Optional[Dict[StrictStr, Any]] = None,
3234
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3235
- ) -> ApiResponse[ReponseValidationSucces]:
3236
- """Valider un XML Factur-X existant
3237
-
3238
- Valide un fichier XML Factur-X contre les règles métier Schematron selon la norme EN 16931. ## Norme appliquée **Schematron ISO/IEC 19757-3** : Langage de validation de règles métier pour XML - Validation sémantique (au-delà de la syntaxe XSD) - Règles métier européennes EN 16931 - Règles françaises spécifiques Factur-X - Calculs arithmétiques et cohérence des données ## Profils et règles validées ### MINIMUM (45 règles) - Identifiant de facture unique - Dates (émission, échéance) - Identifiants parties (SIRET/SIREN) - Montant total TTC ### BASIC (102 règles) - Toutes les règles MINIMUM - Lignes de facture détaillées - Calculs de TVA basiques - Modes de paiement - Références (commande, contrat) ### EN16931 (178 règles) - Toutes les règles BASIC - **Règles européennes (BR-xx)** : 81 règles business - **Règles françaises (FR-xx)** : 12 règles spécifiques France - **Calculs avancés (CR-xx)** : 32 règles de calcul - **Codes normalisés (CL-xx)** : 52 listes de codes ### EXTENDED (210+ règles) - Toutes les règles EN16931 - Informations logistiques - Données comptables avancées - Références externes multiples ## Contrôles effectués ### 1. Validation syntaxique - Parsing XML correct (UTF-8, bien formé) - Namespaces UN/CEFACT présents - Structure hiérarchique respectée ### 2. Règles business (BR-xx) Exemples : - `BR-1` : Le total de la facture doit être égal à la somme des totaux de lignes + montants au niveau document - `BR-CO-10` : La somme des montants de base de TVA doit être égale au total net de la facture - `BR-16` : Le code de devise de la facture doit figurer dans la liste ISO 4217 ### 3. Règles françaises (FR-xx) Exemples : - `FR-1` : Le SIRET fournisseur doit avoir 14 chiffres - `FR-2` : Le SIRET client doit avoir 14 chiffres (si présent) - `FR-5` : Le numéro de TVA intracommunautaire doit être au format FRxx999999999 ### 4. Règles de calcul (CR-xx) - Montants HT + TVA = TTC - Somme des lignes = Total document - Remises et majorations correctement appliquées - Arrondis conformes (2 décimales pour les montants) ### 5. Codes normalisés (CL-xx) - Codes pays ISO 3166-1 alpha-2 - Codes devises ISO 4217 - Unités de mesure UN/ECE Rec 20 - Codes TVA (types, catégories, exonérations) - SchemeID pour identifiants (0002=SIREN, 0009=SIRET, etc.) ## Processus de validation 1. **Chargement XSLT** : Fichier Schematron converti en XSLT (Saxon-HE) 2. **Transformation** : Application des règles sur le XML 3. **Analyse résultats** : Extraction des erreurs (`failed-assert`) et avertissements (`successful-report`) 4. **Rapport** : Liste structurée des non-conformités ## Réponses **200 OK** : XML conforme ```json { \"message\": \"Le XML est conforme au profil EN16931\" } ``` **400 Bad Request** : XML non conforme ```json { \"detail\": [ \"[BR-1] Le total de la facture (120.00) ne correspond pas à la somme calculée (100.00 + 20.00)\", \"[FR-1] Le SIRET fournisseur doit contenir exactement 14 chiffres\" ] } ``` ## Cas d'usage - **Pré-validation** : Vérifier un XML avant intégration dans un PDF/A - **Debugging** : Identifier précisément les erreurs de génération - **Tests** : Valider des XMLs de test ou d'exemple - **Conformité** : S'assurer du respect des règles européennes et françaises - **Développement** : Tester rapidement sans générer de PDF ## Temps de traitement - Profil MINIMUM : ~0.5 seconde - Profil EN16931 : ~1-2 secondes - Profil EXTENDED : ~2-3 secondes
3239
-
3240
- :param fichier_xml: Fichier XML Factur-X à valider (format .xml). (required)
3241
- :type fichier_xml: bytearray
3242
- :param profil: Profil de validation (MINIMUM, BASIC, EN16931, EXTENDED).
3243
- :type profil: ProfilAPI
3244
- :param _request_timeout: timeout setting for this request. If one
3245
- number provided, it will be total request
3246
- timeout. It can also be a pair (tuple) of
3247
- (connection, read) timeouts.
3248
- :type _request_timeout: int, tuple(int, int), optional
3249
- :param _request_auth: set to override the auth_settings for an a single
3250
- request; this effectively ignores the
3251
- authentication in the spec for a single request.
3252
- :type _request_auth: dict, optional
3253
- :param _content_type: force content-type for the request.
3254
- :type _content_type: str, Optional
3255
- :param _headers: set to override the headers for a single
3256
- request; this effectively ignores the headers
3257
- in the spec for a single request.
3258
- :type _headers: dict, optional
3259
- :param _host_index: set to override the host_index for a single
3260
- request; this effectively ignores the host_index
3261
- in the spec for a single request.
3262
- :type _host_index: int, optional
3263
- :return: Returns the result object.
3264
- """ # noqa: E501
3265
-
3266
- _param = self._valider_xml_api_v1_traitement_valider_xml_post_serialize(
3267
- fichier_xml=fichier_xml,
3268
- profil=profil,
3269
- _request_auth=_request_auth,
3270
- _content_type=_content_type,
3271
- _headers=_headers,
3272
- _host_index=_host_index
3273
- )
3274
-
3275
- _response_types_map: Dict[str, Optional[str]] = {
3276
- '200': "ReponseValidationSucces",
3277
- '400': "ReponseValidationErreur",
3278
- '422': "HTTPValidationError",
3279
- }
3280
- response_data = self.api_client.call_api(
3281
- *_param,
3282
- _request_timeout=_request_timeout
3283
- )
3284
- response_data.read()
3285
- return self.api_client.response_deserialize(
3286
- response_data=response_data,
3287
- response_types_map=_response_types_map,
3288
- )
3289
-
3290
-
3291
- @validate_call
3292
- def valider_xml_api_v1_traitement_valider_xml_post_without_preload_content(
3293
- self,
3294
- fichier_xml: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier XML Factur-X à valider (format .xml).")],
3295
- profil: Annotated[Optional[Any], Field(description="Profil de validation (MINIMUM, BASIC, EN16931, EXTENDED).")] = None,
3296
- _request_timeout: Union[
3297
- None,
3298
- Annotated[StrictFloat, Field(gt=0)],
3299
- Tuple[
3300
- Annotated[StrictFloat, Field(gt=0)],
3301
- Annotated[StrictFloat, Field(gt=0)]
3302
- ]
3303
- ] = None,
3304
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
3305
- _content_type: Optional[StrictStr] = None,
3306
- _headers: Optional[Dict[StrictStr, Any]] = None,
3307
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3308
- ) -> RESTResponseType:
3309
- """Valider un XML Factur-X existant
3310
-
3311
- Valide un fichier XML Factur-X contre les règles métier Schematron selon la norme EN 16931. ## Norme appliquée **Schematron ISO/IEC 19757-3** : Langage de validation de règles métier pour XML - Validation sémantique (au-delà de la syntaxe XSD) - Règles métier européennes EN 16931 - Règles françaises spécifiques Factur-X - Calculs arithmétiques et cohérence des données ## Profils et règles validées ### MINIMUM (45 règles) - Identifiant de facture unique - Dates (émission, échéance) - Identifiants parties (SIRET/SIREN) - Montant total TTC ### BASIC (102 règles) - Toutes les règles MINIMUM - Lignes de facture détaillées - Calculs de TVA basiques - Modes de paiement - Références (commande, contrat) ### EN16931 (178 règles) - Toutes les règles BASIC - **Règles européennes (BR-xx)** : 81 règles business - **Règles françaises (FR-xx)** : 12 règles spécifiques France - **Calculs avancés (CR-xx)** : 32 règles de calcul - **Codes normalisés (CL-xx)** : 52 listes de codes ### EXTENDED (210+ règles) - Toutes les règles EN16931 - Informations logistiques - Données comptables avancées - Références externes multiples ## Contrôles effectués ### 1. Validation syntaxique - Parsing XML correct (UTF-8, bien formé) - Namespaces UN/CEFACT présents - Structure hiérarchique respectée ### 2. Règles business (BR-xx) Exemples : - `BR-1` : Le total de la facture doit être égal à la somme des totaux de lignes + montants au niveau document - `BR-CO-10` : La somme des montants de base de TVA doit être égale au total net de la facture - `BR-16` : Le code de devise de la facture doit figurer dans la liste ISO 4217 ### 3. Règles françaises (FR-xx) Exemples : - `FR-1` : Le SIRET fournisseur doit avoir 14 chiffres - `FR-2` : Le SIRET client doit avoir 14 chiffres (si présent) - `FR-5` : Le numéro de TVA intracommunautaire doit être au format FRxx999999999 ### 4. Règles de calcul (CR-xx) - Montants HT + TVA = TTC - Somme des lignes = Total document - Remises et majorations correctement appliquées - Arrondis conformes (2 décimales pour les montants) ### 5. Codes normalisés (CL-xx) - Codes pays ISO 3166-1 alpha-2 - Codes devises ISO 4217 - Unités de mesure UN/ECE Rec 20 - Codes TVA (types, catégories, exonérations) - SchemeID pour identifiants (0002=SIREN, 0009=SIRET, etc.) ## Processus de validation 1. **Chargement XSLT** : Fichier Schematron converti en XSLT (Saxon-HE) 2. **Transformation** : Application des règles sur le XML 3. **Analyse résultats** : Extraction des erreurs (`failed-assert`) et avertissements (`successful-report`) 4. **Rapport** : Liste structurée des non-conformités ## Réponses **200 OK** : XML conforme ```json { \"message\": \"Le XML est conforme au profil EN16931\" } ``` **400 Bad Request** : XML non conforme ```json { \"detail\": [ \"[BR-1] Le total de la facture (120.00) ne correspond pas à la somme calculée (100.00 + 20.00)\", \"[FR-1] Le SIRET fournisseur doit contenir exactement 14 chiffres\" ] } ``` ## Cas d'usage - **Pré-validation** : Vérifier un XML avant intégration dans un PDF/A - **Debugging** : Identifier précisément les erreurs de génération - **Tests** : Valider des XMLs de test ou d'exemple - **Conformité** : S'assurer du respect des règles européennes et françaises - **Développement** : Tester rapidement sans générer de PDF ## Temps de traitement - Profil MINIMUM : ~0.5 seconde - Profil EN16931 : ~1-2 secondes - Profil EXTENDED : ~2-3 secondes
3312
-
3313
- :param fichier_xml: Fichier XML Factur-X à valider (format .xml). (required)
3314
- :type fichier_xml: bytearray
3315
- :param profil: Profil de validation (MINIMUM, BASIC, EN16931, EXTENDED).
3316
- :type profil: ProfilAPI
3317
- :param _request_timeout: timeout setting for this request. If one
3318
- number provided, it will be total request
3319
- timeout. It can also be a pair (tuple) of
3320
- (connection, read) timeouts.
3321
- :type _request_timeout: int, tuple(int, int), optional
3322
- :param _request_auth: set to override the auth_settings for an a single
3323
- request; this effectively ignores the
3324
- authentication in the spec for a single request.
3325
- :type _request_auth: dict, optional
3326
- :param _content_type: force content-type for the request.
3327
- :type _content_type: str, Optional
3328
- :param _headers: set to override the headers for a single
3329
- request; this effectively ignores the headers
3330
- in the spec for a single request.
3331
- :type _headers: dict, optional
3332
- :param _host_index: set to override the host_index for a single
3333
- request; this effectively ignores the host_index
3334
- in the spec for a single request.
3335
- :type _host_index: int, optional
3336
- :return: Returns the result object.
3337
- """ # noqa: E501
3338
-
3339
- _param = self._valider_xml_api_v1_traitement_valider_xml_post_serialize(
3340
- fichier_xml=fichier_xml,
3341
- profil=profil,
3342
- _request_auth=_request_auth,
3343
- _content_type=_content_type,
3344
- _headers=_headers,
3345
- _host_index=_host_index
3346
- )
3347
-
3348
- _response_types_map: Dict[str, Optional[str]] = {
3349
- '200': "ReponseValidationSucces",
3350
- '400': "ReponseValidationErreur",
3351
- '422': "HTTPValidationError",
3352
- }
3353
- response_data = self.api_client.call_api(
3354
- *_param,
3355
- _request_timeout=_request_timeout
3356
- )
3357
- return response_data.response
3358
-
3359
-
3360
- def _valider_xml_api_v1_traitement_valider_xml_post_serialize(
3361
- self,
3362
- fichier_xml,
3363
- profil,
3364
- _request_auth,
3365
- _content_type,
3366
- _headers,
3367
- _host_index,
3368
- ) -> RequestSerialized:
3369
-
3370
- _host = None
3371
-
3372
- _collection_formats: Dict[str, str] = {
3373
- }
3374
-
3375
- _path_params: Dict[str, str] = {}
3376
- _query_params: List[Tuple[str, str]] = []
3377
- _header_params: Dict[str, Optional[str]] = _headers or {}
3378
- _form_params: List[Tuple[str, str]] = []
3379
- _files: Dict[
3380
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3381
- ] = {}
3382
- _body_params: Optional[bytes] = None
3383
-
3384
- # process the path parameters
3385
- # process the query parameters
3386
- # process the header parameters
3387
- # process the form parameters
3388
- if fichier_xml is not None:
3389
- _files['fichier_xml'] = fichier_xml
3390
- if profil is not None:
3391
- _form_params.append(('profil', profil))
3392
- # process the body parameter
3393
-
3394
-
3395
- # set the HTTP header `Accept`
3396
- if 'Accept' not in _header_params:
3397
- _header_params['Accept'] = self.api_client.select_header_accept(
3398
- [
3399
- 'application/json'
3400
- ]
3401
- )
3402
-
3403
- # set the HTTP header `Content-Type`
3404
- if _content_type:
3405
- _header_params['Content-Type'] = _content_type
3406
- else:
3407
- _default_content_type = (
3408
- self.api_client.select_header_content_type(
3409
- [
3410
- 'multipart/form-data'
3411
- ]
3412
- )
3413
- )
3414
- if _default_content_type is not None:
3415
- _header_params['Content-Type'] = _default_content_type
3416
-
3417
- # authentication setting
3418
- _auth_settings: List[str] = [
3419
- 'HTTPBearer'
3420
- ]
3421
-
3422
- return self.api_client.param_serialize(
3423
- method='POST',
3424
- resource_path='/api/v1/traitement/valider-xml',
3425
- path_params=_path_params,
3426
- query_params=_query_params,
3427
- header_params=_header_params,
3428
- body=_body_params,
3429
- post_params=_form_params,
3430
- files=_files,
3431
- auth_settings=_auth_settings,
3432
- collection_formats=_collection_formats,
3433
- _host=_host,
3434
- _request_auth=_request_auth
3435
- )
3436
-
3437
-