@factpulse/sdk 3.0.36 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/.openapi-generator/FILES +2 -2
  2. package/CHANGELOG.md +10 -13
  3. package/README.md +135 -148
  4. package/dist/esm/models/{facture-electronique-rest-api-schemas-ereporting-invoice-type-code.d.ts → facture-electronique-models-invoice-type-code.d.ts} +67 -8
  5. package/dist/esm/models/{facture-electronique-rest-api-schemas-ereporting-invoice-type-code.js → facture-electronique-models-invoice-type-code.js} +66 -7
  6. package/dist/esm/models/index.d.ts +1 -1
  7. package/dist/esm/models/index.js +1 -1
  8. package/dist/esm/models/invoice-input.d.ts +2 -2
  9. package/dist/esm/models/invoice-type-code.d.ts +6 -65
  10. package/dist/esm/models/invoice-type-code.js +6 -65
  11. package/dist/esm/models/recipient.d.ts +1 -1
  12. package/dist/esm/models/scheme-id.d.ts +7 -7
  13. package/dist/esm/models/scheme-id.js +7 -7
  14. package/dist/esm/models/simplified-invoice-data.d.ts +2 -2
  15. package/dist/esm/models/submit-complete-invoice-response.d.ts +1 -1
  16. package/dist/esm/models/supplier.d.ts +1 -1
  17. package/dist/esm/src/helpers/client.d.ts +43 -265
  18. package/dist/esm/src/helpers/client.js +196 -779
  19. package/dist/esm/src/helpers/index.d.ts +1 -2
  20. package/dist/esm/src/helpers/index.js +1 -3
  21. package/dist/models/{facture-electronique-rest-api-schemas-ereporting-invoice-type-code.d.ts → facture-electronique-models-invoice-type-code.d.ts} +67 -8
  22. package/dist/models/{facture-electronique-rest-api-schemas-ereporting-invoice-type-code.js → facture-electronique-models-invoice-type-code.js} +67 -8
  23. package/dist/models/index.d.ts +1 -1
  24. package/dist/models/index.js +1 -1
  25. package/dist/models/invoice-input.d.ts +2 -2
  26. package/dist/models/invoice-type-code.d.ts +6 -65
  27. package/dist/models/invoice-type-code.js +6 -65
  28. package/dist/models/recipient.d.ts +1 -1
  29. package/dist/models/scheme-id.d.ts +7 -7
  30. package/dist/models/scheme-id.js +7 -7
  31. package/dist/models/simplified-invoice-data.d.ts +2 -2
  32. package/dist/models/submit-complete-invoice-response.d.ts +1 -1
  33. package/dist/models/supplier.d.ts +1 -1
  34. package/dist/src/helpers/client.d.ts +43 -265
  35. package/dist/src/helpers/client.js +199 -823
  36. package/dist/src/helpers/index.d.ts +1 -2
  37. package/dist/src/helpers/index.js +2 -12
  38. package/docs/FactureElectroniqueModelsInvoiceTypeCode.md +39 -0
  39. package/docs/InvoiceInput.md +1 -1
  40. package/docs/InvoiceTypeCode.md +6 -28
  41. package/docs/Recipient.md +1 -1
  42. package/docs/SchemeID.md +4 -4
  43. package/docs/SimplifiedInvoiceData.md +1 -1
  44. package/docs/SubmitCompleteInvoiceResponse.md +2 -2
  45. package/docs/Supplier.md +1 -1
  46. package/models/{facture-electronique-rest-api-schemas-ereporting-invoice-type-code.ts → facture-electronique-models-invoice-type-code.ts} +67 -8
  47. package/models/index.ts +1 -1
  48. package/models/invoice-input.ts +2 -2
  49. package/models/invoice-type-code.ts +6 -65
  50. package/models/recipient.ts +1 -1
  51. package/models/scheme-id.ts +7 -7
  52. package/models/simplified-invoice-data.ts +2 -2
  53. package/models/submit-complete-invoice-response.ts +1 -1
  54. package/models/supplier.ts +1 -1
  55. package/package.json +1 -1
  56. package/src/helpers/client.ts +211 -834
  57. package/src/helpers/index.ts +1 -3
  58. package/docs/FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.md +0 -17
@@ -173,8 +173,8 @@ docs/ErrorSource.md
173
173
  docs/ExtractionInfo.md
174
174
  docs/FacturXInvoice.md
175
175
  docs/FacturXPDFInfo.md
176
+ docs/FactureElectroniqueModelsInvoiceTypeCode.md
176
177
  docs/FactureElectroniqueRestApiSchemasCdarValidationErrorResponse.md
177
- docs/FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.md
178
178
  docs/FactureElectroniqueRestApiSchemasProcessingChorusProCredentials.md
179
179
  docs/FieldStatus.md
180
180
  docs/FileInfo.md
@@ -472,8 +472,8 @@ models/error-source.ts
472
472
  models/extraction-info.ts
473
473
  models/factur-xinvoice.ts
474
474
  models/factur-xpdfinfo.ts
475
+ models/facture-electronique-models-invoice-type-code.ts
475
476
  models/facture-electronique-rest-api-schemas-cdar-validation-error-response.ts
476
- models/facture-electronique-rest-api-schemas-ereporting-invoice-type-code.ts
477
477
  models/facture-electronique-rest-api-schemas-processing-chorus-pro-credentials.ts
478
478
  models/field-status.ts
479
479
  models/file-info.ts
package/CHANGELOG.md CHANGED
@@ -7,18 +7,15 @@ et ce projet adhère au [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ## [3.0.36] - 2026-01-17
10
+ ## [4.0.0] - 2026-01-19
11
11
 
12
12
  ### Added
13
- - Version initiale du SDK typescript
14
- - Support complet de l'API FactPulse
15
- - Endpoints Factur-X (génération, validation)
16
- - Endpoints AFNOR PDP/PA (Flow Service, Directory Service)
17
- - Endpoints Chorus Pro (recherche entreprise, soumission factures)
18
- - Endpoints Signature électronique (PAdES-B-B, PAdES-B-T, PAdES-B-LT)
19
- - Support des deux modes d'authentification (stored credentials et zero-trust)
20
- - Documentation complète et exemples
21
-
22
-
23
- [Unreleased]: https://github.com/factpulse/sdk-typescript/compare/v3.0.36...HEAD
24
- [3.0.36]: https://github.com/factpulse/sdk-typescript/releases/tag/v3.0.36
13
+ - Gestion automatique des taches asynchrones
14
+ - Gestion automatique du décodage des documents renvoyés en base 64.
15
+
16
+ ### Changed
17
+ - Rework complet du fonctionnement des SDK, fonctionnement totalement générique et transparent
18
+
19
+
20
+ [Unreleased]: https://github.com/factpulse/sdk-typescript/compare/v4.0.0...HEAD
21
+ [4.0.0]: https://github.com/factpulse/sdk-typescript/releases/tag/v4.0.0
package/README.md CHANGED
@@ -8,7 +8,7 @@ Official TypeScript/JavaScript client for the FactPulse API - French electronic
8
8
  - **Chorus Pro**: Integration with the French public invoicing platform
9
9
  - **AFNOR PDP/PA**: Submission of flows compliant with XP Z12-013 standard
10
10
  - **Electronic signature**: PDF signing (PAdES-B-B, PAdES-B-T, PAdES-B-LT)
11
- - **Simplified client**: JWT authentication and polling integrated via `helpers`
11
+ - **Thin HTTP wrapper**: Generic `post()` and `get()` methods with automatic JWT auth and polling
12
12
 
13
13
  ## Installation
14
14
 
@@ -20,8 +20,6 @@ yarn add @factpulse/sdk
20
20
 
21
21
  ## Quick Start
22
22
 
23
- The `helpers` module provides a simplified API with automatic authentication and polling:
24
-
25
23
  ```typescript
26
24
  import { FactPulseClient } from '@factpulse/sdk/helpers';
27
25
  import * as fs from 'fs';
@@ -29,189 +27,178 @@ import * as fs from 'fs';
29
27
  // Create the client
30
28
  const client = new FactPulseClient({
31
29
  email: 'your_email@example.com',
32
- password: 'your_password'
30
+ password: 'your_password',
31
+ clientUid: 'your-client-uuid', // From dashboard: Configuration > Clients
33
32
  });
34
33
 
35
- // Build the invoice using simplified format (auto-calculates totals)
36
- const invoiceData = {
37
- number: 'INV-2025-001',
38
- supplier: {
39
- name: 'My Company SAS',
40
- siret: '12345678901234',
41
- iban: 'FR7630001007941234567890185',
42
- },
43
- recipient: {
44
- name: 'Client SARL',
45
- siret: '98765432109876',
34
+ // Read your source PDF
35
+ const pdfB64 = fs.readFileSync('source_invoice.pdf').toString('base64');
36
+
37
+ // Generate Factur-X and submit to PDP in one call
38
+ const result = await client.post('processing/invoices/submit-complete-async', {
39
+ invoiceData: {
40
+ number: 'INV-2025-001',
41
+ supplier: {
42
+ siret: '12345678901234',
43
+ iban: 'FR7630001007941234567890185',
44
+ routing_address: '12345678901234',
45
+ },
46
+ recipient: {
47
+ siret: '98765432109876',
48
+ routing_address: '98765432109876',
49
+ },
50
+ lines: [
51
+ {
52
+ description: 'Consulting services',
53
+ quantity: 10,
54
+ unitPrice: 100.0,
55
+ vatRate: 20.0,
56
+ },
57
+ ],
46
58
  },
47
- lines: [
48
- {
49
- description: 'Consulting services',
50
- quantity: 10,
51
- unitPrice: 100.0,
52
- vatRate: 20,
53
- }
54
- ],
55
- };
56
-
57
- // Generate the Factur-X PDF
58
- const pdfBytes = await client.generateFacturx(invoiceData, 'source_invoice.pdf');
59
-
60
- fs.writeFileSync('facturx_invoice.pdf', pdfBytes);
61
- ```
62
-
63
- ## Available Helpers
64
-
65
- ### amount(value)
59
+ sourcePdf: pdfB64,
60
+ profile: 'EN16931',
61
+ destination: { type: 'afnor' },
62
+ });
66
63
 
67
- Converts a value to a formatted string for monetary amounts.
64
+ // PDF is in result.content (auto-polled, auto-decoded from base64)
65
+ fs.writeFileSync('facturx_invoice.pdf', result.content);
68
66
 
69
- ```typescript
70
- import { amount } from '@factpulse/sdk/helpers';
71
-
72
- amount(1234.5); // "1234.50"
73
- amount("1234.56"); // "1234.56"
74
- amount(null); // "0.00"
67
+ console.log(`Flow ID: ${result.afnorResult?.flowId}`);
75
68
  ```
76
69
 
77
- ### invoiceTotals(exclTax, vat, inclTax, amountDue, options?)
70
+ ## API Methods
78
71
 
79
- Creates a complete invoice totals object.
72
+ The SDK provides two generic methods that map directly to API endpoints:
80
73
 
81
74
  ```typescript
82
- import { invoiceTotals } from '@factpulse/sdk/helpers';
75
+ // POST /api/v1/{path}
76
+ const result = await client.post('path/to/endpoint', { key1: value1, key2: value2 });
83
77
 
84
- const totals = invoiceTotals(1000.00, 200.00, 1200.00, 1200.00, {
85
- globalAllowanceAmount: 50.00, // Optional
86
- globalAllowanceReason: 'Loyalty', // Optional
87
- prepayment: 100.00, // Optional
88
- });
78
+ // GET /api/v1/{path}
79
+ const result = await client.get('path/to/endpoint', { param1: value1 });
89
80
  ```
90
81
 
91
- ### invoiceLine(lineNumber, itemName, quantity, unitNetPrice, lineNetAmount, options?)
82
+ ### Common Endpoints
92
83
 
93
- Creates an invoice line.
84
+ | Endpoint | Method | Description |
85
+ |----------|--------|-------------|
86
+ | `processing/invoices/submit-complete-async` | POST | Generate Factur-X + submit to PDP |
87
+ | `processing/generate-invoice` | POST | Generate Factur-X XML or PDF |
88
+ | `processing/validate-xml` | POST | Validate Factur-X XML |
89
+ | `processing/validate-facturx-pdf` | POST | Validate Factur-X PDF |
90
+ | `processing/sign-pdf` | POST | Sign PDF with certificate |
91
+ | `afnor/flow/v1/flows` | POST | Submit flow to AFNOR PDP |
92
+ | `afnor/incoming-flows/{flow_id}` | GET | Get incoming invoice |
93
+ | `chorus-pro/factures/soumettre` | POST | Submit to Chorus Pro |
94
94
 
95
- ```typescript
96
- import { invoiceLine } from '@factpulse/sdk/helpers';
97
-
98
- const line = invoiceLine(
99
- 1,
100
- 'Consulting services',
101
- 5,
102
- 200.00,
103
- 1000.00,
104
- {
105
- vatRate: 'TVA20', // Or manualVatRate: '20.00'
106
- vatCategory: 'S', // S, Z, E, AE, K
107
- unit: 'HOUR', // LUMP_SUM, PIECE, HOUR, DAY...
108
- reference: 'REF-001', // Optional
109
- }
110
- );
111
- ```
95
+ ## Webhooks
112
96
 
113
- ### vatLine(taxableAmount, vatAmount, options?)
114
-
115
- Creates a VAT breakdown line.
97
+ Instead of polling, you can receive results via webhook by adding `callbackUrl`:
116
98
 
117
99
  ```typescript
118
- import { vatLine } from '@factpulse/sdk/helpers';
119
-
120
- const vat = vatLine(1000.00, 200.00, {
121
- rate: 'TVA20', // Or manualRate: '20.00'
122
- category: 'S', // S, Z, E, AE, K
100
+ // Submit with webhook - returns immediately
101
+ const result = await client.post('processing/invoices/submit-complete-async', {
102
+ invoiceData,
103
+ sourcePdf: pdfB64,
104
+ destination: { type: 'afnor' },
105
+ callbackUrl: 'https://your-server.com/webhook/factpulse',
106
+ webhookMode: 'INLINE', // or 'DOWNLOAD_URL'
123
107
  });
124
- ```
125
108
 
126
- ### postalAddress(line1, postalCode, city, options?)
109
+ const taskId = result.taskId;
110
+ // Result will be POSTed to your webhook URL
111
+ ```
127
112
 
128
- Creates a structured postal address.
113
+ ### Webhook Receiver Example (Express.js)
129
114
 
130
115
  ```typescript
131
- import { postalAddress } from '@factpulse/sdk/helpers';
132
-
133
- const address = postalAddress('123 Republic Street', '75001', 'Paris', {
134
- country: 'FR', // Default: 'FR'
135
- line2: 'Building A' // Optional
136
- });
137
- ```
138
-
139
- ### electronicAddress(identifier, schemeId?)
116
+ import express from 'express';
117
+ import crypto from 'crypto';
118
+
119
+ const app = express();
120
+ app.use(express.json({ verify: (req, res, buf) => (req.rawBody = buf) }));
121
+
122
+ const WEBHOOK_SECRET = 'your-shared-secret';
123
+
124
+ function verifySignature(payload: Buffer, signature: string): boolean {
125
+ if (!signature.startsWith('sha256=')) return false;
126
+ const expected = crypto
127
+ .createHmac('sha256', WEBHOOK_SECRET)
128
+ .update(payload)
129
+ .digest('hex');
130
+ return crypto.timingSafeEqual(
131
+ Buffer.from(signature.slice(7)),
132
+ Buffer.from(expected)
133
+ );
134
+ }
135
+
136
+ app.post('/webhook/factpulse', (req, res) => {
137
+ const signature = req.headers['x-webhook-signature'] as string || '';
138
+ if (!verifySignature(req.rawBody, signature)) {
139
+ return res.status(401).json({ error: 'Invalid signature' });
140
+ }
140
141
 
141
- Creates an electronic address (digital identifier).
142
+ const event = req.body;
143
+ const eventType = event.event_type;
144
+ const data = event.data;
142
145
 
143
- ```typescript
144
- import { electronicAddress } from '@factpulse/sdk/helpers';
146
+ if (eventType === 'submission.completed') {
147
+ console.log(`Invoice submitted: ${data.afnorResult?.flowId}`);
148
+ } else if (eventType === 'submission.failed') {
149
+ console.log(`Submission failed: ${data.error}`);
150
+ }
145
151
 
146
- // SIRET (schemeId="0225")
147
- const address = electronicAddress('12345678901234', '0225');
152
+ res.json({ status: 'received' });
153
+ });
148
154
 
149
- // SIREN (schemeId="0009", default)
150
- const address = electronicAddress('123456789');
155
+ app.listen(3000);
151
156
  ```
152
157
 
153
- ### supplier(name, siret, addressLine1, postalCode, city, options?)
158
+ ### Webhook Event Types
154
159
 
155
- Creates a complete supplier with automatic SIREN and intra-EU VAT calculation.
160
+ | Event | Description |
161
+ |-------|-------------|
162
+ | `generation.completed` | Factur-X generated successfully |
163
+ | `generation.failed` | Generation failed |
164
+ | `validation.completed` | Validation passed |
165
+ | `validation.failed` | Validation failed |
166
+ | `signature.completed` | PDF signed |
167
+ | `submission.completed` | Submitted to PDP/Chorus |
168
+ | `submission.failed` | Submission failed |
156
169
 
157
- ```typescript
158
- import { supplier } from '@factpulse/sdk/helpers';
159
-
160
- const s = supplier(
161
- 'My Company SAS',
162
- '12345678901234',
163
- '123 Example Street',
164
- '75001',
165
- 'Paris',
166
- { iban: 'FR7630006000011234567890189' }
167
- );
168
- // SIREN and intra-EU VAT number calculated automatically
169
- ```
170
-
171
- ### recipient(name, siret, addressLine1, postalCode, city, options?)
170
+ ## Zero-Storage Mode
172
171
 
173
- Creates a recipient (customer) with automatic SIREN calculation.
172
+ Pass PDP credentials directly in the request (no server-side storage):
174
173
 
175
174
  ```typescript
176
- import { recipient } from '@factpulse/sdk/helpers';
177
-
178
- const r = recipient(
179
- 'Client SARL',
180
- '98765432109876',
181
- '456 Test Avenue',
182
- '69001',
183
- 'Lyon'
184
- );
175
+ const result = await client.post('processing/invoices/submit-complete-async', {
176
+ invoiceData,
177
+ sourcePdf: pdfB64,
178
+ destination: {
179
+ type: 'afnor',
180
+ flowServiceUrl: 'https://api.pdp.example.com/flow/v1',
181
+ tokenUrl: 'https://auth.pdp.example.com/oauth/token',
182
+ clientId: 'your_pdp_client_id',
183
+ clientSecret: 'your_pdp_client_secret',
184
+ },
185
+ });
185
186
  ```
186
187
 
187
- ## Zero-Trust Mode (Chorus Pro / AFNOR)
188
-
189
- To pass your own credentials without server-side storage:
188
+ ## Error Handling
190
189
 
191
190
  ```typescript
192
- import {
193
- FactPulseClient,
194
- ChorusProCredentials,
195
- AFNORCredentials,
196
- } from '@factpulse/sdk/helpers';
197
-
198
- const client = new FactPulseClient({
199
- email: 'your_email@example.com',
200
- password: 'your_password',
201
- chorusCredentials: {
202
- pisteClientId: 'your_client_id',
203
- pisteClientSecret: 'your_client_secret',
204
- chorusProLogin: 'your_login',
205
- chorusProPassword: 'your_password',
206
- sandbox: true,
207
- },
208
- afnorCredentials: {
209
- flowServiceUrl: 'https://api.pdp.fr/flow/v1',
210
- tokenUrl: 'https://auth.pdp.fr/oauth/token',
211
- clientId: 'your_client_id',
212
- clientSecret: 'your_client_secret',
213
- },
214
- });
191
+ import { FactPulseClient, FactPulseError } from '@factpulse/sdk/helpers';
192
+
193
+ try {
194
+ const result = await client.post('processing/validate-xml', { xmlContent });
195
+ } catch (e) {
196
+ if (e instanceof FactPulseError) {
197
+ console.log(`Error: ${e.message}`);
198
+ console.log(`Status code: ${e.statusCode}`);
199
+ console.log(`Details: ${e.details}`); // Validation errors list
200
+ }
201
+ }
215
202
  ```
216
203
 
217
204
  ## Resources
@@ -10,13 +10,72 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  /**
13
- * Invoice type codes (UNTDID 1001).
13
+ * Document type according to BR-FR-04 (UNTDID 1001 codes). | Code | Name | Description | |------|------|-------------| | 380 | INVOICE | Commercial invoice | | 389 | SELF_BILLED_INVOICE | Self-billed invoice | | 393 | FACTORED_INVOICE | Factored invoice | | 501 | SELF_BILLED_FACTORED_INVOICE | Self-billed factored invoice | | 386 | PREPAYMENT_INVOICE | Prepayment invoice | | 500 | SELF_BILLED_PREPAYMENT_INVOICE | Self-billed prepayment invoice | | 384 | CORRECTIVE_INVOICE | Corrective invoice | | 471 | SELF_BILLED_CORRECTIVE_INVOICE | Self-billed corrective invoice | | 472 | FACTORED_CORRECTIVE_INVOICE | Factored corrective invoice | | 473 | SELF_BILLED_FACTORED_CORRECTIVE_INVOICE | Self-billed factored corrective invoice | | 381 | CREDIT_NOTE | Credit note | | 261 | SELF_BILLED_CREDIT_NOTE | Self-billed credit note | | 262 | GLOBAL_ALLOWANCE_CREDIT_NOTE | Credit note for global allowance | | 396 | FACTORED_CREDIT_NOTE | Factored credit note | | 502 | SELF_BILLED_FACTORED_CREDIT_NOTE | Self-billed factored credit note | | 503 | PREPAYMENT_CREDIT_NOTE | Credit note for prepayment invoice |
14
14
  */
15
- export declare const FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode: {
16
- readonly _380: "380";
17
- readonly _381: "381";
18
- readonly _384: "384";
19
- readonly _389: "389";
20
- readonly _386: "386";
15
+ export declare const FactureElectroniqueModelsInvoiceTypeCode: {
16
+ /**
17
+ * Commercial Invoice
18
+ */
19
+ readonly INVOICE: "380";
20
+ /**
21
+ * Self-billed Invoice
22
+ */
23
+ readonly SELF_BILLED_INVOICE: "389";
24
+ /**
25
+ * Factored Invoice
26
+ */
27
+ readonly FACTORED_INVOICE: "393";
28
+ /**
29
+ * Self-billed Factored Invoice
30
+ */
31
+ readonly SELF_BILLED_FACTORED_INVOICE: "501";
32
+ /**
33
+ * Prepayment Invoice
34
+ */
35
+ readonly PREPAYMENT_INVOICE: "386";
36
+ /**
37
+ * Self-billed Prepayment Invoice
38
+ */
39
+ readonly SELF_BILLED_PREPAYMENT_INVOICE: "500";
40
+ /**
41
+ * Corrective Invoice
42
+ */
43
+ readonly CORRECTIVE_INVOICE: "384";
44
+ /**
45
+ * Self-billed Corrective Invoice
46
+ */
47
+ readonly SELF_BILLED_CORRECTIVE_INVOICE: "471";
48
+ /**
49
+ * Factored Corrective Invoice
50
+ */
51
+ readonly FACTORED_CORRECTIVE_INVOICE: "472";
52
+ /**
53
+ * Self-billed Factored Corrective Invoice
54
+ */
55
+ readonly SELF_BILLED_FACTORED_CORRECTIVE_INVOICE: "473";
56
+ /**
57
+ * Credit Note
58
+ */
59
+ readonly CREDIT_NOTE: "381";
60
+ /**
61
+ * Self-billed Credit Note
62
+ */
63
+ readonly SELF_BILLED_CREDIT_NOTE: "261";
64
+ /**
65
+ * Global Allowance Credit Note
66
+ */
67
+ readonly GLOBAL_ALLOWANCE_CREDIT_NOTE: "262";
68
+ /**
69
+ * Factored Credit Note
70
+ */
71
+ readonly FACTORED_CREDIT_NOTE: "396";
72
+ /**
73
+ * Self-billed Factored Credit Note
74
+ */
75
+ readonly SELF_BILLED_FACTORED_CREDIT_NOTE: "502";
76
+ /**
77
+ * Prepayment Credit Note
78
+ */
79
+ readonly PREPAYMENT_CREDIT_NOTE: "503";
21
80
  };
22
- export type FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode = typeof FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode[keyof typeof FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode];
81
+ export type FactureElectroniqueModelsInvoiceTypeCode = typeof FactureElectroniqueModelsInvoiceTypeCode[keyof typeof FactureElectroniqueModelsInvoiceTypeCode];
@@ -12,12 +12,71 @@
12
12
  * Do not edit the class manually.
13
13
  */
14
14
  /**
15
- * Invoice type codes (UNTDID 1001).
15
+ * Document type according to BR-FR-04 (UNTDID 1001 codes). | Code | Name | Description | |------|------|-------------| | 380 | INVOICE | Commercial invoice | | 389 | SELF_BILLED_INVOICE | Self-billed invoice | | 393 | FACTORED_INVOICE | Factored invoice | | 501 | SELF_BILLED_FACTORED_INVOICE | Self-billed factored invoice | | 386 | PREPAYMENT_INVOICE | Prepayment invoice | | 500 | SELF_BILLED_PREPAYMENT_INVOICE | Self-billed prepayment invoice | | 384 | CORRECTIVE_INVOICE | Corrective invoice | | 471 | SELF_BILLED_CORRECTIVE_INVOICE | Self-billed corrective invoice | | 472 | FACTORED_CORRECTIVE_INVOICE | Factored corrective invoice | | 473 | SELF_BILLED_FACTORED_CORRECTIVE_INVOICE | Self-billed factored corrective invoice | | 381 | CREDIT_NOTE | Credit note | | 261 | SELF_BILLED_CREDIT_NOTE | Self-billed credit note | | 262 | GLOBAL_ALLOWANCE_CREDIT_NOTE | Credit note for global allowance | | 396 | FACTORED_CREDIT_NOTE | Factored credit note | | 502 | SELF_BILLED_FACTORED_CREDIT_NOTE | Self-billed factored credit note | | 503 | PREPAYMENT_CREDIT_NOTE | Credit note for prepayment invoice |
16
16
  */
17
- export const FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode = {
18
- _380: '380',
19
- _381: '381',
20
- _384: '384',
21
- _389: '389',
22
- _386: '386'
17
+ export const FactureElectroniqueModelsInvoiceTypeCode = {
18
+ /**
19
+ * Commercial Invoice
20
+ */
21
+ INVOICE: '380',
22
+ /**
23
+ * Self-billed Invoice
24
+ */
25
+ SELF_BILLED_INVOICE: '389',
26
+ /**
27
+ * Factored Invoice
28
+ */
29
+ FACTORED_INVOICE: '393',
30
+ /**
31
+ * Self-billed Factored Invoice
32
+ */
33
+ SELF_BILLED_FACTORED_INVOICE: '501',
34
+ /**
35
+ * Prepayment Invoice
36
+ */
37
+ PREPAYMENT_INVOICE: '386',
38
+ /**
39
+ * Self-billed Prepayment Invoice
40
+ */
41
+ SELF_BILLED_PREPAYMENT_INVOICE: '500',
42
+ /**
43
+ * Corrective Invoice
44
+ */
45
+ CORRECTIVE_INVOICE: '384',
46
+ /**
47
+ * Self-billed Corrective Invoice
48
+ */
49
+ SELF_BILLED_CORRECTIVE_INVOICE: '471',
50
+ /**
51
+ * Factored Corrective Invoice
52
+ */
53
+ FACTORED_CORRECTIVE_INVOICE: '472',
54
+ /**
55
+ * Self-billed Factored Corrective Invoice
56
+ */
57
+ SELF_BILLED_FACTORED_CORRECTIVE_INVOICE: '473',
58
+ /**
59
+ * Credit Note
60
+ */
61
+ CREDIT_NOTE: '381',
62
+ /**
63
+ * Self-billed Credit Note
64
+ */
65
+ SELF_BILLED_CREDIT_NOTE: '261',
66
+ /**
67
+ * Global Allowance Credit Note
68
+ */
69
+ GLOBAL_ALLOWANCE_CREDIT_NOTE: '262',
70
+ /**
71
+ * Factored Credit Note
72
+ */
73
+ FACTORED_CREDIT_NOTE: '396',
74
+ /**
75
+ * Self-billed Factored Credit Note
76
+ */
77
+ SELF_BILLED_FACTORED_CREDIT_NOTE: '502',
78
+ /**
79
+ * Prepayment Credit Note
80
+ */
81
+ PREPAYMENT_CREDIT_NOTE: '503'
23
82
  };
@@ -145,8 +145,8 @@ export * from './error-source';
145
145
  export * from './extraction-info';
146
146
  export * from './factur-xinvoice';
147
147
  export * from './factur-xpdfinfo';
148
+ export * from './facture-electronique-models-invoice-type-code';
148
149
  export * from './facture-electronique-rest-api-schemas-cdar-validation-error-response';
149
- export * from './facture-electronique-rest-api-schemas-ereporting-invoice-type-code';
150
150
  export * from './facture-electronique-rest-api-schemas-processing-chorus-pro-credentials';
151
151
  export * from './field-status';
152
152
  export * from './file-info';
@@ -145,8 +145,8 @@ export * from './error-source';
145
145
  export * from './extraction-info';
146
146
  export * from './factur-xinvoice';
147
147
  export * from './factur-xpdfinfo';
148
+ export * from './facture-electronique-models-invoice-type-code';
148
149
  export * from './facture-electronique-rest-api-schemas-cdar-validation-error-response';
149
- export * from './facture-electronique-rest-api-schemas-ereporting-invoice-type-code';
150
150
  export * from './facture-electronique-rest-api-schemas-processing-chorus-pro-credentials';
151
151
  export * from './field-status';
152
152
  export * from './file-info';
@@ -11,7 +11,7 @@
11
11
  */
12
12
  import type { Buyercountry } from './buyercountry';
13
13
  import type { Currency } from './currency';
14
- import type { FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode } from './facture-electronique-rest-api-schemas-ereporting-invoice-type-code';
14
+ import type { InvoiceTypeCode } from './invoice-type-code';
15
15
  import type { Sellercountry } from './sellercountry';
16
16
  import type { TaxBreakdownInput } from './tax-breakdown-input';
17
17
  import type { Taxamount1 } from './taxamount1';
@@ -31,7 +31,7 @@ export interface InvoiceInput {
31
31
  /**
32
32
  * Invoice type code
33
33
  */
34
- 'typeCode'?: FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode;
34
+ 'typeCode'?: InvoiceTypeCode;
35
35
  'currency'?: Currency;
36
36
  'dueDate'?: string | null;
37
37
  /**