factpulse 2.0.29 → 2.0.31
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -3
- data/Gemfile.lock +1 -1
- data/README.md +146 -133
- data/docs/AFNORPDPPAApi.md +70 -0
- data/docs/FactureEntrante.md +48 -0
- data/docs/FormatFacture.md +15 -0
- data/docs/FournisseurEntrant.md +32 -0
- data/docs/TypeDocument.md +15 -0
- data/lib/factpulse/api/afnorpdppa_api.rb +63 -0
- data/lib/factpulse/models/facture_entrante.rb +492 -0
- data/lib/factpulse/models/format_facture.rb +41 -0
- data/lib/factpulse/models/fournisseur_entrant.rb +236 -0
- data/lib/factpulse/models/type_document.rb +43 -0
- data/lib/factpulse/version.rb +1 -1
- data/lib/factpulse.rb +4 -0
- metadata +10 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9a2fa7a0aa8a73b2298393f60b15772a3dd178966bf49d1781432466a3394e2a
|
|
4
|
+
data.tar.gz: 41533e0cd8bd3b2871fe5d57f48e1bc5a01d6524b58e76768e8984eb613c3b94
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8be71e97dcd09c3d3d3ee790ab76e0ffb3ba5e06c53fa018582500856df15675b20b4230a2afc8090091e79560d40b2a57885313c734507f90f40d8f32ac25a9
|
|
7
|
+
data.tar.gz: b85c744af81489afe834d1e181f46244285ec0ddc58d6a885d3e86945c7ba6a5f300195e12aee1bac4f6a31d419c7174c6509754952c4ed56ad3d3afdcb9db49
|
data/CHANGELOG.md
CHANGED
|
@@ -7,7 +7,7 @@ et ce projet adhère au [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
-
## [2.0.
|
|
10
|
+
## [2.0.31] - 2025-11-29
|
|
11
11
|
|
|
12
12
|
### Added
|
|
13
13
|
- Version initiale du SDK ruby
|
|
@@ -24,5 +24,5 @@ et ce projet adhère au [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|
|
24
24
|
- Guide d'authentification JWT
|
|
25
25
|
- Configuration avancée (timeout, proxy, debug)
|
|
26
26
|
|
|
27
|
-
[Unreleased]: https://github.com/factpulse/sdk-ruby/compare/v2.0.
|
|
28
|
-
[2.0.
|
|
27
|
+
[Unreleased]: https://github.com/factpulse/sdk-ruby/compare/v2.0.31...HEAD
|
|
28
|
+
[2.0.31]: https://github.com/factpulse/sdk-ruby/releases/tag/v2.0.31
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -2,16 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Client Ruby officiel pour l'API FactPulse - Facturation électronique française.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Fonctionnalités
|
|
6
6
|
|
|
7
7
|
- **Factur-X** : Génération et validation de factures électroniques (profils MINIMUM, BASIC, EN16931, EXTENDED)
|
|
8
8
|
- **Chorus Pro** : Intégration avec la plateforme de facturation publique française
|
|
9
9
|
- **AFNOR PDP/PA** : Soumission de flux conformes à la norme XP Z12-013
|
|
10
10
|
- **Signature électronique** : Signature PDF (PAdES-B-B, PAdES-B-T, PAdES-B-LT)
|
|
11
11
|
- **Client simplifié** : Authentification JWT et polling intégrés via `helpers`
|
|
12
|
-
- **Ruby 2.7+** : Compatible avec les versions modernes de Ruby
|
|
13
12
|
|
|
14
|
-
##
|
|
13
|
+
## Installation
|
|
15
14
|
|
|
16
15
|
```bash
|
|
17
16
|
gem install factpulse
|
|
@@ -23,9 +22,7 @@ Ou dans votre Gemfile :
|
|
|
23
22
|
gem 'factpulse'
|
|
24
23
|
```
|
|
25
24
|
|
|
26
|
-
##
|
|
27
|
-
|
|
28
|
-
### Méthode recommandée : Client simplifié avec helpers
|
|
25
|
+
## Démarrage rapide
|
|
29
26
|
|
|
30
27
|
Le module `helpers` offre une API simplifiée avec authentification et polling automatiques :
|
|
31
28
|
|
|
@@ -33,175 +30,191 @@ Le module `helpers` offre une API simplifiée avec authentification et polling a
|
|
|
33
30
|
require 'factpulse'
|
|
34
31
|
require 'factpulse/helpers'
|
|
35
32
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
include Factpulse::Helpers
|
|
34
|
+
|
|
35
|
+
# Créer le client
|
|
36
|
+
client = FactPulseClient.new(
|
|
37
|
+
'votre_email@example.com',
|
|
38
|
+
'votre_mot_de_passe'
|
|
40
39
|
)
|
|
41
40
|
|
|
42
|
-
#
|
|
41
|
+
# Construire la facture avec les helpers
|
|
43
42
|
facture_data = {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
fournisseur:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
montant_ht_total: '1000.00',
|
|
68
|
-
montant_tva: '200.00',
|
|
69
|
-
montant_ttc_total: '1200.00',
|
|
70
|
-
montant_a_payer: '1200.00'
|
|
71
|
-
},
|
|
72
|
-
lignes_de_poste: [{
|
|
73
|
-
numero: 1,
|
|
74
|
-
denomination: 'Prestation de conseil',
|
|
75
|
-
quantite: '10.00',
|
|
76
|
-
unite: 'PIECE',
|
|
77
|
-
montant_unitaire_ht: '100.00'
|
|
78
|
-
}]
|
|
43
|
+
numeroFacture: 'FAC-2025-001',
|
|
44
|
+
dateFacture: '2025-01-15',
|
|
45
|
+
fournisseur: fournisseur(
|
|
46
|
+
'Mon Entreprise SAS',
|
|
47
|
+
'12345678901234',
|
|
48
|
+
'123 Rue Example',
|
|
49
|
+
'75001',
|
|
50
|
+
'Paris'
|
|
51
|
+
),
|
|
52
|
+
destinataire: destinataire(
|
|
53
|
+
'Client SARL',
|
|
54
|
+
'98765432109876',
|
|
55
|
+
'456 Avenue Test',
|
|
56
|
+
'69001',
|
|
57
|
+
'Lyon'
|
|
58
|
+
),
|
|
59
|
+
montantTotal: montant_total(1000.00, 200.00, 1200.00, 1200.00),
|
|
60
|
+
lignesDePoste: [
|
|
61
|
+
ligne_de_poste(1, 'Prestation de conseil', 10, 100.00, 1000.00)
|
|
62
|
+
],
|
|
63
|
+
lignesDeTva: [
|
|
64
|
+
ligne_de_tva(1000.00, 200.00)
|
|
65
|
+
]
|
|
79
66
|
}
|
|
80
67
|
|
|
81
|
-
#
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
# Générer le PDF Factur-X (polling automatique)
|
|
85
|
-
pdf_bytes = client.generer_facturx(
|
|
86
|
-
facture_data,
|
|
87
|
-
pdf_source,
|
|
88
|
-
profil: 'EN16931',
|
|
89
|
-
format_sortie: 'pdf',
|
|
90
|
-
sync: true # Attend le résultat automatiquement
|
|
91
|
-
)
|
|
68
|
+
# Générer le PDF Factur-X
|
|
69
|
+
pdf_bytes = client.generer_facturx(facture_data, 'facture_source.pdf', 'EN16931')
|
|
92
70
|
|
|
93
|
-
# Sauvegarder
|
|
94
71
|
File.binwrite('facture_facturx.pdf', pdf_bytes)
|
|
95
72
|
```
|
|
96
73
|
|
|
97
|
-
|
|
74
|
+
## Helpers disponibles (module Factpulse::Helpers)
|
|
98
75
|
|
|
99
|
-
|
|
76
|
+
### montant(value)
|
|
77
|
+
|
|
78
|
+
Convertit une valeur en string formaté pour les montants monétaires.
|
|
100
79
|
|
|
101
80
|
```ruby
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
#
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
#
|
|
121
|
-
|
|
122
|
-
config.host = 'https://factpulse.fr/api/facturation'
|
|
123
|
-
config.access_token = token
|
|
124
|
-
end
|
|
125
|
-
|
|
126
|
-
# 3. Appeler l'API
|
|
127
|
-
api = Factpulse::TraitementFactureApi.new
|
|
128
|
-
response = api.generer_facture_api_v1_traitement_generer_facture_post(
|
|
129
|
-
facture_data.to_json,
|
|
130
|
-
'EN16931',
|
|
131
|
-
'pdf',
|
|
132
|
-
File.open('facture_source.pdf', 'rb')
|
|
81
|
+
include Factpulse::Helpers
|
|
82
|
+
|
|
83
|
+
montant(1234.5) # "1234.50"
|
|
84
|
+
montant('1234.56') # "1234.56"
|
|
85
|
+
montant(nil) # "0.00"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### montant_total(ht, tva, ttc, a_payer, ...)
|
|
89
|
+
|
|
90
|
+
Crée un objet MontantTotal complet.
|
|
91
|
+
|
|
92
|
+
```ruby
|
|
93
|
+
total = montant_total(
|
|
94
|
+
1000.00, # ht
|
|
95
|
+
200.00, # tva
|
|
96
|
+
1200.00, # ttc
|
|
97
|
+
1200.00, # a_payer
|
|
98
|
+
50.00, # remise_ttc (optionnel)
|
|
99
|
+
'Fidélité', # motif_remise (optionnel)
|
|
100
|
+
100.00 # acompte (optionnel)
|
|
133
101
|
)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### ligne_de_poste(numero, denomination, quantite, montant_unitaire_ht, montant_total_ligne_ht, ...)
|
|
134
105
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
106
|
+
Crée une ligne de facturation.
|
|
107
|
+
|
|
108
|
+
```ruby
|
|
109
|
+
ligne = ligne_de_poste(
|
|
110
|
+
1,
|
|
111
|
+
'Prestation de conseil',
|
|
112
|
+
5,
|
|
113
|
+
200.00,
|
|
114
|
+
1000.00, # montant_total_ligne_ht requis
|
|
115
|
+
'S', # categorie_tva: S, Z, E, AE, K
|
|
116
|
+
'HEURE', # unite: FORFAIT, PIECE, HEURE, JOUR...
|
|
117
|
+
{
|
|
118
|
+
taux_tva: 'TVA20', # Ou taux_tva_manuel: '20.00'
|
|
119
|
+
reference: 'REF-001'
|
|
120
|
+
}
|
|
121
|
+
)
|
|
138
122
|
```
|
|
139
123
|
|
|
140
|
-
|
|
124
|
+
### ligne_de_tva(montant_base_ht, montant_tva, ...)
|
|
141
125
|
|
|
142
|
-
|
|
143
|
-
|----------------|----------|---------|
|
|
144
|
-
| Authentification | Manuelle | Automatique |
|
|
145
|
-
| Refresh token | Manuel | Automatique |
|
|
146
|
-
| Polling tâches async | Manuel | Automatique (backoff) |
|
|
147
|
-
| Retry sur 401 | Manuel | Automatique |
|
|
126
|
+
Crée une ligne de ventilation TVA.
|
|
148
127
|
|
|
149
|
-
|
|
128
|
+
```ruby
|
|
129
|
+
tva = ligne_de_tva(
|
|
130
|
+
1000.00, # montant_base_ht
|
|
131
|
+
200.00, # montant_tva
|
|
132
|
+
'S', # categorie: S, Z, E, AE, K
|
|
133
|
+
{ taux: 'TVA20' } # Ou taux_manuel: '20.00'
|
|
134
|
+
)
|
|
135
|
+
```
|
|
150
136
|
|
|
151
|
-
###
|
|
137
|
+
### adresse_postale(ligne1, code_postal, ville, ...)
|
|
152
138
|
|
|
153
|
-
|
|
139
|
+
Crée une adresse postale structurée.
|
|
154
140
|
|
|
155
141
|
```ruby
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
142
|
+
adresse = adresse_postale(
|
|
143
|
+
'123 Rue de la République',
|
|
144
|
+
'75001',
|
|
145
|
+
'Paris',
|
|
146
|
+
'FR', # pays (défaut: 'FR')
|
|
147
|
+
'Bâtiment A' # ligne2 (optionnel)
|
|
160
148
|
)
|
|
161
149
|
```
|
|
162
150
|
|
|
163
|
-
###
|
|
151
|
+
### fournisseur(nom, siret, adresse_ligne1, code_postal, ville, options)
|
|
152
|
+
|
|
153
|
+
Crée un fournisseur complet avec calcul automatique du SIREN et TVA intra.
|
|
164
154
|
|
|
165
155
|
```ruby
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
156
|
+
f = fournisseur(
|
|
157
|
+
'Ma Société SAS',
|
|
158
|
+
'12345678901234',
|
|
159
|
+
'123 Rue Example',
|
|
160
|
+
'75001',
|
|
161
|
+
'Paris',
|
|
162
|
+
{ iban: 'FR7630006000011234567890189' }
|
|
173
163
|
)
|
|
164
|
+
# SIREN et TVA intracommunautaire calculés automatiquement
|
|
174
165
|
```
|
|
175
166
|
|
|
176
|
-
|
|
167
|
+
### destinataire(nom, siret, adresse_ligne1, code_postal, ville, options)
|
|
177
168
|
|
|
178
|
-
|
|
169
|
+
Crée un destinataire (client) avec calcul automatique du SIREN.
|
|
179
170
|
|
|
180
171
|
```ruby
|
|
181
|
-
|
|
182
|
-
|
|
172
|
+
d = destinataire(
|
|
173
|
+
'Client SARL',
|
|
174
|
+
'98765432109876',
|
|
175
|
+
'456 Avenue Test',
|
|
176
|
+
'69001',
|
|
177
|
+
'Lyon'
|
|
178
|
+
)
|
|
179
|
+
```
|
|
183
180
|
|
|
184
|
-
|
|
185
|
-
montant = 1234.56
|
|
181
|
+
## Mode Zero-Trust (Chorus Pro / AFNOR)
|
|
186
182
|
|
|
187
|
-
|
|
188
|
-
montant = 1234
|
|
183
|
+
Pour passer vos propres credentials sans stockage côté serveur :
|
|
189
184
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
185
|
+
```ruby
|
|
186
|
+
include Factpulse::Helpers
|
|
187
|
+
|
|
188
|
+
chorus_creds = ChorusProCredentials.new(
|
|
189
|
+
'votre_client_id',
|
|
190
|
+
'votre_client_secret',
|
|
191
|
+
'votre_login',
|
|
192
|
+
'votre_password',
|
|
193
|
+
true # sandbox
|
|
194
|
+
)
|
|
193
195
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
+
afnor_creds = AFNORCredentials.new(
|
|
197
|
+
'https://api.pdp.fr/flow/v1',
|
|
198
|
+
'https://auth.pdp.fr/oauth/token',
|
|
199
|
+
'votre_client_id',
|
|
200
|
+
'votre_client_secret'
|
|
201
|
+
)
|
|
202
|
+
|
|
203
|
+
client = FactPulseClient.new(
|
|
204
|
+
'votre_email@example.com',
|
|
205
|
+
'votre_mot_de_passe',
|
|
206
|
+
nil, # api_url
|
|
207
|
+
nil, # client_uid
|
|
208
|
+
chorus_creds,
|
|
209
|
+
afnor_creds
|
|
210
|
+
)
|
|
196
211
|
```
|
|
197
212
|
|
|
198
|
-
##
|
|
213
|
+
## Ressources
|
|
199
214
|
|
|
200
215
|
- **Documentation API** : https://factpulse.fr/api/facturation/documentation
|
|
201
|
-
- **Code source** : https://github.com/factpulse/sdk-ruby
|
|
202
|
-
- **Issues** : https://github.com/factpulse/sdk-ruby/issues
|
|
203
216
|
- **Support** : contact@factpulse.fr
|
|
204
217
|
|
|
205
|
-
##
|
|
218
|
+
## Licence
|
|
206
219
|
|
|
207
220
|
MIT License - Copyright (c) 2025 FactPulse
|
data/docs/AFNORPDPPAApi.md
CHANGED
|
@@ -5,6 +5,7 @@ All URIs are relative to *http://localhost*
|
|
|
5
5
|
| Method | HTTP request | Description |
|
|
6
6
|
| ------ | ------------ | ----------- |
|
|
7
7
|
| [**get_afnor_credentials_api_v1_afnor_credentials_get**](AFNORPDPPAApi.md#get_afnor_credentials_api_v1_afnor_credentials_get) | **GET** /api/v1/afnor/credentials | Récupérer les credentials AFNOR stockés |
|
|
8
|
+
| [**get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get**](AFNORPDPPAApi.md#get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get) | **GET** /api/v1/afnor/flux-entrants/{flow_id} | Récupérer et extraire une facture entrante |
|
|
8
9
|
| [**oauth_token_proxy_api_v1_afnor_oauth_token_post**](AFNORPDPPAApi.md#oauth_token_proxy_api_v1_afnor_oauth_token_post) | **POST** /api/v1/afnor/oauth/token | Endpoint OAuth2 pour authentification AFNOR |
|
|
9
10
|
|
|
10
11
|
|
|
@@ -74,6 +75,75 @@ This endpoint does not need any parameter.
|
|
|
74
75
|
- **Accept**: application/json
|
|
75
76
|
|
|
76
77
|
|
|
78
|
+
## get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get
|
|
79
|
+
|
|
80
|
+
> <FactureEntrante> get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get(flow_id)
|
|
81
|
+
|
|
82
|
+
Récupérer et extraire une facture entrante
|
|
83
|
+
|
|
84
|
+
Télécharge un flux entrant depuis la PDP AFNOR et extrait les métadonnées de la facture vers un format JSON unifié. Supporte les formats Factur-X, CII et UBL.
|
|
85
|
+
|
|
86
|
+
### Examples
|
|
87
|
+
|
|
88
|
+
```ruby
|
|
89
|
+
require 'time'
|
|
90
|
+
require 'factpulse'
|
|
91
|
+
# setup authorization
|
|
92
|
+
FactPulse.configure do |config|
|
|
93
|
+
# Configure Bearer authorization: HTTPBearer
|
|
94
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
api_instance = FactPulse::AFNORPDPPAApi.new
|
|
98
|
+
flow_id = 'flow_id_example' # String |
|
|
99
|
+
|
|
100
|
+
begin
|
|
101
|
+
# Récupérer et extraire une facture entrante
|
|
102
|
+
result = api_instance.get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get(flow_id)
|
|
103
|
+
p result
|
|
104
|
+
rescue FactPulse::ApiError => e
|
|
105
|
+
puts "Error when calling AFNORPDPPAApi->get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get: #{e}"
|
|
106
|
+
end
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
#### Using the get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get_with_http_info variant
|
|
110
|
+
|
|
111
|
+
This returns an Array which contains the response data, status code and headers.
|
|
112
|
+
|
|
113
|
+
> <Array(<FactureEntrante>, Integer, Hash)> get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get_with_http_info(flow_id)
|
|
114
|
+
|
|
115
|
+
```ruby
|
|
116
|
+
begin
|
|
117
|
+
# Récupérer et extraire une facture entrante
|
|
118
|
+
data, status_code, headers = api_instance.get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get_with_http_info(flow_id)
|
|
119
|
+
p status_code # => 2xx
|
|
120
|
+
p headers # => { ... }
|
|
121
|
+
p data # => <FactureEntrante>
|
|
122
|
+
rescue FactPulse::ApiError => e
|
|
123
|
+
puts "Error when calling AFNORPDPPAApi->get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get_with_http_info: #{e}"
|
|
124
|
+
end
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Parameters
|
|
128
|
+
|
|
129
|
+
| Name | Type | Description | Notes |
|
|
130
|
+
| ---- | ---- | ----------- | ----- |
|
|
131
|
+
| **flow_id** | **String** | | |
|
|
132
|
+
|
|
133
|
+
### Return type
|
|
134
|
+
|
|
135
|
+
[**FactureEntrante**](FactureEntrante.md)
|
|
136
|
+
|
|
137
|
+
### Authorization
|
|
138
|
+
|
|
139
|
+
[HTTPBearer](../README.md#HTTPBearer)
|
|
140
|
+
|
|
141
|
+
### HTTP request headers
|
|
142
|
+
|
|
143
|
+
- **Content-Type**: Not defined
|
|
144
|
+
- **Accept**: application/json
|
|
145
|
+
|
|
146
|
+
|
|
77
147
|
## oauth_token_proxy_api_v1_afnor_oauth_token_post
|
|
78
148
|
|
|
79
149
|
> Object oauth_token_proxy_api_v1_afnor_oauth_token_post
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# FactPulse::FactureEntrante
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **flow_id** | **String** | | [optional] |
|
|
8
|
+
| **format_source** | [**FormatFacture**](FormatFacture.md) | Format source de la facture | |
|
|
9
|
+
| **ref_fournisseur** | **String** | Numéro de facture émis par le fournisseur (BT-1) | |
|
|
10
|
+
| **type_document** | [**TypeDocument**](TypeDocument.md) | Type de document (BT-3) | [optional] |
|
|
11
|
+
| **fournisseur** | [**FournisseurEntrant**](FournisseurEntrant.md) | Émetteur de la facture (SellerTradeParty) | |
|
|
12
|
+
| **site_facturation_nom** | **String** | Nom du destinataire / votre entreprise (BT-44) | |
|
|
13
|
+
| **site_facturation_siret** | **String** | | [optional] |
|
|
14
|
+
| **date_de_piece** | **String** | Date de la facture (BT-2) - YYYY-MM-DD | |
|
|
15
|
+
| **date_reglement** | **String** | | [optional] |
|
|
16
|
+
| **devise** | **String** | Code devise ISO (BT-5) | [optional][default to 'EUR'] |
|
|
17
|
+
| **montant_ht** | **String** | Montant HT total (BT-109) | |
|
|
18
|
+
| **montant_tva** | **String** | Montant TVA total (BT-110) | |
|
|
19
|
+
| **montant_ttc** | **String** | Montant TTC total (BT-112) | |
|
|
20
|
+
| **numero_bon_commande** | **String** | | [optional] |
|
|
21
|
+
| **reference_contrat** | **String** | | [optional] |
|
|
22
|
+
| **objet_facture** | **String** | | [optional] |
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```ruby
|
|
27
|
+
require 'factpulse'
|
|
28
|
+
|
|
29
|
+
instance = FactPulse::FactureEntrante.new(
|
|
30
|
+
flow_id: null,
|
|
31
|
+
format_source: null,
|
|
32
|
+
ref_fournisseur: null,
|
|
33
|
+
type_document: null,
|
|
34
|
+
fournisseur: null,
|
|
35
|
+
site_facturation_nom: null,
|
|
36
|
+
site_facturation_siret: null,
|
|
37
|
+
date_de_piece: null,
|
|
38
|
+
date_reglement: null,
|
|
39
|
+
devise: null,
|
|
40
|
+
montant_ht: null,
|
|
41
|
+
montant_tva: null,
|
|
42
|
+
montant_ttc: null,
|
|
43
|
+
numero_bon_commande: null,
|
|
44
|
+
reference_contrat: null,
|
|
45
|
+
objet_facture: null
|
|
46
|
+
)
|
|
47
|
+
```
|
|
48
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# FactPulse::FournisseurEntrant
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **nom** | **String** | Raison sociale du fournisseur (BT-27) | |
|
|
8
|
+
| **siren** | **String** | | [optional] |
|
|
9
|
+
| **siret** | **String** | | [optional] |
|
|
10
|
+
| **numero_tva_intra** | **String** | | [optional] |
|
|
11
|
+
| **adresse_postale** | [**AdressePostale**](AdressePostale.md) | | [optional] |
|
|
12
|
+
| **adresse_electronique** | [**AdresseElectronique**](AdresseElectronique.md) | | [optional] |
|
|
13
|
+
| **email** | **String** | | [optional] |
|
|
14
|
+
| **telephone** | **String** | | [optional] |
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```ruby
|
|
19
|
+
require 'factpulse'
|
|
20
|
+
|
|
21
|
+
instance = FactPulse::FournisseurEntrant.new(
|
|
22
|
+
nom: null,
|
|
23
|
+
siren: null,
|
|
24
|
+
siret: null,
|
|
25
|
+
numero_tva_intra: null,
|
|
26
|
+
adresse_postale: null,
|
|
27
|
+
adresse_electronique: null,
|
|
28
|
+
email: null,
|
|
29
|
+
telephone: null
|
|
30
|
+
)
|
|
31
|
+
```
|
|
32
|
+
|
|
@@ -76,6 +76,69 @@ module FactPulse
|
|
|
76
76
|
return data, status_code, headers
|
|
77
77
|
end
|
|
78
78
|
|
|
79
|
+
# Récupérer et extraire une facture entrante
|
|
80
|
+
# Télécharge un flux entrant depuis la PDP AFNOR et extrait les métadonnées de la facture vers un format JSON unifié. Supporte les formats Factur-X, CII et UBL.
|
|
81
|
+
# @param flow_id [String]
|
|
82
|
+
# @param [Hash] opts the optional parameters
|
|
83
|
+
# @return [FactureEntrante]
|
|
84
|
+
def get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get(flow_id, opts = {})
|
|
85
|
+
data, _status_code, _headers = get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get_with_http_info(flow_id, opts)
|
|
86
|
+
data
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Récupérer et extraire une facture entrante
|
|
90
|
+
# Télécharge un flux entrant depuis la PDP AFNOR et extrait les métadonnées de la facture vers un format JSON unifié. Supporte les formats Factur-X, CII et UBL.
|
|
91
|
+
# @param flow_id [String]
|
|
92
|
+
# @param [Hash] opts the optional parameters
|
|
93
|
+
# @return [Array<(FactureEntrante, Integer, Hash)>] FactureEntrante data, response status code and response headers
|
|
94
|
+
def get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get_with_http_info(flow_id, opts = {})
|
|
95
|
+
if @api_client.config.debugging
|
|
96
|
+
@api_client.config.logger.debug 'Calling API: AFNORPDPPAApi.get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get ...'
|
|
97
|
+
end
|
|
98
|
+
# verify the required parameter 'flow_id' is set
|
|
99
|
+
if @api_client.config.client_side_validation && flow_id.nil?
|
|
100
|
+
fail ArgumentError, "Missing the required parameter 'flow_id' when calling AFNORPDPPAApi.get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get"
|
|
101
|
+
end
|
|
102
|
+
# resource path
|
|
103
|
+
local_var_path = '/api/v1/afnor/flux-entrants/{flow_id}'.sub('{' + 'flow_id' + '}', CGI.escape(flow_id.to_s))
|
|
104
|
+
|
|
105
|
+
# query parameters
|
|
106
|
+
query_params = opts[:query_params] || {}
|
|
107
|
+
|
|
108
|
+
# header parameters
|
|
109
|
+
header_params = opts[:header_params] || {}
|
|
110
|
+
# HTTP header 'Accept' (if needed)
|
|
111
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
112
|
+
|
|
113
|
+
# form parameters
|
|
114
|
+
form_params = opts[:form_params] || {}
|
|
115
|
+
|
|
116
|
+
# http body (model)
|
|
117
|
+
post_body = opts[:debug_body]
|
|
118
|
+
|
|
119
|
+
# return_type
|
|
120
|
+
return_type = opts[:debug_return_type] || 'FactureEntrante'
|
|
121
|
+
|
|
122
|
+
# auth_names
|
|
123
|
+
auth_names = opts[:debug_auth_names] || ['HTTPBearer']
|
|
124
|
+
|
|
125
|
+
new_options = opts.merge(
|
|
126
|
+
:operation => :"AFNORPDPPAApi.get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get",
|
|
127
|
+
:header_params => header_params,
|
|
128
|
+
:query_params => query_params,
|
|
129
|
+
:form_params => form_params,
|
|
130
|
+
:body => post_body,
|
|
131
|
+
:auth_names => auth_names,
|
|
132
|
+
:return_type => return_type
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
136
|
+
if @api_client.config.debugging
|
|
137
|
+
@api_client.config.logger.debug "API called: AFNORPDPPAApi#get_flux_entrant_api_v1_afnor_flux_entrants_flow_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
138
|
+
end
|
|
139
|
+
return data, status_code, headers
|
|
140
|
+
end
|
|
141
|
+
|
|
79
142
|
# Endpoint OAuth2 pour authentification AFNOR
|
|
80
143
|
# Endpoint proxy OAuth2 pour obtenir un token d'accès AFNOR. Fait proxy vers le mock AFNOR (sandbox) ou la vraie PDP selon MOCK_AFNOR_BASE_URL. Cet endpoint est public (pas d'auth Django requise) car il est appelé par le SDK AFNOR.
|
|
81
144
|
# @param [Hash] opts the optional parameters
|