factpulse 4.0.1 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (368) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -4
  3. data/Gemfile.lock +1 -1
  4. data/docs/AFNORPDPPAApi.md +5 -72
  5. data/docs/AsyncTasksApi.md +77 -0
  6. data/docs/ChorusProCredentials.md +8 -8
  7. data/docs/ChorusProDestination.md +1 -1
  8. data/docs/CreateAggregatedReportRequest.md +3 -1
  9. data/docs/CreateEReportingRequest.md +3 -1
  10. data/docs/ElectronicSignatureApi.md +319 -0
  11. data/docs/EncaisseeRequest.md +10 -6
  12. data/docs/{DocumentConversionApi.md → FacturXConversionApi.md} +39 -39
  13. data/docs/FacturXGenerationApi.md +239 -0
  14. data/docs/FacturXInvoice.md +1 -1
  15. data/docs/FacturXPDFXMLVerificationApi.md +225 -0
  16. data/docs/FacturXValidationApi.md +241 -0
  17. data/docs/FactureElectroniqueRestApiSchemasChorusProChorusProCredentials.md +26 -0
  18. data/docs/{EReportingApi.md → Flux10EReportingApi.md} +53 -51
  19. data/docs/{CDARCycleDeVieApi.md → Flux6InvoiceLifecycleCDARApi.md} +145 -75
  20. data/docs/GetChorusProIdRequest.md +1 -1
  21. data/docs/GetInvoiceRequest.md +1 -1
  22. data/docs/GetStructureRequest.md +1 -1
  23. data/docs/HealthApi.md +67 -0
  24. data/docs/InvoiceInput.md +4 -2
  25. data/docs/IssuerRoleCode.md +15 -0
  26. data/docs/RefuseeRequest.md +10 -6
  27. data/docs/ReportIssuer.md +24 -0
  28. data/docs/ReportSender.md +1 -1
  29. data/docs/SearchStructureRequest.md +1 -1
  30. data/docs/SubmitInvoiceRequest.md +1 -1
  31. data/factpulse.gemspec +2 -2
  32. data/lib/factpulse/api/afnorpdppa_api.rb +5 -62
  33. data/lib/factpulse/api/afnorpdppa_directory_service_api.rb +1 -1
  34. data/lib/factpulse/api/afnorpdppa_flow_service_api.rb +1 -1
  35. data/lib/factpulse/api/async_tasks_api.rb +85 -0
  36. data/lib/factpulse/api/chorus_pro_api.rb +1 -1
  37. data/lib/factpulse/api/client_management_api.rb +1 -1
  38. data/lib/factpulse/api/downloads_api.rb +1 -1
  39. data/lib/factpulse/api/electronic_signature_api.rb +339 -0
  40. data/lib/factpulse/api/{document_conversion_api.rb → factur_x_conversion_api.rb} +42 -42
  41. data/lib/factpulse/api/factur_x_generation_api.rb +254 -0
  42. data/lib/factpulse/api/factur_x_validation_api.rb +256 -0
  43. data/lib/factpulse/api/factur_xpdfxml_verification_api.rb +232 -0
  44. data/lib/factpulse/api/{e_reporting_api.rb → flux10_e_reporting_api.rb} +54 -51
  45. data/lib/factpulse/api/flux6_invoice_lifecycle_cdar_api.rb +670 -0
  46. data/lib/factpulse/api/health_api.rb +58 -1
  47. data/lib/factpulse/api_client.rb +1 -1
  48. data/lib/factpulse/api_error.rb +1 -1
  49. data/lib/factpulse/api_model_base.rb +1 -1
  50. data/lib/factpulse/configuration.rb +1 -1
  51. data/lib/factpulse/models/acknowledgment_status.rb +1 -1
  52. data/lib/factpulse/models/action_code_info.rb +1 -1
  53. data/lib/factpulse/models/action_codes_response.rb +1 -1
  54. data/lib/factpulse/models/additional_document.rb +1 -1
  55. data/lib/factpulse/models/afnor_acknowledgement.rb +1 -1
  56. data/lib/factpulse/models/afnor_acknowledgement_detail.rb +1 -1
  57. data/lib/factpulse/models/afnor_address_edit.rb +1 -1
  58. data/lib/factpulse/models/afnor_address_patch.rb +1 -1
  59. data/lib/factpulse/models/afnor_address_put.rb +1 -1
  60. data/lib/factpulse/models/afnor_address_read.rb +1 -1
  61. data/lib/factpulse/models/afnor_algorithm.rb +1 -1
  62. data/lib/factpulse/models/afnor_contains_operator.rb +1 -1
  63. data/lib/factpulse/models/afnor_create_directory_line_body.rb +1 -1
  64. data/lib/factpulse/models/afnor_create_directory_line_body_addressing_information.rb +1 -1
  65. data/lib/factpulse/models/afnor_create_directory_line_body_period.rb +1 -1
  66. data/lib/factpulse/models/afnor_create_routing_code_body.rb +1 -1
  67. data/lib/factpulse/models/afnor_credentials.rb +1 -1
  68. data/lib/factpulse/models/afnor_destination.rb +1 -1
  69. data/lib/factpulse/models/afnor_diffusion_status.rb +1 -1
  70. data/lib/factpulse/models/afnor_directory_line_field.rb +1 -1
  71. data/lib/factpulse/models/afnor_directory_line_payload_history_legal_unit_facility_routing_code.rb +1 -1
  72. data/lib/factpulse/models/afnor_directory_line_payload_history_legal_unit_facility_routing_code_platform.rb +1 -1
  73. data/lib/factpulse/models/afnor_directory_line_payload_history_legal_unit_facility_routing_code_routing_code.rb +1 -1
  74. data/lib/factpulse/models/afnor_directory_line_post201_response.rb +1 -1
  75. data/lib/factpulse/models/afnor_directory_line_search_post200_response.rb +1 -1
  76. data/lib/factpulse/models/afnor_entity_type.rb +1 -1
  77. data/lib/factpulse/models/afnor_error.rb +1 -1
  78. data/lib/factpulse/models/afnor_facility_administrative_status.rb +1 -1
  79. data/lib/factpulse/models/afnor_facility_nature.rb +1 -1
  80. data/lib/factpulse/models/afnor_facility_payload_history.rb +1 -1
  81. data/lib/factpulse/models/afnor_facility_payload_history_ule_b2g_additional_data.rb +1 -1
  82. data/lib/factpulse/models/afnor_facility_payload_included.rb +1 -1
  83. data/lib/factpulse/models/afnor_facility_type.rb +1 -1
  84. data/lib/factpulse/models/afnor_flow.rb +1 -1
  85. data/lib/factpulse/models/afnor_flow_ack_status.rb +1 -1
  86. data/lib/factpulse/models/afnor_flow_direction.rb +1 -1
  87. data/lib/factpulse/models/afnor_flow_info.rb +1 -1
  88. data/lib/factpulse/models/afnor_flow_profile.rb +1 -1
  89. data/lib/factpulse/models/afnor_flow_syntax.rb +1 -1
  90. data/lib/factpulse/models/afnor_flow_type.rb +1 -1
  91. data/lib/factpulse/models/afnor_full_flow_info.rb +1 -1
  92. data/lib/factpulse/models/afnor_health_check_response.rb +1 -1
  93. data/lib/factpulse/models/afnor_legal_unit_administrative_status.rb +1 -1
  94. data/lib/factpulse/models/afnor_legal_unit_payload_history.rb +1 -1
  95. data/lib/factpulse/models/afnor_legal_unit_payload_included.rb +1 -1
  96. data/lib/factpulse/models/afnor_legal_unit_payload_included_no_siren.rb +1 -1
  97. data/lib/factpulse/models/afnor_platform_status.rb +1 -1
  98. data/lib/factpulse/models/afnor_processing_rule.rb +1 -1
  99. data/lib/factpulse/models/afnor_reason_code.rb +1 -1
  100. data/lib/factpulse/models/afnor_reason_code_enum.rb +1 -1
  101. data/lib/factpulse/models/afnor_recipient_platform_type.rb +1 -1
  102. data/lib/factpulse/models/afnor_result.rb +1 -1
  103. data/lib/factpulse/models/afnor_routing_code_administrative_status.rb +1 -1
  104. data/lib/factpulse/models/afnor_routing_code_field.rb +1 -1
  105. data/lib/factpulse/models/afnor_routing_code_payload_history_legal_unit_facility.rb +1 -1
  106. data/lib/factpulse/models/afnor_routing_code_post201_response.rb +1 -1
  107. data/lib/factpulse/models/afnor_routing_code_search.rb +1 -1
  108. data/lib/factpulse/models/afnor_routing_code_search_filters.rb +1 -1
  109. data/lib/factpulse/models/afnor_routing_code_search_filters_administrative_status.rb +1 -1
  110. data/lib/factpulse/models/afnor_routing_code_search_filters_routing_code_name.rb +1 -1
  111. data/lib/factpulse/models/afnor_routing_code_search_filters_routing_identifier.rb +1 -1
  112. data/lib/factpulse/models/afnor_routing_code_search_post200_response.rb +1 -1
  113. data/lib/factpulse/models/afnor_routing_code_search_sorting_inner.rb +1 -1
  114. data/lib/factpulse/models/afnor_search_directory_line.rb +1 -1
  115. data/lib/factpulse/models/afnor_search_directory_line_filters.rb +1 -1
  116. data/lib/factpulse/models/afnor_search_directory_line_filters_addressing_identifier.rb +1 -1
  117. data/lib/factpulse/models/afnor_search_directory_line_filters_addressing_suffix.rb +1 -1
  118. data/lib/factpulse/models/afnor_search_directory_line_sorting_inner.rb +1 -1
  119. data/lib/factpulse/models/afnor_search_flow_content.rb +1 -1
  120. data/lib/factpulse/models/afnor_search_flow_filters.rb +1 -1
  121. data/lib/factpulse/models/afnor_search_flow_params.rb +1 -1
  122. data/lib/factpulse/models/afnor_search_siren.rb +1 -1
  123. data/lib/factpulse/models/afnor_search_siren_filters.rb +1 -1
  124. data/lib/factpulse/models/afnor_search_siren_filters_administrative_status.rb +1 -1
  125. data/lib/factpulse/models/afnor_search_siren_filters_business_name.rb +1 -1
  126. data/lib/factpulse/models/afnor_search_siren_filters_entity_type.rb +1 -1
  127. data/lib/factpulse/models/afnor_search_siren_filters_siren.rb +1 -1
  128. data/lib/factpulse/models/afnor_search_siren_sorting_inner.rb +1 -1
  129. data/lib/factpulse/models/afnor_search_siret.rb +1 -1
  130. data/lib/factpulse/models/afnor_search_siret_filters.rb +1 -1
  131. data/lib/factpulse/models/afnor_search_siret_filters_address_lines.rb +1 -1
  132. data/lib/factpulse/models/afnor_search_siret_filters_administrative_status.rb +1 -1
  133. data/lib/factpulse/models/afnor_search_siret_filters_country_subdivision.rb +1 -1
  134. data/lib/factpulse/models/afnor_search_siret_filters_facility_type.rb +1 -1
  135. data/lib/factpulse/models/afnor_search_siret_filters_locality.rb +1 -1
  136. data/lib/factpulse/models/afnor_search_siret_filters_name.rb +1 -1
  137. data/lib/factpulse/models/afnor_search_siret_filters_postal_code.rb +1 -1
  138. data/lib/factpulse/models/afnor_search_siret_filters_siret.rb +1 -1
  139. data/lib/factpulse/models/afnor_search_siret_sorting_inner.rb +1 -1
  140. data/lib/factpulse/models/afnor_siren_field.rb +1 -1
  141. data/lib/factpulse/models/afnor_siren_search_post200_response.rb +1 -1
  142. data/lib/factpulse/models/afnor_siret_field.rb +1 -1
  143. data/lib/factpulse/models/afnor_siret_search_post200_response.rb +1 -1
  144. data/lib/factpulse/models/afnor_sorting_order.rb +1 -1
  145. data/lib/factpulse/models/afnor_strict_operator.rb +1 -1
  146. data/lib/factpulse/models/afnor_update_patch_directory_line_body.rb +1 -1
  147. data/lib/factpulse/models/afnor_update_patch_routing_code_body.rb +1 -1
  148. data/lib/factpulse/models/afnor_update_put_routing_code_body.rb +1 -1
  149. data/lib/factpulse/models/afnor_webhook_callback_content.rb +1 -1
  150. data/lib/factpulse/models/aggregated_payment_input.rb +1 -1
  151. data/lib/factpulse/models/aggregated_transaction_input.rb +1 -1
  152. data/lib/factpulse/models/allowance_charge.rb +1 -1
  153. data/lib/factpulse/models/allowance_charge_reason_code.rb +1 -1
  154. data/lib/factpulse/models/allowance_reason_code.rb +1 -1
  155. data/lib/factpulse/models/allowance_total_amount.rb +1 -1
  156. data/lib/factpulse/models/amount.rb +1 -1
  157. data/lib/factpulse/models/amount1.rb +1 -1
  158. data/lib/factpulse/models/amount2.rb +1 -1
  159. data/lib/factpulse/models/amount_due.rb +1 -1
  160. data/lib/factpulse/models/api_error.rb +1 -1
  161. data/lib/factpulse/models/api_profile.rb +1 -1
  162. data/lib/factpulse/models/async_task_status.rb +1 -1
  163. data/lib/factpulse/models/base_amount.rb +1 -1
  164. data/lib/factpulse/models/bounding_box_schema.rb +1 -1
  165. data/lib/factpulse/models/buyercountry.rb +2 -2
  166. data/lib/factpulse/models/celery_status.rb +1 -1
  167. data/lib/factpulse/models/certificate_info_response.rb +1 -1
  168. data/lib/factpulse/models/charge_total_amount.rb +1 -1
  169. data/lib/factpulse/models/chorus_pro_credentials.rb +27 -95
  170. data/lib/factpulse/models/chorus_pro_destination.rb +2 -2
  171. data/lib/factpulse/models/chorus_pro_result.rb +1 -1
  172. data/lib/factpulse/models/client_activate_response.rb +1 -1
  173. data/lib/factpulse/models/client_create_request.rb +1 -1
  174. data/lib/factpulse/models/client_detail.rb +1 -1
  175. data/lib/factpulse/models/client_list_response.rb +1 -1
  176. data/lib/factpulse/models/client_summary.rb +1 -1
  177. data/lib/factpulse/models/client_update_request.rb +1 -1
  178. data/lib/factpulse/models/contact.rb +1 -1
  179. data/lib/factpulse/models/convert_resume_request.rb +1 -1
  180. data/lib/factpulse/models/convert_success_response.rb +1 -1
  181. data/lib/factpulse/models/convert_validation_failed_response.rb +1 -1
  182. data/lib/factpulse/models/country_code.rb +1 -1
  183. data/lib/factpulse/models/create_aggregated_report_request.rb +13 -3
  184. data/lib/factpulse/models/create_cdar_request.rb +1 -1
  185. data/lib/factpulse/models/create_e_reporting_request.rb +13 -3
  186. data/lib/factpulse/models/currency.rb +1 -1
  187. data/lib/factpulse/models/currency_code.rb +1 -1
  188. data/lib/factpulse/models/delivery_party.rb +1 -1
  189. data/lib/factpulse/models/destination.rb +1 -1
  190. data/lib/factpulse/models/doc_type.rb +1 -1
  191. data/lib/factpulse/models/document_type_info.rb +1 -1
  192. data/lib/factpulse/models/e_reporting_flow_type.rb +1 -1
  193. data/lib/factpulse/models/e_reporting_validation_error.rb +1 -1
  194. data/lib/factpulse/models/electronic_address.rb +1 -1
  195. data/lib/factpulse/models/encaisseamount.rb +1 -1
  196. data/lib/factpulse/models/encaisseamount1.rb +1 -1
  197. data/lib/factpulse/models/encaissee_request.rb +86 -32
  198. data/lib/factpulse/models/enriched_invoice_info.rb +1 -1
  199. data/lib/factpulse/models/error_level.rb +1 -1
  200. data/lib/factpulse/models/error_source.rb +3 -2
  201. data/lib/factpulse/models/extraction_info.rb +1 -1
  202. data/lib/factpulse/models/factur_x_invoice.rb +1 -18
  203. data/lib/factpulse/models/factur_xpdf_info.rb +1 -1
  204. data/lib/factpulse/models/facture_electronique_rest_api_schemas_cdar_validation_error_response.rb +1 -1
  205. data/lib/factpulse/models/facture_electronique_rest_api_schemas_chorus_pro_chorus_pro_credentials.rb +259 -0
  206. data/lib/factpulse/models/facture_electronique_rest_api_schemas_ereporting_invoice_type_code.rb +1 -1
  207. data/lib/factpulse/models/field_status.rb +1 -1
  208. data/lib/factpulse/models/file_info.rb +1 -1
  209. data/lib/factpulse/models/files_info.rb +1 -1
  210. data/lib/factpulse/models/flow_direction.rb +1 -1
  211. data/lib/factpulse/models/flow_profile.rb +1 -1
  212. data/lib/factpulse/models/flow_summary.rb +1 -1
  213. data/lib/factpulse/models/flow_syntax.rb +1 -1
  214. data/lib/factpulse/models/flow_type.rb +1 -1
  215. data/lib/factpulse/models/generate_aggregated_report_response.rb +1 -1
  216. data/lib/factpulse/models/generate_cdar_response.rb +1 -1
  217. data/lib/factpulse/models/generate_certificate_request.rb +1 -1
  218. data/lib/factpulse/models/generate_certificate_response.rb +1 -1
  219. data/lib/factpulse/models/generate_e_reporting_response.rb +1 -1
  220. data/lib/factpulse/models/get_chorus_pro_id_request.rb +2 -2
  221. data/lib/factpulse/models/get_chorus_pro_id_response.rb +1 -1
  222. data/lib/factpulse/models/get_invoice_request.rb +2 -2
  223. data/lib/factpulse/models/get_invoice_response.rb +1 -1
  224. data/lib/factpulse/models/get_structure_request.rb +2 -2
  225. data/lib/factpulse/models/get_structure_response.rb +1 -1
  226. data/lib/factpulse/models/global_allowance_amount.rb +1 -1
  227. data/lib/factpulse/models/gross_unit_price.rb +1 -1
  228. data/lib/factpulse/models/http_validation_error.rb +1 -1
  229. data/lib/factpulse/models/incoming_invoice.rb +1 -1
  230. data/lib/factpulse/models/incoming_supplier.rb +1 -1
  231. data/lib/factpulse/models/invoice_format.rb +1 -1
  232. data/lib/factpulse/models/invoice_input.rb +14 -21
  233. data/lib/factpulse/models/invoice_line.rb +1 -1
  234. data/lib/factpulse/models/invoice_line_allowance_amount.rb +1 -1
  235. data/lib/factpulse/models/invoice_note.rb +1 -1
  236. data/lib/factpulse/models/invoice_payment_input.rb +1 -1
  237. data/lib/factpulse/models/invoice_references.rb +1 -1
  238. data/lib/factpulse/models/invoice_status.rb +1 -1
  239. data/lib/factpulse/models/invoice_totals.rb +1 -1
  240. data/lib/factpulse/models/invoice_totals_prepayment.rb +1 -1
  241. data/lib/factpulse/models/invoice_type_code.rb +1 -1
  242. data/lib/factpulse/models/invoice_type_code_output.rb +1 -1
  243. data/lib/factpulse/models/invoicing_framework.rb +1 -1
  244. data/lib/factpulse/models/invoicing_framework_code.rb +1 -1
  245. data/lib/factpulse/models/issuer_role_code.rb +40 -0
  246. data/lib/factpulse/models/line_net_amount.rb +1 -1
  247. data/lib/factpulse/models/line_sub_type.rb +1 -1
  248. data/lib/factpulse/models/line_total_amount.rb +1 -1
  249. data/lib/factpulse/models/location_inner.rb +1 -1
  250. data/lib/factpulse/models/mandatory_note_schema.rb +1 -1
  251. data/lib/factpulse/models/manual_rate.rb +1 -1
  252. data/lib/factpulse/models/manual_vat_rate.rb +1 -1
  253. data/lib/factpulse/models/missing_field.rb +1 -1
  254. data/lib/factpulse/models/operation_nature.rb +1 -1
  255. data/lib/factpulse/models/output_format.rb +1 -1
  256. data/lib/factpulse/models/page_dimensions_schema.rb +1 -1
  257. data/lib/factpulse/models/payee.rb +1 -1
  258. data/lib/factpulse/models/payment_amount_by_rate.rb +1 -1
  259. data/lib/factpulse/models/payment_card.rb +1 -1
  260. data/lib/factpulse/models/payment_means.rb +1 -1
  261. data/lib/factpulse/models/pdf_validation_result_api.rb +1 -1
  262. data/lib/factpulse/models/pdp_config_response.rb +1 -1
  263. data/lib/factpulse/models/pdp_config_update_request.rb +1 -1
  264. data/lib/factpulse/models/pdp_credentials.rb +1 -1
  265. data/lib/factpulse/models/percentage.rb +1 -1
  266. data/lib/factpulse/models/postal_address.rb +1 -1
  267. data/lib/factpulse/models/price_allowance_amount.rb +1 -1
  268. data/lib/factpulse/models/price_basis_quantity.rb +1 -1
  269. data/lib/factpulse/models/processing_options.rb +1 -1
  270. data/lib/factpulse/models/processing_rule.rb +1 -1
  271. data/lib/factpulse/models/product_characteristic.rb +1 -1
  272. data/lib/factpulse/models/product_classification.rb +1 -1
  273. data/lib/factpulse/models/quantity.rb +1 -1
  274. data/lib/factpulse/models/rate.rb +1 -1
  275. data/lib/factpulse/models/rate1.rb +1 -1
  276. data/lib/factpulse/models/reason_code_info.rb +1 -1
  277. data/lib/factpulse/models/reason_codes_response.rb +1 -1
  278. data/lib/factpulse/models/recipient.rb +1 -1
  279. data/lib/factpulse/models/recipient_input.rb +1 -1
  280. data/lib/factpulse/models/refusee_request.rb +84 -30
  281. data/lib/factpulse/models/report_issuer.rb +236 -0
  282. data/lib/factpulse/models/report_period.rb +1 -1
  283. data/lib/factpulse/models/report_sender.rb +3 -3
  284. data/lib/factpulse/models/rounding_amount.rb +1 -1
  285. data/lib/factpulse/models/schematron_validation_error.rb +1 -1
  286. data/lib/factpulse/models/scheme_id.rb +1 -1
  287. data/lib/factpulse/models/search_flow_request.rb +1 -1
  288. data/lib/factpulse/models/search_flow_response.rb +1 -1
  289. data/lib/factpulse/models/search_services_response.rb +1 -1
  290. data/lib/factpulse/models/search_structure_request.rb +2 -2
  291. data/lib/factpulse/models/search_structure_response.rb +1 -1
  292. data/lib/factpulse/models/secret_status.rb +1 -1
  293. data/lib/factpulse/models/sellercountry.rb +2 -2
  294. data/lib/factpulse/models/signature_info.rb +1 -1
  295. data/lib/factpulse/models/signature_info_api.rb +1 -1
  296. data/lib/factpulse/models/signature_parameters.rb +1 -1
  297. data/lib/factpulse/models/simplified_cdar_response.rb +1 -1
  298. data/lib/factpulse/models/simplified_invoice_data.rb +1 -1
  299. data/lib/factpulse/models/status_code_info.rb +1 -1
  300. data/lib/factpulse/models/status_codes_response.rb +1 -1
  301. data/lib/factpulse/models/structure_info.rb +1 -1
  302. data/lib/factpulse/models/structure_parameters.rb +1 -1
  303. data/lib/factpulse/models/structure_service.rb +1 -1
  304. data/lib/factpulse/models/submission_mode.rb +1 -1
  305. data/lib/factpulse/models/submit_aggregated_report_request.rb +1 -1
  306. data/lib/factpulse/models/submit_cdar_request.rb +1 -1
  307. data/lib/factpulse/models/submit_cdar_response.rb +1 -1
  308. data/lib/factpulse/models/submit_cdarxml_request.rb +1 -1
  309. data/lib/factpulse/models/submit_complete_invoice_request.rb +1 -1
  310. data/lib/factpulse/models/submit_complete_invoice_response.rb +1 -1
  311. data/lib/factpulse/models/submit_e_reporting_request.rb +1 -1
  312. data/lib/factpulse/models/submit_e_reporting_response.rb +1 -1
  313. data/lib/factpulse/models/submit_flow_request.rb +1 -1
  314. data/lib/factpulse/models/submit_flow_response.rb +1 -1
  315. data/lib/factpulse/models/submit_gross_amount.rb +1 -1
  316. data/lib/factpulse/models/submit_invoice_request.rb +2 -2
  317. data/lib/factpulse/models/submit_invoice_response.rb +1 -1
  318. data/lib/factpulse/models/submit_net_amount.rb +1 -1
  319. data/lib/factpulse/models/submit_vat_amount.rb +1 -1
  320. data/lib/factpulse/models/supplementary_attachment.rb +1 -1
  321. data/lib/factpulse/models/supplier.rb +1 -1
  322. data/lib/factpulse/models/task_response.rb +1 -1
  323. data/lib/factpulse/models/tax_breakdown_input.rb +1 -1
  324. data/lib/factpulse/models/tax_due_date_type.rb +1 -1
  325. data/lib/factpulse/models/tax_representative.rb +1 -1
  326. data/lib/factpulse/models/taxable_amount.rb +1 -1
  327. data/lib/factpulse/models/taxableamount.rb +1 -1
  328. data/lib/factpulse/models/taxamount.rb +1 -1
  329. data/lib/factpulse/models/taxamount1.rb +1 -1
  330. data/lib/factpulse/models/taxamount2.rb +1 -1
  331. data/lib/factpulse/models/taxexclusiveamount.rb +1 -1
  332. data/lib/factpulse/models/taxexclusiveamount1.rb +1 -1
  333. data/lib/factpulse/models/total_gross_amount.rb +1 -1
  334. data/lib/factpulse/models/total_net_amount.rb +1 -1
  335. data/lib/factpulse/models/total_vat_amount.rb +1 -1
  336. data/lib/factpulse/models/transaction_category.rb +1 -1
  337. data/lib/factpulse/models/transmission_type_code.rb +1 -1
  338. data/lib/factpulse/models/unit_net_price.rb +1 -1
  339. data/lib/factpulse/models/unit_of_measure.rb +1 -1
  340. data/lib/factpulse/models/validate_cdar_request.rb +1 -1
  341. data/lib/factpulse/models/validate_cdar_response.rb +1 -1
  342. data/lib/factpulse/models/validate_e_reporting_request.rb +1 -1
  343. data/lib/factpulse/models/validate_e_reporting_response.rb +1 -1
  344. data/lib/factpulse/models/validation_error.rb +1 -1
  345. data/lib/factpulse/models/validation_error_detail.rb +1 -1
  346. data/lib/factpulse/models/validation_error_response.rb +1 -1
  347. data/lib/factpulse/models/validation_info.rb +1 -1
  348. data/lib/factpulse/models/validation_success_response.rb +1 -1
  349. data/lib/factpulse/models/vat_accounting_code.rb +1 -1
  350. data/lib/factpulse/models/vat_amount.rb +1 -1
  351. data/lib/factpulse/models/vat_category.rb +1 -1
  352. data/lib/factpulse/models/vat_line.rb +1 -1
  353. data/lib/factpulse/models/vat_point_date_code.rb +1 -1
  354. data/lib/factpulse/models/vat_rate.rb +1 -1
  355. data/lib/factpulse/models/verification_success_response.rb +1 -1
  356. data/lib/factpulse/models/verified_field_schema.rb +1 -1
  357. data/lib/factpulse/version.rb +2 -2
  358. data/lib/factpulse.rb +12 -8
  359. metadata +46 -37
  360. data/docs/FactureElectroniqueRestApiSchemasProcessingChorusProCredentials.md +0 -26
  361. data/docs/InvoiceProcessingApi.md +0 -855
  362. data/docs/PDFXMLVerificationApi.md +0 -443
  363. data/docs/UserApi.md +0 -74
  364. data/lib/factpulse/api/cdar_cycle_de_vie_api.rb +0 -601
  365. data/lib/factpulse/api/invoice_processing_api.rb +0 -868
  366. data/lib/factpulse/api/pdfxml_verification_api.rb +0 -442
  367. data/lib/factpulse/api/user_api.rb +0 -79
  368. data/lib/factpulse/models/facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.rb +0 -191
@@ -1,868 +0,0 @@
1
- =begin
2
- #FactPulse REST API
3
-
4
- # REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://factpulse.fr/api/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://factpulse.fr/documentation-api/
5
-
6
- The version of the OpenAPI document: 1.0.0
7
- Contact: contact@factpulse.fr
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.20.0-SNAPSHOT
10
-
11
- =end
12
-
13
- require 'cgi'
14
-
15
- module FactPulse
16
- class InvoiceProcessingApi
17
- attr_accessor :api_client
18
-
19
- def initialize(api_client = ApiClient.default)
20
- @api_client = api_client
21
- end
22
- # Generate a Factur-X invoice
23
- # Generates an electronic invoice in Factur-X format compliant with European standards. ## Applied Standards - **Factur-X** (France): FNFE-MPE standard (Forum National de la Facture Électronique) - **ZUGFeRD** (Germany): German format compatible with Factur-X - **EN 16931**: European semantic standard for electronic invoicing - **ISO 19005-3** (PDF/A-3): Long-term electronic archiving - **Cross Industry Invoice (CII)**: UN/CEFACT XML syntax ## 🆕 New: Simplified format with auto-enrichment (P0.1) You can now create an invoice by providing only: - An invoice number - A supplier SIRET + **IBAN** (required) - A recipient SIRET - Invoice lines (description, quantity, net price) **Simplified format example**: ```json { \"number\": \"FACT-2025-001\", \"supplier\": { \"siret\": \"92019522900017\", \"iban\": \"FR7630001007941234567890185\" }, \"recipient\": {\"siret\": \"35600000000048\"}, \"lines\": [ {\"description\": \"Service\", \"quantity\": 10, \"unitPrice\": 100.00, \"vatRate\": 20.0} ] } ``` **⚠️ Required fields (simplified format)**: - `number`: Unique invoice number - `supplier.siret`: Supplier's SIRET (14 digits) - `supplier.iban`: Bank account IBAN (no public API to retrieve it) - `recipient.siret`: Recipient's SIRET - `lines[]`: At least one invoice line **What happens automatically with `auto_enrich=True`**: - ✅ Name enrichment from Chorus Pro API - ✅ Address enrichment from Business Search API (free, public) - ✅ Automatic intra-EU VAT calculation (FR + key + SIREN) - ✅ Chorus Pro ID retrieval for electronic invoicing - ✅ Net/VAT/Gross totals calculation - ✅ Date generation (today + 30-day due date) - ✅ Multi-rate VAT handling **Supported identifiers**: - SIRET (14 digits): Specific establishment ⭐ Recommended - SIREN (9 digits): Company (auto-selection of headquarters) - Special types: UE_HORS_FRANCE, RIDET, TAHITI, etc. ## Checks performed during generation ### 1. Data validation (Pydantic) - Data types (amounts as Decimal, ISO 8601 dates) - Formats (14-digit SIRET, 9-digit SIREN, IBAN) - Required fields per profile - Amount consistency (Net + VAT = Gross) ### 2. CII-compliant XML generation - Serialization according to Cross Industry Invoice XSD schema - Correct UN/CEFACT namespaces - Hierarchical structure respected - UTF-8 encoding without BOM ### 3. Schematron validation - Business rules for selected profile (MINIMUM, BASIC, EN16931, EXTENDED) - Element cardinality (required, optional, repeatable) - Calculation rules (totals, VAT, discounts) - European EN 16931 compliance ### 4. PDF/A-3 conversion (if output_format='pdf') - Source PDF conversion to PDF/A-3 via Ghostscript - Factur-X XML embedding in PDF - Compliant XMP metadata - ICC sRGB color profile - Removal of forbidden elements (JavaScript, forms) ## How it works 1. **Submission**: Invoice is queued in Celery for asynchronous processing 2. **Immediate return**: You receive a `task_id` (HTTP 202 Accepted) 3. **Tracking**: Use the `/tasks/{task_id}/status` endpoint to track progress ## Webhook notification (recommended) Instead of polling, you can receive a webhook notification when the task completes: ``` callback_url=https://your-server.com/webhook ``` The webhook will POST a JSON payload with: - `event_type`: `generation.completed` or `generation.failed` - `data.task_id`: The Celery task ID - `data.content_b64` or `data.xml_content`: The generated content - `X-Webhook-Signature` header for HMAC verification See `/docs/WEBHOOKS.md` for full documentation. ## Output formats - **xml**: Generates only Factur-X XML (recommended for testing) - **pdf**: Generates PDF/A-3 with embedded XML (requires `source_pdf`) ## Factur-X profiles - **MINIMUM**: Minimal data (simplified invoice) - **BASIC**: Basic information (SMEs) - **EN16931**: European standard (recommended, compliant with directive 2014/55/EU) - **EXTENDED**: All available data (large accounts) ## What you get After successful processing (status `completed`): - **XML only**: Base64-encoded Factur-X compliant XML file - **PDF/A-3**: PDF with embedded XML, ready for sending/archiving - **Metadata**: Profile, Factur-X version, file size - **Validation**: Schematron compliance confirmation ## Validation Data is automatically validated according to detected format. On error, a 422 status is returned with invalid field details.
24
- # @param invoice_data [String] Invoice data in JSON format. Two formats accepted: 1. **Classic format**: Complete FacturXInvoice structure (all fields) 2. **Simplified format** (🆕 P0.1): Minimal structure with auto-enrichment Format is detected automatically!
25
- # @param [Hash] opts the optional parameters
26
- # @option opts [APIProfile] :profile Factur-X profile: MINIMUM, BASIC, EN16931 or EXTENDED.
27
- # @option opts [OutputFormat] :output_format Output format: 'xml' (XML only) or 'pdf' (Factur-X PDF with embedded XML).
28
- # @option opts [Boolean] :auto_enrich 🆕 Enable auto-enrichment from SIRET/SIREN (simplified format only) (default to true)
29
- # @option opts [File] :source_pdf
30
- # @option opts [String] :callback_url
31
- # @option opts [String] :webhook_mode Webhook content delivery: 'inline' (base64 in payload) or 'download_url' (temporary URL, 1h TTL) (default to 'inline')
32
- # @option opts [Boolean] :skip_br_fr
33
- # @return [TaskResponse]
34
- def generate_invoice_api_v1_processing_generate_invoice_post(invoice_data, opts = {})
35
- data, _status_code, _headers = generate_invoice_api_v1_processing_generate_invoice_post_with_http_info(invoice_data, opts)
36
- data
37
- end
38
-
39
- # Generate a Factur-X invoice
40
- # Generates an electronic invoice in Factur-X format compliant with European standards. ## Applied Standards - **Factur-X** (France): FNFE-MPE standard (Forum National de la Facture Électronique) - **ZUGFeRD** (Germany): German format compatible with Factur-X - **EN 16931**: European semantic standard for electronic invoicing - **ISO 19005-3** (PDF/A-3): Long-term electronic archiving - **Cross Industry Invoice (CII)**: UN/CEFACT XML syntax ## 🆕 New: Simplified format with auto-enrichment (P0.1) You can now create an invoice by providing only: - An invoice number - A supplier SIRET + **IBAN** (required) - A recipient SIRET - Invoice lines (description, quantity, net price) **Simplified format example**: ```json { \"number\": \"FACT-2025-001\", \"supplier\": { \"siret\": \"92019522900017\", \"iban\": \"FR7630001007941234567890185\" }, \"recipient\": {\"siret\": \"35600000000048\"}, \"lines\": [ {\"description\": \"Service\", \"quantity\": 10, \"unitPrice\": 100.00, \"vatRate\": 20.0} ] } ``` **⚠️ Required fields (simplified format)**: - `number`: Unique invoice number - `supplier.siret`: Supplier's SIRET (14 digits) - `supplier.iban`: Bank account IBAN (no public API to retrieve it) - `recipient.siret`: Recipient's SIRET - `lines[]`: At least one invoice line **What happens automatically with `auto_enrich=True`**: - ✅ Name enrichment from Chorus Pro API - ✅ Address enrichment from Business Search API (free, public) - ✅ Automatic intra-EU VAT calculation (FR + key + SIREN) - ✅ Chorus Pro ID retrieval for electronic invoicing - ✅ Net/VAT/Gross totals calculation - ✅ Date generation (today + 30-day due date) - ✅ Multi-rate VAT handling **Supported identifiers**: - SIRET (14 digits): Specific establishment ⭐ Recommended - SIREN (9 digits): Company (auto-selection of headquarters) - Special types: UE_HORS_FRANCE, RIDET, TAHITI, etc. ## Checks performed during generation ### 1. Data validation (Pydantic) - Data types (amounts as Decimal, ISO 8601 dates) - Formats (14-digit SIRET, 9-digit SIREN, IBAN) - Required fields per profile - Amount consistency (Net + VAT = Gross) ### 2. CII-compliant XML generation - Serialization according to Cross Industry Invoice XSD schema - Correct UN/CEFACT namespaces - Hierarchical structure respected - UTF-8 encoding without BOM ### 3. Schematron validation - Business rules for selected profile (MINIMUM, BASIC, EN16931, EXTENDED) - Element cardinality (required, optional, repeatable) - Calculation rules (totals, VAT, discounts) - European EN 16931 compliance ### 4. PDF/A-3 conversion (if output_format='pdf') - Source PDF conversion to PDF/A-3 via Ghostscript - Factur-X XML embedding in PDF - Compliant XMP metadata - ICC sRGB color profile - Removal of forbidden elements (JavaScript, forms) ## How it works 1. **Submission**: Invoice is queued in Celery for asynchronous processing 2. **Immediate return**: You receive a `task_id` (HTTP 202 Accepted) 3. **Tracking**: Use the `/tasks/{task_id}/status` endpoint to track progress ## Webhook notification (recommended) Instead of polling, you can receive a webhook notification when the task completes: ``` callback_url=https://your-server.com/webhook ``` The webhook will POST a JSON payload with: - `event_type`: `generation.completed` or `generation.failed` - `data.task_id`: The Celery task ID - `data.content_b64` or `data.xml_content`: The generated content - `X-Webhook-Signature` header for HMAC verification See `/docs/WEBHOOKS.md` for full documentation. ## Output formats - **xml**: Generates only Factur-X XML (recommended for testing) - **pdf**: Generates PDF/A-3 with embedded XML (requires `source_pdf`) ## Factur-X profiles - **MINIMUM**: Minimal data (simplified invoice) - **BASIC**: Basic information (SMEs) - **EN16931**: European standard (recommended, compliant with directive 2014/55/EU) - **EXTENDED**: All available data (large accounts) ## What you get After successful processing (status `completed`): - **XML only**: Base64-encoded Factur-X compliant XML file - **PDF/A-3**: PDF with embedded XML, ready for sending/archiving - **Metadata**: Profile, Factur-X version, file size - **Validation**: Schematron compliance confirmation ## Validation Data is automatically validated according to detected format. On error, a 422 status is returned with invalid field details.
41
- # @param invoice_data [String] Invoice data in JSON format. Two formats accepted: 1. **Classic format**: Complete FacturXInvoice structure (all fields) 2. **Simplified format** (🆕 P0.1): Minimal structure with auto-enrichment Format is detected automatically!
42
- # @param [Hash] opts the optional parameters
43
- # @option opts [APIProfile] :profile Factur-X profile: MINIMUM, BASIC, EN16931 or EXTENDED.
44
- # @option opts [OutputFormat] :output_format Output format: 'xml' (XML only) or 'pdf' (Factur-X PDF with embedded XML).
45
- # @option opts [Boolean] :auto_enrich 🆕 Enable auto-enrichment from SIRET/SIREN (simplified format only) (default to true)
46
- # @option opts [File] :source_pdf
47
- # @option opts [String] :callback_url
48
- # @option opts [String] :webhook_mode Webhook content delivery: 'inline' (base64 in payload) or 'download_url' (temporary URL, 1h TTL) (default to 'inline')
49
- # @option opts [Boolean] :skip_br_fr
50
- # @return [Array<(TaskResponse, Integer, Hash)>] TaskResponse data, response status code and response headers
51
- def generate_invoice_api_v1_processing_generate_invoice_post_with_http_info(invoice_data, opts = {})
52
- if @api_client.config.debugging
53
- @api_client.config.logger.debug 'Calling API: InvoiceProcessingApi.generate_invoice_api_v1_processing_generate_invoice_post ...'
54
- end
55
- # verify the required parameter 'invoice_data' is set
56
- if @api_client.config.client_side_validation && invoice_data.nil?
57
- fail ArgumentError, "Missing the required parameter 'invoice_data' when calling InvoiceProcessingApi.generate_invoice_api_v1_processing_generate_invoice_post"
58
- end
59
- # resource path
60
- local_var_path = '/api/v1/processing/generate-invoice'
61
-
62
- # query parameters
63
- query_params = opts[:query_params] || {}
64
-
65
- # header parameters
66
- header_params = opts[:header_params] || {}
67
- # HTTP header 'Accept' (if needed)
68
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
69
- # HTTP header 'Content-Type'
70
- content_type = @api_client.select_header_content_type(['multipart/form-data'])
71
- if !content_type.nil?
72
- header_params['Content-Type'] = content_type
73
- end
74
-
75
- # form parameters
76
- form_params = opts[:form_params] || {}
77
- form_params['invoice_data'] = invoice_data
78
- form_params['profile'] = opts[:'profile'] if !opts[:'profile'].nil?
79
- form_params['output_format'] = opts[:'output_format'] if !opts[:'output_format'].nil?
80
- form_params['auto_enrich'] = opts[:'auto_enrich'] if !opts[:'auto_enrich'].nil?
81
- form_params['source_pdf'] = opts[:'source_pdf'] if !opts[:'source_pdf'].nil?
82
- form_params['callback_url'] = opts[:'callback_url'] if !opts[:'callback_url'].nil?
83
- form_params['webhook_mode'] = opts[:'webhook_mode'] if !opts[:'webhook_mode'].nil?
84
- form_params['skip_br_fr'] = opts[:'skip_br_fr'] if !opts[:'skip_br_fr'].nil?
85
-
86
- # http body (model)
87
- post_body = opts[:debug_body]
88
-
89
- # return_type
90
- return_type = opts[:debug_return_type] || 'TaskResponse'
91
-
92
- # auth_names
93
- auth_names = opts[:debug_auth_names] || ['HTTPBearer']
94
-
95
- new_options = opts.merge(
96
- :operation => :"InvoiceProcessingApi.generate_invoice_api_v1_processing_generate_invoice_post",
97
- :header_params => header_params,
98
- :query_params => query_params,
99
- :form_params => form_params,
100
- :body => post_body,
101
- :auth_names => auth_names,
102
- :return_type => return_type
103
- )
104
-
105
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
106
- if @api_client.config.debugging
107
- @api_client.config.logger.debug "API called: InvoiceProcessingApi#generate_invoice_api_v1_processing_generate_invoice_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
108
- end
109
- return data, status_code, headers
110
- end
111
-
112
- # Generate a self-signed X.509 test certificate
113
- # Generates a self-signed X.509 certificate for PDF electronic signature testing. **⚠️ WARNING: TEST certificate only!** This certificate is: - ✅ Suitable for testing and development - ✅ Compatible with PDF signing (PAdES) - ✅ Compliant with eIDAS **SES** level (Simple Electronic Signature) - ❌ **NEVER usable in production** - ❌ **Not recognized** by browsers and PDF readers - ❌ **No legal value** ## eIDAS levels - **SES** (Simple): Self-signed certificate ← Generated by this endpoint - **AdES** (Advanced): Commercial CA certificate (Let's Encrypt, etc.) - **QES** (Qualified): Qualified certificate from QTSP (CertEurope, Universign, etc.) ## Usage Once generated, the certificate can be: 1. **Saved in Django** (recommended): - Django Admin > Signing Certificates - Upload `certificate_pem` and `private_key_pem` 2. **Used directly**: - Sign a PDF with `/sign-pdf` - The certificate will be automatically used ## Example call ```bash curl -X POST \"https://factpulse.fr/api/v1/processing/generate-test-certificate\" \\ -H \"Authorization: Bearer eyJ0eXAi...\" \\ -H \"Content-Type: application/json\" \\ -d '{ \"cn\": \"Test Client XYZ\", \"organization\": \"Client XYZ Ltd\", \"email\": \"contact@xyz.com\", \"validity_days\": 365 }' ``` ## Use cases - PDF signature testing in development - Electronic signature POC - Training and demos - Automated integration tests ## Technical compliance Certificate generated with: - RSA key 2048 or 4096 bits - SHA-256 algorithm - Key Usage extensions: `digitalSignature`, `contentCommitment` (non-repudiation) - Extended Key Usage extensions: `codeSigning`, `emailProtection` - Validity: 1 day to 10 years (configurable) - Format: PEM (certificate and key) - Optional: PKCS#12 (.p12)
114
- # @param generate_certificate_request [GenerateCertificateRequest]
115
- # @param [Hash] opts the optional parameters
116
- # @return [GenerateCertificateResponse]
117
- def generate_test_certificate_api_v1_processing_generate_test_certificate_post(generate_certificate_request, opts = {})
118
- data, _status_code, _headers = generate_test_certificate_api_v1_processing_generate_test_certificate_post_with_http_info(generate_certificate_request, opts)
119
- data
120
- end
121
-
122
- # Generate a self-signed X.509 test certificate
123
- # Generates a self-signed X.509 certificate for PDF electronic signature testing. **⚠️ WARNING: TEST certificate only!** This certificate is: - ✅ Suitable for testing and development - ✅ Compatible with PDF signing (PAdES) - ✅ Compliant with eIDAS **SES** level (Simple Electronic Signature) - ❌ **NEVER usable in production** - ❌ **Not recognized** by browsers and PDF readers - ❌ **No legal value** ## eIDAS levels - **SES** (Simple): Self-signed certificate ← Generated by this endpoint - **AdES** (Advanced): Commercial CA certificate (Let&#39;s Encrypt, etc.) - **QES** (Qualified): Qualified certificate from QTSP (CertEurope, Universign, etc.) ## Usage Once generated, the certificate can be: 1. **Saved in Django** (recommended): - Django Admin &gt; Signing Certificates - Upload &#x60;certificate_pem&#x60; and &#x60;private_key_pem&#x60; 2. **Used directly**: - Sign a PDF with &#x60;/sign-pdf&#x60; - The certificate will be automatically used ## Example call &#x60;&#x60;&#x60;bash curl -X POST \&quot;https://factpulse.fr/api/v1/processing/generate-test-certificate\&quot; \\ -H \&quot;Authorization: Bearer eyJ0eXAi...\&quot; \\ -H \&quot;Content-Type: application/json\&quot; \\ -d &#39;{ \&quot;cn\&quot;: \&quot;Test Client XYZ\&quot;, \&quot;organization\&quot;: \&quot;Client XYZ Ltd\&quot;, \&quot;email\&quot;: \&quot;contact@xyz.com\&quot;, \&quot;validity_days\&quot;: 365 }&#39; &#x60;&#x60;&#x60; ## Use cases - PDF signature testing in development - Electronic signature POC - Training and demos - Automated integration tests ## Technical compliance Certificate generated with: - RSA key 2048 or 4096 bits - SHA-256 algorithm - Key Usage extensions: &#x60;digitalSignature&#x60;, &#x60;contentCommitment&#x60; (non-repudiation) - Extended Key Usage extensions: &#x60;codeSigning&#x60;, &#x60;emailProtection&#x60; - Validity: 1 day to 10 years (configurable) - Format: PEM (certificate and key) - Optional: PKCS#12 (.p12)
124
- # @param generate_certificate_request [GenerateCertificateRequest]
125
- # @param [Hash] opts the optional parameters
126
- # @return [Array<(GenerateCertificateResponse, Integer, Hash)>] GenerateCertificateResponse data, response status code and response headers
127
- def generate_test_certificate_api_v1_processing_generate_test_certificate_post_with_http_info(generate_certificate_request, opts = {})
128
- if @api_client.config.debugging
129
- @api_client.config.logger.debug 'Calling API: InvoiceProcessingApi.generate_test_certificate_api_v1_processing_generate_test_certificate_post ...'
130
- end
131
- # verify the required parameter 'generate_certificate_request' is set
132
- if @api_client.config.client_side_validation && generate_certificate_request.nil?
133
- fail ArgumentError, "Missing the required parameter 'generate_certificate_request' when calling InvoiceProcessingApi.generate_test_certificate_api_v1_processing_generate_test_certificate_post"
134
- end
135
- # resource path
136
- local_var_path = '/api/v1/processing/generate-test-certificate'
137
-
138
- # query parameters
139
- query_params = opts[:query_params] || {}
140
-
141
- # header parameters
142
- header_params = opts[:header_params] || {}
143
- # HTTP header 'Accept' (if needed)
144
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
145
- # HTTP header 'Content-Type'
146
- content_type = @api_client.select_header_content_type(['application/json'])
147
- if !content_type.nil?
148
- header_params['Content-Type'] = content_type
149
- end
150
-
151
- # form parameters
152
- form_params = opts[:form_params] || {}
153
-
154
- # http body (model)
155
- post_body = opts[:debug_body] || @api_client.object_to_http_body(generate_certificate_request)
156
-
157
- # return_type
158
- return_type = opts[:debug_return_type] || 'GenerateCertificateResponse'
159
-
160
- # auth_names
161
- auth_names = opts[:debug_auth_names] || ['HTTPBearer']
162
-
163
- new_options = opts.merge(
164
- :operation => :"InvoiceProcessingApi.generate_test_certificate_api_v1_processing_generate_test_certificate_post",
165
- :header_params => header_params,
166
- :query_params => query_params,
167
- :form_params => form_params,
168
- :body => post_body,
169
- :auth_names => auth_names,
170
- :return_type => return_type
171
- )
172
-
173
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
174
- if @api_client.config.debugging
175
- @api_client.config.logger.debug "API called: InvoiceProcessingApi#generate_test_certificate_api_v1_processing_generate_test_certificate_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
176
- end
177
- return data, status_code, headers
178
- end
179
-
180
- # Get task generation status
181
- # Retrieves the progress status of an invoice generation task. ## Possible states The `status` field uses the `CeleryStatus` enum with values: - **PENDING, STARTED, SUCCESS, FAILURE, RETRY** See the `CeleryStatus` schema documentation for details. ## Business result When `status=\"SUCCESS\"`, the `result` field contains: - `status`: \"SUCCESS\" or \"ERROR\" (business result) - `content_b64`: Base64 encoded content (if success) - `errorCode`, `errorMessage`, `details`: AFNOR format (if business error) ## Usage Poll this endpoint every 2-3 seconds until `status` is `SUCCESS` or `FAILURE`.
182
- # @param task_id [String] Celery task ID returned by async endpoints (UUID format)
183
- # @param [Hash] opts the optional parameters
184
- # @return [AsyncTaskStatus]
185
- def get_task_status_api_v1_processing_tasks_task_id_status_get(task_id, opts = {})
186
- data, _status_code, _headers = get_task_status_api_v1_processing_tasks_task_id_status_get_with_http_info(task_id, opts)
187
- data
188
- end
189
-
190
- # Get task generation status
191
- # Retrieves the progress status of an invoice generation task. ## Possible states The &#x60;status&#x60; field uses the &#x60;CeleryStatus&#x60; enum with values: - **PENDING, STARTED, SUCCESS, FAILURE, RETRY** See the &#x60;CeleryStatus&#x60; schema documentation for details. ## Business result When &#x60;status&#x3D;\&quot;SUCCESS\&quot;&#x60;, the &#x60;result&#x60; field contains: - &#x60;status&#x60;: \&quot;SUCCESS\&quot; or \&quot;ERROR\&quot; (business result) - &#x60;content_b64&#x60;: Base64 encoded content (if success) - &#x60;errorCode&#x60;, &#x60;errorMessage&#x60;, &#x60;details&#x60;: AFNOR format (if business error) ## Usage Poll this endpoint every 2-3 seconds until &#x60;status&#x60; is &#x60;SUCCESS&#x60; or &#x60;FAILURE&#x60;.
192
- # @param task_id [String] Celery task ID returned by async endpoints (UUID format)
193
- # @param [Hash] opts the optional parameters
194
- # @return [Array<(AsyncTaskStatus, Integer, Hash)>] AsyncTaskStatus data, response status code and response headers
195
- def get_task_status_api_v1_processing_tasks_task_id_status_get_with_http_info(task_id, opts = {})
196
- if @api_client.config.debugging
197
- @api_client.config.logger.debug 'Calling API: InvoiceProcessingApi.get_task_status_api_v1_processing_tasks_task_id_status_get ...'
198
- end
199
- # verify the required parameter 'task_id' is set
200
- if @api_client.config.client_side_validation && task_id.nil?
201
- fail ArgumentError, "Missing the required parameter 'task_id' when calling InvoiceProcessingApi.get_task_status_api_v1_processing_tasks_task_id_status_get"
202
- end
203
- # resource path
204
- local_var_path = '/api/v1/processing/tasks/{task_id}/status'.sub('{' + 'task_id' + '}', CGI.escape(task_id.to_s))
205
-
206
- # query parameters
207
- query_params = opts[:query_params] || {}
208
-
209
- # header parameters
210
- header_params = opts[:header_params] || {}
211
- # HTTP header 'Accept' (if needed)
212
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
213
-
214
- # form parameters
215
- form_params = opts[:form_params] || {}
216
-
217
- # http body (model)
218
- post_body = opts[:debug_body]
219
-
220
- # return_type
221
- return_type = opts[:debug_return_type] || 'AsyncTaskStatus'
222
-
223
- # auth_names
224
- auth_names = opts[:debug_auth_names] || ['HTTPBearer']
225
-
226
- new_options = opts.merge(
227
- :operation => :"InvoiceProcessingApi.get_task_status_api_v1_processing_tasks_task_id_status_get",
228
- :header_params => header_params,
229
- :query_params => query_params,
230
- :form_params => form_params,
231
- :body => post_body,
232
- :auth_names => auth_names,
233
- :return_type => return_type
234
- )
235
-
236
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
237
- if @api_client.config.debugging
238
- @api_client.config.logger.debug "API called: InvoiceProcessingApi#get_task_status_api_v1_processing_tasks_task_id_status_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
239
- end
240
- return data, status_code, headers
241
- end
242
-
243
- # Sign a PDF with client's certificate (PAdES-B-LT)
244
- # Signs an uploaded PDF with the electronic certificate configured for the client (via client_uid from JWT). **Supported standards**: PAdES-B-B, PAdES-B-T (timestamping), PAdES-B-LT (long-term archiving). **eIDAS levels**: SES (self-signed), AdES (commercial CA), QES (PSCO - out of scope). **Security**: Double authentication X-Internal-Secret + JWT Bearer to retrieve the certificate. **⚠️ Legal disclaimer**: Generated signatures are electronic seals as defined by the eIDAS regulation. The level of legal validity depends on the certificate used (SES/AdES/QES). FactPulse does not provide QES qualified certificates - you must obtain a certificate from a PSCO (qualified Trust Service Provider) for maximum legal validity.
245
- # @param pdf_file [File] PDF file to sign (will be processed and returned signed in base64)
246
- # @param [Hash] opts the optional parameters
247
- # @option opts [String] :reason
248
- # @option opts [String] :location
249
- # @option opts [String] :contact
250
- # @option opts [String] :field_name PDF signature field name (default to 'FactPulseSignature')
251
- # @option opts [Boolean] :use_pades_lt Enable PAdES-B-LT (long-term archiving with embedded validation data). REQUIRES a certificate with OCSP/CRL access. (default to false)
252
- # @option opts [Boolean] :use_timestamp Enable RFC 3161 timestamping with FreeTSA (PAdES-B-T) (default to true)
253
- # @return [Object]
254
- def sign_pdf_api_v1_processing_sign_pdf_post(pdf_file, opts = {})
255
- data, _status_code, _headers = sign_pdf_api_v1_processing_sign_pdf_post_with_http_info(pdf_file, opts)
256
- data
257
- end
258
-
259
- # Sign a PDF with client&#39;s certificate (PAdES-B-LT)
260
- # Signs an uploaded PDF with the electronic certificate configured for the client (via client_uid from JWT). **Supported standards**: PAdES-B-B, PAdES-B-T (timestamping), PAdES-B-LT (long-term archiving). **eIDAS levels**: SES (self-signed), AdES (commercial CA), QES (PSCO - out of scope). **Security**: Double authentication X-Internal-Secret + JWT Bearer to retrieve the certificate. **⚠️ Legal disclaimer**: Generated signatures are electronic seals as defined by the eIDAS regulation. The level of legal validity depends on the certificate used (SES/AdES/QES). FactPulse does not provide QES qualified certificates - you must obtain a certificate from a PSCO (qualified Trust Service Provider) for maximum legal validity.
261
- # @param pdf_file [File] PDF file to sign (will be processed and returned signed in base64)
262
- # @param [Hash] opts the optional parameters
263
- # @option opts [String] :reason
264
- # @option opts [String] :location
265
- # @option opts [String] :contact
266
- # @option opts [String] :field_name PDF signature field name (default to 'FactPulseSignature')
267
- # @option opts [Boolean] :use_pades_lt Enable PAdES-B-LT (long-term archiving with embedded validation data). REQUIRES a certificate with OCSP/CRL access. (default to false)
268
- # @option opts [Boolean] :use_timestamp Enable RFC 3161 timestamping with FreeTSA (PAdES-B-T) (default to true)
269
- # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
270
- def sign_pdf_api_v1_processing_sign_pdf_post_with_http_info(pdf_file, opts = {})
271
- if @api_client.config.debugging
272
- @api_client.config.logger.debug 'Calling API: InvoiceProcessingApi.sign_pdf_api_v1_processing_sign_pdf_post ...'
273
- end
274
- # verify the required parameter 'pdf_file' is set
275
- if @api_client.config.client_side_validation && pdf_file.nil?
276
- fail ArgumentError, "Missing the required parameter 'pdf_file' when calling InvoiceProcessingApi.sign_pdf_api_v1_processing_sign_pdf_post"
277
- end
278
- # resource path
279
- local_var_path = '/api/v1/processing/sign-pdf'
280
-
281
- # query parameters
282
- query_params = opts[:query_params] || {}
283
-
284
- # header parameters
285
- header_params = opts[:header_params] || {}
286
- # HTTP header 'Accept' (if needed)
287
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
288
- # HTTP header 'Content-Type'
289
- content_type = @api_client.select_header_content_type(['multipart/form-data'])
290
- if !content_type.nil?
291
- header_params['Content-Type'] = content_type
292
- end
293
-
294
- # form parameters
295
- form_params = opts[:form_params] || {}
296
- form_params['pdf_file'] = pdf_file
297
- form_params['reason'] = opts[:'reason'] if !opts[:'reason'].nil?
298
- form_params['location'] = opts[:'location'] if !opts[:'location'].nil?
299
- form_params['contact'] = opts[:'contact'] if !opts[:'contact'].nil?
300
- form_params['field_name'] = opts[:'field_name'] if !opts[:'field_name'].nil?
301
- form_params['use_pades_lt'] = opts[:'use_pades_lt'] if !opts[:'use_pades_lt'].nil?
302
- form_params['use_timestamp'] = opts[:'use_timestamp'] if !opts[:'use_timestamp'].nil?
303
-
304
- # http body (model)
305
- post_body = opts[:debug_body]
306
-
307
- # return_type
308
- return_type = opts[:debug_return_type] || 'Object'
309
-
310
- # auth_names
311
- auth_names = opts[:debug_auth_names] || ['HTTPBearer']
312
-
313
- new_options = opts.merge(
314
- :operation => :"InvoiceProcessingApi.sign_pdf_api_v1_processing_sign_pdf_post",
315
- :header_params => header_params,
316
- :query_params => query_params,
317
- :form_params => form_params,
318
- :body => post_body,
319
- :auth_names => auth_names,
320
- :return_type => return_type
321
- )
322
-
323
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
324
- if @api_client.config.debugging
325
- @api_client.config.logger.debug "API called: InvoiceProcessingApi#sign_pdf_api_v1_processing_sign_pdf_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
326
- end
327
- return data, status_code, headers
328
- end
329
-
330
- # Sign a PDF asynchronously (Celery)
331
- # Signs an uploaded PDF asynchronously via a Celery task. **Difference with /sign-pdf**: - `/sign-pdf`: Synchronous signature (blocking until completion) - `/sign-pdf-async`: Asynchronous signature (returns immediately with task_id) **Async advantages**: - No timeout for large files - No blocking of FastAPI worker - Progress tracking via task_id - Ideal for batch processing **Supported standards**: PAdES-B-B, PAdES-B-T (timestamping), PAdES-B-LT (long-term archiving). **⚠️ Legal disclaimer**: Same as /sign-pdf (see that endpoint's documentation).
332
- # @param pdf_file [File] PDF file to sign (processed asynchronously)
333
- # @param [Hash] opts the optional parameters
334
- # @option opts [String] :callback_url
335
- # @option opts [String] :webhook_mode Webhook content delivery: &#39;inline&#39; (base64 in payload) or &#39;download_url&#39; (temporary URL, 1h TTL) (default to 'inline')
336
- # @option opts [String] :reason
337
- # @option opts [String] :location
338
- # @option opts [String] :contact
339
- # @option opts [String] :field_name PDF signature field name (default to 'FactPulseSignature')
340
- # @option opts [Boolean] :use_pades_lt Enable PAdES-B-LT (long-term archiving with embedded validation data). REQUIRES a certificate with OCSP/CRL access. (default to false)
341
- # @option opts [Boolean] :use_timestamp Enable RFC 3161 timestamping with FreeTSA (PAdES-B-T) (default to true)
342
- # @return [Object]
343
- def sign_pdf_async_api_v1_processing_sign_pdf_async_post(pdf_file, opts = {})
344
- data, _status_code, _headers = sign_pdf_async_api_v1_processing_sign_pdf_async_post_with_http_info(pdf_file, opts)
345
- data
346
- end
347
-
348
- # Sign a PDF asynchronously (Celery)
349
- # Signs an uploaded PDF asynchronously via a Celery task. **Difference with /sign-pdf**: - &#x60;/sign-pdf&#x60;: Synchronous signature (blocking until completion) - &#x60;/sign-pdf-async&#x60;: Asynchronous signature (returns immediately with task_id) **Async advantages**: - No timeout for large files - No blocking of FastAPI worker - Progress tracking via task_id - Ideal for batch processing **Supported standards**: PAdES-B-B, PAdES-B-T (timestamping), PAdES-B-LT (long-term archiving). **⚠️ Legal disclaimer**: Same as /sign-pdf (see that endpoint&#39;s documentation).
350
- # @param pdf_file [File] PDF file to sign (processed asynchronously)
351
- # @param [Hash] opts the optional parameters
352
- # @option opts [String] :callback_url
353
- # @option opts [String] :webhook_mode Webhook content delivery: &#39;inline&#39; (base64 in payload) or &#39;download_url&#39; (temporary URL, 1h TTL) (default to 'inline')
354
- # @option opts [String] :reason
355
- # @option opts [String] :location
356
- # @option opts [String] :contact
357
- # @option opts [String] :field_name PDF signature field name (default to 'FactPulseSignature')
358
- # @option opts [Boolean] :use_pades_lt Enable PAdES-B-LT (long-term archiving with embedded validation data). REQUIRES a certificate with OCSP/CRL access. (default to false)
359
- # @option opts [Boolean] :use_timestamp Enable RFC 3161 timestamping with FreeTSA (PAdES-B-T) (default to true)
360
- # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
361
- def sign_pdf_async_api_v1_processing_sign_pdf_async_post_with_http_info(pdf_file, opts = {})
362
- if @api_client.config.debugging
363
- @api_client.config.logger.debug 'Calling API: InvoiceProcessingApi.sign_pdf_async_api_v1_processing_sign_pdf_async_post ...'
364
- end
365
- # verify the required parameter 'pdf_file' is set
366
- if @api_client.config.client_side_validation && pdf_file.nil?
367
- fail ArgumentError, "Missing the required parameter 'pdf_file' when calling InvoiceProcessingApi.sign_pdf_async_api_v1_processing_sign_pdf_async_post"
368
- end
369
- # resource path
370
- local_var_path = '/api/v1/processing/sign-pdf-async'
371
-
372
- # query parameters
373
- query_params = opts[:query_params] || {}
374
-
375
- # header parameters
376
- header_params = opts[:header_params] || {}
377
- # HTTP header 'Accept' (if needed)
378
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
379
- # HTTP header 'Content-Type'
380
- content_type = @api_client.select_header_content_type(['multipart/form-data'])
381
- if !content_type.nil?
382
- header_params['Content-Type'] = content_type
383
- end
384
-
385
- # form parameters
386
- form_params = opts[:form_params] || {}
387
- form_params['pdf_file'] = pdf_file
388
- form_params['callback_url'] = opts[:'callback_url'] if !opts[:'callback_url'].nil?
389
- form_params['webhook_mode'] = opts[:'webhook_mode'] if !opts[:'webhook_mode'].nil?
390
- form_params['reason'] = opts[:'reason'] if !opts[:'reason'].nil?
391
- form_params['location'] = opts[:'location'] if !opts[:'location'].nil?
392
- form_params['contact'] = opts[:'contact'] if !opts[:'contact'].nil?
393
- form_params['field_name'] = opts[:'field_name'] if !opts[:'field_name'].nil?
394
- form_params['use_pades_lt'] = opts[:'use_pades_lt'] if !opts[:'use_pades_lt'].nil?
395
- form_params['use_timestamp'] = opts[:'use_timestamp'] if !opts[:'use_timestamp'].nil?
396
-
397
- # http body (model)
398
- post_body = opts[:debug_body]
399
-
400
- # return_type
401
- return_type = opts[:debug_return_type] || 'Object'
402
-
403
- # auth_names
404
- auth_names = opts[:debug_auth_names] || ['HTTPBearer']
405
-
406
- new_options = opts.merge(
407
- :operation => :"InvoiceProcessingApi.sign_pdf_async_api_v1_processing_sign_pdf_async_post",
408
- :header_params => header_params,
409
- :query_params => query_params,
410
- :form_params => form_params,
411
- :body => post_body,
412
- :auth_names => auth_names,
413
- :return_type => return_type
414
- )
415
-
416
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
417
- if @api_client.config.debugging
418
- @api_client.config.logger.debug "API called: InvoiceProcessingApi#sign_pdf_async_api_v1_processing_sign_pdf_async_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
419
- end
420
- return data, status_code, headers
421
- end
422
-
423
- # Submit a complete invoice (generation + signature + submission)
424
- # Unified endpoint to submit a complete invoice to different destinations. **Automated workflow:** 1. **Auto-enrichment** (optional): retrieves data via public APIs and Chorus Pro/AFNOR 2. **Factur-X PDF generation**: creates a PDF/A-3 with embedded XML 3. **Electronic signature** (optional): signs the PDF with a certificate 4. **Submission**: sends to the chosen destination (Chorus Pro or AFNOR PDP) **Supported destinations:** - **Chorus Pro**: French B2G platform (invoices to public sector) - **AFNOR PDP**: Partner Dematerialization Platforms **Destination credentials - 2 modes available:** **Mode 1 - Retrieval via JWT (recommended):** - Credentials are retrieved automatically via the JWT `client_uid` - Do not provide the `credentials` field in `destination` - Zero-trust architecture: no secrets in the payload - Example: `\"destination\": {\"type\": \"chorus_pro\"}` **Mode 2 - Credentials in the payload:** - Provide credentials directly in the payload - Useful for tests or third-party integrations - Example: `\"destination\": {\"type\": \"chorus_pro\", \"credentials\": {...}}` **Electronic signature (optional) - 2 modes available:** **Mode 1 - Stored certificate (recommended):** - Certificate is retrieved automatically via the JWT `client_uid` - No key to provide in the payload - PAdES-B-LT signature with timestamp (eIDAS compliant) - Example: `\"signature\": {\"reason\": \"Factur-X compliance\"}` **Mode 2 - Keys in the payload (for tests):** - Provide `key_pem` and `cert_pem` directly - PEM format accepted: raw or base64 - Useful for tests or special cases without stored certificate - Example: `\"signature\": {\"key_pem\": \"-----BEGIN...\", \"cert_pem\": \"-----BEGIN...\"}` If `key_pem` and `cert_pem` are provided → Mode 2 Otherwise → Mode 1 (certificate retrieved via `client_uid`)
425
- # @param submit_complete_invoice_request [SubmitCompleteInvoiceRequest]
426
- # @param [Hash] opts the optional parameters
427
- # @return [SubmitCompleteInvoiceResponse]
428
- def submit_complete_invoice_api_v1_processing_invoices_submit_complete_post(submit_complete_invoice_request, opts = {})
429
- data, _status_code, _headers = submit_complete_invoice_api_v1_processing_invoices_submit_complete_post_with_http_info(submit_complete_invoice_request, opts)
430
- data
431
- end
432
-
433
- # Submit a complete invoice (generation + signature + submission)
434
- # Unified endpoint to submit a complete invoice to different destinations. **Automated workflow:** 1. **Auto-enrichment** (optional): retrieves data via public APIs and Chorus Pro/AFNOR 2. **Factur-X PDF generation**: creates a PDF/A-3 with embedded XML 3. **Electronic signature** (optional): signs the PDF with a certificate 4. **Submission**: sends to the chosen destination (Chorus Pro or AFNOR PDP) **Supported destinations:** - **Chorus Pro**: French B2G platform (invoices to public sector) - **AFNOR PDP**: Partner Dematerialization Platforms **Destination credentials - 2 modes available:** **Mode 1 - Retrieval via JWT (recommended):** - Credentials are retrieved automatically via the JWT &#x60;client_uid&#x60; - Do not provide the &#x60;credentials&#x60; field in &#x60;destination&#x60; - Zero-trust architecture: no secrets in the payload - Example: &#x60;\&quot;destination\&quot;: {\&quot;type\&quot;: \&quot;chorus_pro\&quot;}&#x60; **Mode 2 - Credentials in the payload:** - Provide credentials directly in the payload - Useful for tests or third-party integrations - Example: &#x60;\&quot;destination\&quot;: {\&quot;type\&quot;: \&quot;chorus_pro\&quot;, \&quot;credentials\&quot;: {...}}&#x60; **Electronic signature (optional) - 2 modes available:** **Mode 1 - Stored certificate (recommended):** - Certificate is retrieved automatically via the JWT &#x60;client_uid&#x60; - No key to provide in the payload - PAdES-B-LT signature with timestamp (eIDAS compliant) - Example: &#x60;\&quot;signature\&quot;: {\&quot;reason\&quot;: \&quot;Factur-X compliance\&quot;}&#x60; **Mode 2 - Keys in the payload (for tests):** - Provide &#x60;key_pem&#x60; and &#x60;cert_pem&#x60; directly - PEM format accepted: raw or base64 - Useful for tests or special cases without stored certificate - Example: &#x60;\&quot;signature\&quot;: {\&quot;key_pem\&quot;: \&quot;-----BEGIN...\&quot;, \&quot;cert_pem\&quot;: \&quot;-----BEGIN...\&quot;}&#x60; If &#x60;key_pem&#x60; and &#x60;cert_pem&#x60; are provided → Mode 2 Otherwise → Mode 1 (certificate retrieved via &#x60;client_uid&#x60;)
435
- # @param submit_complete_invoice_request [SubmitCompleteInvoiceRequest]
436
- # @param [Hash] opts the optional parameters
437
- # @return [Array<(SubmitCompleteInvoiceResponse, Integer, Hash)>] SubmitCompleteInvoiceResponse data, response status code and response headers
438
- def submit_complete_invoice_api_v1_processing_invoices_submit_complete_post_with_http_info(submit_complete_invoice_request, opts = {})
439
- if @api_client.config.debugging
440
- @api_client.config.logger.debug 'Calling API: InvoiceProcessingApi.submit_complete_invoice_api_v1_processing_invoices_submit_complete_post ...'
441
- end
442
- # verify the required parameter 'submit_complete_invoice_request' is set
443
- if @api_client.config.client_side_validation && submit_complete_invoice_request.nil?
444
- fail ArgumentError, "Missing the required parameter 'submit_complete_invoice_request' when calling InvoiceProcessingApi.submit_complete_invoice_api_v1_processing_invoices_submit_complete_post"
445
- end
446
- # resource path
447
- local_var_path = '/api/v1/processing/invoices/submit-complete'
448
-
449
- # query parameters
450
- query_params = opts[:query_params] || {}
451
-
452
- # header parameters
453
- header_params = opts[:header_params] || {}
454
- # HTTP header 'Accept' (if needed)
455
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
456
- # HTTP header 'Content-Type'
457
- content_type = @api_client.select_header_content_type(['application/json'])
458
- if !content_type.nil?
459
- header_params['Content-Type'] = content_type
460
- end
461
-
462
- # form parameters
463
- form_params = opts[:form_params] || {}
464
-
465
- # http body (model)
466
- post_body = opts[:debug_body] || @api_client.object_to_http_body(submit_complete_invoice_request)
467
-
468
- # return_type
469
- return_type = opts[:debug_return_type] || 'SubmitCompleteInvoiceResponse'
470
-
471
- # auth_names
472
- auth_names = opts[:debug_auth_names] || ['HTTPBearer']
473
-
474
- new_options = opts.merge(
475
- :operation => :"InvoiceProcessingApi.submit_complete_invoice_api_v1_processing_invoices_submit_complete_post",
476
- :header_params => header_params,
477
- :query_params => query_params,
478
- :form_params => form_params,
479
- :body => post_body,
480
- :auth_names => auth_names,
481
- :return_type => return_type
482
- )
483
-
484
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
485
- if @api_client.config.debugging
486
- @api_client.config.logger.debug "API called: InvoiceProcessingApi#submit_complete_invoice_api_v1_processing_invoices_submit_complete_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
487
- end
488
- return data, status_code, headers
489
- end
490
-
491
- # Submit a complete invoice (asynchronous with Celery)
492
- # Asynchronous version of the `/invoices/submit-complete` endpoint using Celery for background processing. **Automated workflow (same as synchronous version):** 1. **Auto-enrichment** (optional): retrieves data via public APIs and Chorus Pro/AFNOR 2. **Factur-X PDF generation**: creates a PDF/A-3 with embedded XML 3. **Electronic signature** (optional): signs the PDF with a certificate 4. **Submission**: sends to the chosen destination (Chorus Pro or AFNOR PDP) **Supported destinations:** - **Chorus Pro**: French B2G platform (invoices to public sector) - **AFNOR PDP**: Partner Dematerialization Platforms **Differences with synchronous version:** - ✅ **Non-blocking**: Returns immediately with a `task_id` (HTTP 202 Accepted) - ✅ **Background processing**: Invoice is processed by a Celery worker - ✅ **Progress tracking**: Use `/tasks/{task_id}/status` to track status - ✅ **Ideal for high volumes**: Allows processing many invoices in parallel **How to use:** 1. **Submission**: Call this endpoint with your invoice data 2. **Immediate return**: You receive a `task_id` (e.g., \"abc123-def456\") 3. **Tracking**: Call `/tasks/{task_id}/status` to check progress 4. **Result**: When `status = \"SUCCESS\"`, the `result` field contains the complete response **Webhook notification (recommended):** Instead of polling, add `?callback_url=https://your-server.com/webhook` to receive automatic notification: - `event_type`: `submission.completed`, `submission.failed`, or `submission.partial` - `data.submission_result`: Complete submission result - `X-Webhook-Signature` header for HMAC verification **Credentials and signature**: Same modes as the synchronous version (JWT or payload).
493
- # @param submit_complete_invoice_request [SubmitCompleteInvoiceRequest]
494
- # @param [Hash] opts the optional parameters
495
- # @option opts [String] :callback_url Webhook URL for async notification when submission completes.
496
- # @option opts [String] :webhook_mode Webhook content delivery: &#39;inline&#39; (base64 in payload) or &#39;download_url&#39; (temporary URL, 1h TTL) (default to 'inline')
497
- # @return [TaskResponse]
498
- def submit_complete_invoice_async_api_v1_processing_invoices_submit_complete_async_post(submit_complete_invoice_request, opts = {})
499
- data, _status_code, _headers = submit_complete_invoice_async_api_v1_processing_invoices_submit_complete_async_post_with_http_info(submit_complete_invoice_request, opts)
500
- data
501
- end
502
-
503
- # Submit a complete invoice (asynchronous with Celery)
504
- # Asynchronous version of the &#x60;/invoices/submit-complete&#x60; endpoint using Celery for background processing. **Automated workflow (same as synchronous version):** 1. **Auto-enrichment** (optional): retrieves data via public APIs and Chorus Pro/AFNOR 2. **Factur-X PDF generation**: creates a PDF/A-3 with embedded XML 3. **Electronic signature** (optional): signs the PDF with a certificate 4. **Submission**: sends to the chosen destination (Chorus Pro or AFNOR PDP) **Supported destinations:** - **Chorus Pro**: French B2G platform (invoices to public sector) - **AFNOR PDP**: Partner Dematerialization Platforms **Differences with synchronous version:** - ✅ **Non-blocking**: Returns immediately with a &#x60;task_id&#x60; (HTTP 202 Accepted) - ✅ **Background processing**: Invoice is processed by a Celery worker - ✅ **Progress tracking**: Use &#x60;/tasks/{task_id}/status&#x60; to track status - ✅ **Ideal for high volumes**: Allows processing many invoices in parallel **How to use:** 1. **Submission**: Call this endpoint with your invoice data 2. **Immediate return**: You receive a &#x60;task_id&#x60; (e.g., \&quot;abc123-def456\&quot;) 3. **Tracking**: Call &#x60;/tasks/{task_id}/status&#x60; to check progress 4. **Result**: When &#x60;status &#x3D; \&quot;SUCCESS\&quot;&#x60;, the &#x60;result&#x60; field contains the complete response **Webhook notification (recommended):** Instead of polling, add &#x60;?callback_url&#x3D;https://your-server.com/webhook&#x60; to receive automatic notification: - &#x60;event_type&#x60;: &#x60;submission.completed&#x60;, &#x60;submission.failed&#x60;, or &#x60;submission.partial&#x60; - &#x60;data.submission_result&#x60;: Complete submission result - &#x60;X-Webhook-Signature&#x60; header for HMAC verification **Credentials and signature**: Same modes as the synchronous version (JWT or payload).
505
- # @param submit_complete_invoice_request [SubmitCompleteInvoiceRequest]
506
- # @param [Hash] opts the optional parameters
507
- # @option opts [String] :callback_url Webhook URL for async notification when submission completes.
508
- # @option opts [String] :webhook_mode Webhook content delivery: &#39;inline&#39; (base64 in payload) or &#39;download_url&#39; (temporary URL, 1h TTL) (default to 'inline')
509
- # @return [Array<(TaskResponse, Integer, Hash)>] TaskResponse data, response status code and response headers
510
- def submit_complete_invoice_async_api_v1_processing_invoices_submit_complete_async_post_with_http_info(submit_complete_invoice_request, opts = {})
511
- if @api_client.config.debugging
512
- @api_client.config.logger.debug 'Calling API: InvoiceProcessingApi.submit_complete_invoice_async_api_v1_processing_invoices_submit_complete_async_post ...'
513
- end
514
- # verify the required parameter 'submit_complete_invoice_request' is set
515
- if @api_client.config.client_side_validation && submit_complete_invoice_request.nil?
516
- fail ArgumentError, "Missing the required parameter 'submit_complete_invoice_request' when calling InvoiceProcessingApi.submit_complete_invoice_async_api_v1_processing_invoices_submit_complete_async_post"
517
- end
518
- # resource path
519
- local_var_path = '/api/v1/processing/invoices/submit-complete-async'
520
-
521
- # query parameters
522
- query_params = opts[:query_params] || {}
523
- query_params[:'callback_url'] = opts[:'callback_url'] if !opts[:'callback_url'].nil?
524
- query_params[:'webhook_mode'] = opts[:'webhook_mode'] if !opts[:'webhook_mode'].nil?
525
-
526
- # header parameters
527
- header_params = opts[:header_params] || {}
528
- # HTTP header 'Accept' (if needed)
529
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
530
- # HTTP header 'Content-Type'
531
- content_type = @api_client.select_header_content_type(['application/json'])
532
- if !content_type.nil?
533
- header_params['Content-Type'] = content_type
534
- end
535
-
536
- # form parameters
537
- form_params = opts[:form_params] || {}
538
-
539
- # http body (model)
540
- post_body = opts[:debug_body] || @api_client.object_to_http_body(submit_complete_invoice_request)
541
-
542
- # return_type
543
- return_type = opts[:debug_return_type] || 'TaskResponse'
544
-
545
- # auth_names
546
- auth_names = opts[:debug_auth_names] || ['HTTPBearer']
547
-
548
- new_options = opts.merge(
549
- :operation => :"InvoiceProcessingApi.submit_complete_invoice_async_api_v1_processing_invoices_submit_complete_async_post",
550
- :header_params => header_params,
551
- :query_params => query_params,
552
- :form_params => form_params,
553
- :body => post_body,
554
- :auth_names => auth_names,
555
- :return_type => return_type
556
- )
557
-
558
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
559
- if @api_client.config.debugging
560
- @api_client.config.logger.debug "API called: InvoiceProcessingApi#submit_complete_invoice_async_api_v1_processing_invoices_submit_complete_async_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
561
- end
562
- return data, status_code, headers
563
- end
564
-
565
- # Validate a complete Factur-X PDF
566
- # Validates a complete Factur-X PDF according to European and French standards. ## Applied validation standards - **EN 16931**: European semantic standard (directive 2014/55/EU) - **ISO 19005-3** (PDF/A-3): Long-term electronic archiving - **Factur-X / ZUGFeRD**: Franco-German specification - **Schematron**: XML business rules validation - **eIDAS**: European regulation on electronic identification (signatures) ## Checks performed ### 1. Factur-X XML extraction and validation **Checks performed:** - Presence of embedded XML file (`factur-x.xml` or `zugferd-invoice.xml`) - Automatic profile detection (MINIMUM, BASIC, EN16931, EXTENDED) - XML parsing with UTF-8 validation - GuidelineSpecifiedDocumentContextParameter/ID extraction **Schematron validation:** - Business rules for detected profile (MINIMUM: 45 rules, EN16931: 178 rules) - Cardinality of required elements - Calculation consistency (net, VAT, gross amounts, discounts) - Identifier formats (SIRET, intra-EU VAT, IBAN) - Standardized codes (ISO country codes, UN/ECE units, VAT codes) **What is verified:** - ✅ XML structure conforming to Cross Industry Invoice XSD - ✅ Correct UN/CEFACT namespace - ✅ European business rules (BR-xx) - ✅ French-specific rules (FR-xx) ### 2. PDF/A-3 compliance **Basic validation (metadata):** - Presence of `/Type` field set to `Catalog` - Metadata `pdfaid:part` = 3 (PDF/A-3) - Metadata `pdfaid:conformance` = B or U - PDF version >= 1.4 **Strict VeraPDF validation (if use_verapdf=True):** - 146+ ISO 19005-3 rules (PDF/A-3B) - Absence of forbidden content (JavaScript, multimedia, dynamic forms) - Correctly embedded fonts and subsets - Compliant color spaces (sRGB, DeviceGray) - Valid file structure (cross-reference table) - XMP metadata conforming to ISO 16684-1 **What is verified:** - ✅ Long-term archivable file (20+ years) - ✅ Guaranteed readability (embedded fonts) - ✅ Legal compliance (France, Germany, EU) ### 3. XMP metadata (eXtensible Metadata Platform) **Checks performed:** - Presence of `<?xpacket>` block with XMP metadata - `fx:` namespace for Factur-X: `urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#` - Required Factur-X fields: - `fx:ConformanceLevel`: Profile (MINIMUM, BASIC, EN16931, EXTENDED) - `fx:DocumentFileName`: Embedded XML name - `fx:DocumentType`: \"INVOICE\" - `fx:Version`: Factur-X version (1.0.07) **What is verified:** - ✅ Metadata conforming to ISO 16684-1 - ✅ Correct declared Factur-X profile - ✅ Supported Factur-X version ### 4. Electronic signatures **Detection and analysis:** - Presence of `/Sig` dictionaries in PDF - Signature type: PAdES (PDF Advanced Electronic Signature) - Information extraction: - Signer name (`/Name`) - Signing date (`/M`) - Signature reason (`/Reason`) - Signature location (`/Location`) - Signature type (approval, certification) **What is verified:** - ✅ Presence of signatures or seals - ✅ Number of signatures (single or multi-signature) - ℹ️ No cryptographic verification (requires certificates) ## Parameters - **pdf_file** (required): The Factur-X PDF file to validate - **profile** (optional): Expected profile. If absent, auto-detected from XML - **use_verapdf** (optional, default=false): Enable strict PDF/A validation with VeraPDF - `false`: Fast metadata validation (2-3 seconds) - `true`: Complete ISO 19005-3 validation (15-30 seconds, **recommended for production**) ## Detailed response ```json { \"isCompliant\": true, \"xml\": { \"present\": true, \"compliant\": true, \"profile\": \"EN16931\", \"errors\": [] }, \"pdfa\": { \"compliant\": true, \"version\": \"PDF/A-3B\", \"method\": \"verapdf\", \"errors\": [] }, \"xmp\": { \"present\": true, \"compliant\": true, \"metadata\": {...} }, \"signatures\": { \"present\": true, \"count\": 1, \"details\": [...] } } ``` ## Use cases - **Before sending**: Validate generated invoice before transmission to client - **On reception**: Verify compliance of invoice received from supplier - **Audit**: Check quality of invoice batches - **Legal compliance**: Ensure B2B/B2G obligations are met in France - **Debugging**: Identify issues in generation process - **Archiving**: Guarantee long-term validity (PDF/A-3) ## Processing time - Basic validation: 2-3 seconds - VeraPDF validation: 15-30 seconds (depends on PDF size)
567
- # @param pdf_file [File] Factur-X PDF file to validate (.pdf format).
568
- # @param [Hash] opts the optional parameters
569
- # @option opts [APIProfile] :profile
570
- # @option opts [Boolean] :use_verapdf Enable strict PDF/A validation with VeraPDF (recommended for production). If False, uses basic metadata validation. (default to false)
571
- # @option opts [Boolean] :skip_br_fr
572
- # @return [PDFValidationResultAPI]
573
- def validate_facturx_pdf_api_v1_processing_validate_facturx_pdf_post(pdf_file, opts = {})
574
- data, _status_code, _headers = validate_facturx_pdf_api_v1_processing_validate_facturx_pdf_post_with_http_info(pdf_file, opts)
575
- data
576
- end
577
-
578
- # Validate a complete Factur-X PDF
579
- # Validates a complete Factur-X PDF according to European and French standards. ## Applied validation standards - **EN 16931**: European semantic standard (directive 2014/55/EU) - **ISO 19005-3** (PDF/A-3): Long-term electronic archiving - **Factur-X / ZUGFeRD**: Franco-German specification - **Schematron**: XML business rules validation - **eIDAS**: European regulation on electronic identification (signatures) ## Checks performed ### 1. Factur-X XML extraction and validation **Checks performed:** - Presence of embedded XML file (&#x60;factur-x.xml&#x60; or &#x60;zugferd-invoice.xml&#x60;) - Automatic profile detection (MINIMUM, BASIC, EN16931, EXTENDED) - XML parsing with UTF-8 validation - GuidelineSpecifiedDocumentContextParameter/ID extraction **Schematron validation:** - Business rules for detected profile (MINIMUM: 45 rules, EN16931: 178 rules) - Cardinality of required elements - Calculation consistency (net, VAT, gross amounts, discounts) - Identifier formats (SIRET, intra-EU VAT, IBAN) - Standardized codes (ISO country codes, UN/ECE units, VAT codes) **What is verified:** - ✅ XML structure conforming to Cross Industry Invoice XSD - ✅ Correct UN/CEFACT namespace - ✅ European business rules (BR-xx) - ✅ French-specific rules (FR-xx) ### 2. PDF/A-3 compliance **Basic validation (metadata):** - Presence of &#x60;/Type&#x60; field set to &#x60;Catalog&#x60; - Metadata &#x60;pdfaid:part&#x60; &#x3D; 3 (PDF/A-3) - Metadata &#x60;pdfaid:conformance&#x60; &#x3D; B or U - PDF version &gt;&#x3D; 1.4 **Strict VeraPDF validation (if use_verapdf&#x3D;True):** - 146+ ISO 19005-3 rules (PDF/A-3B) - Absence of forbidden content (JavaScript, multimedia, dynamic forms) - Correctly embedded fonts and subsets - Compliant color spaces (sRGB, DeviceGray) - Valid file structure (cross-reference table) - XMP metadata conforming to ISO 16684-1 **What is verified:** - ✅ Long-term archivable file (20+ years) - ✅ Guaranteed readability (embedded fonts) - ✅ Legal compliance (France, Germany, EU) ### 3. XMP metadata (eXtensible Metadata Platform) **Checks performed:** - Presence of &#x60;&lt;?xpacket&gt;&#x60; block with XMP metadata - &#x60;fx:&#x60; namespace for Factur-X: &#x60;urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#&#x60; - Required Factur-X fields: - &#x60;fx:ConformanceLevel&#x60;: Profile (MINIMUM, BASIC, EN16931, EXTENDED) - &#x60;fx:DocumentFileName&#x60;: Embedded XML name - &#x60;fx:DocumentType&#x60;: \&quot;INVOICE\&quot; - &#x60;fx:Version&#x60;: Factur-X version (1.0.07) **What is verified:** - ✅ Metadata conforming to ISO 16684-1 - ✅ Correct declared Factur-X profile - ✅ Supported Factur-X version ### 4. Electronic signatures **Detection and analysis:** - Presence of &#x60;/Sig&#x60; dictionaries in PDF - Signature type: PAdES (PDF Advanced Electronic Signature) - Information extraction: - Signer name (&#x60;/Name&#x60;) - Signing date (&#x60;/M&#x60;) - Signature reason (&#x60;/Reason&#x60;) - Signature location (&#x60;/Location&#x60;) - Signature type (approval, certification) **What is verified:** - ✅ Presence of signatures or seals - ✅ Number of signatures (single or multi-signature) - ℹ️ No cryptographic verification (requires certificates) ## Parameters - **pdf_file** (required): The Factur-X PDF file to validate - **profile** (optional): Expected profile. If absent, auto-detected from XML - **use_verapdf** (optional, default&#x3D;false): Enable strict PDF/A validation with VeraPDF - &#x60;false&#x60;: Fast metadata validation (2-3 seconds) - &#x60;true&#x60;: Complete ISO 19005-3 validation (15-30 seconds, **recommended for production**) ## Detailed response &#x60;&#x60;&#x60;json { \&quot;isCompliant\&quot;: true, \&quot;xml\&quot;: { \&quot;present\&quot;: true, \&quot;compliant\&quot;: true, \&quot;profile\&quot;: \&quot;EN16931\&quot;, \&quot;errors\&quot;: [] }, \&quot;pdfa\&quot;: { \&quot;compliant\&quot;: true, \&quot;version\&quot;: \&quot;PDF/A-3B\&quot;, \&quot;method\&quot;: \&quot;verapdf\&quot;, \&quot;errors\&quot;: [] }, \&quot;xmp\&quot;: { \&quot;present\&quot;: true, \&quot;compliant\&quot;: true, \&quot;metadata\&quot;: {...} }, \&quot;signatures\&quot;: { \&quot;present\&quot;: true, \&quot;count\&quot;: 1, \&quot;details\&quot;: [...] } } &#x60;&#x60;&#x60; ## Use cases - **Before sending**: Validate generated invoice before transmission to client - **On reception**: Verify compliance of invoice received from supplier - **Audit**: Check quality of invoice batches - **Legal compliance**: Ensure B2B/B2G obligations are met in France - **Debugging**: Identify issues in generation process - **Archiving**: Guarantee long-term validity (PDF/A-3) ## Processing time - Basic validation: 2-3 seconds - VeraPDF validation: 15-30 seconds (depends on PDF size)
580
- # @param pdf_file [File] Factur-X PDF file to validate (.pdf format).
581
- # @param [Hash] opts the optional parameters
582
- # @option opts [APIProfile] :profile
583
- # @option opts [Boolean] :use_verapdf Enable strict PDF/A validation with VeraPDF (recommended for production). If False, uses basic metadata validation. (default to false)
584
- # @option opts [Boolean] :skip_br_fr
585
- # @return [Array<(PDFValidationResultAPI, Integer, Hash)>] PDFValidationResultAPI data, response status code and response headers
586
- def validate_facturx_pdf_api_v1_processing_validate_facturx_pdf_post_with_http_info(pdf_file, opts = {})
587
- if @api_client.config.debugging
588
- @api_client.config.logger.debug 'Calling API: InvoiceProcessingApi.validate_facturx_pdf_api_v1_processing_validate_facturx_pdf_post ...'
589
- end
590
- # verify the required parameter 'pdf_file' is set
591
- if @api_client.config.client_side_validation && pdf_file.nil?
592
- fail ArgumentError, "Missing the required parameter 'pdf_file' when calling InvoiceProcessingApi.validate_facturx_pdf_api_v1_processing_validate_facturx_pdf_post"
593
- end
594
- # resource path
595
- local_var_path = '/api/v1/processing/validate-facturx-pdf'
596
-
597
- # query parameters
598
- query_params = opts[:query_params] || {}
599
-
600
- # header parameters
601
- header_params = opts[:header_params] || {}
602
- # HTTP header 'Accept' (if needed)
603
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
604
- # HTTP header 'Content-Type'
605
- content_type = @api_client.select_header_content_type(['multipart/form-data'])
606
- if !content_type.nil?
607
- header_params['Content-Type'] = content_type
608
- end
609
-
610
- # form parameters
611
- form_params = opts[:form_params] || {}
612
- form_params['pdf_file'] = pdf_file
613
- form_params['profile'] = opts[:'profile'] if !opts[:'profile'].nil?
614
- form_params['use_verapdf'] = opts[:'use_verapdf'] if !opts[:'use_verapdf'].nil?
615
- form_params['skip_br_fr'] = opts[:'skip_br_fr'] if !opts[:'skip_br_fr'].nil?
616
-
617
- # http body (model)
618
- post_body = opts[:debug_body]
619
-
620
- # return_type
621
- return_type = opts[:debug_return_type] || 'PDFValidationResultAPI'
622
-
623
- # auth_names
624
- auth_names = opts[:debug_auth_names] || ['HTTPBearer']
625
-
626
- new_options = opts.merge(
627
- :operation => :"InvoiceProcessingApi.validate_facturx_pdf_api_v1_processing_validate_facturx_pdf_post",
628
- :header_params => header_params,
629
- :query_params => query_params,
630
- :form_params => form_params,
631
- :body => post_body,
632
- :auth_names => auth_names,
633
- :return_type => return_type
634
- )
635
-
636
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
637
- if @api_client.config.debugging
638
- @api_client.config.logger.debug "API called: InvoiceProcessingApi#validate_facturx_pdf_api_v1_processing_validate_facturx_pdf_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
639
- end
640
- return data, status_code, headers
641
- end
642
-
643
- # Validate a Factur-X PDF (asynchronous with polling)
644
- # Validates a Factur-X PDF asynchronously with polling system. ## How it works 1. **Submission**: PDF is queued for asynchronous validation 2. **Immediate return**: You receive a `task_id` (HTTP 202) 3. **Tracking**: Use the `/tasks/{task_id}/status` endpoint to track progress ## Advantages of asynchronous mode - **No timeout**: Ideal for large PDFs or VeraPDF validation (which can take several seconds) - **Scalability**: Validations are processed by dedicated Celery workers - **Status tracking**: Allows you to monitor validation progress - **Non-blocking**: Your client doesn't wait during validation ## Webhook notification (recommended) Instead of polling, you can receive a webhook notification when validation completes: ``` callback_url=https://your-server.com/webhook webhook_mode=download_url # Optional: get download URL instead of base64 ``` The webhook will POST a JSON payload with: - `event_type`: `validation.completed` or `validation.failed` - `data.is_compliant`: Whether the PDF is Factur-X compliant - `data.detected_profile`: The detected Factur-X profile - `X-Webhook-Signature` header for HMAC verification ## When to use this mode? - **VeraPDF validation enabled** (`use_verapdf=True`): Strict validation can take 2-10 seconds - **Large PDF files**: PDFs > 1 MB - **Batch processing**: Validating multiple invoices in parallel - **Asynchronous integration**: Your system supports polling ## Checks performed ### 1. Factur-X XML extraction and validation - Verifies presence of Factur-X compliant embedded XML file - Automatically detects profile used (MINIMUM, BASIC, EN16931, EXTENDED) - Validates XML against detected profile's Schematron rules ### 2. PDF/A compliance - **Without VeraPDF**: Basic metadata validation (fast, ~100ms) - **With VeraPDF**: Strict ISO 19005 validation (146+ rules, 2-10s) - Detects PDF/A version (PDF/A-1, PDF/A-3, etc.) - Detailed non-compliance reports ### 3. XMP metadata - Verifies presence of XMP metadata in PDF - Validates Factur-X metadata compliance (profile, version) - Extracts all available XMP metadata ### 4. Electronic signatures - Detects presence of electronic signatures or seals - Extracts information about each signature (signer, date, reason) - Counts number of signatures present ## Parameters - **pdf_file**: The Factur-X PDF file to validate - **profile**: Expected Factur-X profile (optional). If not specified, profile will be auto-detected from embedded XML file. - **use_verapdf**: Enable strict PDF/A validation with VeraPDF. ⚠️ **Warning**: VeraPDF can take 2-10 seconds depending on PDF size. Recommended only in asynchronous mode to avoid timeouts. ## Retrieving results After submission, use `GET /tasks/{task_id}/status` endpoint to retrieve the result. **Polling example**: ```python import requests import time # 1. Submit task response = requests.post(\"/validate-facturx-async\", files={\"pdf_file\": pdf_file}) task_id = response.json()[\"taskId\"] # 2. Poll every 2 seconds while True: status_response = requests.get(f\"/tasks/{task_id}/status\") status = status_response.json() if status[\"status\"] == \"SUCCESS\": result = status[\"result\"][\"validation_result\"] print(f\"Compliant: {result['is_compliant']}\") break elif status[\"status\"] == \"FAILURE\": print(f\"Error: {status['result']['errorMessage']}\") break time.sleep(2) # Wait 2 seconds before next check ``` ## Use cases - Validate invoices before sending with VeraPDF (strict validation) - Process invoice batches in parallel - Integrate validation into an asynchronous pipeline - Validate large PDFs without timeout risk
645
- # @param pdf_file [File] Factur-X PDF file to validate (.pdf format).
646
- # @param [Hash] opts the optional parameters
647
- # @option opts [APIProfile] :profile
648
- # @option opts [Boolean] :use_verapdf Enable strict PDF/A validation with VeraPDF (recommended for production). May take several seconds. (default to false)
649
- # @option opts [String] :callback_url
650
- # @option opts [String] :webhook_mode Webhook content delivery: &#39;inline&#39; (base64 in payload) or &#39;download_url&#39; (temporary URL, 1h TTL) (default to 'inline')
651
- # @return [TaskResponse]
652
- def validate_facturx_pdf_async_api_v1_processing_validate_facturx_async_post(pdf_file, opts = {})
653
- data, _status_code, _headers = validate_facturx_pdf_async_api_v1_processing_validate_facturx_async_post_with_http_info(pdf_file, opts)
654
- data
655
- end
656
-
657
- # Validate a Factur-X PDF (asynchronous with polling)
658
- # Validates a Factur-X PDF asynchronously with polling system. ## How it works 1. **Submission**: PDF is queued for asynchronous validation 2. **Immediate return**: You receive a &#x60;task_id&#x60; (HTTP 202) 3. **Tracking**: Use the &#x60;/tasks/{task_id}/status&#x60; endpoint to track progress ## Advantages of asynchronous mode - **No timeout**: Ideal for large PDFs or VeraPDF validation (which can take several seconds) - **Scalability**: Validations are processed by dedicated Celery workers - **Status tracking**: Allows you to monitor validation progress - **Non-blocking**: Your client doesn&#39;t wait during validation ## Webhook notification (recommended) Instead of polling, you can receive a webhook notification when validation completes: &#x60;&#x60;&#x60; callback_url&#x3D;https://your-server.com/webhook webhook_mode&#x3D;download_url # Optional: get download URL instead of base64 &#x60;&#x60;&#x60; The webhook will POST a JSON payload with: - &#x60;event_type&#x60;: &#x60;validation.completed&#x60; or &#x60;validation.failed&#x60; - &#x60;data.is_compliant&#x60;: Whether the PDF is Factur-X compliant - &#x60;data.detected_profile&#x60;: The detected Factur-X profile - &#x60;X-Webhook-Signature&#x60; header for HMAC verification ## When to use this mode? - **VeraPDF validation enabled** (&#x60;use_verapdf&#x3D;True&#x60;): Strict validation can take 2-10 seconds - **Large PDF files**: PDFs &gt; 1 MB - **Batch processing**: Validating multiple invoices in parallel - **Asynchronous integration**: Your system supports polling ## Checks performed ### 1. Factur-X XML extraction and validation - Verifies presence of Factur-X compliant embedded XML file - Automatically detects profile used (MINIMUM, BASIC, EN16931, EXTENDED) - Validates XML against detected profile&#39;s Schematron rules ### 2. PDF/A compliance - **Without VeraPDF**: Basic metadata validation (fast, ~100ms) - **With VeraPDF**: Strict ISO 19005 validation (146+ rules, 2-10s) - Detects PDF/A version (PDF/A-1, PDF/A-3, etc.) - Detailed non-compliance reports ### 3. XMP metadata - Verifies presence of XMP metadata in PDF - Validates Factur-X metadata compliance (profile, version) - Extracts all available XMP metadata ### 4. Electronic signatures - Detects presence of electronic signatures or seals - Extracts information about each signature (signer, date, reason) - Counts number of signatures present ## Parameters - **pdf_file**: The Factur-X PDF file to validate - **profile**: Expected Factur-X profile (optional). If not specified, profile will be auto-detected from embedded XML file. - **use_verapdf**: Enable strict PDF/A validation with VeraPDF. ⚠️ **Warning**: VeraPDF can take 2-10 seconds depending on PDF size. Recommended only in asynchronous mode to avoid timeouts. ## Retrieving results After submission, use &#x60;GET /tasks/{task_id}/status&#x60; endpoint to retrieve the result. **Polling example**: &#x60;&#x60;&#x60;python import requests import time # 1. Submit task response &#x3D; requests.post(\&quot;/validate-facturx-async\&quot;, files&#x3D;{\&quot;pdf_file\&quot;: pdf_file}) task_id &#x3D; response.json()[\&quot;taskId\&quot;] # 2. Poll every 2 seconds while True: status_response &#x3D; requests.get(f\&quot;/tasks/{task_id}/status\&quot;) status &#x3D; status_response.json() if status[\&quot;status\&quot;] &#x3D;&#x3D; \&quot;SUCCESS\&quot;: result &#x3D; status[\&quot;result\&quot;][\&quot;validation_result\&quot;] print(f\&quot;Compliant: {result[&#39;is_compliant&#39;]}\&quot;) break elif status[\&quot;status\&quot;] &#x3D;&#x3D; \&quot;FAILURE\&quot;: print(f\&quot;Error: {status[&#39;result&#39;][&#39;errorMessage&#39;]}\&quot;) break time.sleep(2) # Wait 2 seconds before next check &#x60;&#x60;&#x60; ## Use cases - Validate invoices before sending with VeraPDF (strict validation) - Process invoice batches in parallel - Integrate validation into an asynchronous pipeline - Validate large PDFs without timeout risk
659
- # @param pdf_file [File] Factur-X PDF file to validate (.pdf format).
660
- # @param [Hash] opts the optional parameters
661
- # @option opts [APIProfile] :profile
662
- # @option opts [Boolean] :use_verapdf Enable strict PDF/A validation with VeraPDF (recommended for production). May take several seconds. (default to false)
663
- # @option opts [String] :callback_url
664
- # @option opts [String] :webhook_mode Webhook content delivery: &#39;inline&#39; (base64 in payload) or &#39;download_url&#39; (temporary URL, 1h TTL) (default to 'inline')
665
- # @return [Array<(TaskResponse, Integer, Hash)>] TaskResponse data, response status code and response headers
666
- def validate_facturx_pdf_async_api_v1_processing_validate_facturx_async_post_with_http_info(pdf_file, opts = {})
667
- if @api_client.config.debugging
668
- @api_client.config.logger.debug 'Calling API: InvoiceProcessingApi.validate_facturx_pdf_async_api_v1_processing_validate_facturx_async_post ...'
669
- end
670
- # verify the required parameter 'pdf_file' is set
671
- if @api_client.config.client_side_validation && pdf_file.nil?
672
- fail ArgumentError, "Missing the required parameter 'pdf_file' when calling InvoiceProcessingApi.validate_facturx_pdf_async_api_v1_processing_validate_facturx_async_post"
673
- end
674
- # resource path
675
- local_var_path = '/api/v1/processing/validate-facturx-async'
676
-
677
- # query parameters
678
- query_params = opts[:query_params] || {}
679
-
680
- # header parameters
681
- header_params = opts[:header_params] || {}
682
- # HTTP header 'Accept' (if needed)
683
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
684
- # HTTP header 'Content-Type'
685
- content_type = @api_client.select_header_content_type(['multipart/form-data'])
686
- if !content_type.nil?
687
- header_params['Content-Type'] = content_type
688
- end
689
-
690
- # form parameters
691
- form_params = opts[:form_params] || {}
692
- form_params['pdf_file'] = pdf_file
693
- form_params['profile'] = opts[:'profile'] if !opts[:'profile'].nil?
694
- form_params['use_verapdf'] = opts[:'use_verapdf'] if !opts[:'use_verapdf'].nil?
695
- form_params['callback_url'] = opts[:'callback_url'] if !opts[:'callback_url'].nil?
696
- form_params['webhook_mode'] = opts[:'webhook_mode'] if !opts[:'webhook_mode'].nil?
697
-
698
- # http body (model)
699
- post_body = opts[:debug_body]
700
-
701
- # return_type
702
- return_type = opts[:debug_return_type] || 'TaskResponse'
703
-
704
- # auth_names
705
- auth_names = opts[:debug_auth_names] || ['HTTPBearer']
706
-
707
- new_options = opts.merge(
708
- :operation => :"InvoiceProcessingApi.validate_facturx_pdf_async_api_v1_processing_validate_facturx_async_post",
709
- :header_params => header_params,
710
- :query_params => query_params,
711
- :form_params => form_params,
712
- :body => post_body,
713
- :auth_names => auth_names,
714
- :return_type => return_type
715
- )
716
-
717
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
718
- if @api_client.config.debugging
719
- @api_client.config.logger.debug "API called: InvoiceProcessingApi#validate_facturx_pdf_async_api_v1_processing_validate_facturx_async_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
720
- end
721
- return data, status_code, headers
722
- end
723
-
724
- # Validate electronic signatures of a PDF
725
- # Validates electronic signatures present in an uploaded PDF. **Verifications performed**: - Presence of signatures - Document integrity (not modified since signing) - Certificate validity - Chain of trust (if available) - Presence of timestamp (PAdES-B-T) - Validation data (PAdES-B-LT) **Supported standards**: PAdES-B-B, PAdES-B-T, PAdES-B-LT, ISO 32000-2. **⚠️ Note**: This validation is technical (cryptographic integrity). Legal validity depends on the eIDAS level of the certificate (SES/AdES/QES) and the context of use.
726
- # @param pdf_file [File] PDF file to validate (will be analyzed to detect and validate signatures)
727
- # @param [Hash] opts the optional parameters
728
- # @return [Object]
729
- def validate_pdf_signature_endpoint_api_v1_processing_validate_pdf_signature_post(pdf_file, opts = {})
730
- data, _status_code, _headers = validate_pdf_signature_endpoint_api_v1_processing_validate_pdf_signature_post_with_http_info(pdf_file, opts)
731
- data
732
- end
733
-
734
- # Validate electronic signatures of a PDF
735
- # Validates electronic signatures present in an uploaded PDF. **Verifications performed**: - Presence of signatures - Document integrity (not modified since signing) - Certificate validity - Chain of trust (if available) - Presence of timestamp (PAdES-B-T) - Validation data (PAdES-B-LT) **Supported standards**: PAdES-B-B, PAdES-B-T, PAdES-B-LT, ISO 32000-2. **⚠️ Note**: This validation is technical (cryptographic integrity). Legal validity depends on the eIDAS level of the certificate (SES/AdES/QES) and the context of use.
736
- # @param pdf_file [File] PDF file to validate (will be analyzed to detect and validate signatures)
737
- # @param [Hash] opts the optional parameters
738
- # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
739
- def validate_pdf_signature_endpoint_api_v1_processing_validate_pdf_signature_post_with_http_info(pdf_file, opts = {})
740
- if @api_client.config.debugging
741
- @api_client.config.logger.debug 'Calling API: InvoiceProcessingApi.validate_pdf_signature_endpoint_api_v1_processing_validate_pdf_signature_post ...'
742
- end
743
- # verify the required parameter 'pdf_file' is set
744
- if @api_client.config.client_side_validation && pdf_file.nil?
745
- fail ArgumentError, "Missing the required parameter 'pdf_file' when calling InvoiceProcessingApi.validate_pdf_signature_endpoint_api_v1_processing_validate_pdf_signature_post"
746
- end
747
- # resource path
748
- local_var_path = '/api/v1/processing/validate-pdf-signature'
749
-
750
- # query parameters
751
- query_params = opts[:query_params] || {}
752
-
753
- # header parameters
754
- header_params = opts[:header_params] || {}
755
- # HTTP header 'Accept' (if needed)
756
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
757
- # HTTP header 'Content-Type'
758
- content_type = @api_client.select_header_content_type(['multipart/form-data'])
759
- if !content_type.nil?
760
- header_params['Content-Type'] = content_type
761
- end
762
-
763
- # form parameters
764
- form_params = opts[:form_params] || {}
765
- form_params['pdf_file'] = pdf_file
766
-
767
- # http body (model)
768
- post_body = opts[:debug_body]
769
-
770
- # return_type
771
- return_type = opts[:debug_return_type] || 'Object'
772
-
773
- # auth_names
774
- auth_names = opts[:debug_auth_names] || ['HTTPBearer']
775
-
776
- new_options = opts.merge(
777
- :operation => :"InvoiceProcessingApi.validate_pdf_signature_endpoint_api_v1_processing_validate_pdf_signature_post",
778
- :header_params => header_params,
779
- :query_params => query_params,
780
- :form_params => form_params,
781
- :body => post_body,
782
- :auth_names => auth_names,
783
- :return_type => return_type
784
- )
785
-
786
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
787
- if @api_client.config.debugging
788
- @api_client.config.logger.debug "API called: InvoiceProcessingApi#validate_pdf_signature_endpoint_api_v1_processing_validate_pdf_signature_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
789
- end
790
- return data, status_code, headers
791
- end
792
-
793
- # Validate an existing Factur-X XML
794
- # Validates a Factur-X XML file against Schematron business rules according to EN 16931 standard. ## Applied Standard **Schematron ISO/IEC 19757-3**: Business rules validation language for XML - Semantic validation (beyond XSD syntax) - European EN 16931 business rules - French-specific Factur-X rules - Arithmetic calculations and data consistency ## Profiles and validated rules ### MINIMUM (45 rules) - Unique invoice identifier - Dates (issue, due date) - Party identifiers (SIRET/SIREN) - Total gross amount ### BASIC (102 rules) - All MINIMUM rules - Detailed invoice lines - Basic VAT calculations - Payment methods - References (order, contract) ### EN16931 (178 rules) - All BASIC rules - **European rules (BR-xx)**: 81 business rules - **French rules (FR-xx)**: 12 France-specific rules - **Advanced calculations (CR-xx)**: 32 calculation rules - **Standardized codes (CL-xx)**: 52 code lists ### EXTENDED (210+ rules) - All EN16931 rules - Logistics information - Advanced accounting data - Multiple external references ## Checks performed ### 1. Syntax validation - Correct XML parsing (UTF-8, well-formed) - UN/CEFACT namespaces present - Hierarchical structure respected ### 2. Business rules (BR-xx) Examples: - `BR-1`: Invoice total must equal sum of line totals + document-level amounts - `BR-CO-10`: Sum of VAT base amounts must equal invoice net total - `BR-16`: Invoice currency code must be in ISO 4217 list ### 3. French rules (FR-xx) Examples: - `FR-1`: Supplier SIRET must have 14 digits - `FR-2`: Customer SIRET must have 14 digits (if present) - `FR-5`: Intra-EU VAT number must be in format FRxx999999999 ### 4. Calculation rules (CR-xx) - Net + VAT = Gross amounts - Sum of lines = Document total - Discounts and surcharges correctly applied - Compliant rounding (2 decimals for amounts) ### 5. Standardized codes (CL-xx) - ISO 3166-1 alpha-2 country codes - ISO 4217 currency codes - UN/ECE Rec 20 measurement units - VAT codes (types, categories, exemptions) - SchemeID for identifiers (0002=SIREN, 0009=SIRET, etc.) ## Validation process 1. **XSLT loading**: Schematron file converted to XSLT (Saxon-HE) 2. **Transformation**: Rules applied to XML 3. **Results analysis**: Extraction of errors (`failed-assert`) and warnings (`successful-report`) 4. **Report**: Structured list of non-conformities ## Responses **200 OK**: Compliant XML ```json { \"message\": \"XML is compliant with EN16931 profile\" } ``` **400 Bad Request**: Non-compliant XML ```json { \"detail\": [ \"[BR-1] Invoice total (120.00) does not match calculated sum (100.00 + 20.00)\", \"[FR-1] Supplier SIRET must contain exactly 14 digits\" ] } ``` ## Use cases - **Pre-validation**: Verify XML before PDF/A integration - **Debugging**: Precisely identify generation errors - **Testing**: Validate test or example XMLs - **Compliance**: Ensure European and French rules are met - **Development**: Quick testing without PDF generation ## Processing time - MINIMUM profile: ~0.5 second - EN16931 profile: ~1-2 seconds - EXTENDED profile: ~2-3 seconds
795
- # @param xml_file [File] Factur-X XML file to validate (.xml format).
796
- # @param [Hash] opts the optional parameters
797
- # @option opts [APIProfile] :profile Validation profile (MINIMUM, BASIC, EN16931, EXTENDED).
798
- # @option opts [Boolean] :skip_br_fr
799
- # @return [ValidationSuccessResponse]
800
- def validate_xml_api_v1_processing_validate_xml_post(xml_file, opts = {})
801
- data, _status_code, _headers = validate_xml_api_v1_processing_validate_xml_post_with_http_info(xml_file, opts)
802
- data
803
- end
804
-
805
- # Validate an existing Factur-X XML
806
- # Validates a Factur-X XML file against Schematron business rules according to EN 16931 standard. ## Applied Standard **Schematron ISO/IEC 19757-3**: Business rules validation language for XML - Semantic validation (beyond XSD syntax) - European EN 16931 business rules - French-specific Factur-X rules - Arithmetic calculations and data consistency ## Profiles and validated rules ### MINIMUM (45 rules) - Unique invoice identifier - Dates (issue, due date) - Party identifiers (SIRET/SIREN) - Total gross amount ### BASIC (102 rules) - All MINIMUM rules - Detailed invoice lines - Basic VAT calculations - Payment methods - References (order, contract) ### EN16931 (178 rules) - All BASIC rules - **European rules (BR-xx)**: 81 business rules - **French rules (FR-xx)**: 12 France-specific rules - **Advanced calculations (CR-xx)**: 32 calculation rules - **Standardized codes (CL-xx)**: 52 code lists ### EXTENDED (210+ rules) - All EN16931 rules - Logistics information - Advanced accounting data - Multiple external references ## Checks performed ### 1. Syntax validation - Correct XML parsing (UTF-8, well-formed) - UN/CEFACT namespaces present - Hierarchical structure respected ### 2. Business rules (BR-xx) Examples: - &#x60;BR-1&#x60;: Invoice total must equal sum of line totals + document-level amounts - &#x60;BR-CO-10&#x60;: Sum of VAT base amounts must equal invoice net total - &#x60;BR-16&#x60;: Invoice currency code must be in ISO 4217 list ### 3. French rules (FR-xx) Examples: - &#x60;FR-1&#x60;: Supplier SIRET must have 14 digits - &#x60;FR-2&#x60;: Customer SIRET must have 14 digits (if present) - &#x60;FR-5&#x60;: Intra-EU VAT number must be in format FRxx999999999 ### 4. Calculation rules (CR-xx) - Net + VAT &#x3D; Gross amounts - Sum of lines &#x3D; Document total - Discounts and surcharges correctly applied - Compliant rounding (2 decimals for amounts) ### 5. Standardized codes (CL-xx) - ISO 3166-1 alpha-2 country codes - ISO 4217 currency codes - UN/ECE Rec 20 measurement units - VAT codes (types, categories, exemptions) - SchemeID for identifiers (0002&#x3D;SIREN, 0009&#x3D;SIRET, etc.) ## Validation process 1. **XSLT loading**: Schematron file converted to XSLT (Saxon-HE) 2. **Transformation**: Rules applied to XML 3. **Results analysis**: Extraction of errors (&#x60;failed-assert&#x60;) and warnings (&#x60;successful-report&#x60;) 4. **Report**: Structured list of non-conformities ## Responses **200 OK**: Compliant XML &#x60;&#x60;&#x60;json { \&quot;message\&quot;: \&quot;XML is compliant with EN16931 profile\&quot; } &#x60;&#x60;&#x60; **400 Bad Request**: Non-compliant XML &#x60;&#x60;&#x60;json { \&quot;detail\&quot;: [ \&quot;[BR-1] Invoice total (120.00) does not match calculated sum (100.00 + 20.00)\&quot;, \&quot;[FR-1] Supplier SIRET must contain exactly 14 digits\&quot; ] } &#x60;&#x60;&#x60; ## Use cases - **Pre-validation**: Verify XML before PDF/A integration - **Debugging**: Precisely identify generation errors - **Testing**: Validate test or example XMLs - **Compliance**: Ensure European and French rules are met - **Development**: Quick testing without PDF generation ## Processing time - MINIMUM profile: ~0.5 second - EN16931 profile: ~1-2 seconds - EXTENDED profile: ~2-3 seconds
807
- # @param xml_file [File] Factur-X XML file to validate (.xml format).
808
- # @param [Hash] opts the optional parameters
809
- # @option opts [APIProfile] :profile Validation profile (MINIMUM, BASIC, EN16931, EXTENDED).
810
- # @option opts [Boolean] :skip_br_fr
811
- # @return [Array<(ValidationSuccessResponse, Integer, Hash)>] ValidationSuccessResponse data, response status code and response headers
812
- def validate_xml_api_v1_processing_validate_xml_post_with_http_info(xml_file, opts = {})
813
- if @api_client.config.debugging
814
- @api_client.config.logger.debug 'Calling API: InvoiceProcessingApi.validate_xml_api_v1_processing_validate_xml_post ...'
815
- end
816
- # verify the required parameter 'xml_file' is set
817
- if @api_client.config.client_side_validation && xml_file.nil?
818
- fail ArgumentError, "Missing the required parameter 'xml_file' when calling InvoiceProcessingApi.validate_xml_api_v1_processing_validate_xml_post"
819
- end
820
- # resource path
821
- local_var_path = '/api/v1/processing/validate-xml'
822
-
823
- # query parameters
824
- query_params = opts[:query_params] || {}
825
-
826
- # header parameters
827
- header_params = opts[:header_params] || {}
828
- # HTTP header 'Accept' (if needed)
829
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
830
- # HTTP header 'Content-Type'
831
- content_type = @api_client.select_header_content_type(['multipart/form-data'])
832
- if !content_type.nil?
833
- header_params['Content-Type'] = content_type
834
- end
835
-
836
- # form parameters
837
- form_params = opts[:form_params] || {}
838
- form_params['xml_file'] = xml_file
839
- form_params['profile'] = opts[:'profile'] if !opts[:'profile'].nil?
840
- form_params['skip_br_fr'] = opts[:'skip_br_fr'] if !opts[:'skip_br_fr'].nil?
841
-
842
- # http body (model)
843
- post_body = opts[:debug_body]
844
-
845
- # return_type
846
- return_type = opts[:debug_return_type] || 'ValidationSuccessResponse'
847
-
848
- # auth_names
849
- auth_names = opts[:debug_auth_names] || ['HTTPBearer']
850
-
851
- new_options = opts.merge(
852
- :operation => :"InvoiceProcessingApi.validate_xml_api_v1_processing_validate_xml_post",
853
- :header_params => header_params,
854
- :query_params => query_params,
855
- :form_params => form_params,
856
- :body => post_body,
857
- :auth_names => auth_names,
858
- :return_type => return_type
859
- )
860
-
861
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
862
- if @api_client.config.debugging
863
- @api_client.config.logger.debug "API called: InvoiceProcessingApi#validate_xml_api_v1_processing_validate_xml_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
864
- end
865
- return data, status_code, headers
866
- end
867
- end
868
- end