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,855 +0,0 @@
1
- # FactPulse::InvoiceProcessingApi
2
-
3
- All URIs are relative to *https://factpulse.fr*
4
-
5
- | Method | HTTP request | Description |
6
- | ------ | ------------ | ----------- |
7
- | [**generate_invoice_api_v1_processing_generate_invoice_post**](InvoiceProcessingApi.md#generate_invoice_api_v1_processing_generate_invoice_post) | **POST** /api/v1/processing/generate-invoice | Generate a Factur-X invoice |
8
- | [**generate_test_certificate_api_v1_processing_generate_test_certificate_post**](InvoiceProcessingApi.md#generate_test_certificate_api_v1_processing_generate_test_certificate_post) | **POST** /api/v1/processing/generate-test-certificate | Generate a self-signed X.509 test certificate |
9
- | [**get_task_status_api_v1_processing_tasks_task_id_status_get**](InvoiceProcessingApi.md#get_task_status_api_v1_processing_tasks_task_id_status_get) | **GET** /api/v1/processing/tasks/{task_id}/status | Get task generation status |
10
- | [**sign_pdf_api_v1_processing_sign_pdf_post**](InvoiceProcessingApi.md#sign_pdf_api_v1_processing_sign_pdf_post) | **POST** /api/v1/processing/sign-pdf | Sign a PDF with client's certificate (PAdES-B-LT) |
11
- | [**sign_pdf_async_api_v1_processing_sign_pdf_async_post**](InvoiceProcessingApi.md#sign_pdf_async_api_v1_processing_sign_pdf_async_post) | **POST** /api/v1/processing/sign-pdf-async | Sign a PDF asynchronously (Celery) |
12
- | [**submit_complete_invoice_api_v1_processing_invoices_submit_complete_post**](InvoiceProcessingApi.md#submit_complete_invoice_api_v1_processing_invoices_submit_complete_post) | **POST** /api/v1/processing/invoices/submit-complete | Submit a complete invoice (generation + signature + submission) |
13
- | [**submit_complete_invoice_async_api_v1_processing_invoices_submit_complete_async_post**](InvoiceProcessingApi.md#submit_complete_invoice_async_api_v1_processing_invoices_submit_complete_async_post) | **POST** /api/v1/processing/invoices/submit-complete-async | Submit a complete invoice (asynchronous with Celery) |
14
- | [**validate_facturx_pdf_api_v1_processing_validate_facturx_pdf_post**](InvoiceProcessingApi.md#validate_facturx_pdf_api_v1_processing_validate_facturx_pdf_post) | **POST** /api/v1/processing/validate-facturx-pdf | Validate a complete Factur-X PDF |
15
- | [**validate_facturx_pdf_async_api_v1_processing_validate_facturx_async_post**](InvoiceProcessingApi.md#validate_facturx_pdf_async_api_v1_processing_validate_facturx_async_post) | **POST** /api/v1/processing/validate-facturx-async | Validate a Factur-X PDF (asynchronous with polling) |
16
- | [**validate_pdf_signature_endpoint_api_v1_processing_validate_pdf_signature_post**](InvoiceProcessingApi.md#validate_pdf_signature_endpoint_api_v1_processing_validate_pdf_signature_post) | **POST** /api/v1/processing/validate-pdf-signature | Validate electronic signatures of a PDF |
17
- | [**validate_xml_api_v1_processing_validate_xml_post**](InvoiceProcessingApi.md#validate_xml_api_v1_processing_validate_xml_post) | **POST** /api/v1/processing/validate-xml | Validate an existing Factur-X XML |
18
-
19
-
20
- ## generate_invoice_api_v1_processing_generate_invoice_post
21
-
22
- > <TaskResponse> generate_invoice_api_v1_processing_generate_invoice_post(invoice_data, opts)
23
-
24
- Generate a Factur-X invoice
25
-
26
- 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.
27
-
28
- ### Examples
29
-
30
- ```ruby
31
- require 'time'
32
- require 'factpulse'
33
- # setup authorization
34
- FactPulse.configure do |config|
35
- # Configure Bearer authorization: HTTPBearer
36
- config.access_token = 'YOUR_BEARER_TOKEN'
37
- end
38
-
39
- api_instance = FactPulse::InvoiceProcessingApi.new
40
- invoice_data = 'invoice_data_example' # 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!
41
- opts = {
42
- profile: FactPulse::APIProfile::MINIMUM, # APIProfile | Factur-X profile: MINIMUM, BASIC, EN16931 or EXTENDED.
43
- output_format: FactPulse::OutputFormat::XML, # OutputFormat | Output format: 'xml' (XML only) or 'pdf' (Factur-X PDF with embedded XML).
44
- auto_enrich: true, # Boolean | 🆕 Enable auto-enrichment from SIRET/SIREN (simplified format only)
45
- source_pdf: File.new('/path/to/some/file'), # File |
46
- callback_url: 'callback_url_example', # String |
47
- webhook_mode: 'webhook_mode_example', # String | Webhook content delivery: 'inline' (base64 in payload) or 'download_url' (temporary URL, 1h TTL)
48
- skip_br_fr: true # Boolean |
49
- }
50
-
51
- begin
52
- # Generate a Factur-X invoice
53
- result = api_instance.generate_invoice_api_v1_processing_generate_invoice_post(invoice_data, opts)
54
- p result
55
- rescue FactPulse::ApiError => e
56
- puts "Error when calling InvoiceProcessingApi->generate_invoice_api_v1_processing_generate_invoice_post: #{e}"
57
- end
58
- ```
59
-
60
- #### Using the generate_invoice_api_v1_processing_generate_invoice_post_with_http_info variant
61
-
62
- This returns an Array which contains the response data, status code and headers.
63
-
64
- > <Array(<TaskResponse>, Integer, Hash)> generate_invoice_api_v1_processing_generate_invoice_post_with_http_info(invoice_data, opts)
65
-
66
- ```ruby
67
- begin
68
- # Generate a Factur-X invoice
69
- data, status_code, headers = api_instance.generate_invoice_api_v1_processing_generate_invoice_post_with_http_info(invoice_data, opts)
70
- p status_code # => 2xx
71
- p headers # => { ... }
72
- p data # => <TaskResponse>
73
- rescue FactPulse::ApiError => e
74
- puts "Error when calling InvoiceProcessingApi->generate_invoice_api_v1_processing_generate_invoice_post_with_http_info: #{e}"
75
- end
76
- ```
77
-
78
- ### Parameters
79
-
80
- | Name | Type | Description | Notes |
81
- | ---- | ---- | ----------- | ----- |
82
- | **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! | |
83
- | **profile** | [**APIProfile**](APIProfile.md) | Factur-X profile: MINIMUM, BASIC, EN16931 or EXTENDED. | [optional] |
84
- | **output_format** | [**OutputFormat**](OutputFormat.md) | Output format: &#39;xml&#39; (XML only) or &#39;pdf&#39; (Factur-X PDF with embedded XML). | [optional] |
85
- | **auto_enrich** | **Boolean** | 🆕 Enable auto-enrichment from SIRET/SIREN (simplified format only) | [optional][default to true] |
86
- | **source_pdf** | **File** | | [optional] |
87
- | **callback_url** | **String** | | [optional] |
88
- | **webhook_mode** | **String** | Webhook content delivery: &#39;inline&#39; (base64 in payload) or &#39;download_url&#39; (temporary URL, 1h TTL) | [optional][default to &#39;inline&#39;] |
89
- | **skip_br_fr** | **Boolean** | | [optional] |
90
-
91
- ### Return type
92
-
93
- [**TaskResponse**](TaskResponse.md)
94
-
95
- ### Authorization
96
-
97
- [HTTPBearer](../README.md#HTTPBearer)
98
-
99
- ### HTTP request headers
100
-
101
- - **Content-Type**: multipart/form-data
102
- - **Accept**: application/json
103
-
104
-
105
- ## generate_test_certificate_api_v1_processing_generate_test_certificate_post
106
-
107
- > <GenerateCertificateResponse> generate_test_certificate_api_v1_processing_generate_test_certificate_post(generate_certificate_request)
108
-
109
- Generate a self-signed X.509 test certificate
110
-
111
- 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)
112
-
113
- ### Examples
114
-
115
- ```ruby
116
- require 'time'
117
- require 'factpulse'
118
- # setup authorization
119
- FactPulse.configure do |config|
120
- # Configure Bearer authorization: HTTPBearer
121
- config.access_token = 'YOUR_BEARER_TOKEN'
122
- end
123
-
124
- api_instance = FactPulse::InvoiceProcessingApi.new
125
- generate_certificate_request = FactPulse::GenerateCertificateRequest.new # GenerateCertificateRequest |
126
-
127
- begin
128
- # Generate a self-signed X.509 test certificate
129
- result = api_instance.generate_test_certificate_api_v1_processing_generate_test_certificate_post(generate_certificate_request)
130
- p result
131
- rescue FactPulse::ApiError => e
132
- puts "Error when calling InvoiceProcessingApi->generate_test_certificate_api_v1_processing_generate_test_certificate_post: #{e}"
133
- end
134
- ```
135
-
136
- #### Using the generate_test_certificate_api_v1_processing_generate_test_certificate_post_with_http_info variant
137
-
138
- This returns an Array which contains the response data, status code and headers.
139
-
140
- > <Array(<GenerateCertificateResponse>, Integer, Hash)> generate_test_certificate_api_v1_processing_generate_test_certificate_post_with_http_info(generate_certificate_request)
141
-
142
- ```ruby
143
- begin
144
- # Generate a self-signed X.509 test certificate
145
- data, status_code, headers = api_instance.generate_test_certificate_api_v1_processing_generate_test_certificate_post_with_http_info(generate_certificate_request)
146
- p status_code # => 2xx
147
- p headers # => { ... }
148
- p data # => <GenerateCertificateResponse>
149
- rescue FactPulse::ApiError => e
150
- puts "Error when calling InvoiceProcessingApi->generate_test_certificate_api_v1_processing_generate_test_certificate_post_with_http_info: #{e}"
151
- end
152
- ```
153
-
154
- ### Parameters
155
-
156
- | Name | Type | Description | Notes |
157
- | ---- | ---- | ----------- | ----- |
158
- | **generate_certificate_request** | [**GenerateCertificateRequest**](GenerateCertificateRequest.md) | | |
159
-
160
- ### Return type
161
-
162
- [**GenerateCertificateResponse**](GenerateCertificateResponse.md)
163
-
164
- ### Authorization
165
-
166
- [HTTPBearer](../README.md#HTTPBearer)
167
-
168
- ### HTTP request headers
169
-
170
- - **Content-Type**: application/json
171
- - **Accept**: application/json
172
-
173
-
174
- ## get_task_status_api_v1_processing_tasks_task_id_status_get
175
-
176
- > <AsyncTaskStatus> get_task_status_api_v1_processing_tasks_task_id_status_get(task_id)
177
-
178
- Get task generation status
179
-
180
- 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`.
181
-
182
- ### Examples
183
-
184
- ```ruby
185
- require 'time'
186
- require 'factpulse'
187
- # setup authorization
188
- FactPulse.configure do |config|
189
- # Configure Bearer authorization: HTTPBearer
190
- config.access_token = 'YOUR_BEARER_TOKEN'
191
- end
192
-
193
- api_instance = FactPulse::InvoiceProcessingApi.new
194
- task_id = 'task_id_example' # String | Celery task ID returned by async endpoints (UUID format)
195
-
196
- begin
197
- # Get task generation status
198
- result = api_instance.get_task_status_api_v1_processing_tasks_task_id_status_get(task_id)
199
- p result
200
- rescue FactPulse::ApiError => e
201
- puts "Error when calling InvoiceProcessingApi->get_task_status_api_v1_processing_tasks_task_id_status_get: #{e}"
202
- end
203
- ```
204
-
205
- #### Using the get_task_status_api_v1_processing_tasks_task_id_status_get_with_http_info variant
206
-
207
- This returns an Array which contains the response data, status code and headers.
208
-
209
- > <Array(<AsyncTaskStatus>, Integer, Hash)> get_task_status_api_v1_processing_tasks_task_id_status_get_with_http_info(task_id)
210
-
211
- ```ruby
212
- begin
213
- # Get task generation status
214
- data, status_code, headers = api_instance.get_task_status_api_v1_processing_tasks_task_id_status_get_with_http_info(task_id)
215
- p status_code # => 2xx
216
- p headers # => { ... }
217
- p data # => <AsyncTaskStatus>
218
- rescue FactPulse::ApiError => e
219
- puts "Error when calling InvoiceProcessingApi->get_task_status_api_v1_processing_tasks_task_id_status_get_with_http_info: #{e}"
220
- end
221
- ```
222
-
223
- ### Parameters
224
-
225
- | Name | Type | Description | Notes |
226
- | ---- | ---- | ----------- | ----- |
227
- | **task_id** | **String** | Celery task ID returned by async endpoints (UUID format) | |
228
-
229
- ### Return type
230
-
231
- [**AsyncTaskStatus**](AsyncTaskStatus.md)
232
-
233
- ### Authorization
234
-
235
- [HTTPBearer](../README.md#HTTPBearer)
236
-
237
- ### HTTP request headers
238
-
239
- - **Content-Type**: Not defined
240
- - **Accept**: application/json
241
-
242
-
243
- ## sign_pdf_api_v1_processing_sign_pdf_post
244
-
245
- > Object sign_pdf_api_v1_processing_sign_pdf_post(pdf_file, opts)
246
-
247
- Sign a PDF with client's certificate (PAdES-B-LT)
248
-
249
- 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.
250
-
251
- ### Examples
252
-
253
- ```ruby
254
- require 'time'
255
- require 'factpulse'
256
- # setup authorization
257
- FactPulse.configure do |config|
258
- # Configure Bearer authorization: HTTPBearer
259
- config.access_token = 'YOUR_BEARER_TOKEN'
260
- end
261
-
262
- api_instance = FactPulse::InvoiceProcessingApi.new
263
- pdf_file = File.new('/path/to/some/file') # File | PDF file to sign (will be processed and returned signed in base64)
264
- opts = {
265
- reason: 'reason_example', # String |
266
- location: 'location_example', # String |
267
- contact: 'contact_example', # String |
268
- field_name: 'field_name_example', # String | PDF signature field name
269
- use_pades_lt: true, # Boolean | Enable PAdES-B-LT (long-term archiving with embedded validation data). REQUIRES a certificate with OCSP/CRL access.
270
- use_timestamp: true # Boolean | Enable RFC 3161 timestamping with FreeTSA (PAdES-B-T)
271
- }
272
-
273
- begin
274
- # Sign a PDF with client's certificate (PAdES-B-LT)
275
- result = api_instance.sign_pdf_api_v1_processing_sign_pdf_post(pdf_file, opts)
276
- p result
277
- rescue FactPulse::ApiError => e
278
- puts "Error when calling InvoiceProcessingApi->sign_pdf_api_v1_processing_sign_pdf_post: #{e}"
279
- end
280
- ```
281
-
282
- #### Using the sign_pdf_api_v1_processing_sign_pdf_post_with_http_info variant
283
-
284
- This returns an Array which contains the response data, status code and headers.
285
-
286
- > <Array(Object, Integer, Hash)> sign_pdf_api_v1_processing_sign_pdf_post_with_http_info(pdf_file, opts)
287
-
288
- ```ruby
289
- begin
290
- # Sign a PDF with client's certificate (PAdES-B-LT)
291
- data, status_code, headers = api_instance.sign_pdf_api_v1_processing_sign_pdf_post_with_http_info(pdf_file, opts)
292
- p status_code # => 2xx
293
- p headers # => { ... }
294
- p data # => Object
295
- rescue FactPulse::ApiError => e
296
- puts "Error when calling InvoiceProcessingApi->sign_pdf_api_v1_processing_sign_pdf_post_with_http_info: #{e}"
297
- end
298
- ```
299
-
300
- ### Parameters
301
-
302
- | Name | Type | Description | Notes |
303
- | ---- | ---- | ----------- | ----- |
304
- | **pdf_file** | **File** | PDF file to sign (will be processed and returned signed in base64) | |
305
- | **reason** | **String** | | [optional] |
306
- | **location** | **String** | | [optional] |
307
- | **contact** | **String** | | [optional] |
308
- | **field_name** | **String** | PDF signature field name | [optional][default to &#39;FactPulseSignature&#39;] |
309
- | **use_pades_lt** | **Boolean** | Enable PAdES-B-LT (long-term archiving with embedded validation data). REQUIRES a certificate with OCSP/CRL access. | [optional][default to false] |
310
- | **use_timestamp** | **Boolean** | Enable RFC 3161 timestamping with FreeTSA (PAdES-B-T) | [optional][default to true] |
311
-
312
- ### Return type
313
-
314
- **Object**
315
-
316
- ### Authorization
317
-
318
- [HTTPBearer](../README.md#HTTPBearer)
319
-
320
- ### HTTP request headers
321
-
322
- - **Content-Type**: multipart/form-data
323
- - **Accept**: application/json
324
-
325
-
326
- ## sign_pdf_async_api_v1_processing_sign_pdf_async_post
327
-
328
- > Object sign_pdf_async_api_v1_processing_sign_pdf_async_post(pdf_file, opts)
329
-
330
- Sign a PDF asynchronously (Celery)
331
-
332
- 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).
333
-
334
- ### Examples
335
-
336
- ```ruby
337
- require 'time'
338
- require 'factpulse'
339
- # setup authorization
340
- FactPulse.configure do |config|
341
- # Configure Bearer authorization: HTTPBearer
342
- config.access_token = 'YOUR_BEARER_TOKEN'
343
- end
344
-
345
- api_instance = FactPulse::InvoiceProcessingApi.new
346
- pdf_file = File.new('/path/to/some/file') # File | PDF file to sign (processed asynchronously)
347
- opts = {
348
- callback_url: 'callback_url_example', # String |
349
- webhook_mode: 'webhook_mode_example', # String | Webhook content delivery: 'inline' (base64 in payload) or 'download_url' (temporary URL, 1h TTL)
350
- reason: 'reason_example', # String |
351
- location: 'location_example', # String |
352
- contact: 'contact_example', # String |
353
- field_name: 'field_name_example', # String | PDF signature field name
354
- use_pades_lt: true, # Boolean | Enable PAdES-B-LT (long-term archiving with embedded validation data). REQUIRES a certificate with OCSP/CRL access.
355
- use_timestamp: true # Boolean | Enable RFC 3161 timestamping with FreeTSA (PAdES-B-T)
356
- }
357
-
358
- begin
359
- # Sign a PDF asynchronously (Celery)
360
- result = api_instance.sign_pdf_async_api_v1_processing_sign_pdf_async_post(pdf_file, opts)
361
- p result
362
- rescue FactPulse::ApiError => e
363
- puts "Error when calling InvoiceProcessingApi->sign_pdf_async_api_v1_processing_sign_pdf_async_post: #{e}"
364
- end
365
- ```
366
-
367
- #### Using the sign_pdf_async_api_v1_processing_sign_pdf_async_post_with_http_info variant
368
-
369
- This returns an Array which contains the response data, status code and headers.
370
-
371
- > <Array(Object, Integer, Hash)> sign_pdf_async_api_v1_processing_sign_pdf_async_post_with_http_info(pdf_file, opts)
372
-
373
- ```ruby
374
- begin
375
- # Sign a PDF asynchronously (Celery)
376
- data, status_code, headers = api_instance.sign_pdf_async_api_v1_processing_sign_pdf_async_post_with_http_info(pdf_file, opts)
377
- p status_code # => 2xx
378
- p headers # => { ... }
379
- p data # => Object
380
- rescue FactPulse::ApiError => e
381
- puts "Error when calling InvoiceProcessingApi->sign_pdf_async_api_v1_processing_sign_pdf_async_post_with_http_info: #{e}"
382
- end
383
- ```
384
-
385
- ### Parameters
386
-
387
- | Name | Type | Description | Notes |
388
- | ---- | ---- | ----------- | ----- |
389
- | **pdf_file** | **File** | PDF file to sign (processed asynchronously) | |
390
- | **callback_url** | **String** | | [optional] |
391
- | **webhook_mode** | **String** | Webhook content delivery: &#39;inline&#39; (base64 in payload) or &#39;download_url&#39; (temporary URL, 1h TTL) | [optional][default to &#39;inline&#39;] |
392
- | **reason** | **String** | | [optional] |
393
- | **location** | **String** | | [optional] |
394
- | **contact** | **String** | | [optional] |
395
- | **field_name** | **String** | PDF signature field name | [optional][default to &#39;FactPulseSignature&#39;] |
396
- | **use_pades_lt** | **Boolean** | Enable PAdES-B-LT (long-term archiving with embedded validation data). REQUIRES a certificate with OCSP/CRL access. | [optional][default to false] |
397
- | **use_timestamp** | **Boolean** | Enable RFC 3161 timestamping with FreeTSA (PAdES-B-T) | [optional][default to true] |
398
-
399
- ### Return type
400
-
401
- **Object**
402
-
403
- ### Authorization
404
-
405
- [HTTPBearer](../README.md#HTTPBearer)
406
-
407
- ### HTTP request headers
408
-
409
- - **Content-Type**: multipart/form-data
410
- - **Accept**: application/json
411
-
412
-
413
- ## submit_complete_invoice_api_v1_processing_invoices_submit_complete_post
414
-
415
- > <SubmitCompleteInvoiceResponse> submit_complete_invoice_api_v1_processing_invoices_submit_complete_post(submit_complete_invoice_request)
416
-
417
- Submit a complete invoice (generation + signature + submission)
418
-
419
- 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`)
420
-
421
- ### Examples
422
-
423
- ```ruby
424
- require 'time'
425
- require 'factpulse'
426
- # setup authorization
427
- FactPulse.configure do |config|
428
- # Configure Bearer authorization: HTTPBearer
429
- config.access_token = 'YOUR_BEARER_TOKEN'
430
- end
431
-
432
- api_instance = FactPulse::InvoiceProcessingApi.new
433
- submit_complete_invoice_request = FactPulse::SubmitCompleteInvoiceRequest.new({invoice_data: FactPulse::SimplifiedInvoiceData.new({number: 'number_example', supplier: { key: 3.56}, recipient: { key: 3.56}, lines: [{ key: 3.56}]}), source_pdf: 'source_pdf_example', destination: FactPulse::AFNORDestination.new}) # SubmitCompleteInvoiceRequest |
434
-
435
- begin
436
- # Submit a complete invoice (generation + signature + submission)
437
- result = api_instance.submit_complete_invoice_api_v1_processing_invoices_submit_complete_post(submit_complete_invoice_request)
438
- p result
439
- rescue FactPulse::ApiError => e
440
- puts "Error when calling InvoiceProcessingApi->submit_complete_invoice_api_v1_processing_invoices_submit_complete_post: #{e}"
441
- end
442
- ```
443
-
444
- #### Using the submit_complete_invoice_api_v1_processing_invoices_submit_complete_post_with_http_info variant
445
-
446
- This returns an Array which contains the response data, status code and headers.
447
-
448
- > <Array(<SubmitCompleteInvoiceResponse>, Integer, Hash)> submit_complete_invoice_api_v1_processing_invoices_submit_complete_post_with_http_info(submit_complete_invoice_request)
449
-
450
- ```ruby
451
- begin
452
- # Submit a complete invoice (generation + signature + submission)
453
- data, status_code, headers = api_instance.submit_complete_invoice_api_v1_processing_invoices_submit_complete_post_with_http_info(submit_complete_invoice_request)
454
- p status_code # => 2xx
455
- p headers # => { ... }
456
- p data # => <SubmitCompleteInvoiceResponse>
457
- rescue FactPulse::ApiError => e
458
- puts "Error when calling InvoiceProcessingApi->submit_complete_invoice_api_v1_processing_invoices_submit_complete_post_with_http_info: #{e}"
459
- end
460
- ```
461
-
462
- ### Parameters
463
-
464
- | Name | Type | Description | Notes |
465
- | ---- | ---- | ----------- | ----- |
466
- | **submit_complete_invoice_request** | [**SubmitCompleteInvoiceRequest**](SubmitCompleteInvoiceRequest.md) | | |
467
-
468
- ### Return type
469
-
470
- [**SubmitCompleteInvoiceResponse**](SubmitCompleteInvoiceResponse.md)
471
-
472
- ### Authorization
473
-
474
- [HTTPBearer](../README.md#HTTPBearer)
475
-
476
- ### HTTP request headers
477
-
478
- - **Content-Type**: application/json
479
- - **Accept**: application/json
480
-
481
-
482
- ## submit_complete_invoice_async_api_v1_processing_invoices_submit_complete_async_post
483
-
484
- > <TaskResponse> submit_complete_invoice_async_api_v1_processing_invoices_submit_complete_async_post(submit_complete_invoice_request, opts)
485
-
486
- Submit a complete invoice (asynchronous with Celery)
487
-
488
- 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).
489
-
490
- ### Examples
491
-
492
- ```ruby
493
- require 'time'
494
- require 'factpulse'
495
- # setup authorization
496
- FactPulse.configure do |config|
497
- # Configure Bearer authorization: HTTPBearer
498
- config.access_token = 'YOUR_BEARER_TOKEN'
499
- end
500
-
501
- api_instance = FactPulse::InvoiceProcessingApi.new
502
- submit_complete_invoice_request = FactPulse::SubmitCompleteInvoiceRequest.new({invoice_data: FactPulse::SimplifiedInvoiceData.new({number: 'number_example', supplier: { key: 3.56}, recipient: { key: 3.56}, lines: [{ key: 3.56}]}), source_pdf: 'source_pdf_example', destination: FactPulse::AFNORDestination.new}) # SubmitCompleteInvoiceRequest |
503
- opts = {
504
- callback_url: 'callback_url_example', # String | Webhook URL for async notification when submission completes.
505
- webhook_mode: 'webhook_mode_example' # String | Webhook content delivery: 'inline' (base64 in payload) or 'download_url' (temporary URL, 1h TTL)
506
- }
507
-
508
- begin
509
- # Submit a complete invoice (asynchronous with Celery)
510
- result = api_instance.submit_complete_invoice_async_api_v1_processing_invoices_submit_complete_async_post(submit_complete_invoice_request, opts)
511
- p result
512
- rescue FactPulse::ApiError => e
513
- puts "Error when calling InvoiceProcessingApi->submit_complete_invoice_async_api_v1_processing_invoices_submit_complete_async_post: #{e}"
514
- end
515
- ```
516
-
517
- #### Using the submit_complete_invoice_async_api_v1_processing_invoices_submit_complete_async_post_with_http_info variant
518
-
519
- This returns an Array which contains the response data, status code and headers.
520
-
521
- > <Array(<TaskResponse>, Integer, Hash)> submit_complete_invoice_async_api_v1_processing_invoices_submit_complete_async_post_with_http_info(submit_complete_invoice_request, opts)
522
-
523
- ```ruby
524
- begin
525
- # Submit a complete invoice (asynchronous with Celery)
526
- data, status_code, headers = api_instance.submit_complete_invoice_async_api_v1_processing_invoices_submit_complete_async_post_with_http_info(submit_complete_invoice_request, opts)
527
- p status_code # => 2xx
528
- p headers # => { ... }
529
- p data # => <TaskResponse>
530
- rescue FactPulse::ApiError => e
531
- puts "Error when calling InvoiceProcessingApi->submit_complete_invoice_async_api_v1_processing_invoices_submit_complete_async_post_with_http_info: #{e}"
532
- end
533
- ```
534
-
535
- ### Parameters
536
-
537
- | Name | Type | Description | Notes |
538
- | ---- | ---- | ----------- | ----- |
539
- | **submit_complete_invoice_request** | [**SubmitCompleteInvoiceRequest**](SubmitCompleteInvoiceRequest.md) | | |
540
- | **callback_url** | **String** | Webhook URL for async notification when submission completes. | [optional] |
541
- | **webhook_mode** | **String** | Webhook content delivery: &#39;inline&#39; (base64 in payload) or &#39;download_url&#39; (temporary URL, 1h TTL) | [optional][default to &#39;inline&#39;] |
542
-
543
- ### Return type
544
-
545
- [**TaskResponse**](TaskResponse.md)
546
-
547
- ### Authorization
548
-
549
- [HTTPBearer](../README.md#HTTPBearer)
550
-
551
- ### HTTP request headers
552
-
553
- - **Content-Type**: application/json
554
- - **Accept**: application/json
555
-
556
-
557
- ## validate_facturx_pdf_api_v1_processing_validate_facturx_pdf_post
558
-
559
- > <PDFValidationResultAPI> validate_facturx_pdf_api_v1_processing_validate_facturx_pdf_post(pdf_file, opts)
560
-
561
- Validate a complete Factur-X PDF
562
-
563
- 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)
564
-
565
- ### Examples
566
-
567
- ```ruby
568
- require 'time'
569
- require 'factpulse'
570
- # setup authorization
571
- FactPulse.configure do |config|
572
- # Configure Bearer authorization: HTTPBearer
573
- config.access_token = 'YOUR_BEARER_TOKEN'
574
- end
575
-
576
- api_instance = FactPulse::InvoiceProcessingApi.new
577
- pdf_file = File.new('/path/to/some/file') # File | Factur-X PDF file to validate (.pdf format).
578
- opts = {
579
- profile: FactPulse::APIProfile::MINIMUM, # APIProfile |
580
- use_verapdf: true, # Boolean | Enable strict PDF/A validation with VeraPDF (recommended for production). If False, uses basic metadata validation.
581
- skip_br_fr: true # Boolean |
582
- }
583
-
584
- begin
585
- # Validate a complete Factur-X PDF
586
- result = api_instance.validate_facturx_pdf_api_v1_processing_validate_facturx_pdf_post(pdf_file, opts)
587
- p result
588
- rescue FactPulse::ApiError => e
589
- puts "Error when calling InvoiceProcessingApi->validate_facturx_pdf_api_v1_processing_validate_facturx_pdf_post: #{e}"
590
- end
591
- ```
592
-
593
- #### Using the validate_facturx_pdf_api_v1_processing_validate_facturx_pdf_post_with_http_info variant
594
-
595
- This returns an Array which contains the response data, status code and headers.
596
-
597
- > <Array(<PDFValidationResultAPI>, Integer, Hash)> validate_facturx_pdf_api_v1_processing_validate_facturx_pdf_post_with_http_info(pdf_file, opts)
598
-
599
- ```ruby
600
- begin
601
- # Validate a complete Factur-X PDF
602
- data, status_code, headers = api_instance.validate_facturx_pdf_api_v1_processing_validate_facturx_pdf_post_with_http_info(pdf_file, opts)
603
- p status_code # => 2xx
604
- p headers # => { ... }
605
- p data # => <PDFValidationResultAPI>
606
- rescue FactPulse::ApiError => e
607
- puts "Error when calling InvoiceProcessingApi->validate_facturx_pdf_api_v1_processing_validate_facturx_pdf_post_with_http_info: #{e}"
608
- end
609
- ```
610
-
611
- ### Parameters
612
-
613
- | Name | Type | Description | Notes |
614
- | ---- | ---- | ----------- | ----- |
615
- | **pdf_file** | **File** | Factur-X PDF file to validate (.pdf format). | |
616
- | **profile** | [**APIProfile**](APIProfile.md) | | [optional] |
617
- | **use_verapdf** | **Boolean** | Enable strict PDF/A validation with VeraPDF (recommended for production). If False, uses basic metadata validation. | [optional][default to false] |
618
- | **skip_br_fr** | **Boolean** | | [optional] |
619
-
620
- ### Return type
621
-
622
- [**PDFValidationResultAPI**](PDFValidationResultAPI.md)
623
-
624
- ### Authorization
625
-
626
- [HTTPBearer](../README.md#HTTPBearer)
627
-
628
- ### HTTP request headers
629
-
630
- - **Content-Type**: multipart/form-data
631
- - **Accept**: application/json
632
-
633
-
634
- ## validate_facturx_pdf_async_api_v1_processing_validate_facturx_async_post
635
-
636
- > <TaskResponse> validate_facturx_pdf_async_api_v1_processing_validate_facturx_async_post(pdf_file, opts)
637
-
638
- Validate a Factur-X PDF (asynchronous with polling)
639
-
640
- 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
641
-
642
- ### Examples
643
-
644
- ```ruby
645
- require 'time'
646
- require 'factpulse'
647
- # setup authorization
648
- FactPulse.configure do |config|
649
- # Configure Bearer authorization: HTTPBearer
650
- config.access_token = 'YOUR_BEARER_TOKEN'
651
- end
652
-
653
- api_instance = FactPulse::InvoiceProcessingApi.new
654
- pdf_file = File.new('/path/to/some/file') # File | Factur-X PDF file to validate (.pdf format).
655
- opts = {
656
- profile: FactPulse::APIProfile::MINIMUM, # APIProfile |
657
- use_verapdf: true, # Boolean | Enable strict PDF/A validation with VeraPDF (recommended for production). May take several seconds.
658
- callback_url: 'callback_url_example', # String |
659
- webhook_mode: 'webhook_mode_example' # String | Webhook content delivery: 'inline' (base64 in payload) or 'download_url' (temporary URL, 1h TTL)
660
- }
661
-
662
- begin
663
- # Validate a Factur-X PDF (asynchronous with polling)
664
- result = api_instance.validate_facturx_pdf_async_api_v1_processing_validate_facturx_async_post(pdf_file, opts)
665
- p result
666
- rescue FactPulse::ApiError => e
667
- puts "Error when calling InvoiceProcessingApi->validate_facturx_pdf_async_api_v1_processing_validate_facturx_async_post: #{e}"
668
- end
669
- ```
670
-
671
- #### Using the validate_facturx_pdf_async_api_v1_processing_validate_facturx_async_post_with_http_info variant
672
-
673
- This returns an Array which contains the response data, status code and headers.
674
-
675
- > <Array(<TaskResponse>, Integer, Hash)> validate_facturx_pdf_async_api_v1_processing_validate_facturx_async_post_with_http_info(pdf_file, opts)
676
-
677
- ```ruby
678
- begin
679
- # Validate a Factur-X PDF (asynchronous with polling)
680
- data, status_code, headers = api_instance.validate_facturx_pdf_async_api_v1_processing_validate_facturx_async_post_with_http_info(pdf_file, opts)
681
- p status_code # => 2xx
682
- p headers # => { ... }
683
- p data # => <TaskResponse>
684
- rescue FactPulse::ApiError => e
685
- puts "Error when calling InvoiceProcessingApi->validate_facturx_pdf_async_api_v1_processing_validate_facturx_async_post_with_http_info: #{e}"
686
- end
687
- ```
688
-
689
- ### Parameters
690
-
691
- | Name | Type | Description | Notes |
692
- | ---- | ---- | ----------- | ----- |
693
- | **pdf_file** | **File** | Factur-X PDF file to validate (.pdf format). | |
694
- | **profile** | [**APIProfile**](APIProfile.md) | | [optional] |
695
- | **use_verapdf** | **Boolean** | Enable strict PDF/A validation with VeraPDF (recommended for production). May take several seconds. | [optional][default to false] |
696
- | **callback_url** | **String** | | [optional] |
697
- | **webhook_mode** | **String** | Webhook content delivery: &#39;inline&#39; (base64 in payload) or &#39;download_url&#39; (temporary URL, 1h TTL) | [optional][default to &#39;inline&#39;] |
698
-
699
- ### Return type
700
-
701
- [**TaskResponse**](TaskResponse.md)
702
-
703
- ### Authorization
704
-
705
- [HTTPBearer](../README.md#HTTPBearer)
706
-
707
- ### HTTP request headers
708
-
709
- - **Content-Type**: multipart/form-data
710
- - **Accept**: application/json
711
-
712
-
713
- ## validate_pdf_signature_endpoint_api_v1_processing_validate_pdf_signature_post
714
-
715
- > Object validate_pdf_signature_endpoint_api_v1_processing_validate_pdf_signature_post(pdf_file)
716
-
717
- Validate electronic signatures of a PDF
718
-
719
- 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.
720
-
721
- ### Examples
722
-
723
- ```ruby
724
- require 'time'
725
- require 'factpulse'
726
- # setup authorization
727
- FactPulse.configure do |config|
728
- # Configure Bearer authorization: HTTPBearer
729
- config.access_token = 'YOUR_BEARER_TOKEN'
730
- end
731
-
732
- api_instance = FactPulse::InvoiceProcessingApi.new
733
- pdf_file = File.new('/path/to/some/file') # File | PDF file to validate (will be analyzed to detect and validate signatures)
734
-
735
- begin
736
- # Validate electronic signatures of a PDF
737
- result = api_instance.validate_pdf_signature_endpoint_api_v1_processing_validate_pdf_signature_post(pdf_file)
738
- p result
739
- rescue FactPulse::ApiError => e
740
- puts "Error when calling InvoiceProcessingApi->validate_pdf_signature_endpoint_api_v1_processing_validate_pdf_signature_post: #{e}"
741
- end
742
- ```
743
-
744
- #### Using the validate_pdf_signature_endpoint_api_v1_processing_validate_pdf_signature_post_with_http_info variant
745
-
746
- This returns an Array which contains the response data, status code and headers.
747
-
748
- > <Array(Object, Integer, Hash)> validate_pdf_signature_endpoint_api_v1_processing_validate_pdf_signature_post_with_http_info(pdf_file)
749
-
750
- ```ruby
751
- begin
752
- # Validate electronic signatures of a PDF
753
- data, status_code, headers = api_instance.validate_pdf_signature_endpoint_api_v1_processing_validate_pdf_signature_post_with_http_info(pdf_file)
754
- p status_code # => 2xx
755
- p headers # => { ... }
756
- p data # => Object
757
- rescue FactPulse::ApiError => e
758
- puts "Error when calling InvoiceProcessingApi->validate_pdf_signature_endpoint_api_v1_processing_validate_pdf_signature_post_with_http_info: #{e}"
759
- end
760
- ```
761
-
762
- ### Parameters
763
-
764
- | Name | Type | Description | Notes |
765
- | ---- | ---- | ----------- | ----- |
766
- | **pdf_file** | **File** | PDF file to validate (will be analyzed to detect and validate signatures) | |
767
-
768
- ### Return type
769
-
770
- **Object**
771
-
772
- ### Authorization
773
-
774
- [HTTPBearer](../README.md#HTTPBearer)
775
-
776
- ### HTTP request headers
777
-
778
- - **Content-Type**: multipart/form-data
779
- - **Accept**: application/json
780
-
781
-
782
- ## validate_xml_api_v1_processing_validate_xml_post
783
-
784
- > <ValidationSuccessResponse> validate_xml_api_v1_processing_validate_xml_post(xml_file, opts)
785
-
786
- Validate an existing Factur-X XML
787
-
788
- 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
789
-
790
- ### Examples
791
-
792
- ```ruby
793
- require 'time'
794
- require 'factpulse'
795
- # setup authorization
796
- FactPulse.configure do |config|
797
- # Configure Bearer authorization: HTTPBearer
798
- config.access_token = 'YOUR_BEARER_TOKEN'
799
- end
800
-
801
- api_instance = FactPulse::InvoiceProcessingApi.new
802
- xml_file = File.new('/path/to/some/file') # File | Factur-X XML file to validate (.xml format).
803
- opts = {
804
- profile: FactPulse::APIProfile::MINIMUM, # APIProfile | Validation profile (MINIMUM, BASIC, EN16931, EXTENDED).
805
- skip_br_fr: true # Boolean |
806
- }
807
-
808
- begin
809
- # Validate an existing Factur-X XML
810
- result = api_instance.validate_xml_api_v1_processing_validate_xml_post(xml_file, opts)
811
- p result
812
- rescue FactPulse::ApiError => e
813
- puts "Error when calling InvoiceProcessingApi->validate_xml_api_v1_processing_validate_xml_post: #{e}"
814
- end
815
- ```
816
-
817
- #### Using the validate_xml_api_v1_processing_validate_xml_post_with_http_info variant
818
-
819
- This returns an Array which contains the response data, status code and headers.
820
-
821
- > <Array(<ValidationSuccessResponse>, Integer, Hash)> validate_xml_api_v1_processing_validate_xml_post_with_http_info(xml_file, opts)
822
-
823
- ```ruby
824
- begin
825
- # Validate an existing Factur-X XML
826
- data, status_code, headers = api_instance.validate_xml_api_v1_processing_validate_xml_post_with_http_info(xml_file, opts)
827
- p status_code # => 2xx
828
- p headers # => { ... }
829
- p data # => <ValidationSuccessResponse>
830
- rescue FactPulse::ApiError => e
831
- puts "Error when calling InvoiceProcessingApi->validate_xml_api_v1_processing_validate_xml_post_with_http_info: #{e}"
832
- end
833
- ```
834
-
835
- ### Parameters
836
-
837
- | Name | Type | Description | Notes |
838
- | ---- | ---- | ----------- | ----- |
839
- | **xml_file** | **File** | Factur-X XML file to validate (.xml format). | |
840
- | **profile** | [**APIProfile**](APIProfile.md) | Validation profile (MINIMUM, BASIC, EN16931, EXTENDED). | [optional] |
841
- | **skip_br_fr** | **Boolean** | | [optional] |
842
-
843
- ### Return type
844
-
845
- [**ValidationSuccessResponse**](ValidationSuccessResponse.md)
846
-
847
- ### Authorization
848
-
849
- [HTTPBearer](../README.md#HTTPBearer)
850
-
851
- ### HTTP request headers
852
-
853
- - **Content-Type**: multipart/form-data
854
- - **Accept**: application/json
855
-