factpulse 1.0.9__py3-none-any.whl → 2.0.37__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.
- factpulse/__init__.py +54 -50
- factpulse/api/__init__.py +1 -0
- factpulse/api/afnorpdppa_api.py +552 -2
- factpulse/api/afnorpdppa_directory_service_api.py +4312 -65
- factpulse/api/afnorpdppa_flow_service_api.py +1 -1
- factpulse/api/chorus_pro_api.py +152 -194
- factpulse/api/sant_api.py +246 -1
- factpulse/api/traitement_facture_api.py +25 -27
- factpulse/api/utilisateur_api.py +1 -1
- factpulse/api/vrification_pdfxml_api.py +1719 -0
- factpulse/api_client.py +5 -5
- factpulse/configuration.py +5 -3
- factpulse/exceptions.py +7 -4
- factpulse/models/__init__.py +26 -25
- factpulse/models/adresse_electronique.py +1 -1
- factpulse/models/adresse_postale.py +1 -1
- factpulse/models/{body_ajouter_fichier_api_v1_chorus_pro_transverses_ajouter_fichier_post.py → api_error.py} +24 -24
- factpulse/models/{body_completer_facture_api_v1_chorus_pro_factures_completer_post.py → bounding_box_schema.py} +23 -27
- factpulse/models/cadre_de_facturation.py +11 -3
- factpulse/models/categorie_tva.py +11 -11
- factpulse/models/certificate_info_response.py +1 -1
- factpulse/models/champ_verifie_schema.py +129 -0
- factpulse/models/chorus_pro_credentials.py +1 -1
- factpulse/models/code_cadre_facturation.py +2 -2
- factpulse/models/code_raison_reduction.py +9 -9
- factpulse/models/consulter_facture_request.py +1 -1
- factpulse/models/consulter_facture_response.py +1 -1
- factpulse/models/consulter_structure_request.py +1 -1
- factpulse/models/consulter_structure_response.py +1 -1
- factpulse/models/credentials_afnor.py +1 -1
- factpulse/models/credentials_chorus_pro.py +1 -1
- factpulse/models/destinataire.py +16 -2
- factpulse/models/destination.py +1 -1
- factpulse/models/destination_afnor.py +1 -1
- factpulse/models/destination_chorus_pro.py +1 -1
- factpulse/models/{quota_info.py → dimension_page_schema.py} +12 -18
- factpulse/models/direction_flux.py +1 -1
- factpulse/models/donnees_facture_simplifiees.py +1 -1
- factpulse/models/error_level.py +37 -0
- factpulse/models/error_source.py +43 -0
- factpulse/models/{facture_enrichie_info_output.py → facture_enrichie_info.py} +4 -4
- factpulse/models/facture_entrante.py +196 -0
- factpulse/models/facture_factur_x.py +12 -2
- factpulse/models/flux_resume.py +1 -1
- factpulse/models/format_facture.py +38 -0
- factpulse/models/format_sortie.py +1 -1
- factpulse/models/fournisseur.py +9 -2
- factpulse/models/fournisseur_entrant.py +144 -0
- factpulse/models/generate_certificate_request.py +1 -1
- factpulse/models/generate_certificate_response.py +1 -1
- factpulse/models/http_validation_error.py +1 -1
- factpulse/models/information_signature_api.py +1 -1
- factpulse/models/ligne_de_poste.py +7 -12
- factpulse/models/ligne_de_poste_montant_remise_ht.py +2 -2
- factpulse/models/ligne_de_poste_taux_tva_manuel.py +2 -2
- factpulse/models/ligne_de_tva.py +24 -10
- factpulse/models/mode_depot.py +1 -1
- factpulse/models/mode_paiement.py +1 -1
- factpulse/models/{montantapayer.py → montant_a_payer.py} +6 -6
- factpulse/models/{montantbaseht.py → montant_base_ht.py} +6 -6
- factpulse/models/montant_ht_total.py +4 -4
- factpulse/models/{montant_total_montant_remise_globale_ttc.py → montant_remise_globale_ttc.py} +7 -13
- factpulse/models/montant_total.py +16 -21
- factpulse/models/montant_total_acompte.py +2 -2
- factpulse/models/{ligne_de_poste_montant_total_ligne_ht.py → montant_total_ligne_ht.py} +7 -13
- factpulse/models/montant_ttc_total.py +4 -4
- factpulse/models/montant_tva.py +2 -2
- factpulse/models/{montanttva1.py → montant_tva_ligne.py} +7 -7
- factpulse/models/{montantttctotal.py → montant_tva_total.py} +7 -7
- factpulse/models/{montantunitaireht.py → montant_unitaire_ht.py} +5 -5
- factpulse/models/nature_operation.py +49 -0
- factpulse/models/{body_valideur_rechercher_factures_api_v1_chorus_pro_factures_valideur_rechercher_post.py → note.py} +14 -24
- factpulse/models/{utilisateur.py → note_obligatoire_schema.py} +40 -44
- factpulse/models/obtenir_id_chorus_pro_request.py +1 -1
- factpulse/models/obtenir_id_chorus_pro_response.py +1 -1
- factpulse/models/options_processing.py +1 -1
- factpulse/models/parametres_signature.py +1 -1
- factpulse/models/parametres_structure.py +1 -1
- factpulse/models/pdf_factur_x_info.py +1 -1
- factpulse/models/pdp_credentials.py +10 -3
- factpulse/models/piece_jointe_complementaire.py +1 -1
- factpulse/models/profil_api.py +1 -1
- factpulse/models/profil_flux.py +1 -1
- factpulse/models/quantite.py +1 -1
- factpulse/models/rechercher_services_response.py +1 -1
- factpulse/models/rechercher_structure_request.py +1 -1
- factpulse/models/rechercher_structure_response.py +1 -1
- factpulse/models/references.py +1 -1
- factpulse/models/reponse_healthcheck_afnor.py +1 -1
- factpulse/models/reponse_recherche_flux.py +1 -1
- factpulse/models/reponse_soumission_flux.py +1 -1
- factpulse/models/reponse_tache.py +1 -1
- factpulse/models/reponse_validation_erreur.py +1 -1
- factpulse/models/reponse_validation_succes.py +1 -1
- factpulse/models/reponse_verification_succes.py +135 -0
- factpulse/models/requete_recherche_flux.py +1 -1
- factpulse/models/requete_soumission_flux.py +1 -1
- factpulse/models/resultat_afnor.py +1 -1
- factpulse/models/resultat_chorus_pro.py +1 -1
- factpulse/models/resultat_validation_pdfapi.py +1 -1
- factpulse/models/scheme_id.py +7 -7
- factpulse/models/service_structure.py +1 -1
- factpulse/models/signature_info.py +1 -1
- factpulse/models/soumettre_facture_complete_request.py +1 -1
- factpulse/models/soumettre_facture_complete_response.py +4 -4
- factpulse/models/soumettre_facture_request.py +19 -7
- factpulse/models/soumettre_facture_response.py +1 -1
- factpulse/models/statut_acquittement.py +1 -1
- factpulse/models/statut_celery.py +40 -0
- factpulse/models/statut_champ_api.py +40 -0
- factpulse/models/statut_facture.py +1 -1
- factpulse/models/statut_tache.py +7 -9
- factpulse/models/structure_info.py +1 -1
- factpulse/models/syntaxe_flux.py +1 -1
- factpulse/models/tauxmanuel.py +2 -2
- factpulse/models/type_document.py +40 -0
- factpulse/models/type_facture.py +1 -1
- factpulse/models/type_flux.py +1 -1
- factpulse/models/type_tva.py +1 -1
- factpulse/models/unite.py +1 -1
- factpulse/models/validation_error.py +1 -1
- factpulse/models/{body_rechercher_factures_fournisseur_api_v1_chorus_pro_factures_rechercher_fournisseur_post.py → validation_error_detail.py} +27 -24
- factpulse/models/validation_error_loc_inner.py +1 -1
- factpulse/rest.py +8 -3
- factpulse-2.0.37.dist-info/METADATA +292 -0
- factpulse-2.0.37.dist-info/RECORD +134 -0
- factpulse-2.0.37.dist-info/top_level.txt +2 -0
- factpulse_helpers/__init__.py +96 -0
- factpulse_helpers/client.py +1887 -0
- factpulse_helpers/exceptions.py +253 -0
- factpulse/api/processing_endpoints_unifis_api.py +0 -592
- factpulse/api/signature_lectronique_api.py +0 -1358
- factpulse/models/body_lister_services_structure_api_v1_chorus_pro_structures_id_structure_cpp_services_get.py +0 -102
- factpulse/models/body_rechercher_factures_destinataire_api_v1_chorus_pro_factures_rechercher_destinataire_post.py +0 -104
- factpulse/models/body_recycler_facture_api_v1_chorus_pro_factures_recycler_post.py +0 -104
- factpulse/models/body_telecharger_groupe_factures_api_v1_chorus_pro_factures_telecharger_groupe_post.py +0 -104
- factpulse/models/body_traiter_facture_recue_api_v1_chorus_pro_factures_traiter_facture_recue_post.py +0 -104
- factpulse/models/body_valideur_consulter_facture_api_v1_chorus_pro_factures_valideur_consulter_post.py +0 -104
- factpulse/models/body_valideur_traiter_facture_api_v1_chorus_pro_factures_valideur_traiter_post.py +0 -104
- factpulse/models/facture_enrichie_info_input.py +0 -123
- factpulse/models/montanthttotal.py +0 -139
- factpulse/models/montanttva.py +0 -139
- factpulse-1.0.9.dist-info/METADATA +0 -182
- factpulse-1.0.9.dist-info/RECORD +0 -131
- factpulse-1.0.9.dist-info/top_level.txt +0 -1
- {factpulse-1.0.9.dist-info → factpulse-2.0.37.dist-info}/WHEEL +0 -0
- {factpulse-1.0.9.dist-info → factpulse-2.0.37.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,1719 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
API REST FactPulse
|
|
5
|
+
|
|
6
|
+
API REST pour la facturation électronique en France : Factur-X, AFNOR PDP/PA, signatures électroniques. ## 🎯 Fonctionnalités principales ### 📄 Génération de factures Factur-X - **Formats** : XML seul ou PDF/A-3 avec XML embarqué - **Profils** : MINIMUM, BASIC, EN16931, EXTENDED - **Normes** : EN 16931 (directive UE 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Format simplifié** : Génération à partir de SIRET + auto-enrichissement (API Chorus Pro + Recherche Entreprises) ### ✅ Validation et conformité - **Validation XML** : Schematron (45 à 210+ règles selon profil) - **Validation PDF** : PDF/A-3, métadonnées XMP Factur-X, signatures électroniques - **VeraPDF** : Validation stricte PDF/A (146+ règles ISO 19005-3) - **Traitement asynchrone** : Support Celery pour validations lourdes (VeraPDF) ### 📡 Intégration AFNOR PDP/PA (XP Z12-013) - **Soumission de flux** : Envoi de factures vers Plateformes de Dématérialisation Partenaires - **Recherche de flux** : Consultation des factures soumises - **Téléchargement** : Récupération des PDF/A-3 avec XML - **Directory Service** : Recherche d'entreprises (SIREN/SIRET) - **Multi-client** : Support de plusieurs configs PDP par utilisateur (stored credentials ou zero-storage) ### ✍️ Signature électronique PDF - **Standards** : PAdES-B-B, PAdES-B-T (horodatage RFC 3161), PAdES-B-LT (archivage long terme) - **Niveaux eIDAS** : SES (auto-signé), AdES (CA commerciale), QES (PSCO) - **Validation** : Vérification intégrité cryptographique et certificats - **Génération de certificats** : Certificats X.509 auto-signés pour tests ### 🔄 Traitement asynchrone - **Celery** : Génération, validation et signature asynchrones - **Polling** : Suivi d'état via `/taches/{id_tache}/statut` - **Pas de timeout** : Idéal pour gros fichiers ou validations lourdes ## 🔒 Authentification Toutes les requêtes nécessitent un **token JWT** dans le header Authorization : ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### Comment obtenir un token JWT ? #### 🔑 Méthode 1 : API `/api/token/` (Recommandée) **URL :** `https://www.factpulse.fr/api/token/` Cette méthode est **recommandée** pour l'intégration dans vos applications et workflows CI/CD. **Prérequis :** Avoir défini un mot de passe sur votre compte **Pour les utilisateurs inscrits via email/password :** - Vous avez déjà un mot de passe, utilisez-le directement **Pour les utilisateurs inscrits via OAuth (Google/GitHub) :** - Vous devez d'abord définir un mot de passe sur : https://www.factpulse.fr/accounts/password/set/ - Une fois le mot de passe créé, vous pourrez utiliser l'API **Exemple de requête :** ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\" }' ``` **Paramètre optionnel `client_uid` :** Pour sélectionner les credentials d'un client spécifique (PA/PDP, Chorus Pro, certificats de signature), ajoutez `client_uid` : ```bash curl -X POST https://www.factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d '{ \"username\": \"votre_email@example.com\", \"password\": \"votre_mot_de_passe\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }' ``` Le `client_uid` sera inclus dans le JWT et permettra à l'API d'utiliser automatiquement : - Les credentials AFNOR/PDP configurés pour ce client - Les credentials Chorus Pro configurés pour ce client - Les certificats de signature électronique configurés pour ce client **Réponse :** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Token d'accès (validité: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Token de rafraîchissement (validité: 7 jours) } ``` **Avantages :** - ✅ Automatisation complète (CI/CD, scripts) - ✅ Gestion programmatique des tokens - ✅ Support du refresh token pour renouveler automatiquement l'accès - ✅ Intégration facile dans n'importe quel langage/outil #### 🖥️ Méthode 2 : Génération via Dashboard (Alternative) **URL :** https://www.factpulse.fr/dashboard/ Cette méthode convient pour des tests rapides ou une utilisation occasionnelle via l'interface graphique. **Fonctionnement :** - Connectez-vous au dashboard - Utilisez les boutons \"Generate Test Token\" ou \"Generate Production Token\" - Fonctionne pour **tous** les utilisateurs (OAuth et email/password), sans nécessiter de mot de passe **Types de tokens :** - **Token Test** : Validité 24h, quota 1000 appels/jour (gratuit) - **Token Production** : Validité 7 jours, quota selon votre forfait **Avantages :** - ✅ Rapide pour tester l'API - ✅ Aucun mot de passe requis - ✅ Interface visuelle simple **Inconvénients :** - ❌ Nécessite une action manuelle - ❌ Pas de refresh token - ❌ Moins adapté pour l'automatisation ### 📚 Documentation complète Pour plus d'informations sur l'authentification et l'utilisation de l'API : https://www.factpulse.fr/documentation-api/
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
import warnings
|
|
15
|
+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
16
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
17
|
+
from typing_extensions import Annotated
|
|
18
|
+
|
|
19
|
+
from pydantic import Field, StrictBool, StrictBytes, StrictStr
|
|
20
|
+
from typing import Optional, Tuple, Union
|
|
21
|
+
from typing_extensions import Annotated
|
|
22
|
+
from factpulse.models.reponse_tache import ReponseTache
|
|
23
|
+
from factpulse.models.reponse_verification_succes import ReponseVerificationSucces
|
|
24
|
+
from factpulse.models.statut_tache import StatutTache
|
|
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 VrificationPDFXMLApi:
|
|
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 obtenir_statut_verification_api_v1_verification_verifier_async_id_tache_statut_get(
|
|
46
|
+
self,
|
|
47
|
+
id_tache: 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
|
+
) -> StatutTache:
|
|
61
|
+
"""Obtenir le statut d'une vérification asynchrone
|
|
62
|
+
|
|
63
|
+
Récupère le statut et le résultat d'une tâche de vérification asynchrone. **Statuts possibles:** - `PENDING`: Tâche en attente dans la file - `STARTED`: Tâche en cours d'exécution - `SUCCESS`: Tâche terminée avec succès (voir `resultat`) - `FAILURE`: Erreur système (exception non gérée) **Note:** Le champ `resultat.statut` peut être \"SUCCES\" ou \"ERREUR\" indépendamment du statut Celery (qui sera toujours SUCCESS si la tâche s'est exécutée).
|
|
64
|
+
|
|
65
|
+
:param id_tache: (required)
|
|
66
|
+
:type id_tache: 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._obtenir_statut_verification_api_v1_verification_verifier_async_id_tache_statut_get_serialize(
|
|
90
|
+
id_tache=id_tache,
|
|
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': "StatutTache",
|
|
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 obtenir_statut_verification_api_v1_verification_verifier_async_id_tache_statut_get_with_http_info(
|
|
114
|
+
self,
|
|
115
|
+
id_tache: 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[StatutTache]:
|
|
129
|
+
"""Obtenir le statut d'une vérification asynchrone
|
|
130
|
+
|
|
131
|
+
Récupère le statut et le résultat d'une tâche de vérification asynchrone. **Statuts possibles:** - `PENDING`: Tâche en attente dans la file - `STARTED`: Tâche en cours d'exécution - `SUCCESS`: Tâche terminée avec succès (voir `resultat`) - `FAILURE`: Erreur système (exception non gérée) **Note:** Le champ `resultat.statut` peut être \"SUCCES\" ou \"ERREUR\" indépendamment du statut Celery (qui sera toujours SUCCESS si la tâche s'est exécutée).
|
|
132
|
+
|
|
133
|
+
:param id_tache: (required)
|
|
134
|
+
:type id_tache: 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._obtenir_statut_verification_api_v1_verification_verifier_async_id_tache_statut_get_serialize(
|
|
158
|
+
id_tache=id_tache,
|
|
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': "StatutTache",
|
|
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 obtenir_statut_verification_api_v1_verification_verifier_async_id_tache_statut_get_without_preload_content(
|
|
182
|
+
self,
|
|
183
|
+
id_tache: 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
|
+
"""Obtenir le statut d'une vérification asynchrone
|
|
198
|
+
|
|
199
|
+
Récupère le statut et le résultat d'une tâche de vérification asynchrone. **Statuts possibles:** - `PENDING`: Tâche en attente dans la file - `STARTED`: Tâche en cours d'exécution - `SUCCESS`: Tâche terminée avec succès (voir `resultat`) - `FAILURE`: Erreur système (exception non gérée) **Note:** Le champ `resultat.statut` peut être \"SUCCES\" ou \"ERREUR\" indépendamment du statut Celery (qui sera toujours SUCCESS si la tâche s'est exécutée).
|
|
200
|
+
|
|
201
|
+
:param id_tache: (required)
|
|
202
|
+
:type id_tache: 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._obtenir_statut_verification_api_v1_verification_verifier_async_id_tache_statut_get_serialize(
|
|
226
|
+
id_tache=id_tache,
|
|
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': "StatutTache",
|
|
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 _obtenir_statut_verification_api_v1_verification_verifier_async_id_tache_statut_get_serialize(
|
|
245
|
+
self,
|
|
246
|
+
id_tache,
|
|
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 id_tache is not None:
|
|
269
|
+
_path_params['id_tache'] = id_tache
|
|
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/verifier-async/{id_tache}/statut',
|
|
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 obtenir_statut_verification_api_v1_verification_verifier_async_id_tache_statut_get_0(
|
|
310
|
+
self,
|
|
311
|
+
id_tache: 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
|
+
) -> StatutTache:
|
|
325
|
+
"""Obtenir le statut d'une vérification asynchrone
|
|
326
|
+
|
|
327
|
+
Récupère le statut et le résultat d'une tâche de vérification asynchrone. **Statuts possibles:** - `PENDING`: Tâche en attente dans la file - `STARTED`: Tâche en cours d'exécution - `SUCCESS`: Tâche terminée avec succès (voir `resultat`) - `FAILURE`: Erreur système (exception non gérée) **Note:** Le champ `resultat.statut` peut être \"SUCCES\" ou \"ERREUR\" indépendamment du statut Celery (qui sera toujours SUCCESS si la tâche s'est exécutée).
|
|
328
|
+
|
|
329
|
+
:param id_tache: (required)
|
|
330
|
+
:type id_tache: 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._obtenir_statut_verification_api_v1_verification_verifier_async_id_tache_statut_get_0_serialize(
|
|
354
|
+
id_tache=id_tache,
|
|
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': "StatutTache",
|
|
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 obtenir_statut_verification_api_v1_verification_verifier_async_id_tache_statut_get_0_with_http_info(
|
|
378
|
+
self,
|
|
379
|
+
id_tache: 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[StatutTache]:
|
|
393
|
+
"""Obtenir le statut d'une vérification asynchrone
|
|
394
|
+
|
|
395
|
+
Récupère le statut et le résultat d'une tâche de vérification asynchrone. **Statuts possibles:** - `PENDING`: Tâche en attente dans la file - `STARTED`: Tâche en cours d'exécution - `SUCCESS`: Tâche terminée avec succès (voir `resultat`) - `FAILURE`: Erreur système (exception non gérée) **Note:** Le champ `resultat.statut` peut être \"SUCCES\" ou \"ERREUR\" indépendamment du statut Celery (qui sera toujours SUCCESS si la tâche s'est exécutée).
|
|
396
|
+
|
|
397
|
+
:param id_tache: (required)
|
|
398
|
+
:type id_tache: 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._obtenir_statut_verification_api_v1_verification_verifier_async_id_tache_statut_get_0_serialize(
|
|
422
|
+
id_tache=id_tache,
|
|
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': "StatutTache",
|
|
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 obtenir_statut_verification_api_v1_verification_verifier_async_id_tache_statut_get_0_without_preload_content(
|
|
446
|
+
self,
|
|
447
|
+
id_tache: 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
|
+
"""Obtenir le statut d'une vérification asynchrone
|
|
462
|
+
|
|
463
|
+
Récupère le statut et le résultat d'une tâche de vérification asynchrone. **Statuts possibles:** - `PENDING`: Tâche en attente dans la file - `STARTED`: Tâche en cours d'exécution - `SUCCESS`: Tâche terminée avec succès (voir `resultat`) - `FAILURE`: Erreur système (exception non gérée) **Note:** Le champ `resultat.statut` peut être \"SUCCES\" ou \"ERREUR\" indépendamment du statut Celery (qui sera toujours SUCCESS si la tâche s'est exécutée).
|
|
464
|
+
|
|
465
|
+
:param id_tache: (required)
|
|
466
|
+
:type id_tache: 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._obtenir_statut_verification_api_v1_verification_verifier_async_id_tache_statut_get_0_serialize(
|
|
490
|
+
id_tache=id_tache,
|
|
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': "StatutTache",
|
|
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 _obtenir_statut_verification_api_v1_verification_verifier_async_id_tache_statut_get_0_serialize(
|
|
509
|
+
self,
|
|
510
|
+
id_tache,
|
|
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 id_tache is not None:
|
|
533
|
+
_path_params['id_tache'] = id_tache
|
|
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/verifier-async/{id_tache}/statut',
|
|
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 verifier_pdf_async_api_v1_verification_verifier_async_post(
|
|
574
|
+
self,
|
|
575
|
+
fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF Factur-X à vérifier")],
|
|
576
|
+
forcer_ocr: Annotated[Optional[StrictBool], Field(description="Forcer l'utilisation de l'OCR même si le PDF contient du texte natif")] = 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
|
+
) -> ReponseTache:
|
|
590
|
+
"""Vérifier la conformité PDF/XML Factur-X (asynchrone)
|
|
591
|
+
|
|
592
|
+
Vérifie la conformité PDF/XML Factur-X de manière asynchrone. **IMPORTANT**: Seuls les PDF Factur-X (avec XML embarqué) sont acceptés. Les PDF sans XML Factur-X retourneront une erreur `NOT_FACTURX` dans le résultat. Cette version utilise une tâche Celery et peut faire appel au service OCR si le PDF est une image ou si `forcer_ocr=true`. **Retourne immédiatement** un ID de tâche. Utilisez `/verifier-async/{id_tache}/statut` pour récupérer le résultat. **Principe de vérification (Factur-X 1.08):** - Principe n°2: Le XML ne peut contenir que des infos présentes dans le PDF - Principe n°4: Toute info XML doit être présente et conforme dans le PDF **Champs vérifiés:** - Identification: BT-1 (n° facture), BT-2 (date), BT-3 (type), BT-5 (devise), BT-23 (cadre) - Vendeur: BT-27 (nom), BT-29 (SIRET), BT-30 (SIREN), BT-31 (TVA) - Acheteur: BT-44 (nom), BT-46 (SIRET), BT-47 (SIREN), BT-48 (TVA) - Montants: BT-109 (HT), BT-110 (TVA), BT-112 (TTC), BT-115 (à payer) - Ventilation TVA: BT-116, BT-117, BT-118, BT-119 - Lignes de facture: BT-153, BT-129, BT-146, BT-131 - Notes obligatoires: PMT, PMD, AAB - Règle BR-FR-09: cohérence SIRET/SIREN **Avantages par rapport à la version synchrone:** - Support OCR pour les PDF images (via service DocTR) - Timeout plus long pour les gros documents - Ne bloque pas le serveur
|
|
593
|
+
|
|
594
|
+
:param fichier_pdf: Fichier PDF Factur-X à vérifier (required)
|
|
595
|
+
:type fichier_pdf: bytearray
|
|
596
|
+
:param forcer_ocr: Forcer l'utilisation de l'OCR même si le PDF contient du texte natif
|
|
597
|
+
:type forcer_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._verifier_pdf_async_api_v1_verification_verifier_async_post_serialize(
|
|
621
|
+
fichier_pdf=fichier_pdf,
|
|
622
|
+
forcer_ocr=forcer_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': "ReponseTache",
|
|
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 verifier_pdf_async_api_v1_verification_verifier_async_post_with_http_info(
|
|
646
|
+
self,
|
|
647
|
+
fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF Factur-X à vérifier")],
|
|
648
|
+
forcer_ocr: Annotated[Optional[StrictBool], Field(description="Forcer l'utilisation de l'OCR même si le PDF contient du texte natif")] = 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[ReponseTache]:
|
|
662
|
+
"""Vérifier la conformité PDF/XML Factur-X (asynchrone)
|
|
663
|
+
|
|
664
|
+
Vérifie la conformité PDF/XML Factur-X de manière asynchrone. **IMPORTANT**: Seuls les PDF Factur-X (avec XML embarqué) sont acceptés. Les PDF sans XML Factur-X retourneront une erreur `NOT_FACTURX` dans le résultat. Cette version utilise une tâche Celery et peut faire appel au service OCR si le PDF est une image ou si `forcer_ocr=true`. **Retourne immédiatement** un ID de tâche. Utilisez `/verifier-async/{id_tache}/statut` pour récupérer le résultat. **Principe de vérification (Factur-X 1.08):** - Principe n°2: Le XML ne peut contenir que des infos présentes dans le PDF - Principe n°4: Toute info XML doit être présente et conforme dans le PDF **Champs vérifiés:** - Identification: BT-1 (n° facture), BT-2 (date), BT-3 (type), BT-5 (devise), BT-23 (cadre) - Vendeur: BT-27 (nom), BT-29 (SIRET), BT-30 (SIREN), BT-31 (TVA) - Acheteur: BT-44 (nom), BT-46 (SIRET), BT-47 (SIREN), BT-48 (TVA) - Montants: BT-109 (HT), BT-110 (TVA), BT-112 (TTC), BT-115 (à payer) - Ventilation TVA: BT-116, BT-117, BT-118, BT-119 - Lignes de facture: BT-153, BT-129, BT-146, BT-131 - Notes obligatoires: PMT, PMD, AAB - Règle BR-FR-09: cohérence SIRET/SIREN **Avantages par rapport à la version synchrone:** - Support OCR pour les PDF images (via service DocTR) - Timeout plus long pour les gros documents - Ne bloque pas le serveur
|
|
665
|
+
|
|
666
|
+
:param fichier_pdf: Fichier PDF Factur-X à vérifier (required)
|
|
667
|
+
:type fichier_pdf: bytearray
|
|
668
|
+
:param forcer_ocr: Forcer l'utilisation de l'OCR même si le PDF contient du texte natif
|
|
669
|
+
:type forcer_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._verifier_pdf_async_api_v1_verification_verifier_async_post_serialize(
|
|
693
|
+
fichier_pdf=fichier_pdf,
|
|
694
|
+
forcer_ocr=forcer_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': "ReponseTache",
|
|
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 verifier_pdf_async_api_v1_verification_verifier_async_post_without_preload_content(
|
|
718
|
+
self,
|
|
719
|
+
fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF Factur-X à vérifier")],
|
|
720
|
+
forcer_ocr: Annotated[Optional[StrictBool], Field(description="Forcer l'utilisation de l'OCR même si le PDF contient du texte natif")] = 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
|
+
"""Vérifier la conformité PDF/XML Factur-X (asynchrone)
|
|
735
|
+
|
|
736
|
+
Vérifie la conformité PDF/XML Factur-X de manière asynchrone. **IMPORTANT**: Seuls les PDF Factur-X (avec XML embarqué) sont acceptés. Les PDF sans XML Factur-X retourneront une erreur `NOT_FACTURX` dans le résultat. Cette version utilise une tâche Celery et peut faire appel au service OCR si le PDF est une image ou si `forcer_ocr=true`. **Retourne immédiatement** un ID de tâche. Utilisez `/verifier-async/{id_tache}/statut` pour récupérer le résultat. **Principe de vérification (Factur-X 1.08):** - Principe n°2: Le XML ne peut contenir que des infos présentes dans le PDF - Principe n°4: Toute info XML doit être présente et conforme dans le PDF **Champs vérifiés:** - Identification: BT-1 (n° facture), BT-2 (date), BT-3 (type), BT-5 (devise), BT-23 (cadre) - Vendeur: BT-27 (nom), BT-29 (SIRET), BT-30 (SIREN), BT-31 (TVA) - Acheteur: BT-44 (nom), BT-46 (SIRET), BT-47 (SIREN), BT-48 (TVA) - Montants: BT-109 (HT), BT-110 (TVA), BT-112 (TTC), BT-115 (à payer) - Ventilation TVA: BT-116, BT-117, BT-118, BT-119 - Lignes de facture: BT-153, BT-129, BT-146, BT-131 - Notes obligatoires: PMT, PMD, AAB - Règle BR-FR-09: cohérence SIRET/SIREN **Avantages par rapport à la version synchrone:** - Support OCR pour les PDF images (via service DocTR) - Timeout plus long pour les gros documents - Ne bloque pas le serveur
|
|
737
|
+
|
|
738
|
+
:param fichier_pdf: Fichier PDF Factur-X à vérifier (required)
|
|
739
|
+
:type fichier_pdf: bytearray
|
|
740
|
+
:param forcer_ocr: Forcer l'utilisation de l'OCR même si le PDF contient du texte natif
|
|
741
|
+
:type forcer_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._verifier_pdf_async_api_v1_verification_verifier_async_post_serialize(
|
|
765
|
+
fichier_pdf=fichier_pdf,
|
|
766
|
+
forcer_ocr=forcer_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': "ReponseTache",
|
|
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 _verifier_pdf_async_api_v1_verification_verifier_async_post_serialize(
|
|
785
|
+
self,
|
|
786
|
+
fichier_pdf,
|
|
787
|
+
forcer_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 fichier_pdf is not None:
|
|
813
|
+
_files['fichier_pdf'] = fichier_pdf
|
|
814
|
+
if forcer_ocr is not None:
|
|
815
|
+
_form_params.append(('forcer_ocr', forcer_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/verifier-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 verifier_pdf_async_api_v1_verification_verifier_async_post_0(
|
|
866
|
+
self,
|
|
867
|
+
fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF Factur-X à vérifier")],
|
|
868
|
+
forcer_ocr: Annotated[Optional[StrictBool], Field(description="Forcer l'utilisation de l'OCR même si le PDF contient du texte natif")] = 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
|
+
) -> ReponseTache:
|
|
882
|
+
"""Vérifier la conformité PDF/XML Factur-X (asynchrone)
|
|
883
|
+
|
|
884
|
+
Vérifie la conformité PDF/XML Factur-X de manière asynchrone. **IMPORTANT**: Seuls les PDF Factur-X (avec XML embarqué) sont acceptés. Les PDF sans XML Factur-X retourneront une erreur `NOT_FACTURX` dans le résultat. Cette version utilise une tâche Celery et peut faire appel au service OCR si le PDF est une image ou si `forcer_ocr=true`. **Retourne immédiatement** un ID de tâche. Utilisez `/verifier-async/{id_tache}/statut` pour récupérer le résultat. **Principe de vérification (Factur-X 1.08):** - Principe n°2: Le XML ne peut contenir que des infos présentes dans le PDF - Principe n°4: Toute info XML doit être présente et conforme dans le PDF **Champs vérifiés:** - Identification: BT-1 (n° facture), BT-2 (date), BT-3 (type), BT-5 (devise), BT-23 (cadre) - Vendeur: BT-27 (nom), BT-29 (SIRET), BT-30 (SIREN), BT-31 (TVA) - Acheteur: BT-44 (nom), BT-46 (SIRET), BT-47 (SIREN), BT-48 (TVA) - Montants: BT-109 (HT), BT-110 (TVA), BT-112 (TTC), BT-115 (à payer) - Ventilation TVA: BT-116, BT-117, BT-118, BT-119 - Lignes de facture: BT-153, BT-129, BT-146, BT-131 - Notes obligatoires: PMT, PMD, AAB - Règle BR-FR-09: cohérence SIRET/SIREN **Avantages par rapport à la version synchrone:** - Support OCR pour les PDF images (via service DocTR) - Timeout plus long pour les gros documents - Ne bloque pas le serveur
|
|
885
|
+
|
|
886
|
+
:param fichier_pdf: Fichier PDF Factur-X à vérifier (required)
|
|
887
|
+
:type fichier_pdf: bytearray
|
|
888
|
+
:param forcer_ocr: Forcer l'utilisation de l'OCR même si le PDF contient du texte natif
|
|
889
|
+
:type forcer_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._verifier_pdf_async_api_v1_verification_verifier_async_post_0_serialize(
|
|
913
|
+
fichier_pdf=fichier_pdf,
|
|
914
|
+
forcer_ocr=forcer_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': "ReponseTache",
|
|
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 verifier_pdf_async_api_v1_verification_verifier_async_post_0_with_http_info(
|
|
938
|
+
self,
|
|
939
|
+
fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF Factur-X à vérifier")],
|
|
940
|
+
forcer_ocr: Annotated[Optional[StrictBool], Field(description="Forcer l'utilisation de l'OCR même si le PDF contient du texte natif")] = 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[ReponseTache]:
|
|
954
|
+
"""Vérifier la conformité PDF/XML Factur-X (asynchrone)
|
|
955
|
+
|
|
956
|
+
Vérifie la conformité PDF/XML Factur-X de manière asynchrone. **IMPORTANT**: Seuls les PDF Factur-X (avec XML embarqué) sont acceptés. Les PDF sans XML Factur-X retourneront une erreur `NOT_FACTURX` dans le résultat. Cette version utilise une tâche Celery et peut faire appel au service OCR si le PDF est une image ou si `forcer_ocr=true`. **Retourne immédiatement** un ID de tâche. Utilisez `/verifier-async/{id_tache}/statut` pour récupérer le résultat. **Principe de vérification (Factur-X 1.08):** - Principe n°2: Le XML ne peut contenir que des infos présentes dans le PDF - Principe n°4: Toute info XML doit être présente et conforme dans le PDF **Champs vérifiés:** - Identification: BT-1 (n° facture), BT-2 (date), BT-3 (type), BT-5 (devise), BT-23 (cadre) - Vendeur: BT-27 (nom), BT-29 (SIRET), BT-30 (SIREN), BT-31 (TVA) - Acheteur: BT-44 (nom), BT-46 (SIRET), BT-47 (SIREN), BT-48 (TVA) - Montants: BT-109 (HT), BT-110 (TVA), BT-112 (TTC), BT-115 (à payer) - Ventilation TVA: BT-116, BT-117, BT-118, BT-119 - Lignes de facture: BT-153, BT-129, BT-146, BT-131 - Notes obligatoires: PMT, PMD, AAB - Règle BR-FR-09: cohérence SIRET/SIREN **Avantages par rapport à la version synchrone:** - Support OCR pour les PDF images (via service DocTR) - Timeout plus long pour les gros documents - Ne bloque pas le serveur
|
|
957
|
+
|
|
958
|
+
:param fichier_pdf: Fichier PDF Factur-X à vérifier (required)
|
|
959
|
+
:type fichier_pdf: bytearray
|
|
960
|
+
:param forcer_ocr: Forcer l'utilisation de l'OCR même si le PDF contient du texte natif
|
|
961
|
+
:type forcer_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._verifier_pdf_async_api_v1_verification_verifier_async_post_0_serialize(
|
|
985
|
+
fichier_pdf=fichier_pdf,
|
|
986
|
+
forcer_ocr=forcer_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': "ReponseTache",
|
|
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 verifier_pdf_async_api_v1_verification_verifier_async_post_0_without_preload_content(
|
|
1010
|
+
self,
|
|
1011
|
+
fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF Factur-X à vérifier")],
|
|
1012
|
+
forcer_ocr: Annotated[Optional[StrictBool], Field(description="Forcer l'utilisation de l'OCR même si le PDF contient du texte natif")] = 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
|
+
"""Vérifier la conformité PDF/XML Factur-X (asynchrone)
|
|
1027
|
+
|
|
1028
|
+
Vérifie la conformité PDF/XML Factur-X de manière asynchrone. **IMPORTANT**: Seuls les PDF Factur-X (avec XML embarqué) sont acceptés. Les PDF sans XML Factur-X retourneront une erreur `NOT_FACTURX` dans le résultat. Cette version utilise une tâche Celery et peut faire appel au service OCR si le PDF est une image ou si `forcer_ocr=true`. **Retourne immédiatement** un ID de tâche. Utilisez `/verifier-async/{id_tache}/statut` pour récupérer le résultat. **Principe de vérification (Factur-X 1.08):** - Principe n°2: Le XML ne peut contenir que des infos présentes dans le PDF - Principe n°4: Toute info XML doit être présente et conforme dans le PDF **Champs vérifiés:** - Identification: BT-1 (n° facture), BT-2 (date), BT-3 (type), BT-5 (devise), BT-23 (cadre) - Vendeur: BT-27 (nom), BT-29 (SIRET), BT-30 (SIREN), BT-31 (TVA) - Acheteur: BT-44 (nom), BT-46 (SIRET), BT-47 (SIREN), BT-48 (TVA) - Montants: BT-109 (HT), BT-110 (TVA), BT-112 (TTC), BT-115 (à payer) - Ventilation TVA: BT-116, BT-117, BT-118, BT-119 - Lignes de facture: BT-153, BT-129, BT-146, BT-131 - Notes obligatoires: PMT, PMD, AAB - Règle BR-FR-09: cohérence SIRET/SIREN **Avantages par rapport à la version synchrone:** - Support OCR pour les PDF images (via service DocTR) - Timeout plus long pour les gros documents - Ne bloque pas le serveur
|
|
1029
|
+
|
|
1030
|
+
:param fichier_pdf: Fichier PDF Factur-X à vérifier (required)
|
|
1031
|
+
:type fichier_pdf: bytearray
|
|
1032
|
+
:param forcer_ocr: Forcer l'utilisation de l'OCR même si le PDF contient du texte natif
|
|
1033
|
+
:type forcer_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._verifier_pdf_async_api_v1_verification_verifier_async_post_0_serialize(
|
|
1057
|
+
fichier_pdf=fichier_pdf,
|
|
1058
|
+
forcer_ocr=forcer_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': "ReponseTache",
|
|
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 _verifier_pdf_async_api_v1_verification_verifier_async_post_0_serialize(
|
|
1077
|
+
self,
|
|
1078
|
+
fichier_pdf,
|
|
1079
|
+
forcer_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 fichier_pdf is not None:
|
|
1105
|
+
_files['fichier_pdf'] = fichier_pdf
|
|
1106
|
+
if forcer_ocr is not None:
|
|
1107
|
+
_form_params.append(('forcer_ocr', forcer_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/verifier-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 verifier_pdf_sync_api_v1_verification_verifier_post(
|
|
1158
|
+
self,
|
|
1159
|
+
fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF Factur-X à vérifier")],
|
|
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
|
+
) -> ReponseVerificationSucces:
|
|
1173
|
+
"""Vérifier la conformité PDF/XML Factur-X (synchrone)
|
|
1174
|
+
|
|
1175
|
+
Vérifie la conformité entre le PDF et son XML Factur-X embarqué. **IMPORTANT**: Seuls les PDF Factur-X (avec XML embarqué) sont acceptés. Les PDF sans XML Factur-X seront rejetés avec une erreur 400. Cette version synchrone utilise uniquement l'extraction PDF native (pdfplumber). Pour les PDF images nécessitant de l'OCR, utilisez l'endpoint `/verifier-async`. **Principe de vérification (Factur-X 1.08):** - Principe n°2: Le XML ne peut contenir que des infos présentes dans le PDF - Principe n°4: Toute info XML doit être présente et conforme dans le PDF **Champs vérifiés:** - Identification: BT-1 (n° facture), BT-2 (date), BT-3 (type), BT-5 (devise), BT-23 (cadre) - Vendeur: BT-27 (nom), BT-29 (SIRET), BT-30 (SIREN), BT-31 (TVA) - Acheteur: BT-44 (nom), BT-46 (SIRET), BT-47 (SIREN), BT-48 (TVA) - Montants: BT-109 (HT), BT-110 (TVA), BT-112 (TTC), BT-115 (à payer) - Ventilation TVA: BT-116, BT-117, BT-118, BT-119 - Lignes de facture: BT-153, BT-129, BT-146, BT-131 - Notes obligatoires: PMT, PMD, AAB - Règle BR-FR-09: cohérence SIRET/SIREN
|
|
1176
|
+
|
|
1177
|
+
:param fichier_pdf: Fichier PDF Factur-X à vérifier (required)
|
|
1178
|
+
:type fichier_pdf: 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._verifier_pdf_sync_api_v1_verification_verifier_post_serialize(
|
|
1202
|
+
fichier_pdf=fichier_pdf,
|
|
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': "ReponseVerificationSucces",
|
|
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 verifier_pdf_sync_api_v1_verification_verifier_post_with_http_info(
|
|
1228
|
+
self,
|
|
1229
|
+
fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF Factur-X à vérifier")],
|
|
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[ReponseVerificationSucces]:
|
|
1243
|
+
"""Vérifier la conformité PDF/XML Factur-X (synchrone)
|
|
1244
|
+
|
|
1245
|
+
Vérifie la conformité entre le PDF et son XML Factur-X embarqué. **IMPORTANT**: Seuls les PDF Factur-X (avec XML embarqué) sont acceptés. Les PDF sans XML Factur-X seront rejetés avec une erreur 400. Cette version synchrone utilise uniquement l'extraction PDF native (pdfplumber). Pour les PDF images nécessitant de l'OCR, utilisez l'endpoint `/verifier-async`. **Principe de vérification (Factur-X 1.08):** - Principe n°2: Le XML ne peut contenir que des infos présentes dans le PDF - Principe n°4: Toute info XML doit être présente et conforme dans le PDF **Champs vérifiés:** - Identification: BT-1 (n° facture), BT-2 (date), BT-3 (type), BT-5 (devise), BT-23 (cadre) - Vendeur: BT-27 (nom), BT-29 (SIRET), BT-30 (SIREN), BT-31 (TVA) - Acheteur: BT-44 (nom), BT-46 (SIRET), BT-47 (SIREN), BT-48 (TVA) - Montants: BT-109 (HT), BT-110 (TVA), BT-112 (TTC), BT-115 (à payer) - Ventilation TVA: BT-116, BT-117, BT-118, BT-119 - Lignes de facture: BT-153, BT-129, BT-146, BT-131 - Notes obligatoires: PMT, PMD, AAB - Règle BR-FR-09: cohérence SIRET/SIREN
|
|
1246
|
+
|
|
1247
|
+
:param fichier_pdf: Fichier PDF Factur-X à vérifier (required)
|
|
1248
|
+
:type fichier_pdf: 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._verifier_pdf_sync_api_v1_verification_verifier_post_serialize(
|
|
1272
|
+
fichier_pdf=fichier_pdf,
|
|
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': "ReponseVerificationSucces",
|
|
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 verifier_pdf_sync_api_v1_verification_verifier_post_without_preload_content(
|
|
1298
|
+
self,
|
|
1299
|
+
fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF Factur-X à vérifier")],
|
|
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
|
+
"""Vérifier la conformité PDF/XML Factur-X (synchrone)
|
|
1314
|
+
|
|
1315
|
+
Vérifie la conformité entre le PDF et son XML Factur-X embarqué. **IMPORTANT**: Seuls les PDF Factur-X (avec XML embarqué) sont acceptés. Les PDF sans XML Factur-X seront rejetés avec une erreur 400. Cette version synchrone utilise uniquement l'extraction PDF native (pdfplumber). Pour les PDF images nécessitant de l'OCR, utilisez l'endpoint `/verifier-async`. **Principe de vérification (Factur-X 1.08):** - Principe n°2: Le XML ne peut contenir que des infos présentes dans le PDF - Principe n°4: Toute info XML doit être présente et conforme dans le PDF **Champs vérifiés:** - Identification: BT-1 (n° facture), BT-2 (date), BT-3 (type), BT-5 (devise), BT-23 (cadre) - Vendeur: BT-27 (nom), BT-29 (SIRET), BT-30 (SIREN), BT-31 (TVA) - Acheteur: BT-44 (nom), BT-46 (SIRET), BT-47 (SIREN), BT-48 (TVA) - Montants: BT-109 (HT), BT-110 (TVA), BT-112 (TTC), BT-115 (à payer) - Ventilation TVA: BT-116, BT-117, BT-118, BT-119 - Lignes de facture: BT-153, BT-129, BT-146, BT-131 - Notes obligatoires: PMT, PMD, AAB - Règle BR-FR-09: cohérence SIRET/SIREN
|
|
1316
|
+
|
|
1317
|
+
:param fichier_pdf: Fichier PDF Factur-X à vérifier (required)
|
|
1318
|
+
:type fichier_pdf: 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._verifier_pdf_sync_api_v1_verification_verifier_post_serialize(
|
|
1342
|
+
fichier_pdf=fichier_pdf,
|
|
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': "ReponseVerificationSucces",
|
|
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 _verifier_pdf_sync_api_v1_verification_verifier_post_serialize(
|
|
1363
|
+
self,
|
|
1364
|
+
fichier_pdf,
|
|
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 fichier_pdf is not None:
|
|
1390
|
+
_files['fichier_pdf'] = fichier_pdf
|
|
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/verifier',
|
|
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 verifier_pdf_sync_api_v1_verification_verifier_post_0(
|
|
1441
|
+
self,
|
|
1442
|
+
fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF Factur-X à vérifier")],
|
|
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
|
+
) -> ReponseVerificationSucces:
|
|
1456
|
+
"""Vérifier la conformité PDF/XML Factur-X (synchrone)
|
|
1457
|
+
|
|
1458
|
+
Vérifie la conformité entre le PDF et son XML Factur-X embarqué. **IMPORTANT**: Seuls les PDF Factur-X (avec XML embarqué) sont acceptés. Les PDF sans XML Factur-X seront rejetés avec une erreur 400. Cette version synchrone utilise uniquement l'extraction PDF native (pdfplumber). Pour les PDF images nécessitant de l'OCR, utilisez l'endpoint `/verifier-async`. **Principe de vérification (Factur-X 1.08):** - Principe n°2: Le XML ne peut contenir que des infos présentes dans le PDF - Principe n°4: Toute info XML doit être présente et conforme dans le PDF **Champs vérifiés:** - Identification: BT-1 (n° facture), BT-2 (date), BT-3 (type), BT-5 (devise), BT-23 (cadre) - Vendeur: BT-27 (nom), BT-29 (SIRET), BT-30 (SIREN), BT-31 (TVA) - Acheteur: BT-44 (nom), BT-46 (SIRET), BT-47 (SIREN), BT-48 (TVA) - Montants: BT-109 (HT), BT-110 (TVA), BT-112 (TTC), BT-115 (à payer) - Ventilation TVA: BT-116, BT-117, BT-118, BT-119 - Lignes de facture: BT-153, BT-129, BT-146, BT-131 - Notes obligatoires: PMT, PMD, AAB - Règle BR-FR-09: cohérence SIRET/SIREN
|
|
1459
|
+
|
|
1460
|
+
:param fichier_pdf: Fichier PDF Factur-X à vérifier (required)
|
|
1461
|
+
:type fichier_pdf: 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._verifier_pdf_sync_api_v1_verification_verifier_post_0_serialize(
|
|
1485
|
+
fichier_pdf=fichier_pdf,
|
|
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': "ReponseVerificationSucces",
|
|
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 verifier_pdf_sync_api_v1_verification_verifier_post_0_with_http_info(
|
|
1511
|
+
self,
|
|
1512
|
+
fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF Factur-X à vérifier")],
|
|
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[ReponseVerificationSucces]:
|
|
1526
|
+
"""Vérifier la conformité PDF/XML Factur-X (synchrone)
|
|
1527
|
+
|
|
1528
|
+
Vérifie la conformité entre le PDF et son XML Factur-X embarqué. **IMPORTANT**: Seuls les PDF Factur-X (avec XML embarqué) sont acceptés. Les PDF sans XML Factur-X seront rejetés avec une erreur 400. Cette version synchrone utilise uniquement l'extraction PDF native (pdfplumber). Pour les PDF images nécessitant de l'OCR, utilisez l'endpoint `/verifier-async`. **Principe de vérification (Factur-X 1.08):** - Principe n°2: Le XML ne peut contenir que des infos présentes dans le PDF - Principe n°4: Toute info XML doit être présente et conforme dans le PDF **Champs vérifiés:** - Identification: BT-1 (n° facture), BT-2 (date), BT-3 (type), BT-5 (devise), BT-23 (cadre) - Vendeur: BT-27 (nom), BT-29 (SIRET), BT-30 (SIREN), BT-31 (TVA) - Acheteur: BT-44 (nom), BT-46 (SIRET), BT-47 (SIREN), BT-48 (TVA) - Montants: BT-109 (HT), BT-110 (TVA), BT-112 (TTC), BT-115 (à payer) - Ventilation TVA: BT-116, BT-117, BT-118, BT-119 - Lignes de facture: BT-153, BT-129, BT-146, BT-131 - Notes obligatoires: PMT, PMD, AAB - Règle BR-FR-09: cohérence SIRET/SIREN
|
|
1529
|
+
|
|
1530
|
+
:param fichier_pdf: Fichier PDF Factur-X à vérifier (required)
|
|
1531
|
+
:type fichier_pdf: 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._verifier_pdf_sync_api_v1_verification_verifier_post_0_serialize(
|
|
1555
|
+
fichier_pdf=fichier_pdf,
|
|
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': "ReponseVerificationSucces",
|
|
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 verifier_pdf_sync_api_v1_verification_verifier_post_0_without_preload_content(
|
|
1581
|
+
self,
|
|
1582
|
+
fichier_pdf: Annotated[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], Field(description="Fichier PDF Factur-X à vérifier")],
|
|
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
|
+
"""Vérifier la conformité PDF/XML Factur-X (synchrone)
|
|
1597
|
+
|
|
1598
|
+
Vérifie la conformité entre le PDF et son XML Factur-X embarqué. **IMPORTANT**: Seuls les PDF Factur-X (avec XML embarqué) sont acceptés. Les PDF sans XML Factur-X seront rejetés avec une erreur 400. Cette version synchrone utilise uniquement l'extraction PDF native (pdfplumber). Pour les PDF images nécessitant de l'OCR, utilisez l'endpoint `/verifier-async`. **Principe de vérification (Factur-X 1.08):** - Principe n°2: Le XML ne peut contenir que des infos présentes dans le PDF - Principe n°4: Toute info XML doit être présente et conforme dans le PDF **Champs vérifiés:** - Identification: BT-1 (n° facture), BT-2 (date), BT-3 (type), BT-5 (devise), BT-23 (cadre) - Vendeur: BT-27 (nom), BT-29 (SIRET), BT-30 (SIREN), BT-31 (TVA) - Acheteur: BT-44 (nom), BT-46 (SIRET), BT-47 (SIREN), BT-48 (TVA) - Montants: BT-109 (HT), BT-110 (TVA), BT-112 (TTC), BT-115 (à payer) - Ventilation TVA: BT-116, BT-117, BT-118, BT-119 - Lignes de facture: BT-153, BT-129, BT-146, BT-131 - Notes obligatoires: PMT, PMD, AAB - Règle BR-FR-09: cohérence SIRET/SIREN
|
|
1599
|
+
|
|
1600
|
+
:param fichier_pdf: Fichier PDF Factur-X à vérifier (required)
|
|
1601
|
+
:type fichier_pdf: 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._verifier_pdf_sync_api_v1_verification_verifier_post_0_serialize(
|
|
1625
|
+
fichier_pdf=fichier_pdf,
|
|
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': "ReponseVerificationSucces",
|
|
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 _verifier_pdf_sync_api_v1_verification_verifier_post_0_serialize(
|
|
1646
|
+
self,
|
|
1647
|
+
fichier_pdf,
|
|
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 fichier_pdf is not None:
|
|
1673
|
+
_files['fichier_pdf'] = fichier_pdf
|
|
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/verifier',
|
|
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
|
+
|