factpulse 1.0.9__py3-none-any.whl → 3.0.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of factpulse might be problematic. Click here for more details.

Files changed (269) hide show
  1. factpulse/__init__.py +275 -203
  2. factpulse/api/__init__.py +5 -3
  3. factpulse/api/afnorpdppa_api.py +559 -9
  4. factpulse/api/afnorpdppa_directory_service_api.py +4313 -66
  5. factpulse/api/afnorpdppa_flow_service_api.py +23 -23
  6. factpulse/api/chorus_pro_api.py +362 -404
  7. factpulse/api/{signature_lectronique_api.py → document_conversion_api.py} +519 -371
  8. factpulse/api/health_api.py +526 -0
  9. factpulse/api/invoice_processing_api.py +3437 -0
  10. factpulse/api/pdfxml_verification_api.py +1719 -0
  11. factpulse/api/{sant_api.py → user_api.py} +18 -17
  12. factpulse/api_client.py +6 -6
  13. factpulse/configuration.py +6 -4
  14. factpulse/exceptions.py +8 -5
  15. factpulse/models/__init__.py +133 -99
  16. factpulse/models/acknowledgment_status.py +38 -0
  17. factpulse/models/additional_document.py +115 -0
  18. factpulse/models/afnor_credentials.py +106 -0
  19. factpulse/models/afnor_destination.py +127 -0
  20. factpulse/models/afnor_health_check_response.py +91 -0
  21. factpulse/models/afnor_result.py +105 -0
  22. factpulse/models/allowance_charge.py +147 -0
  23. factpulse/models/allowance_reason_code.py +42 -0
  24. factpulse/models/allowance_total_amount.py +145 -0
  25. factpulse/models/amount.py +139 -0
  26. factpulse/models/amount_due.py +139 -0
  27. factpulse/models/api_error.py +104 -0
  28. factpulse/models/async_task_status.py +97 -0
  29. factpulse/models/base_amount.py +145 -0
  30. factpulse/models/bounding_box_schema.py +100 -0
  31. factpulse/models/celery_status.py +40 -0
  32. factpulse/models/certificate_info_response.py +24 -24
  33. factpulse/models/charge_total_amount.py +145 -0
  34. factpulse/models/chorus_pro_destination.py +108 -0
  35. factpulse/models/chorus_pro_result.py +101 -0
  36. factpulse/models/contact.py +113 -0
  37. factpulse/models/convert_error_response.py +105 -0
  38. factpulse/models/convert_pending_input_response.py +114 -0
  39. factpulse/models/convert_resume_request.py +87 -0
  40. factpulse/models/convert_success_response.py +126 -0
  41. factpulse/models/convert_validation_failed_response.py +120 -0
  42. factpulse/models/delivery_party.py +121 -0
  43. factpulse/models/destination.py +27 -27
  44. factpulse/models/document_type_info.py +91 -0
  45. factpulse/models/electronic_address.py +90 -0
  46. factpulse/models/enriched_invoice_info.py +133 -0
  47. factpulse/models/error_level.py +37 -0
  48. factpulse/models/error_source.py +43 -0
  49. factpulse/models/extraction_info.py +93 -0
  50. factpulse/models/factur_x_invoice.py +320 -0
  51. factpulse/models/factur_x_profile.py +39 -0
  52. factpulse/models/factur_xpdf_info.py +91 -0
  53. factpulse/models/facture_electronique_rest_api_schemas_chorus_pro_chorus_pro_credentials.py +95 -0
  54. factpulse/models/facture_electronique_rest_api_schemas_processing_chorus_pro_credentials.py +115 -0
  55. factpulse/models/field_status.py +40 -0
  56. factpulse/models/file_info.py +94 -0
  57. factpulse/models/files_info.py +106 -0
  58. factpulse/models/flow_direction.py +37 -0
  59. factpulse/models/flow_profile.py +38 -0
  60. factpulse/models/flow_summary.py +131 -0
  61. factpulse/models/flow_syntax.py +40 -0
  62. factpulse/models/flow_type.py +40 -0
  63. factpulse/models/generate_certificate_request.py +26 -26
  64. factpulse/models/generate_certificate_response.py +15 -15
  65. factpulse/models/get_chorus_pro_id_request.py +100 -0
  66. factpulse/models/get_chorus_pro_id_response.py +98 -0
  67. factpulse/models/get_invoice_request.py +98 -0
  68. factpulse/models/get_invoice_response.py +142 -0
  69. factpulse/models/get_structure_request.py +100 -0
  70. factpulse/models/get_structure_response.py +142 -0
  71. factpulse/models/global_allowance_amount.py +139 -0
  72. factpulse/models/gross_unit_price.py +145 -0
  73. factpulse/models/http_validation_error.py +2 -2
  74. factpulse/models/incoming_invoice.py +196 -0
  75. factpulse/models/incoming_supplier.py +144 -0
  76. factpulse/models/invoice_format.py +38 -0
  77. factpulse/models/invoice_line.py +354 -0
  78. factpulse/models/invoice_line_allowance_amount.py +145 -0
  79. factpulse/models/invoice_note.py +94 -0
  80. factpulse/models/invoice_references.py +194 -0
  81. factpulse/models/invoice_status.py +96 -0
  82. factpulse/models/invoice_totals.py +177 -0
  83. factpulse/models/invoice_totals_prepayment.py +145 -0
  84. factpulse/models/invoice_type_code.py +51 -0
  85. factpulse/models/invoicing_framework.py +110 -0
  86. factpulse/models/invoicing_framework_code.py +39 -0
  87. factpulse/models/line_net_amount.py +145 -0
  88. factpulse/models/line_total_amount.py +145 -0
  89. factpulse/models/mandatory_note_schema.py +124 -0
  90. factpulse/models/manual_rate.py +139 -0
  91. factpulse/models/manual_vat_rate.py +139 -0
  92. factpulse/models/missing_field.py +107 -0
  93. factpulse/models/operation_nature.py +49 -0
  94. factpulse/models/output_format.py +37 -0
  95. factpulse/models/page_dimensions_schema.py +89 -0
  96. factpulse/models/payee.py +168 -0
  97. factpulse/models/payment_card.py +99 -0
  98. factpulse/models/payment_means.py +41 -0
  99. factpulse/models/pdf_validation_result_api.py +169 -0
  100. factpulse/models/pdp_credentials.py +20 -13
  101. factpulse/models/percentage.py +145 -0
  102. factpulse/models/postal_address.py +134 -0
  103. factpulse/models/price_allowance_amount.py +145 -0
  104. factpulse/models/price_basis_quantity.py +145 -0
  105. factpulse/models/processing_options.py +94 -0
  106. factpulse/models/product_characteristic.py +89 -0
  107. factpulse/models/product_classification.py +101 -0
  108. factpulse/models/quantity.py +139 -0
  109. factpulse/models/recipient.py +167 -0
  110. factpulse/models/rounding_amount.py +145 -0
  111. factpulse/models/scheme_id.py +14 -8
  112. factpulse/models/search_flow_request.py +143 -0
  113. factpulse/models/search_flow_response.py +101 -0
  114. factpulse/models/search_services_response.py +101 -0
  115. factpulse/models/search_structure_request.py +119 -0
  116. factpulse/models/search_structure_response.py +101 -0
  117. factpulse/models/signature_info.py +6 -6
  118. factpulse/models/signature_info_api.py +122 -0
  119. factpulse/models/signature_parameters.py +133 -0
  120. factpulse/models/simplified_invoice_data.py +124 -0
  121. factpulse/models/structure_info.py +14 -14
  122. factpulse/models/structure_parameters.py +91 -0
  123. factpulse/models/structure_service.py +93 -0
  124. factpulse/models/submission_mode.py +38 -0
  125. factpulse/models/submit_complete_invoice_request.py +116 -0
  126. factpulse/models/submit_complete_invoice_response.py +145 -0
  127. factpulse/models/submit_flow_request.py +123 -0
  128. factpulse/models/submit_flow_response.py +109 -0
  129. factpulse/models/submit_gross_amount.py +139 -0
  130. factpulse/models/submit_invoice_request.py +176 -0
  131. factpulse/models/submit_invoice_response.py +103 -0
  132. factpulse/models/submit_net_amount.py +139 -0
  133. factpulse/models/submit_vat_amount.py +139 -0
  134. factpulse/models/supplementary_attachment.py +95 -0
  135. factpulse/models/supplier.py +225 -0
  136. factpulse/models/task_response.py +87 -0
  137. factpulse/models/tax_representative.py +95 -0
  138. factpulse/models/taxable_amount.py +139 -0
  139. factpulse/models/total_gross_amount.py +139 -0
  140. factpulse/models/total_net_amount.py +139 -0
  141. factpulse/models/total_vat_amount.py +139 -0
  142. factpulse/models/unit_net_price.py +139 -0
  143. factpulse/models/unit_of_measure.py +41 -0
  144. factpulse/models/validation_error.py +2 -2
  145. factpulse/models/validation_error_detail.py +107 -0
  146. factpulse/models/validation_error_loc_inner.py +2 -2
  147. factpulse/models/validation_error_response.py +87 -0
  148. factpulse/models/validation_info.py +105 -0
  149. factpulse/models/validation_success_response.py +87 -0
  150. factpulse/models/vat_accounting_code.py +39 -0
  151. factpulse/models/vat_amount.py +139 -0
  152. factpulse/models/vat_category.py +44 -0
  153. factpulse/models/vat_line.py +140 -0
  154. factpulse/models/vat_point_date_code.py +38 -0
  155. factpulse/models/vat_rate.py +145 -0
  156. factpulse/models/verification_success_response.py +135 -0
  157. factpulse/models/verified_field_schema.py +129 -0
  158. factpulse/rest.py +9 -4
  159. factpulse-3.0.7.dist-info/METADATA +292 -0
  160. factpulse-3.0.7.dist-info/RECORD +168 -0
  161. factpulse-3.0.7.dist-info/top_level.txt +2 -0
  162. factpulse_helpers/__init__.py +96 -0
  163. factpulse_helpers/client.py +2111 -0
  164. factpulse_helpers/exceptions.py +253 -0
  165. factpulse/api/processing_endpoints_unifis_api.py +0 -592
  166. factpulse/api/traitement_facture_api.py +0 -3439
  167. factpulse/api/utilisateur_api.py +0 -282
  168. factpulse/models/adresse_electronique.py +0 -90
  169. factpulse/models/adresse_postale.py +0 -120
  170. factpulse/models/body_ajouter_fichier_api_v1_chorus_pro_transverses_ajouter_fichier_post.py +0 -104
  171. factpulse/models/body_completer_facture_api_v1_chorus_pro_factures_completer_post.py +0 -104
  172. factpulse/models/body_lister_services_structure_api_v1_chorus_pro_structures_id_structure_cpp_services_get.py +0 -102
  173. factpulse/models/body_rechercher_factures_destinataire_api_v1_chorus_pro_factures_rechercher_destinataire_post.py +0 -104
  174. factpulse/models/body_rechercher_factures_fournisseur_api_v1_chorus_pro_factures_rechercher_fournisseur_post.py +0 -104
  175. factpulse/models/body_recycler_facture_api_v1_chorus_pro_factures_recycler_post.py +0 -104
  176. factpulse/models/body_telecharger_groupe_factures_api_v1_chorus_pro_factures_telecharger_groupe_post.py +0 -104
  177. factpulse/models/body_traiter_facture_recue_api_v1_chorus_pro_factures_traiter_facture_recue_post.py +0 -104
  178. factpulse/models/body_valideur_consulter_facture_api_v1_chorus_pro_factures_valideur_consulter_post.py +0 -104
  179. factpulse/models/body_valideur_rechercher_factures_api_v1_chorus_pro_factures_valideur_rechercher_post.py +0 -104
  180. factpulse/models/body_valideur_traiter_facture_api_v1_chorus_pro_factures_valideur_traiter_post.py +0 -104
  181. factpulse/models/cadre_de_facturation.py +0 -102
  182. factpulse/models/categorie_tva.py +0 -44
  183. factpulse/models/chorus_pro_credentials.py +0 -95
  184. factpulse/models/code_cadre_facturation.py +0 -39
  185. factpulse/models/code_raison_reduction.py +0 -42
  186. factpulse/models/consulter_facture_request.py +0 -98
  187. factpulse/models/consulter_facture_response.py +0 -142
  188. factpulse/models/consulter_structure_request.py +0 -100
  189. factpulse/models/consulter_structure_response.py +0 -142
  190. factpulse/models/credentials_afnor.py +0 -106
  191. factpulse/models/credentials_chorus_pro.py +0 -115
  192. factpulse/models/destinataire.py +0 -116
  193. factpulse/models/destination_afnor.py +0 -127
  194. factpulse/models/destination_chorus_pro.py +0 -108
  195. factpulse/models/direction_flux.py +0 -37
  196. factpulse/models/donnees_facture_simplifiees.py +0 -124
  197. factpulse/models/facture_enrichie_info_input.py +0 -123
  198. factpulse/models/facture_enrichie_info_output.py +0 -133
  199. factpulse/models/facture_factur_x.py +0 -173
  200. factpulse/models/flux_resume.py +0 -131
  201. factpulse/models/format_sortie.py +0 -37
  202. factpulse/models/fournisseur.py +0 -146
  203. factpulse/models/information_signature_api.py +0 -122
  204. factpulse/models/ligne_de_poste.py +0 -188
  205. factpulse/models/ligne_de_poste_montant_remise_ht.py +0 -145
  206. factpulse/models/ligne_de_poste_montant_total_ligne_ht.py +0 -145
  207. factpulse/models/ligne_de_poste_taux_tva_manuel.py +0 -145
  208. factpulse/models/ligne_de_tva.py +0 -118
  209. factpulse/models/mode_depot.py +0 -38
  210. factpulse/models/mode_paiement.py +0 -41
  211. factpulse/models/montant_ht_total.py +0 -139
  212. factpulse/models/montant_total.py +0 -138
  213. factpulse/models/montant_total_acompte.py +0 -145
  214. factpulse/models/montant_total_montant_remise_globale_ttc.py +0 -145
  215. factpulse/models/montant_ttc_total.py +0 -139
  216. factpulse/models/montant_tva.py +0 -139
  217. factpulse/models/montantapayer.py +0 -139
  218. factpulse/models/montantbaseht.py +0 -139
  219. factpulse/models/montanthttotal.py +0 -139
  220. factpulse/models/montantttctotal.py +0 -139
  221. factpulse/models/montanttva.py +0 -139
  222. factpulse/models/montanttva1.py +0 -139
  223. factpulse/models/montantunitaireht.py +0 -139
  224. factpulse/models/obtenir_id_chorus_pro_request.py +0 -100
  225. factpulse/models/obtenir_id_chorus_pro_response.py +0 -98
  226. factpulse/models/options_processing.py +0 -94
  227. factpulse/models/parametres_signature.py +0 -133
  228. factpulse/models/parametres_structure.py +0 -91
  229. factpulse/models/pdf_factur_x_info.py +0 -91
  230. factpulse/models/piece_jointe_complementaire.py +0 -95
  231. factpulse/models/profil_api.py +0 -39
  232. factpulse/models/profil_flux.py +0 -38
  233. factpulse/models/quantite.py +0 -139
  234. factpulse/models/quota_info.py +0 -95
  235. factpulse/models/rechercher_services_response.py +0 -101
  236. factpulse/models/rechercher_structure_request.py +0 -119
  237. factpulse/models/rechercher_structure_response.py +0 -101
  238. factpulse/models/references.py +0 -124
  239. factpulse/models/reponse_healthcheck_afnor.py +0 -91
  240. factpulse/models/reponse_recherche_flux.py +0 -101
  241. factpulse/models/reponse_soumission_flux.py +0 -109
  242. factpulse/models/reponse_tache.py +0 -87
  243. factpulse/models/reponse_validation_erreur.py +0 -87
  244. factpulse/models/reponse_validation_succes.py +0 -87
  245. factpulse/models/requete_recherche_flux.py +0 -143
  246. factpulse/models/requete_soumission_flux.py +0 -123
  247. factpulse/models/resultat_afnor.py +0 -105
  248. factpulse/models/resultat_chorus_pro.py +0 -101
  249. factpulse/models/resultat_validation_pdfapi.py +0 -169
  250. factpulse/models/service_structure.py +0 -93
  251. factpulse/models/soumettre_facture_complete_request.py +0 -116
  252. factpulse/models/soumettre_facture_complete_response.py +0 -145
  253. factpulse/models/soumettre_facture_request.py +0 -164
  254. factpulse/models/soumettre_facture_response.py +0 -103
  255. factpulse/models/statut_acquittement.py +0 -38
  256. factpulse/models/statut_facture.py +0 -96
  257. factpulse/models/statut_tache.py +0 -99
  258. factpulse/models/syntaxe_flux.py +0 -40
  259. factpulse/models/tauxmanuel.py +0 -139
  260. factpulse/models/type_facture.py +0 -37
  261. factpulse/models/type_flux.py +0 -40
  262. factpulse/models/type_tva.py +0 -39
  263. factpulse/models/unite.py +0 -41
  264. factpulse/models/utilisateur.py +0 -128
  265. factpulse-1.0.9.dist-info/METADATA +0 -182
  266. factpulse-1.0.9.dist-info/RECORD +0 -131
  267. factpulse-1.0.9.dist-info/top_level.txt +0 -1
  268. {factpulse-1.0.9.dist-info → factpulse-3.0.7.dist-info}/WHEEL +0 -0
  269. {factpulse-1.0.9.dist-info → factpulse-3.0.7.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,1719 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ FactPulse REST API
5
+
6
+ REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://www.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://www.factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://www.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://www.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://www.factpulse.fr/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://www.factpulse.fr/documentation-api/
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from pydantic import Field, StrictBool, StrictBytes, StrictStr
20
+ from typing import Optional, Tuple, Union
21
+ from typing_extensions import Annotated
22
+ from factpulse.models.async_task_status import AsyncTaskStatus
23
+ from factpulse.models.task_response import TaskResponse
24
+ from factpulse.models.verification_success_response import VerificationSuccessResponse
25
+
26
+ from factpulse.api_client import ApiClient, RequestSerialized
27
+ from factpulse.api_response import ApiResponse
28
+ from factpulse.rest import RESTResponseType
29
+
30
+
31
+ class PDFXMLVerificationApi:
32
+ """NOTE: This class is auto generated by OpenAPI Generator
33
+ Ref: https://openapi-generator.tech
34
+
35
+ Do not edit the class manually.
36
+ """
37
+
38
+ def __init__(self, api_client=None) -> None:
39
+ if api_client is None:
40
+ api_client = ApiClient.get_default()
41
+ self.api_client = api_client
42
+
43
+
44
+ @validate_call
45
+ def get_verification_status_api_v1_verification_verify_async_task_id_status_get(
46
+ self,
47
+ task_id: StrictStr,
48
+ _request_timeout: Union[
49
+ None,
50
+ Annotated[StrictFloat, Field(gt=0)],
51
+ Tuple[
52
+ Annotated[StrictFloat, Field(gt=0)],
53
+ Annotated[StrictFloat, Field(gt=0)]
54
+ ]
55
+ ] = None,
56
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
57
+ _content_type: Optional[StrictStr] = None,
58
+ _headers: Optional[Dict[StrictStr, Any]] = None,
59
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
60
+ ) -> AsyncTaskStatus:
61
+ """Get status of an asynchronous verification
62
+
63
+ Retrieves the status and result of an asynchronous verification task. **Possible statuses:** - `PENDING`: Task waiting in queue - `STARTED`: Task currently running - `SUCCESS`: Task completed successfully (see `result`) - `FAILURE`: System error (unhandled exception) **Note:** The `result.status` field can be \"SUCCESS\" or \"ERROR\" independently of Celery status (which will always be SUCCESS if the task ran).
64
+
65
+ :param task_id: (required)
66
+ :type task_id: str
67
+ :param _request_timeout: timeout setting for this request. If one
68
+ number provided, it will be total request
69
+ timeout. It can also be a pair (tuple) of
70
+ (connection, read) timeouts.
71
+ :type _request_timeout: int, tuple(int, int), optional
72
+ :param _request_auth: set to override the auth_settings for an a single
73
+ request; this effectively ignores the
74
+ authentication in the spec for a single request.
75
+ :type _request_auth: dict, optional
76
+ :param _content_type: force content-type for the request.
77
+ :type _content_type: str, Optional
78
+ :param _headers: set to override the headers for a single
79
+ request; this effectively ignores the headers
80
+ in the spec for a single request.
81
+ :type _headers: dict, optional
82
+ :param _host_index: set to override the host_index for a single
83
+ request; this effectively ignores the host_index
84
+ in the spec for a single request.
85
+ :type _host_index: int, optional
86
+ :return: Returns the result object.
87
+ """ # noqa: E501
88
+
89
+ _param = self._get_verification_status_api_v1_verification_verify_async_task_id_status_get_serialize(
90
+ task_id=task_id,
91
+ _request_auth=_request_auth,
92
+ _content_type=_content_type,
93
+ _headers=_headers,
94
+ _host_index=_host_index
95
+ )
96
+
97
+ _response_types_map: Dict[str, Optional[str]] = {
98
+ '200': "AsyncTaskStatus",
99
+ '422': "HTTPValidationError",
100
+ }
101
+ response_data = self.api_client.call_api(
102
+ *_param,
103
+ _request_timeout=_request_timeout
104
+ )
105
+ response_data.read()
106
+ return self.api_client.response_deserialize(
107
+ response_data=response_data,
108
+ response_types_map=_response_types_map,
109
+ ).data
110
+
111
+
112
+ @validate_call
113
+ def get_verification_status_api_v1_verification_verify_async_task_id_status_get_with_http_info(
114
+ self,
115
+ task_id: StrictStr,
116
+ _request_timeout: Union[
117
+ None,
118
+ Annotated[StrictFloat, Field(gt=0)],
119
+ Tuple[
120
+ Annotated[StrictFloat, Field(gt=0)],
121
+ Annotated[StrictFloat, Field(gt=0)]
122
+ ]
123
+ ] = None,
124
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
125
+ _content_type: Optional[StrictStr] = None,
126
+ _headers: Optional[Dict[StrictStr, Any]] = None,
127
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
128
+ ) -> ApiResponse[AsyncTaskStatus]:
129
+ """Get status of an asynchronous verification
130
+
131
+ Retrieves the status and result of an asynchronous verification task. **Possible statuses:** - `PENDING`: Task waiting in queue - `STARTED`: Task currently running - `SUCCESS`: Task completed successfully (see `result`) - `FAILURE`: System error (unhandled exception) **Note:** The `result.status` field can be \"SUCCESS\" or \"ERROR\" independently of Celery status (which will always be SUCCESS if the task ran).
132
+
133
+ :param task_id: (required)
134
+ :type task_id: str
135
+ :param _request_timeout: timeout setting for this request. If one
136
+ number provided, it will be total request
137
+ timeout. It can also be a pair (tuple) of
138
+ (connection, read) timeouts.
139
+ :type _request_timeout: int, tuple(int, int), optional
140
+ :param _request_auth: set to override the auth_settings for an a single
141
+ request; this effectively ignores the
142
+ authentication in the spec for a single request.
143
+ :type _request_auth: dict, optional
144
+ :param _content_type: force content-type for the request.
145
+ :type _content_type: str, Optional
146
+ :param _headers: set to override the headers for a single
147
+ request; this effectively ignores the headers
148
+ in the spec for a single request.
149
+ :type _headers: dict, optional
150
+ :param _host_index: set to override the host_index for a single
151
+ request; this effectively ignores the host_index
152
+ in the spec for a single request.
153
+ :type _host_index: int, optional
154
+ :return: Returns the result object.
155
+ """ # noqa: E501
156
+
157
+ _param = self._get_verification_status_api_v1_verification_verify_async_task_id_status_get_serialize(
158
+ task_id=task_id,
159
+ _request_auth=_request_auth,
160
+ _content_type=_content_type,
161
+ _headers=_headers,
162
+ _host_index=_host_index
163
+ )
164
+
165
+ _response_types_map: Dict[str, Optional[str]] = {
166
+ '200': "AsyncTaskStatus",
167
+ '422': "HTTPValidationError",
168
+ }
169
+ response_data = self.api_client.call_api(
170
+ *_param,
171
+ _request_timeout=_request_timeout
172
+ )
173
+ response_data.read()
174
+ return self.api_client.response_deserialize(
175
+ response_data=response_data,
176
+ response_types_map=_response_types_map,
177
+ )
178
+
179
+
180
+ @validate_call
181
+ def get_verification_status_api_v1_verification_verify_async_task_id_status_get_without_preload_content(
182
+ self,
183
+ task_id: StrictStr,
184
+ _request_timeout: Union[
185
+ None,
186
+ Annotated[StrictFloat, Field(gt=0)],
187
+ Tuple[
188
+ Annotated[StrictFloat, Field(gt=0)],
189
+ Annotated[StrictFloat, Field(gt=0)]
190
+ ]
191
+ ] = None,
192
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
193
+ _content_type: Optional[StrictStr] = None,
194
+ _headers: Optional[Dict[StrictStr, Any]] = None,
195
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
196
+ ) -> RESTResponseType:
197
+ """Get status of an asynchronous verification
198
+
199
+ Retrieves the status and result of an asynchronous verification task. **Possible statuses:** - `PENDING`: Task waiting in queue - `STARTED`: Task currently running - `SUCCESS`: Task completed successfully (see `result`) - `FAILURE`: System error (unhandled exception) **Note:** The `result.status` field can be \"SUCCESS\" or \"ERROR\" independently of Celery status (which will always be SUCCESS if the task ran).
200
+
201
+ :param task_id: (required)
202
+ :type task_id: str
203
+ :param _request_timeout: timeout setting for this request. If one
204
+ number provided, it will be total request
205
+ timeout. It can also be a pair (tuple) of
206
+ (connection, read) timeouts.
207
+ :type _request_timeout: int, tuple(int, int), optional
208
+ :param _request_auth: set to override the auth_settings for an a single
209
+ request; this effectively ignores the
210
+ authentication in the spec for a single request.
211
+ :type _request_auth: dict, optional
212
+ :param _content_type: force content-type for the request.
213
+ :type _content_type: str, Optional
214
+ :param _headers: set to override the headers for a single
215
+ request; this effectively ignores the headers
216
+ in the spec for a single request.
217
+ :type _headers: dict, optional
218
+ :param _host_index: set to override the host_index for a single
219
+ request; this effectively ignores the host_index
220
+ in the spec for a single request.
221
+ :type _host_index: int, optional
222
+ :return: Returns the result object.
223
+ """ # noqa: E501
224
+
225
+ _param = self._get_verification_status_api_v1_verification_verify_async_task_id_status_get_serialize(
226
+ task_id=task_id,
227
+ _request_auth=_request_auth,
228
+ _content_type=_content_type,
229
+ _headers=_headers,
230
+ _host_index=_host_index
231
+ )
232
+
233
+ _response_types_map: Dict[str, Optional[str]] = {
234
+ '200': "AsyncTaskStatus",
235
+ '422': "HTTPValidationError",
236
+ }
237
+ response_data = self.api_client.call_api(
238
+ *_param,
239
+ _request_timeout=_request_timeout
240
+ )
241
+ return response_data.response
242
+
243
+
244
+ def _get_verification_status_api_v1_verification_verify_async_task_id_status_get_serialize(
245
+ self,
246
+ task_id,
247
+ _request_auth,
248
+ _content_type,
249
+ _headers,
250
+ _host_index,
251
+ ) -> RequestSerialized:
252
+
253
+ _host = None
254
+
255
+ _collection_formats: Dict[str, str] = {
256
+ }
257
+
258
+ _path_params: Dict[str, str] = {}
259
+ _query_params: List[Tuple[str, str]] = []
260
+ _header_params: Dict[str, Optional[str]] = _headers or {}
261
+ _form_params: List[Tuple[str, str]] = []
262
+ _files: Dict[
263
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
264
+ ] = {}
265
+ _body_params: Optional[bytes] = None
266
+
267
+ # process the path parameters
268
+ if task_id is not None:
269
+ _path_params['task_id'] = task_id
270
+ # process the query parameters
271
+ # process the header parameters
272
+ # process the form parameters
273
+ # process the body parameter
274
+
275
+
276
+ # set the HTTP header `Accept`
277
+ if 'Accept' not in _header_params:
278
+ _header_params['Accept'] = self.api_client.select_header_accept(
279
+ [
280
+ 'application/json'
281
+ ]
282
+ )
283
+
284
+
285
+ # authentication setting
286
+ _auth_settings: List[str] = [
287
+ 'HTTPBearer'
288
+ ]
289
+
290
+ return self.api_client.param_serialize(
291
+ method='GET',
292
+ resource_path='/api/v1/verification/verify-async/{task_id}/status',
293
+ path_params=_path_params,
294
+ query_params=_query_params,
295
+ header_params=_header_params,
296
+ body=_body_params,
297
+ post_params=_form_params,
298
+ files=_files,
299
+ auth_settings=_auth_settings,
300
+ collection_formats=_collection_formats,
301
+ _host=_host,
302
+ _request_auth=_request_auth
303
+ )
304
+
305
+
306
+
307
+
308
+ @validate_call
309
+ def get_verification_status_api_v1_verification_verify_async_task_id_status_get_0(
310
+ self,
311
+ task_id: StrictStr,
312
+ _request_timeout: Union[
313
+ None,
314
+ Annotated[StrictFloat, Field(gt=0)],
315
+ Tuple[
316
+ Annotated[StrictFloat, Field(gt=0)],
317
+ Annotated[StrictFloat, Field(gt=0)]
318
+ ]
319
+ ] = None,
320
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
321
+ _content_type: Optional[StrictStr] = None,
322
+ _headers: Optional[Dict[StrictStr, Any]] = None,
323
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
324
+ ) -> AsyncTaskStatus:
325
+ """Get status of an asynchronous verification
326
+
327
+ Retrieves the status and result of an asynchronous verification task. **Possible statuses:** - `PENDING`: Task waiting in queue - `STARTED`: Task currently running - `SUCCESS`: Task completed successfully (see `result`) - `FAILURE`: System error (unhandled exception) **Note:** The `result.status` field can be \"SUCCESS\" or \"ERROR\" independently of Celery status (which will always be SUCCESS if the task ran).
328
+
329
+ :param task_id: (required)
330
+ :type task_id: str
331
+ :param _request_timeout: timeout setting for this request. If one
332
+ number provided, it will be total request
333
+ timeout. It can also be a pair (tuple) of
334
+ (connection, read) timeouts.
335
+ :type _request_timeout: int, tuple(int, int), optional
336
+ :param _request_auth: set to override the auth_settings for an a single
337
+ request; this effectively ignores the
338
+ authentication in the spec for a single request.
339
+ :type _request_auth: dict, optional
340
+ :param _content_type: force content-type for the request.
341
+ :type _content_type: str, Optional
342
+ :param _headers: set to override the headers for a single
343
+ request; this effectively ignores the headers
344
+ in the spec for a single request.
345
+ :type _headers: dict, optional
346
+ :param _host_index: set to override the host_index for a single
347
+ request; this effectively ignores the host_index
348
+ in the spec for a single request.
349
+ :type _host_index: int, optional
350
+ :return: Returns the result object.
351
+ """ # noqa: E501
352
+
353
+ _param = self._get_verification_status_api_v1_verification_verify_async_task_id_status_get_0_serialize(
354
+ task_id=task_id,
355
+ _request_auth=_request_auth,
356
+ _content_type=_content_type,
357
+ _headers=_headers,
358
+ _host_index=_host_index
359
+ )
360
+
361
+ _response_types_map: Dict[str, Optional[str]] = {
362
+ '200': "AsyncTaskStatus",
363
+ '422': "HTTPValidationError",
364
+ }
365
+ response_data = self.api_client.call_api(
366
+ *_param,
367
+ _request_timeout=_request_timeout
368
+ )
369
+ response_data.read()
370
+ return self.api_client.response_deserialize(
371
+ response_data=response_data,
372
+ response_types_map=_response_types_map,
373
+ ).data
374
+
375
+
376
+ @validate_call
377
+ def get_verification_status_api_v1_verification_verify_async_task_id_status_get_0_with_http_info(
378
+ self,
379
+ task_id: StrictStr,
380
+ _request_timeout: Union[
381
+ None,
382
+ Annotated[StrictFloat, Field(gt=0)],
383
+ Tuple[
384
+ Annotated[StrictFloat, Field(gt=0)],
385
+ Annotated[StrictFloat, Field(gt=0)]
386
+ ]
387
+ ] = None,
388
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
389
+ _content_type: Optional[StrictStr] = None,
390
+ _headers: Optional[Dict[StrictStr, Any]] = None,
391
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
392
+ ) -> ApiResponse[AsyncTaskStatus]:
393
+ """Get status of an asynchronous verification
394
+
395
+ Retrieves the status and result of an asynchronous verification task. **Possible statuses:** - `PENDING`: Task waiting in queue - `STARTED`: Task currently running - `SUCCESS`: Task completed successfully (see `result`) - `FAILURE`: System error (unhandled exception) **Note:** The `result.status` field can be \"SUCCESS\" or \"ERROR\" independently of Celery status (which will always be SUCCESS if the task ran).
396
+
397
+ :param task_id: (required)
398
+ :type task_id: str
399
+ :param _request_timeout: timeout setting for this request. If one
400
+ number provided, it will be total request
401
+ timeout. It can also be a pair (tuple) of
402
+ (connection, read) timeouts.
403
+ :type _request_timeout: int, tuple(int, int), optional
404
+ :param _request_auth: set to override the auth_settings for an a single
405
+ request; this effectively ignores the
406
+ authentication in the spec for a single request.
407
+ :type _request_auth: dict, optional
408
+ :param _content_type: force content-type for the request.
409
+ :type _content_type: str, Optional
410
+ :param _headers: set to override the headers for a single
411
+ request; this effectively ignores the headers
412
+ in the spec for a single request.
413
+ :type _headers: dict, optional
414
+ :param _host_index: set to override the host_index for a single
415
+ request; this effectively ignores the host_index
416
+ in the spec for a single request.
417
+ :type _host_index: int, optional
418
+ :return: Returns the result object.
419
+ """ # noqa: E501
420
+
421
+ _param = self._get_verification_status_api_v1_verification_verify_async_task_id_status_get_0_serialize(
422
+ task_id=task_id,
423
+ _request_auth=_request_auth,
424
+ _content_type=_content_type,
425
+ _headers=_headers,
426
+ _host_index=_host_index
427
+ )
428
+
429
+ _response_types_map: Dict[str, Optional[str]] = {
430
+ '200': "AsyncTaskStatus",
431
+ '422': "HTTPValidationError",
432
+ }
433
+ response_data = self.api_client.call_api(
434
+ *_param,
435
+ _request_timeout=_request_timeout
436
+ )
437
+ response_data.read()
438
+ return self.api_client.response_deserialize(
439
+ response_data=response_data,
440
+ response_types_map=_response_types_map,
441
+ )
442
+
443
+
444
+ @validate_call
445
+ def get_verification_status_api_v1_verification_verify_async_task_id_status_get_0_without_preload_content(
446
+ self,
447
+ task_id: StrictStr,
448
+ _request_timeout: Union[
449
+ None,
450
+ Annotated[StrictFloat, Field(gt=0)],
451
+ Tuple[
452
+ Annotated[StrictFloat, Field(gt=0)],
453
+ Annotated[StrictFloat, Field(gt=0)]
454
+ ]
455
+ ] = None,
456
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
457
+ _content_type: Optional[StrictStr] = None,
458
+ _headers: Optional[Dict[StrictStr, Any]] = None,
459
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
460
+ ) -> RESTResponseType:
461
+ """Get status of an asynchronous verification
462
+
463
+ Retrieves the status and result of an asynchronous verification task. **Possible statuses:** - `PENDING`: Task waiting in queue - `STARTED`: Task currently running - `SUCCESS`: Task completed successfully (see `result`) - `FAILURE`: System error (unhandled exception) **Note:** The `result.status` field can be \"SUCCESS\" or \"ERROR\" independently of Celery status (which will always be SUCCESS if the task ran).
464
+
465
+ :param task_id: (required)
466
+ :type task_id: str
467
+ :param _request_timeout: timeout setting for this request. If one
468
+ number provided, it will be total request
469
+ timeout. It can also be a pair (tuple) of
470
+ (connection, read) timeouts.
471
+ :type _request_timeout: int, tuple(int, int), optional
472
+ :param _request_auth: set to override the auth_settings for an a single
473
+ request; this effectively ignores the
474
+ authentication in the spec for a single request.
475
+ :type _request_auth: dict, optional
476
+ :param _content_type: force content-type for the request.
477
+ :type _content_type: str, Optional
478
+ :param _headers: set to override the headers for a single
479
+ request; this effectively ignores the headers
480
+ in the spec for a single request.
481
+ :type _headers: dict, optional
482
+ :param _host_index: set to override the host_index for a single
483
+ request; this effectively ignores the host_index
484
+ in the spec for a single request.
485
+ :type _host_index: int, optional
486
+ :return: Returns the result object.
487
+ """ # noqa: E501
488
+
489
+ _param = self._get_verification_status_api_v1_verification_verify_async_task_id_status_get_0_serialize(
490
+ task_id=task_id,
491
+ _request_auth=_request_auth,
492
+ _content_type=_content_type,
493
+ _headers=_headers,
494
+ _host_index=_host_index
495
+ )
496
+
497
+ _response_types_map: Dict[str, Optional[str]] = {
498
+ '200': "AsyncTaskStatus",
499
+ '422': "HTTPValidationError",
500
+ }
501
+ response_data = self.api_client.call_api(
502
+ *_param,
503
+ _request_timeout=_request_timeout
504
+ )
505
+ return response_data.response
506
+
507
+
508
+ def _get_verification_status_api_v1_verification_verify_async_task_id_status_get_0_serialize(
509
+ self,
510
+ task_id,
511
+ _request_auth,
512
+ _content_type,
513
+ _headers,
514
+ _host_index,
515
+ ) -> RequestSerialized:
516
+
517
+ _host = None
518
+
519
+ _collection_formats: Dict[str, str] = {
520
+ }
521
+
522
+ _path_params: Dict[str, str] = {}
523
+ _query_params: List[Tuple[str, str]] = []
524
+ _header_params: Dict[str, Optional[str]] = _headers or {}
525
+ _form_params: List[Tuple[str, str]] = []
526
+ _files: Dict[
527
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
528
+ ] = {}
529
+ _body_params: Optional[bytes] = None
530
+
531
+ # process the path parameters
532
+ if task_id is not None:
533
+ _path_params['task_id'] = task_id
534
+ # process the query parameters
535
+ # process the header parameters
536
+ # process the form parameters
537
+ # process the body parameter
538
+
539
+
540
+ # set the HTTP header `Accept`
541
+ if 'Accept' not in _header_params:
542
+ _header_params['Accept'] = self.api_client.select_header_accept(
543
+ [
544
+ 'application/json'
545
+ ]
546
+ )
547
+
548
+
549
+ # authentication setting
550
+ _auth_settings: List[str] = [
551
+ 'HTTPBearer'
552
+ ]
553
+
554
+ return self.api_client.param_serialize(
555
+ method='GET',
556
+ resource_path='/api/v1/verification/verify-async/{task_id}/status',
557
+ path_params=_path_params,
558
+ query_params=_query_params,
559
+ header_params=_header_params,
560
+ body=_body_params,
561
+ post_params=_form_params,
562
+ files=_files,
563
+ auth_settings=_auth_settings,
564
+ collection_formats=_collection_formats,
565
+ _host=_host,
566
+ _request_auth=_request_auth
567
+ )
568
+
569
+
570
+
571
+
572
+ @validate_call
573
+ def verify_pdf_async_api_v1_verification_verify_async_post(
574
+ self,
575
+ pdf_file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Factur-X PDF file to verify")],
576
+ force_ocr: Annotated[Optional[StrictBool], Field(description="Force OCR usage even if PDF contains native text")] = None,
577
+ _request_timeout: Union[
578
+ None,
579
+ Annotated[StrictFloat, Field(gt=0)],
580
+ Tuple[
581
+ Annotated[StrictFloat, Field(gt=0)],
582
+ Annotated[StrictFloat, Field(gt=0)]
583
+ ]
584
+ ] = None,
585
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
586
+ _content_type: Optional[StrictStr] = None,
587
+ _headers: Optional[Dict[StrictStr, Any]] = None,
588
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
589
+ ) -> TaskResponse:
590
+ """Verify PDF/XML Factur-X compliance (asynchronous)
591
+
592
+ Verifies PDF/XML Factur-X compliance asynchronously. **IMPORTANT**: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will return a `NOT_FACTURX` error in the result. This version uses a Celery task and can call the OCR service if the PDF is an image or if `force_ocr=true`. **Returns immediately** a task ID. Use `/verify-async/{task_id}/status` to retrieve the result. **Verification principle (Factur-X 1.08):** - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF **Verified fields:** - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency **Advantages over synchronous version:** - OCR support for image PDFs (via DocTR service) - Longer timeout for large documents - Doesn't block the server
593
+
594
+ :param pdf_file: Factur-X PDF file to verify (required)
595
+ :type pdf_file: bytearray
596
+ :param force_ocr: Force OCR usage even if PDF contains native text
597
+ :type force_ocr: bool
598
+ :param _request_timeout: timeout setting for this request. If one
599
+ number provided, it will be total request
600
+ timeout. It can also be a pair (tuple) of
601
+ (connection, read) timeouts.
602
+ :type _request_timeout: int, tuple(int, int), optional
603
+ :param _request_auth: set to override the auth_settings for an a single
604
+ request; this effectively ignores the
605
+ authentication in the spec for a single request.
606
+ :type _request_auth: dict, optional
607
+ :param _content_type: force content-type for the request.
608
+ :type _content_type: str, Optional
609
+ :param _headers: set to override the headers for a single
610
+ request; this effectively ignores the headers
611
+ in the spec for a single request.
612
+ :type _headers: dict, optional
613
+ :param _host_index: set to override the host_index for a single
614
+ request; this effectively ignores the host_index
615
+ in the spec for a single request.
616
+ :type _host_index: int, optional
617
+ :return: Returns the result object.
618
+ """ # noqa: E501
619
+
620
+ _param = self._verify_pdf_async_api_v1_verification_verify_async_post_serialize(
621
+ pdf_file=pdf_file,
622
+ force_ocr=force_ocr,
623
+ _request_auth=_request_auth,
624
+ _content_type=_content_type,
625
+ _headers=_headers,
626
+ _host_index=_host_index
627
+ )
628
+
629
+ _response_types_map: Dict[str, Optional[str]] = {
630
+ '202': "TaskResponse",
631
+ '422': "HTTPValidationError",
632
+ }
633
+ response_data = self.api_client.call_api(
634
+ *_param,
635
+ _request_timeout=_request_timeout
636
+ )
637
+ response_data.read()
638
+ return self.api_client.response_deserialize(
639
+ response_data=response_data,
640
+ response_types_map=_response_types_map,
641
+ ).data
642
+
643
+
644
+ @validate_call
645
+ def verify_pdf_async_api_v1_verification_verify_async_post_with_http_info(
646
+ self,
647
+ pdf_file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Factur-X PDF file to verify")],
648
+ force_ocr: Annotated[Optional[StrictBool], Field(description="Force OCR usage even if PDF contains native text")] = None,
649
+ _request_timeout: Union[
650
+ None,
651
+ Annotated[StrictFloat, Field(gt=0)],
652
+ Tuple[
653
+ Annotated[StrictFloat, Field(gt=0)],
654
+ Annotated[StrictFloat, Field(gt=0)]
655
+ ]
656
+ ] = None,
657
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
658
+ _content_type: Optional[StrictStr] = None,
659
+ _headers: Optional[Dict[StrictStr, Any]] = None,
660
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
661
+ ) -> ApiResponse[TaskResponse]:
662
+ """Verify PDF/XML Factur-X compliance (asynchronous)
663
+
664
+ Verifies PDF/XML Factur-X compliance asynchronously. **IMPORTANT**: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will return a `NOT_FACTURX` error in the result. This version uses a Celery task and can call the OCR service if the PDF is an image or if `force_ocr=true`. **Returns immediately** a task ID. Use `/verify-async/{task_id}/status` to retrieve the result. **Verification principle (Factur-X 1.08):** - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF **Verified fields:** - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency **Advantages over synchronous version:** - OCR support for image PDFs (via DocTR service) - Longer timeout for large documents - Doesn't block the server
665
+
666
+ :param pdf_file: Factur-X PDF file to verify (required)
667
+ :type pdf_file: bytearray
668
+ :param force_ocr: Force OCR usage even if PDF contains native text
669
+ :type force_ocr: bool
670
+ :param _request_timeout: timeout setting for this request. If one
671
+ number provided, it will be total request
672
+ timeout. It can also be a pair (tuple) of
673
+ (connection, read) timeouts.
674
+ :type _request_timeout: int, tuple(int, int), optional
675
+ :param _request_auth: set to override the auth_settings for an a single
676
+ request; this effectively ignores the
677
+ authentication in the spec for a single request.
678
+ :type _request_auth: dict, optional
679
+ :param _content_type: force content-type for the request.
680
+ :type _content_type: str, Optional
681
+ :param _headers: set to override the headers for a single
682
+ request; this effectively ignores the headers
683
+ in the spec for a single request.
684
+ :type _headers: dict, optional
685
+ :param _host_index: set to override the host_index for a single
686
+ request; this effectively ignores the host_index
687
+ in the spec for a single request.
688
+ :type _host_index: int, optional
689
+ :return: Returns the result object.
690
+ """ # noqa: E501
691
+
692
+ _param = self._verify_pdf_async_api_v1_verification_verify_async_post_serialize(
693
+ pdf_file=pdf_file,
694
+ force_ocr=force_ocr,
695
+ _request_auth=_request_auth,
696
+ _content_type=_content_type,
697
+ _headers=_headers,
698
+ _host_index=_host_index
699
+ )
700
+
701
+ _response_types_map: Dict[str, Optional[str]] = {
702
+ '202': "TaskResponse",
703
+ '422': "HTTPValidationError",
704
+ }
705
+ response_data = self.api_client.call_api(
706
+ *_param,
707
+ _request_timeout=_request_timeout
708
+ )
709
+ response_data.read()
710
+ return self.api_client.response_deserialize(
711
+ response_data=response_data,
712
+ response_types_map=_response_types_map,
713
+ )
714
+
715
+
716
+ @validate_call
717
+ def verify_pdf_async_api_v1_verification_verify_async_post_without_preload_content(
718
+ self,
719
+ pdf_file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Factur-X PDF file to verify")],
720
+ force_ocr: Annotated[Optional[StrictBool], Field(description="Force OCR usage even if PDF contains native text")] = None,
721
+ _request_timeout: Union[
722
+ None,
723
+ Annotated[StrictFloat, Field(gt=0)],
724
+ Tuple[
725
+ Annotated[StrictFloat, Field(gt=0)],
726
+ Annotated[StrictFloat, Field(gt=0)]
727
+ ]
728
+ ] = None,
729
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
730
+ _content_type: Optional[StrictStr] = None,
731
+ _headers: Optional[Dict[StrictStr, Any]] = None,
732
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
733
+ ) -> RESTResponseType:
734
+ """Verify PDF/XML Factur-X compliance (asynchronous)
735
+
736
+ Verifies PDF/XML Factur-X compliance asynchronously. **IMPORTANT**: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will return a `NOT_FACTURX` error in the result. This version uses a Celery task and can call the OCR service if the PDF is an image or if `force_ocr=true`. **Returns immediately** a task ID. Use `/verify-async/{task_id}/status` to retrieve the result. **Verification principle (Factur-X 1.08):** - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF **Verified fields:** - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency **Advantages over synchronous version:** - OCR support for image PDFs (via DocTR service) - Longer timeout for large documents - Doesn't block the server
737
+
738
+ :param pdf_file: Factur-X PDF file to verify (required)
739
+ :type pdf_file: bytearray
740
+ :param force_ocr: Force OCR usage even if PDF contains native text
741
+ :type force_ocr: bool
742
+ :param _request_timeout: timeout setting for this request. If one
743
+ number provided, it will be total request
744
+ timeout. It can also be a pair (tuple) of
745
+ (connection, read) timeouts.
746
+ :type _request_timeout: int, tuple(int, int), optional
747
+ :param _request_auth: set to override the auth_settings for an a single
748
+ request; this effectively ignores the
749
+ authentication in the spec for a single request.
750
+ :type _request_auth: dict, optional
751
+ :param _content_type: force content-type for the request.
752
+ :type _content_type: str, Optional
753
+ :param _headers: set to override the headers for a single
754
+ request; this effectively ignores the headers
755
+ in the spec for a single request.
756
+ :type _headers: dict, optional
757
+ :param _host_index: set to override the host_index for a single
758
+ request; this effectively ignores the host_index
759
+ in the spec for a single request.
760
+ :type _host_index: int, optional
761
+ :return: Returns the result object.
762
+ """ # noqa: E501
763
+
764
+ _param = self._verify_pdf_async_api_v1_verification_verify_async_post_serialize(
765
+ pdf_file=pdf_file,
766
+ force_ocr=force_ocr,
767
+ _request_auth=_request_auth,
768
+ _content_type=_content_type,
769
+ _headers=_headers,
770
+ _host_index=_host_index
771
+ )
772
+
773
+ _response_types_map: Dict[str, Optional[str]] = {
774
+ '202': "TaskResponse",
775
+ '422': "HTTPValidationError",
776
+ }
777
+ response_data = self.api_client.call_api(
778
+ *_param,
779
+ _request_timeout=_request_timeout
780
+ )
781
+ return response_data.response
782
+
783
+
784
+ def _verify_pdf_async_api_v1_verification_verify_async_post_serialize(
785
+ self,
786
+ pdf_file,
787
+ force_ocr,
788
+ _request_auth,
789
+ _content_type,
790
+ _headers,
791
+ _host_index,
792
+ ) -> RequestSerialized:
793
+
794
+ _host = None
795
+
796
+ _collection_formats: Dict[str, str] = {
797
+ }
798
+
799
+ _path_params: Dict[str, str] = {}
800
+ _query_params: List[Tuple[str, str]] = []
801
+ _header_params: Dict[str, Optional[str]] = _headers or {}
802
+ _form_params: List[Tuple[str, str]] = []
803
+ _files: Dict[
804
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
805
+ ] = {}
806
+ _body_params: Optional[bytes] = None
807
+
808
+ # process the path parameters
809
+ # process the query parameters
810
+ # process the header parameters
811
+ # process the form parameters
812
+ if pdf_file is not None:
813
+ _files['pdf_file'] = pdf_file
814
+ if force_ocr is not None:
815
+ _form_params.append(('force_ocr', force_ocr))
816
+ # process the body parameter
817
+
818
+
819
+ # set the HTTP header `Accept`
820
+ if 'Accept' not in _header_params:
821
+ _header_params['Accept'] = self.api_client.select_header_accept(
822
+ [
823
+ 'application/json'
824
+ ]
825
+ )
826
+
827
+ # set the HTTP header `Content-Type`
828
+ if _content_type:
829
+ _header_params['Content-Type'] = _content_type
830
+ else:
831
+ _default_content_type = (
832
+ self.api_client.select_header_content_type(
833
+ [
834
+ 'multipart/form-data'
835
+ ]
836
+ )
837
+ )
838
+ if _default_content_type is not None:
839
+ _header_params['Content-Type'] = _default_content_type
840
+
841
+ # authentication setting
842
+ _auth_settings: List[str] = [
843
+ 'HTTPBearer'
844
+ ]
845
+
846
+ return self.api_client.param_serialize(
847
+ method='POST',
848
+ resource_path='/api/v1/verification/verify-async',
849
+ path_params=_path_params,
850
+ query_params=_query_params,
851
+ header_params=_header_params,
852
+ body=_body_params,
853
+ post_params=_form_params,
854
+ files=_files,
855
+ auth_settings=_auth_settings,
856
+ collection_formats=_collection_formats,
857
+ _host=_host,
858
+ _request_auth=_request_auth
859
+ )
860
+
861
+
862
+
863
+
864
+ @validate_call
865
+ def verify_pdf_async_api_v1_verification_verify_async_post_0(
866
+ self,
867
+ pdf_file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Factur-X PDF file to verify")],
868
+ force_ocr: Annotated[Optional[StrictBool], Field(description="Force OCR usage even if PDF contains native text")] = None,
869
+ _request_timeout: Union[
870
+ None,
871
+ Annotated[StrictFloat, Field(gt=0)],
872
+ Tuple[
873
+ Annotated[StrictFloat, Field(gt=0)],
874
+ Annotated[StrictFloat, Field(gt=0)]
875
+ ]
876
+ ] = None,
877
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
878
+ _content_type: Optional[StrictStr] = None,
879
+ _headers: Optional[Dict[StrictStr, Any]] = None,
880
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
881
+ ) -> TaskResponse:
882
+ """Verify PDF/XML Factur-X compliance (asynchronous)
883
+
884
+ Verifies PDF/XML Factur-X compliance asynchronously. **IMPORTANT**: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will return a `NOT_FACTURX` error in the result. This version uses a Celery task and can call the OCR service if the PDF is an image or if `force_ocr=true`. **Returns immediately** a task ID. Use `/verify-async/{task_id}/status` to retrieve the result. **Verification principle (Factur-X 1.08):** - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF **Verified fields:** - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency **Advantages over synchronous version:** - OCR support for image PDFs (via DocTR service) - Longer timeout for large documents - Doesn't block the server
885
+
886
+ :param pdf_file: Factur-X PDF file to verify (required)
887
+ :type pdf_file: bytearray
888
+ :param force_ocr: Force OCR usage even if PDF contains native text
889
+ :type force_ocr: bool
890
+ :param _request_timeout: timeout setting for this request. If one
891
+ number provided, it will be total request
892
+ timeout. It can also be a pair (tuple) of
893
+ (connection, read) timeouts.
894
+ :type _request_timeout: int, tuple(int, int), optional
895
+ :param _request_auth: set to override the auth_settings for an a single
896
+ request; this effectively ignores the
897
+ authentication in the spec for a single request.
898
+ :type _request_auth: dict, optional
899
+ :param _content_type: force content-type for the request.
900
+ :type _content_type: str, Optional
901
+ :param _headers: set to override the headers for a single
902
+ request; this effectively ignores the headers
903
+ in the spec for a single request.
904
+ :type _headers: dict, optional
905
+ :param _host_index: set to override the host_index for a single
906
+ request; this effectively ignores the host_index
907
+ in the spec for a single request.
908
+ :type _host_index: int, optional
909
+ :return: Returns the result object.
910
+ """ # noqa: E501
911
+
912
+ _param = self._verify_pdf_async_api_v1_verification_verify_async_post_0_serialize(
913
+ pdf_file=pdf_file,
914
+ force_ocr=force_ocr,
915
+ _request_auth=_request_auth,
916
+ _content_type=_content_type,
917
+ _headers=_headers,
918
+ _host_index=_host_index
919
+ )
920
+
921
+ _response_types_map: Dict[str, Optional[str]] = {
922
+ '202': "TaskResponse",
923
+ '422': "HTTPValidationError",
924
+ }
925
+ response_data = self.api_client.call_api(
926
+ *_param,
927
+ _request_timeout=_request_timeout
928
+ )
929
+ response_data.read()
930
+ return self.api_client.response_deserialize(
931
+ response_data=response_data,
932
+ response_types_map=_response_types_map,
933
+ ).data
934
+
935
+
936
+ @validate_call
937
+ def verify_pdf_async_api_v1_verification_verify_async_post_0_with_http_info(
938
+ self,
939
+ pdf_file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Factur-X PDF file to verify")],
940
+ force_ocr: Annotated[Optional[StrictBool], Field(description="Force OCR usage even if PDF contains native text")] = None,
941
+ _request_timeout: Union[
942
+ None,
943
+ Annotated[StrictFloat, Field(gt=0)],
944
+ Tuple[
945
+ Annotated[StrictFloat, Field(gt=0)],
946
+ Annotated[StrictFloat, Field(gt=0)]
947
+ ]
948
+ ] = None,
949
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
950
+ _content_type: Optional[StrictStr] = None,
951
+ _headers: Optional[Dict[StrictStr, Any]] = None,
952
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
953
+ ) -> ApiResponse[TaskResponse]:
954
+ """Verify PDF/XML Factur-X compliance (asynchronous)
955
+
956
+ Verifies PDF/XML Factur-X compliance asynchronously. **IMPORTANT**: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will return a `NOT_FACTURX` error in the result. This version uses a Celery task and can call the OCR service if the PDF is an image or if `force_ocr=true`. **Returns immediately** a task ID. Use `/verify-async/{task_id}/status` to retrieve the result. **Verification principle (Factur-X 1.08):** - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF **Verified fields:** - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency **Advantages over synchronous version:** - OCR support for image PDFs (via DocTR service) - Longer timeout for large documents - Doesn't block the server
957
+
958
+ :param pdf_file: Factur-X PDF file to verify (required)
959
+ :type pdf_file: bytearray
960
+ :param force_ocr: Force OCR usage even if PDF contains native text
961
+ :type force_ocr: bool
962
+ :param _request_timeout: timeout setting for this request. If one
963
+ number provided, it will be total request
964
+ timeout. It can also be a pair (tuple) of
965
+ (connection, read) timeouts.
966
+ :type _request_timeout: int, tuple(int, int), optional
967
+ :param _request_auth: set to override the auth_settings for an a single
968
+ request; this effectively ignores the
969
+ authentication in the spec for a single request.
970
+ :type _request_auth: dict, optional
971
+ :param _content_type: force content-type for the request.
972
+ :type _content_type: str, Optional
973
+ :param _headers: set to override the headers for a single
974
+ request; this effectively ignores the headers
975
+ in the spec for a single request.
976
+ :type _headers: dict, optional
977
+ :param _host_index: set to override the host_index for a single
978
+ request; this effectively ignores the host_index
979
+ in the spec for a single request.
980
+ :type _host_index: int, optional
981
+ :return: Returns the result object.
982
+ """ # noqa: E501
983
+
984
+ _param = self._verify_pdf_async_api_v1_verification_verify_async_post_0_serialize(
985
+ pdf_file=pdf_file,
986
+ force_ocr=force_ocr,
987
+ _request_auth=_request_auth,
988
+ _content_type=_content_type,
989
+ _headers=_headers,
990
+ _host_index=_host_index
991
+ )
992
+
993
+ _response_types_map: Dict[str, Optional[str]] = {
994
+ '202': "TaskResponse",
995
+ '422': "HTTPValidationError",
996
+ }
997
+ response_data = self.api_client.call_api(
998
+ *_param,
999
+ _request_timeout=_request_timeout
1000
+ )
1001
+ response_data.read()
1002
+ return self.api_client.response_deserialize(
1003
+ response_data=response_data,
1004
+ response_types_map=_response_types_map,
1005
+ )
1006
+
1007
+
1008
+ @validate_call
1009
+ def verify_pdf_async_api_v1_verification_verify_async_post_0_without_preload_content(
1010
+ self,
1011
+ pdf_file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Factur-X PDF file to verify")],
1012
+ force_ocr: Annotated[Optional[StrictBool], Field(description="Force OCR usage even if PDF contains native text")] = None,
1013
+ _request_timeout: Union[
1014
+ None,
1015
+ Annotated[StrictFloat, Field(gt=0)],
1016
+ Tuple[
1017
+ Annotated[StrictFloat, Field(gt=0)],
1018
+ Annotated[StrictFloat, Field(gt=0)]
1019
+ ]
1020
+ ] = None,
1021
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1022
+ _content_type: Optional[StrictStr] = None,
1023
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1024
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1025
+ ) -> RESTResponseType:
1026
+ """Verify PDF/XML Factur-X compliance (asynchronous)
1027
+
1028
+ Verifies PDF/XML Factur-X compliance asynchronously. **IMPORTANT**: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will return a `NOT_FACTURX` error in the result. This version uses a Celery task and can call the OCR service if the PDF is an image or if `force_ocr=true`. **Returns immediately** a task ID. Use `/verify-async/{task_id}/status` to retrieve the result. **Verification principle (Factur-X 1.08):** - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF **Verified fields:** - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency **Advantages over synchronous version:** - OCR support for image PDFs (via DocTR service) - Longer timeout for large documents - Doesn't block the server
1029
+
1030
+ :param pdf_file: Factur-X PDF file to verify (required)
1031
+ :type pdf_file: bytearray
1032
+ :param force_ocr: Force OCR usage even if PDF contains native text
1033
+ :type force_ocr: bool
1034
+ :param _request_timeout: timeout setting for this request. If one
1035
+ number provided, it will be total request
1036
+ timeout. It can also be a pair (tuple) of
1037
+ (connection, read) timeouts.
1038
+ :type _request_timeout: int, tuple(int, int), optional
1039
+ :param _request_auth: set to override the auth_settings for an a single
1040
+ request; this effectively ignores the
1041
+ authentication in the spec for a single request.
1042
+ :type _request_auth: dict, optional
1043
+ :param _content_type: force content-type for the request.
1044
+ :type _content_type: str, Optional
1045
+ :param _headers: set to override the headers for a single
1046
+ request; this effectively ignores the headers
1047
+ in the spec for a single request.
1048
+ :type _headers: dict, optional
1049
+ :param _host_index: set to override the host_index for a single
1050
+ request; this effectively ignores the host_index
1051
+ in the spec for a single request.
1052
+ :type _host_index: int, optional
1053
+ :return: Returns the result object.
1054
+ """ # noqa: E501
1055
+
1056
+ _param = self._verify_pdf_async_api_v1_verification_verify_async_post_0_serialize(
1057
+ pdf_file=pdf_file,
1058
+ force_ocr=force_ocr,
1059
+ _request_auth=_request_auth,
1060
+ _content_type=_content_type,
1061
+ _headers=_headers,
1062
+ _host_index=_host_index
1063
+ )
1064
+
1065
+ _response_types_map: Dict[str, Optional[str]] = {
1066
+ '202': "TaskResponse",
1067
+ '422': "HTTPValidationError",
1068
+ }
1069
+ response_data = self.api_client.call_api(
1070
+ *_param,
1071
+ _request_timeout=_request_timeout
1072
+ )
1073
+ return response_data.response
1074
+
1075
+
1076
+ def _verify_pdf_async_api_v1_verification_verify_async_post_0_serialize(
1077
+ self,
1078
+ pdf_file,
1079
+ force_ocr,
1080
+ _request_auth,
1081
+ _content_type,
1082
+ _headers,
1083
+ _host_index,
1084
+ ) -> RequestSerialized:
1085
+
1086
+ _host = None
1087
+
1088
+ _collection_formats: Dict[str, str] = {
1089
+ }
1090
+
1091
+ _path_params: Dict[str, str] = {}
1092
+ _query_params: List[Tuple[str, str]] = []
1093
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1094
+ _form_params: List[Tuple[str, str]] = []
1095
+ _files: Dict[
1096
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1097
+ ] = {}
1098
+ _body_params: Optional[bytes] = None
1099
+
1100
+ # process the path parameters
1101
+ # process the query parameters
1102
+ # process the header parameters
1103
+ # process the form parameters
1104
+ if pdf_file is not None:
1105
+ _files['pdf_file'] = pdf_file
1106
+ if force_ocr is not None:
1107
+ _form_params.append(('force_ocr', force_ocr))
1108
+ # process the body parameter
1109
+
1110
+
1111
+ # set the HTTP header `Accept`
1112
+ if 'Accept' not in _header_params:
1113
+ _header_params['Accept'] = self.api_client.select_header_accept(
1114
+ [
1115
+ 'application/json'
1116
+ ]
1117
+ )
1118
+
1119
+ # set the HTTP header `Content-Type`
1120
+ if _content_type:
1121
+ _header_params['Content-Type'] = _content_type
1122
+ else:
1123
+ _default_content_type = (
1124
+ self.api_client.select_header_content_type(
1125
+ [
1126
+ 'multipart/form-data'
1127
+ ]
1128
+ )
1129
+ )
1130
+ if _default_content_type is not None:
1131
+ _header_params['Content-Type'] = _default_content_type
1132
+
1133
+ # authentication setting
1134
+ _auth_settings: List[str] = [
1135
+ 'HTTPBearer'
1136
+ ]
1137
+
1138
+ return self.api_client.param_serialize(
1139
+ method='POST',
1140
+ resource_path='/api/v1/verification/verify-async',
1141
+ path_params=_path_params,
1142
+ query_params=_query_params,
1143
+ header_params=_header_params,
1144
+ body=_body_params,
1145
+ post_params=_form_params,
1146
+ files=_files,
1147
+ auth_settings=_auth_settings,
1148
+ collection_formats=_collection_formats,
1149
+ _host=_host,
1150
+ _request_auth=_request_auth
1151
+ )
1152
+
1153
+
1154
+
1155
+
1156
+ @validate_call
1157
+ def verify_pdf_sync_api_v1_verification_verify_post(
1158
+ self,
1159
+ pdf_file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Factur-X PDF file to verify")],
1160
+ _request_timeout: Union[
1161
+ None,
1162
+ Annotated[StrictFloat, Field(gt=0)],
1163
+ Tuple[
1164
+ Annotated[StrictFloat, Field(gt=0)],
1165
+ Annotated[StrictFloat, Field(gt=0)]
1166
+ ]
1167
+ ] = None,
1168
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1169
+ _content_type: Optional[StrictStr] = None,
1170
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1171
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1172
+ ) -> VerificationSuccessResponse:
1173
+ """Verify PDF/XML Factur-X compliance (synchronous)
1174
+
1175
+ Verifies compliance between the PDF and its embedded Factur-X XML. **IMPORTANT**: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will be rejected with a 400 error. This synchronous version uses only native PDF extraction (pdfplumber). For image PDFs requiring OCR, use the `/verify-async` endpoint. **Verification principle (Factur-X 1.08):** - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF **Verified fields:** - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency
1176
+
1177
+ :param pdf_file: Factur-X PDF file to verify (required)
1178
+ :type pdf_file: bytearray
1179
+ :param _request_timeout: timeout setting for this request. If one
1180
+ number provided, it will be total request
1181
+ timeout. It can also be a pair (tuple) of
1182
+ (connection, read) timeouts.
1183
+ :type _request_timeout: int, tuple(int, int), optional
1184
+ :param _request_auth: set to override the auth_settings for an a single
1185
+ request; this effectively ignores the
1186
+ authentication in the spec for a single request.
1187
+ :type _request_auth: dict, optional
1188
+ :param _content_type: force content-type for the request.
1189
+ :type _content_type: str, Optional
1190
+ :param _headers: set to override the headers for a single
1191
+ request; this effectively ignores the headers
1192
+ in the spec for a single request.
1193
+ :type _headers: dict, optional
1194
+ :param _host_index: set to override the host_index for a single
1195
+ request; this effectively ignores the host_index
1196
+ in the spec for a single request.
1197
+ :type _host_index: int, optional
1198
+ :return: Returns the result object.
1199
+ """ # noqa: E501
1200
+
1201
+ _param = self._verify_pdf_sync_api_v1_verification_verify_post_serialize(
1202
+ pdf_file=pdf_file,
1203
+ _request_auth=_request_auth,
1204
+ _content_type=_content_type,
1205
+ _headers=_headers,
1206
+ _host_index=_host_index
1207
+ )
1208
+
1209
+ _response_types_map: Dict[str, Optional[str]] = {
1210
+ '200': "VerificationSuccessResponse",
1211
+ '400': "APIError",
1212
+ '413': "APIError",
1213
+ '422': "HTTPValidationError",
1214
+ }
1215
+ response_data = self.api_client.call_api(
1216
+ *_param,
1217
+ _request_timeout=_request_timeout
1218
+ )
1219
+ response_data.read()
1220
+ return self.api_client.response_deserialize(
1221
+ response_data=response_data,
1222
+ response_types_map=_response_types_map,
1223
+ ).data
1224
+
1225
+
1226
+ @validate_call
1227
+ def verify_pdf_sync_api_v1_verification_verify_post_with_http_info(
1228
+ self,
1229
+ pdf_file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Factur-X PDF file to verify")],
1230
+ _request_timeout: Union[
1231
+ None,
1232
+ Annotated[StrictFloat, Field(gt=0)],
1233
+ Tuple[
1234
+ Annotated[StrictFloat, Field(gt=0)],
1235
+ Annotated[StrictFloat, Field(gt=0)]
1236
+ ]
1237
+ ] = None,
1238
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1239
+ _content_type: Optional[StrictStr] = None,
1240
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1241
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1242
+ ) -> ApiResponse[VerificationSuccessResponse]:
1243
+ """Verify PDF/XML Factur-X compliance (synchronous)
1244
+
1245
+ Verifies compliance between the PDF and its embedded Factur-X XML. **IMPORTANT**: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will be rejected with a 400 error. This synchronous version uses only native PDF extraction (pdfplumber). For image PDFs requiring OCR, use the `/verify-async` endpoint. **Verification principle (Factur-X 1.08):** - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF **Verified fields:** - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency
1246
+
1247
+ :param pdf_file: Factur-X PDF file to verify (required)
1248
+ :type pdf_file: bytearray
1249
+ :param _request_timeout: timeout setting for this request. If one
1250
+ number provided, it will be total request
1251
+ timeout. It can also be a pair (tuple) of
1252
+ (connection, read) timeouts.
1253
+ :type _request_timeout: int, tuple(int, int), optional
1254
+ :param _request_auth: set to override the auth_settings for an a single
1255
+ request; this effectively ignores the
1256
+ authentication in the spec for a single request.
1257
+ :type _request_auth: dict, optional
1258
+ :param _content_type: force content-type for the request.
1259
+ :type _content_type: str, Optional
1260
+ :param _headers: set to override the headers for a single
1261
+ request; this effectively ignores the headers
1262
+ in the spec for a single request.
1263
+ :type _headers: dict, optional
1264
+ :param _host_index: set to override the host_index for a single
1265
+ request; this effectively ignores the host_index
1266
+ in the spec for a single request.
1267
+ :type _host_index: int, optional
1268
+ :return: Returns the result object.
1269
+ """ # noqa: E501
1270
+
1271
+ _param = self._verify_pdf_sync_api_v1_verification_verify_post_serialize(
1272
+ pdf_file=pdf_file,
1273
+ _request_auth=_request_auth,
1274
+ _content_type=_content_type,
1275
+ _headers=_headers,
1276
+ _host_index=_host_index
1277
+ )
1278
+
1279
+ _response_types_map: Dict[str, Optional[str]] = {
1280
+ '200': "VerificationSuccessResponse",
1281
+ '400': "APIError",
1282
+ '413': "APIError",
1283
+ '422': "HTTPValidationError",
1284
+ }
1285
+ response_data = self.api_client.call_api(
1286
+ *_param,
1287
+ _request_timeout=_request_timeout
1288
+ )
1289
+ response_data.read()
1290
+ return self.api_client.response_deserialize(
1291
+ response_data=response_data,
1292
+ response_types_map=_response_types_map,
1293
+ )
1294
+
1295
+
1296
+ @validate_call
1297
+ def verify_pdf_sync_api_v1_verification_verify_post_without_preload_content(
1298
+ self,
1299
+ pdf_file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Factur-X PDF file to verify")],
1300
+ _request_timeout: Union[
1301
+ None,
1302
+ Annotated[StrictFloat, Field(gt=0)],
1303
+ Tuple[
1304
+ Annotated[StrictFloat, Field(gt=0)],
1305
+ Annotated[StrictFloat, Field(gt=0)]
1306
+ ]
1307
+ ] = None,
1308
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1309
+ _content_type: Optional[StrictStr] = None,
1310
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1311
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1312
+ ) -> RESTResponseType:
1313
+ """Verify PDF/XML Factur-X compliance (synchronous)
1314
+
1315
+ Verifies compliance between the PDF and its embedded Factur-X XML. **IMPORTANT**: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will be rejected with a 400 error. This synchronous version uses only native PDF extraction (pdfplumber). For image PDFs requiring OCR, use the `/verify-async` endpoint. **Verification principle (Factur-X 1.08):** - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF **Verified fields:** - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency
1316
+
1317
+ :param pdf_file: Factur-X PDF file to verify (required)
1318
+ :type pdf_file: bytearray
1319
+ :param _request_timeout: timeout setting for this request. If one
1320
+ number provided, it will be total request
1321
+ timeout. It can also be a pair (tuple) of
1322
+ (connection, read) timeouts.
1323
+ :type _request_timeout: int, tuple(int, int), optional
1324
+ :param _request_auth: set to override the auth_settings for an a single
1325
+ request; this effectively ignores the
1326
+ authentication in the spec for a single request.
1327
+ :type _request_auth: dict, optional
1328
+ :param _content_type: force content-type for the request.
1329
+ :type _content_type: str, Optional
1330
+ :param _headers: set to override the headers for a single
1331
+ request; this effectively ignores the headers
1332
+ in the spec for a single request.
1333
+ :type _headers: dict, optional
1334
+ :param _host_index: set to override the host_index for a single
1335
+ request; this effectively ignores the host_index
1336
+ in the spec for a single request.
1337
+ :type _host_index: int, optional
1338
+ :return: Returns the result object.
1339
+ """ # noqa: E501
1340
+
1341
+ _param = self._verify_pdf_sync_api_v1_verification_verify_post_serialize(
1342
+ pdf_file=pdf_file,
1343
+ _request_auth=_request_auth,
1344
+ _content_type=_content_type,
1345
+ _headers=_headers,
1346
+ _host_index=_host_index
1347
+ )
1348
+
1349
+ _response_types_map: Dict[str, Optional[str]] = {
1350
+ '200': "VerificationSuccessResponse",
1351
+ '400': "APIError",
1352
+ '413': "APIError",
1353
+ '422': "HTTPValidationError",
1354
+ }
1355
+ response_data = self.api_client.call_api(
1356
+ *_param,
1357
+ _request_timeout=_request_timeout
1358
+ )
1359
+ return response_data.response
1360
+
1361
+
1362
+ def _verify_pdf_sync_api_v1_verification_verify_post_serialize(
1363
+ self,
1364
+ pdf_file,
1365
+ _request_auth,
1366
+ _content_type,
1367
+ _headers,
1368
+ _host_index,
1369
+ ) -> RequestSerialized:
1370
+
1371
+ _host = None
1372
+
1373
+ _collection_formats: Dict[str, str] = {
1374
+ }
1375
+
1376
+ _path_params: Dict[str, str] = {}
1377
+ _query_params: List[Tuple[str, str]] = []
1378
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1379
+ _form_params: List[Tuple[str, str]] = []
1380
+ _files: Dict[
1381
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1382
+ ] = {}
1383
+ _body_params: Optional[bytes] = None
1384
+
1385
+ # process the path parameters
1386
+ # process the query parameters
1387
+ # process the header parameters
1388
+ # process the form parameters
1389
+ if pdf_file is not None:
1390
+ _files['pdf_file'] = pdf_file
1391
+ # process the body parameter
1392
+
1393
+
1394
+ # set the HTTP header `Accept`
1395
+ if 'Accept' not in _header_params:
1396
+ _header_params['Accept'] = self.api_client.select_header_accept(
1397
+ [
1398
+ 'application/json'
1399
+ ]
1400
+ )
1401
+
1402
+ # set the HTTP header `Content-Type`
1403
+ if _content_type:
1404
+ _header_params['Content-Type'] = _content_type
1405
+ else:
1406
+ _default_content_type = (
1407
+ self.api_client.select_header_content_type(
1408
+ [
1409
+ 'multipart/form-data'
1410
+ ]
1411
+ )
1412
+ )
1413
+ if _default_content_type is not None:
1414
+ _header_params['Content-Type'] = _default_content_type
1415
+
1416
+ # authentication setting
1417
+ _auth_settings: List[str] = [
1418
+ 'HTTPBearer'
1419
+ ]
1420
+
1421
+ return self.api_client.param_serialize(
1422
+ method='POST',
1423
+ resource_path='/api/v1/verification/verify',
1424
+ path_params=_path_params,
1425
+ query_params=_query_params,
1426
+ header_params=_header_params,
1427
+ body=_body_params,
1428
+ post_params=_form_params,
1429
+ files=_files,
1430
+ auth_settings=_auth_settings,
1431
+ collection_formats=_collection_formats,
1432
+ _host=_host,
1433
+ _request_auth=_request_auth
1434
+ )
1435
+
1436
+
1437
+
1438
+
1439
+ @validate_call
1440
+ def verify_pdf_sync_api_v1_verification_verify_post_0(
1441
+ self,
1442
+ pdf_file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Factur-X PDF file to verify")],
1443
+ _request_timeout: Union[
1444
+ None,
1445
+ Annotated[StrictFloat, Field(gt=0)],
1446
+ Tuple[
1447
+ Annotated[StrictFloat, Field(gt=0)],
1448
+ Annotated[StrictFloat, Field(gt=0)]
1449
+ ]
1450
+ ] = None,
1451
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1452
+ _content_type: Optional[StrictStr] = None,
1453
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1454
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1455
+ ) -> VerificationSuccessResponse:
1456
+ """Verify PDF/XML Factur-X compliance (synchronous)
1457
+
1458
+ Verifies compliance between the PDF and its embedded Factur-X XML. **IMPORTANT**: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will be rejected with a 400 error. This synchronous version uses only native PDF extraction (pdfplumber). For image PDFs requiring OCR, use the `/verify-async` endpoint. **Verification principle (Factur-X 1.08):** - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF **Verified fields:** - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency
1459
+
1460
+ :param pdf_file: Factur-X PDF file to verify (required)
1461
+ :type pdf_file: bytearray
1462
+ :param _request_timeout: timeout setting for this request. If one
1463
+ number provided, it will be total request
1464
+ timeout. It can also be a pair (tuple) of
1465
+ (connection, read) timeouts.
1466
+ :type _request_timeout: int, tuple(int, int), optional
1467
+ :param _request_auth: set to override the auth_settings for an a single
1468
+ request; this effectively ignores the
1469
+ authentication in the spec for a single request.
1470
+ :type _request_auth: dict, optional
1471
+ :param _content_type: force content-type for the request.
1472
+ :type _content_type: str, Optional
1473
+ :param _headers: set to override the headers for a single
1474
+ request; this effectively ignores the headers
1475
+ in the spec for a single request.
1476
+ :type _headers: dict, optional
1477
+ :param _host_index: set to override the host_index for a single
1478
+ request; this effectively ignores the host_index
1479
+ in the spec for a single request.
1480
+ :type _host_index: int, optional
1481
+ :return: Returns the result object.
1482
+ """ # noqa: E501
1483
+
1484
+ _param = self._verify_pdf_sync_api_v1_verification_verify_post_0_serialize(
1485
+ pdf_file=pdf_file,
1486
+ _request_auth=_request_auth,
1487
+ _content_type=_content_type,
1488
+ _headers=_headers,
1489
+ _host_index=_host_index
1490
+ )
1491
+
1492
+ _response_types_map: Dict[str, Optional[str]] = {
1493
+ '200': "VerificationSuccessResponse",
1494
+ '400': "APIError",
1495
+ '413': "APIError",
1496
+ '422': "HTTPValidationError",
1497
+ }
1498
+ response_data = self.api_client.call_api(
1499
+ *_param,
1500
+ _request_timeout=_request_timeout
1501
+ )
1502
+ response_data.read()
1503
+ return self.api_client.response_deserialize(
1504
+ response_data=response_data,
1505
+ response_types_map=_response_types_map,
1506
+ ).data
1507
+
1508
+
1509
+ @validate_call
1510
+ def verify_pdf_sync_api_v1_verification_verify_post_0_with_http_info(
1511
+ self,
1512
+ pdf_file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Factur-X PDF file to verify")],
1513
+ _request_timeout: Union[
1514
+ None,
1515
+ Annotated[StrictFloat, Field(gt=0)],
1516
+ Tuple[
1517
+ Annotated[StrictFloat, Field(gt=0)],
1518
+ Annotated[StrictFloat, Field(gt=0)]
1519
+ ]
1520
+ ] = None,
1521
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1522
+ _content_type: Optional[StrictStr] = None,
1523
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1524
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1525
+ ) -> ApiResponse[VerificationSuccessResponse]:
1526
+ """Verify PDF/XML Factur-X compliance (synchronous)
1527
+
1528
+ Verifies compliance between the PDF and its embedded Factur-X XML. **IMPORTANT**: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will be rejected with a 400 error. This synchronous version uses only native PDF extraction (pdfplumber). For image PDFs requiring OCR, use the `/verify-async` endpoint. **Verification principle (Factur-X 1.08):** - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF **Verified fields:** - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency
1529
+
1530
+ :param pdf_file: Factur-X PDF file to verify (required)
1531
+ :type pdf_file: bytearray
1532
+ :param _request_timeout: timeout setting for this request. If one
1533
+ number provided, it will be total request
1534
+ timeout. It can also be a pair (tuple) of
1535
+ (connection, read) timeouts.
1536
+ :type _request_timeout: int, tuple(int, int), optional
1537
+ :param _request_auth: set to override the auth_settings for an a single
1538
+ request; this effectively ignores the
1539
+ authentication in the spec for a single request.
1540
+ :type _request_auth: dict, optional
1541
+ :param _content_type: force content-type for the request.
1542
+ :type _content_type: str, Optional
1543
+ :param _headers: set to override the headers for a single
1544
+ request; this effectively ignores the headers
1545
+ in the spec for a single request.
1546
+ :type _headers: dict, optional
1547
+ :param _host_index: set to override the host_index for a single
1548
+ request; this effectively ignores the host_index
1549
+ in the spec for a single request.
1550
+ :type _host_index: int, optional
1551
+ :return: Returns the result object.
1552
+ """ # noqa: E501
1553
+
1554
+ _param = self._verify_pdf_sync_api_v1_verification_verify_post_0_serialize(
1555
+ pdf_file=pdf_file,
1556
+ _request_auth=_request_auth,
1557
+ _content_type=_content_type,
1558
+ _headers=_headers,
1559
+ _host_index=_host_index
1560
+ )
1561
+
1562
+ _response_types_map: Dict[str, Optional[str]] = {
1563
+ '200': "VerificationSuccessResponse",
1564
+ '400': "APIError",
1565
+ '413': "APIError",
1566
+ '422': "HTTPValidationError",
1567
+ }
1568
+ response_data = self.api_client.call_api(
1569
+ *_param,
1570
+ _request_timeout=_request_timeout
1571
+ )
1572
+ response_data.read()
1573
+ return self.api_client.response_deserialize(
1574
+ response_data=response_data,
1575
+ response_types_map=_response_types_map,
1576
+ )
1577
+
1578
+
1579
+ @validate_call
1580
+ def verify_pdf_sync_api_v1_verification_verify_post_0_without_preload_content(
1581
+ self,
1582
+ pdf_file: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Factur-X PDF file to verify")],
1583
+ _request_timeout: Union[
1584
+ None,
1585
+ Annotated[StrictFloat, Field(gt=0)],
1586
+ Tuple[
1587
+ Annotated[StrictFloat, Field(gt=0)],
1588
+ Annotated[StrictFloat, Field(gt=0)]
1589
+ ]
1590
+ ] = None,
1591
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1592
+ _content_type: Optional[StrictStr] = None,
1593
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1594
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1595
+ ) -> RESTResponseType:
1596
+ """Verify PDF/XML Factur-X compliance (synchronous)
1597
+
1598
+ Verifies compliance between the PDF and its embedded Factur-X XML. **IMPORTANT**: Only Factur-X PDFs (with embedded XML) are accepted. PDFs without Factur-X XML will be rejected with a 400 error. This synchronous version uses only native PDF extraction (pdfplumber). For image PDFs requiring OCR, use the `/verify-async` endpoint. **Verification principle (Factur-X 1.08):** - Principle #2: XML can only contain info present in the PDF - Principle #4: All XML info must be present and compliant in the PDF **Verified fields:** - Identification: BT-1 (invoice #), BT-2 (date), BT-3 (type), BT-5 (currency), BT-23 (framework) - Seller: BT-27 (name), BT-29 (SIRET), BT-30 (SIREN), BT-31 (VAT) - Buyer: BT-44 (name), BT-46 (SIRET), BT-47 (SIREN), BT-48 (VAT) - Amounts: BT-109 (excl. tax), BT-110 (VAT), BT-112 (incl. tax), BT-115 (amount due) - VAT breakdown: BT-116, BT-117, BT-118, BT-119 - Invoice lines: BT-153, BT-129, BT-146, BT-131 - Mandatory notes: PMT, PMD, AAB - Rule BR-FR-09: SIRET/SIREN consistency
1599
+
1600
+ :param pdf_file: Factur-X PDF file to verify (required)
1601
+ :type pdf_file: bytearray
1602
+ :param _request_timeout: timeout setting for this request. If one
1603
+ number provided, it will be total request
1604
+ timeout. It can also be a pair (tuple) of
1605
+ (connection, read) timeouts.
1606
+ :type _request_timeout: int, tuple(int, int), optional
1607
+ :param _request_auth: set to override the auth_settings for an a single
1608
+ request; this effectively ignores the
1609
+ authentication in the spec for a single request.
1610
+ :type _request_auth: dict, optional
1611
+ :param _content_type: force content-type for the request.
1612
+ :type _content_type: str, Optional
1613
+ :param _headers: set to override the headers for a single
1614
+ request; this effectively ignores the headers
1615
+ in the spec for a single request.
1616
+ :type _headers: dict, optional
1617
+ :param _host_index: set to override the host_index for a single
1618
+ request; this effectively ignores the host_index
1619
+ in the spec for a single request.
1620
+ :type _host_index: int, optional
1621
+ :return: Returns the result object.
1622
+ """ # noqa: E501
1623
+
1624
+ _param = self._verify_pdf_sync_api_v1_verification_verify_post_0_serialize(
1625
+ pdf_file=pdf_file,
1626
+ _request_auth=_request_auth,
1627
+ _content_type=_content_type,
1628
+ _headers=_headers,
1629
+ _host_index=_host_index
1630
+ )
1631
+
1632
+ _response_types_map: Dict[str, Optional[str]] = {
1633
+ '200': "VerificationSuccessResponse",
1634
+ '400': "APIError",
1635
+ '413': "APIError",
1636
+ '422': "HTTPValidationError",
1637
+ }
1638
+ response_data = self.api_client.call_api(
1639
+ *_param,
1640
+ _request_timeout=_request_timeout
1641
+ )
1642
+ return response_data.response
1643
+
1644
+
1645
+ def _verify_pdf_sync_api_v1_verification_verify_post_0_serialize(
1646
+ self,
1647
+ pdf_file,
1648
+ _request_auth,
1649
+ _content_type,
1650
+ _headers,
1651
+ _host_index,
1652
+ ) -> RequestSerialized:
1653
+
1654
+ _host = None
1655
+
1656
+ _collection_formats: Dict[str, str] = {
1657
+ }
1658
+
1659
+ _path_params: Dict[str, str] = {}
1660
+ _query_params: List[Tuple[str, str]] = []
1661
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1662
+ _form_params: List[Tuple[str, str]] = []
1663
+ _files: Dict[
1664
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1665
+ ] = {}
1666
+ _body_params: Optional[bytes] = None
1667
+
1668
+ # process the path parameters
1669
+ # process the query parameters
1670
+ # process the header parameters
1671
+ # process the form parameters
1672
+ if pdf_file is not None:
1673
+ _files['pdf_file'] = pdf_file
1674
+ # process the body parameter
1675
+
1676
+
1677
+ # set the HTTP header `Accept`
1678
+ if 'Accept' not in _header_params:
1679
+ _header_params['Accept'] = self.api_client.select_header_accept(
1680
+ [
1681
+ 'application/json'
1682
+ ]
1683
+ )
1684
+
1685
+ # set the HTTP header `Content-Type`
1686
+ if _content_type:
1687
+ _header_params['Content-Type'] = _content_type
1688
+ else:
1689
+ _default_content_type = (
1690
+ self.api_client.select_header_content_type(
1691
+ [
1692
+ 'multipart/form-data'
1693
+ ]
1694
+ )
1695
+ )
1696
+ if _default_content_type is not None:
1697
+ _header_params['Content-Type'] = _default_content_type
1698
+
1699
+ # authentication setting
1700
+ _auth_settings: List[str] = [
1701
+ 'HTTPBearer'
1702
+ ]
1703
+
1704
+ return self.api_client.param_serialize(
1705
+ method='POST',
1706
+ resource_path='/api/v1/verification/verify',
1707
+ path_params=_path_params,
1708
+ query_params=_query_params,
1709
+ header_params=_header_params,
1710
+ body=_body_params,
1711
+ post_params=_form_params,
1712
+ files=_files,
1713
+ auth_settings=_auth_settings,
1714
+ collection_formats=_collection_formats,
1715
+ _host=_host,
1716
+ _request_auth=_request_auth
1717
+ )
1718
+
1719
+