@factpulse/sdk 3.0.33 → 3.0.35

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 (32) hide show
  1. package/.openapi-generator/FILES +2 -2
  2. package/CHANGELOG.md +13 -9
  3. 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
  4. package/dist/esm/models/{facture-electronique-rest-api-schemas-ereporting-invoice-type-code.js → facture-electronique-models-invoice-type-code.js} +66 -7
  5. package/dist/esm/models/index.d.ts +1 -1
  6. package/dist/esm/models/index.js +1 -1
  7. package/dist/esm/models/invoice-input.d.ts +2 -2
  8. package/dist/esm/models/invoice-type-code.d.ts +6 -65
  9. package/dist/esm/models/invoice-type-code.js +6 -65
  10. package/dist/esm/models/simplified-invoice-data.d.ts +2 -2
  11. package/dist/esm/src/helpers/client.js +9 -1
  12. package/dist/models/{facture-electronique-rest-api-schemas-ereporting-invoice-type-code.d.ts → facture-electronique-models-invoice-type-code.d.ts} +67 -8
  13. package/dist/models/{facture-electronique-rest-api-schemas-ereporting-invoice-type-code.js → facture-electronique-models-invoice-type-code.js} +67 -8
  14. package/dist/models/index.d.ts +1 -1
  15. package/dist/models/index.js +1 -1
  16. package/dist/models/invoice-input.d.ts +2 -2
  17. package/dist/models/invoice-type-code.d.ts +6 -65
  18. package/dist/models/invoice-type-code.js +6 -65
  19. package/dist/models/simplified-invoice-data.d.ts +2 -2
  20. package/dist/src/helpers/client.js +9 -1
  21. package/docs/FactureElectroniqueModelsInvoiceTypeCode.md +39 -0
  22. package/docs/InvoiceInput.md +1 -1
  23. package/docs/InvoiceTypeCode.md +6 -28
  24. package/docs/SimplifiedInvoiceData.md +1 -1
  25. package/models/{facture-electronique-rest-api-schemas-ereporting-invoice-type-code.ts → facture-electronique-models-invoice-type-code.ts} +67 -8
  26. package/models/index.ts +1 -1
  27. package/models/invoice-input.ts +2 -2
  28. package/models/invoice-type-code.ts +6 -65
  29. package/models/simplified-invoice-data.ts +2 -2
  30. package/package.json +1 -1
  31. package/src/helpers/client.ts +11 -1
  32. 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/FactureElectroniqueRestApiSchemasChorusProChorusProCredentials.md
177
- docs/FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.md
178
178
  docs/FactureElectroniqueRestApiSchemasValidationValidationErrorResponse.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-chorus-pro-chorus-pro-credentials.ts
476
- models/facture-electronique-rest-api-schemas-ereporting-invoice-type-code.ts
477
477
  models/facture-electronique-rest-api-schemas-validation-validation-error-response.ts
478
478
  models/field-status.ts
479
479
  models/file-info.ts
package/CHANGELOG.md CHANGED
@@ -7,14 +7,18 @@ 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.33] - 2026-01-17
10
+ ## [3.0.35] - 2026-01-17
11
11
 
12
12
  ### Added
13
- - Support API cycle de vie CDAR
14
-
15
- ### Fixed
16
- - Soumission AFNOR dans le flux complet
17
-
18
-
19
- [Unreleased]: https://github.com/factpulse/sdk-typescript/compare/v3.0.33...HEAD
20
- [3.0.33]: https://github.com/factpulse/sdk-typescript/releases/tag/v3.0.33
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.35...HEAD
24
+ [3.0.35]: https://github.com/factpulse/sdk-typescript/releases/tag/v3.0.35
@@ -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-chorus-pro-chorus-pro-credentials';
149
- export * from './facture-electronique-rest-api-schemas-ereporting-invoice-type-code';
150
150
  export * from './facture-electronique-rest-api-schemas-validation-validation-error-response';
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-chorus-pro-chorus-pro-credentials';
149
- export * from './facture-electronique-rest-api-schemas-ereporting-invoice-type-code';
150
150
  export * from './facture-electronique-rest-api-schemas-validation-validation-error-response';
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
  /**
@@ -10,72 +10,13 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  /**
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 |
13
+ * Invoice type codes (UNTDID 1001).
14
14
  */
15
15
  export declare const InvoiceTypeCode: {
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";
16
+ readonly _380: "380";
17
+ readonly _381: "381";
18
+ readonly _384: "384";
19
+ readonly _389: "389";
20
+ readonly _386: "386";
80
21
  };
81
22
  export type InvoiceTypeCode = typeof InvoiceTypeCode[keyof typeof InvoiceTypeCode];
@@ -12,71 +12,12 @@
12
12
  * Do not edit the class manually.
13
13
  */
14
14
  /**
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 |
15
+ * Invoice type codes (UNTDID 1001).
16
16
  */
17
17
  export const InvoiceTypeCode = {
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'
18
+ _380: '380',
19
+ _381: '381',
20
+ _384: '384',
21
+ _389: '389',
22
+ _386: '386'
82
23
  };
@@ -9,7 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { InvoiceTypeCode } from './invoice-type-code';
12
+ import type { FactureElectroniqueModelsInvoiceTypeCode } from './facture-electronique-models-invoice-type-code';
13
13
  import type { InvoicingFrameworkCode } from './invoicing-framework-code';
14
14
  import type { OperationNature } from './operation-nature';
15
15
  /**
@@ -49,7 +49,7 @@ export interface SimplifiedInvoiceData {
49
49
  /**
50
50
  * Document type (UNTDID 1001). Default: 380 (Invoice).
51
51
  */
52
- 'invoiceType'?: InvoiceTypeCode;
52
+ 'invoiceType'?: FactureElectroniqueModelsInvoiceTypeCode;
53
53
  'precedingInvoiceReference'?: string | null;
54
54
  'operationNature'?: OperationNature | null;
55
55
  'invoicingFramework'?: InvoicingFrameworkCode | null;
@@ -303,7 +303,7 @@ export class FactPulseClient {
303
303
  for (let attempt = 0; attempt <= this.config.maxRetries; attempt++) {
304
304
  yield this.ensureAuthenticated();
305
305
  const form = new FormData();
306
- form.append('invoice_data', jsonData);
306
+ form.append('invoice_data', jsonData, { contentType: 'application/json', filename: 'invoice.json' });
307
307
  form.append('profile', profile);
308
308
  form.append('output_format', outputFormat);
309
309
  form.append('source_pdf', fs.createReadStream(pdfPath), { filename: path.basename(pdfPath), contentType: 'application/pdf' });
@@ -357,6 +357,14 @@ export class FactPulseClient {
357
357
  if (!sync)
358
358
  return taskId;
359
359
  const result = yield this.pollTask(taskId, timeout);
360
+ // Check for business error (task succeeded but business result is ERROR)
361
+ if (result.status === 'ERROR') {
362
+ const errorMsg = result.errorMessage || 'Business error';
363
+ const errors = Array.isArray(result.details)
364
+ ? result.details.filter((e) => typeof e === 'object' && e !== null)
365
+ : [];
366
+ throw new FactPulseValidationError(errorMsg, errors);
367
+ }
360
368
  if (result.content_b64)
361
369
  return Buffer.from(result.content_b64, 'base64');
362
370
  throw new FactPulseValidationError('No content');
@@ -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];
@@ -13,14 +13,73 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode = void 0;
16
+ exports.FactureElectroniqueModelsInvoiceTypeCode = void 0;
17
17
  /**
18
- * Invoice type codes (UNTDID 1001).
18
+ * 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 |
19
19
  */
20
- exports.FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode = {
21
- _380: '380',
22
- _381: '381',
23
- _384: '384',
24
- _389: '389',
25
- _386: '386'
20
+ exports.FactureElectroniqueModelsInvoiceTypeCode = {
21
+ /**
22
+ * Commercial Invoice
23
+ */
24
+ INVOICE: '380',
25
+ /**
26
+ * Self-billed Invoice
27
+ */
28
+ SELF_BILLED_INVOICE: '389',
29
+ /**
30
+ * Factored Invoice
31
+ */
32
+ FACTORED_INVOICE: '393',
33
+ /**
34
+ * Self-billed Factored Invoice
35
+ */
36
+ SELF_BILLED_FACTORED_INVOICE: '501',
37
+ /**
38
+ * Prepayment Invoice
39
+ */
40
+ PREPAYMENT_INVOICE: '386',
41
+ /**
42
+ * Self-billed Prepayment Invoice
43
+ */
44
+ SELF_BILLED_PREPAYMENT_INVOICE: '500',
45
+ /**
46
+ * Corrective Invoice
47
+ */
48
+ CORRECTIVE_INVOICE: '384',
49
+ /**
50
+ * Self-billed Corrective Invoice
51
+ */
52
+ SELF_BILLED_CORRECTIVE_INVOICE: '471',
53
+ /**
54
+ * Factored Corrective Invoice
55
+ */
56
+ FACTORED_CORRECTIVE_INVOICE: '472',
57
+ /**
58
+ * Self-billed Factored Corrective Invoice
59
+ */
60
+ SELF_BILLED_FACTORED_CORRECTIVE_INVOICE: '473',
61
+ /**
62
+ * Credit Note
63
+ */
64
+ CREDIT_NOTE: '381',
65
+ /**
66
+ * Self-billed Credit Note
67
+ */
68
+ SELF_BILLED_CREDIT_NOTE: '261',
69
+ /**
70
+ * Global Allowance Credit Note
71
+ */
72
+ GLOBAL_ALLOWANCE_CREDIT_NOTE: '262',
73
+ /**
74
+ * Factored Credit Note
75
+ */
76
+ FACTORED_CREDIT_NOTE: '396',
77
+ /**
78
+ * Self-billed Factored Credit Note
79
+ */
80
+ SELF_BILLED_FACTORED_CREDIT_NOTE: '502',
81
+ /**
82
+ * Prepayment Credit Note
83
+ */
84
+ PREPAYMENT_CREDIT_NOTE: '503'
26
85
  };
@@ -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-chorus-pro-chorus-pro-credentials';
149
- export * from './facture-electronique-rest-api-schemas-ereporting-invoice-type-code';
150
150
  export * from './facture-electronique-rest-api-schemas-validation-validation-error-response';
151
151
  export * from './field-status';
152
152
  export * from './file-info';
@@ -161,8 +161,8 @@ __exportStar(require("./error-source"), exports);
161
161
  __exportStar(require("./extraction-info"), exports);
162
162
  __exportStar(require("./factur-xinvoice"), exports);
163
163
  __exportStar(require("./factur-xpdfinfo"), exports);
164
+ __exportStar(require("./facture-electronique-models-invoice-type-code"), exports);
164
165
  __exportStar(require("./facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials"), exports);
165
- __exportStar(require("./facture-electronique-rest-api-schemas-ereporting-invoice-type-code"), exports);
166
166
  __exportStar(require("./facture-electronique-rest-api-schemas-validation-validation-error-response"), exports);
167
167
  __exportStar(require("./field-status"), exports);
168
168
  __exportStar(require("./file-info"), exports);
@@ -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
  /**
@@ -10,72 +10,13 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  /**
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 |
13
+ * Invoice type codes (UNTDID 1001).
14
14
  */
15
15
  export declare const InvoiceTypeCode: {
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";
16
+ readonly _380: "380";
17
+ readonly _381: "381";
18
+ readonly _384: "384";
19
+ readonly _389: "389";
20
+ readonly _386: "386";
80
21
  };
81
22
  export type InvoiceTypeCode = typeof InvoiceTypeCode[keyof typeof InvoiceTypeCode];
@@ -15,71 +15,12 @@
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.InvoiceTypeCode = void 0;
17
17
  /**
18
- * 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 |
18
+ * Invoice type codes (UNTDID 1001).
19
19
  */
20
20
  exports.InvoiceTypeCode = {
21
- /**
22
- * Commercial Invoice
23
- */
24
- INVOICE: '380',
25
- /**
26
- * Self-billed Invoice
27
- */
28
- SELF_BILLED_INVOICE: '389',
29
- /**
30
- * Factored Invoice
31
- */
32
- FACTORED_INVOICE: '393',
33
- /**
34
- * Self-billed Factored Invoice
35
- */
36
- SELF_BILLED_FACTORED_INVOICE: '501',
37
- /**
38
- * Prepayment Invoice
39
- */
40
- PREPAYMENT_INVOICE: '386',
41
- /**
42
- * Self-billed Prepayment Invoice
43
- */
44
- SELF_BILLED_PREPAYMENT_INVOICE: '500',
45
- /**
46
- * Corrective Invoice
47
- */
48
- CORRECTIVE_INVOICE: '384',
49
- /**
50
- * Self-billed Corrective Invoice
51
- */
52
- SELF_BILLED_CORRECTIVE_INVOICE: '471',
53
- /**
54
- * Factored Corrective Invoice
55
- */
56
- FACTORED_CORRECTIVE_INVOICE: '472',
57
- /**
58
- * Self-billed Factored Corrective Invoice
59
- */
60
- SELF_BILLED_FACTORED_CORRECTIVE_INVOICE: '473',
61
- /**
62
- * Credit Note
63
- */
64
- CREDIT_NOTE: '381',
65
- /**
66
- * Self-billed Credit Note
67
- */
68
- SELF_BILLED_CREDIT_NOTE: '261',
69
- /**
70
- * Global Allowance Credit Note
71
- */
72
- GLOBAL_ALLOWANCE_CREDIT_NOTE: '262',
73
- /**
74
- * Factored Credit Note
75
- */
76
- FACTORED_CREDIT_NOTE: '396',
77
- /**
78
- * Self-billed Factored Credit Note
79
- */
80
- SELF_BILLED_FACTORED_CREDIT_NOTE: '502',
81
- /**
82
- * Prepayment Credit Note
83
- */
84
- PREPAYMENT_CREDIT_NOTE: '503'
21
+ _380: '380',
22
+ _381: '381',
23
+ _384: '384',
24
+ _389: '389',
25
+ _386: '386'
85
26
  };
@@ -9,7 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { InvoiceTypeCode } from './invoice-type-code';
12
+ import type { FactureElectroniqueModelsInvoiceTypeCode } from './facture-electronique-models-invoice-type-code';
13
13
  import type { InvoicingFrameworkCode } from './invoicing-framework-code';
14
14
  import type { OperationNature } from './operation-nature';
15
15
  /**
@@ -49,7 +49,7 @@ export interface SimplifiedInvoiceData {
49
49
  /**
50
50
  * Document type (UNTDID 1001). Default: 380 (Invoice).
51
51
  */
52
- 'invoiceType'?: InvoiceTypeCode;
52
+ 'invoiceType'?: FactureElectroniqueModelsInvoiceTypeCode;
53
53
  'precedingInvoiceReference'?: string | null;
54
54
  'operationNature'?: OperationNature | null;
55
55
  'invoicingFramework'?: InvoicingFrameworkCode | null;
@@ -351,7 +351,7 @@ class FactPulseClient {
351
351
  for (let attempt = 0; attempt <= this.config.maxRetries; attempt++) {
352
352
  yield this.ensureAuthenticated();
353
353
  const form = new form_data_1.default();
354
- form.append('invoice_data', jsonData);
354
+ form.append('invoice_data', jsonData, { contentType: 'application/json', filename: 'invoice.json' });
355
355
  form.append('profile', profile);
356
356
  form.append('output_format', outputFormat);
357
357
  form.append('source_pdf', fs.createReadStream(pdfPath), { filename: path.basename(pdfPath), contentType: 'application/pdf' });
@@ -405,6 +405,14 @@ class FactPulseClient {
405
405
  if (!sync)
406
406
  return taskId;
407
407
  const result = yield this.pollTask(taskId, timeout);
408
+ // Check for business error (task succeeded but business result is ERROR)
409
+ if (result.status === 'ERROR') {
410
+ const errorMsg = result.errorMessage || 'Business error';
411
+ const errors = Array.isArray(result.details)
412
+ ? result.details.filter((e) => typeof e === 'object' && e !== null)
413
+ : [];
414
+ throw new exceptions_1.FactPulseValidationError(errorMsg, errors);
415
+ }
408
416
  if (result.content_b64)
409
417
  return Buffer.from(result.content_b64, 'base64');
410
418
  throw new exceptions_1.FactPulseValidationError('No content');
@@ -0,0 +1,39 @@
1
+ # FactureElectroniqueModelsInvoiceTypeCode
2
+
3
+ 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 |
4
+
5
+ ## Enum
6
+
7
+ * `INVOICE` (value: `'380'`)
8
+
9
+ * `SELF_BILLED_INVOICE` (value: `'389'`)
10
+
11
+ * `FACTORED_INVOICE` (value: `'393'`)
12
+
13
+ * `SELF_BILLED_FACTORED_INVOICE` (value: `'501'`)
14
+
15
+ * `PREPAYMENT_INVOICE` (value: `'386'`)
16
+
17
+ * `SELF_BILLED_PREPAYMENT_INVOICE` (value: `'500'`)
18
+
19
+ * `CORRECTIVE_INVOICE` (value: `'384'`)
20
+
21
+ * `SELF_BILLED_CORRECTIVE_INVOICE` (value: `'471'`)
22
+
23
+ * `FACTORED_CORRECTIVE_INVOICE` (value: `'472'`)
24
+
25
+ * `SELF_BILLED_FACTORED_CORRECTIVE_INVOICE` (value: `'473'`)
26
+
27
+ * `CREDIT_NOTE` (value: `'381'`)
28
+
29
+ * `SELF_BILLED_CREDIT_NOTE` (value: `'261'`)
30
+
31
+ * `GLOBAL_ALLOWANCE_CREDIT_NOTE` (value: `'262'`)
32
+
33
+ * `FACTORED_CREDIT_NOTE` (value: `'396'`)
34
+
35
+ * `SELF_BILLED_FACTORED_CREDIT_NOTE` (value: `'502'`)
36
+
37
+ * `PREPAYMENT_CREDIT_NOTE` (value: `'503'`)
38
+
39
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -8,7 +8,7 @@ Name | Type | Description | Notes
8
8
  ------------ | ------------- | ------------- | -------------
9
9
  **invoiceId** | **string** | Invoice identifier | [default to undefined]
10
10
  **issueDate** | **string** | Invoice issue date | [default to undefined]
11
- **typeCode** | [**FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode**](FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.md) | Invoice type code | [optional] [default to undefined]
11
+ **typeCode** | [**InvoiceTypeCode**](InvoiceTypeCode.md) | Invoice type code | [optional] [default to undefined]
12
12
  **currency** | [**Currency**](Currency.md) | | [optional] [default to undefined]
13
13
  **dueDate** | **string** | | [optional] [default to undefined]
14
14
  **sellerSiren** | **string** | Seller SIREN/SIRET | [default to undefined]
@@ -1,39 +1,17 @@
1
1
  # InvoiceTypeCode
2
2
 
3
- 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 |
3
+ Invoice type codes (UNTDID 1001).
4
4
 
5
5
  ## Enum
6
6
 
7
- * `INVOICE` (value: `'380'`)
7
+ * `_380` (value: `'380'`)
8
8
 
9
- * `SELF_BILLED_INVOICE` (value: `'389'`)
9
+ * `_381` (value: `'381'`)
10
10
 
11
- * `FACTORED_INVOICE` (value: `'393'`)
11
+ * `_384` (value: `'384'`)
12
12
 
13
- * `SELF_BILLED_FACTORED_INVOICE` (value: `'501'`)
13
+ * `_389` (value: `'389'`)
14
14
 
15
- * `PREPAYMENT_INVOICE` (value: `'386'`)
16
-
17
- * `SELF_BILLED_PREPAYMENT_INVOICE` (value: `'500'`)
18
-
19
- * `CORRECTIVE_INVOICE` (value: `'384'`)
20
-
21
- * `SELF_BILLED_CORRECTIVE_INVOICE` (value: `'471'`)
22
-
23
- * `FACTORED_CORRECTIVE_INVOICE` (value: `'472'`)
24
-
25
- * `SELF_BILLED_FACTORED_CORRECTIVE_INVOICE` (value: `'473'`)
26
-
27
- * `CREDIT_NOTE` (value: `'381'`)
28
-
29
- * `SELF_BILLED_CREDIT_NOTE` (value: `'261'`)
30
-
31
- * `GLOBAL_ALLOWANCE_CREDIT_NOTE` (value: `'262'`)
32
-
33
- * `FACTORED_CREDIT_NOTE` (value: `'396'`)
34
-
35
- * `SELF_BILLED_FACTORED_CREDIT_NOTE` (value: `'502'`)
36
-
37
- * `PREPAYMENT_CREDIT_NOTE` (value: `'503'`)
15
+ * `_386` (value: `'386'`)
38
16
 
39
17
  [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -15,7 +15,7 @@ Name | Type | Description | Notes
15
15
  **comment** | **string** | | [optional] [default to undefined]
16
16
  **purchaseOrderReference** | **string** | | [optional] [default to undefined]
17
17
  **contractReference** | **string** | | [optional] [default to undefined]
18
- **invoiceType** | [**InvoiceTypeCode**](InvoiceTypeCode.md) | Document type (UNTDID 1001). Default: 380 (Invoice). | [optional] [default to undefined]
18
+ **invoiceType** | [**FactureElectroniqueModelsInvoiceTypeCode**](FactureElectroniqueModelsInvoiceTypeCode.md) | Document type (UNTDID 1001). Default: 380 (Invoice). | [optional] [default to undefined]
19
19
  **precedingInvoiceReference** | **string** | | [optional] [default to undefined]
20
20
  **operationNature** | [**OperationNature**](OperationNature.md) | | [optional] [default to undefined]
21
21
  **invoicingFramework** | [**InvoicingFrameworkCode**](InvoicingFrameworkCode.md) | | [optional] [default to undefined]
@@ -15,18 +15,77 @@
15
15
 
16
16
 
17
17
  /**
18
- * Invoice type codes (UNTDID 1001).
18
+ * 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 |
19
19
  */
20
20
 
21
- export const FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode = {
22
- _380: '380',
23
- _381: '381',
24
- _384: '384',
25
- _389: '389',
26
- _386: '386'
21
+ export const FactureElectroniqueModelsInvoiceTypeCode = {
22
+ /**
23
+ * Commercial Invoice
24
+ */
25
+ INVOICE: '380',
26
+ /**
27
+ * Self-billed Invoice
28
+ */
29
+ SELF_BILLED_INVOICE: '389',
30
+ /**
31
+ * Factored Invoice
32
+ */
33
+ FACTORED_INVOICE: '393',
34
+ /**
35
+ * Self-billed Factored Invoice
36
+ */
37
+ SELF_BILLED_FACTORED_INVOICE: '501',
38
+ /**
39
+ * Prepayment Invoice
40
+ */
41
+ PREPAYMENT_INVOICE: '386',
42
+ /**
43
+ * Self-billed Prepayment Invoice
44
+ */
45
+ SELF_BILLED_PREPAYMENT_INVOICE: '500',
46
+ /**
47
+ * Corrective Invoice
48
+ */
49
+ CORRECTIVE_INVOICE: '384',
50
+ /**
51
+ * Self-billed Corrective Invoice
52
+ */
53
+ SELF_BILLED_CORRECTIVE_INVOICE: '471',
54
+ /**
55
+ * Factored Corrective Invoice
56
+ */
57
+ FACTORED_CORRECTIVE_INVOICE: '472',
58
+ /**
59
+ * Self-billed Factored Corrective Invoice
60
+ */
61
+ SELF_BILLED_FACTORED_CORRECTIVE_INVOICE: '473',
62
+ /**
63
+ * Credit Note
64
+ */
65
+ CREDIT_NOTE: '381',
66
+ /**
67
+ * Self-billed Credit Note
68
+ */
69
+ SELF_BILLED_CREDIT_NOTE: '261',
70
+ /**
71
+ * Global Allowance Credit Note
72
+ */
73
+ GLOBAL_ALLOWANCE_CREDIT_NOTE: '262',
74
+ /**
75
+ * Factored Credit Note
76
+ */
77
+ FACTORED_CREDIT_NOTE: '396',
78
+ /**
79
+ * Self-billed Factored Credit Note
80
+ */
81
+ SELF_BILLED_FACTORED_CREDIT_NOTE: '502',
82
+ /**
83
+ * Prepayment Credit Note
84
+ */
85
+ PREPAYMENT_CREDIT_NOTE: '503'
27
86
  } as const;
28
87
 
29
- export type FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode = typeof FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode[keyof typeof FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode];
88
+ export type FactureElectroniqueModelsInvoiceTypeCode = typeof FactureElectroniqueModelsInvoiceTypeCode[keyof typeof FactureElectroniqueModelsInvoiceTypeCode];
30
89
 
31
90
 
32
91
 
package/models/index.ts CHANGED
@@ -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-chorus-pro-chorus-pro-credentials';
149
- export * from './facture-electronique-rest-api-schemas-ereporting-invoice-type-code';
150
150
  export * from './facture-electronique-rest-api-schemas-validation-validation-error-response';
151
151
  export * from './field-status';
152
152
  export * from './file-info';
@@ -21,7 +21,7 @@ import type { Buyercountry } from './buyercountry';
21
21
  import type { Currency } from './currency';
22
22
  // May contain unused imports in some cases
23
23
  // @ts-ignore
24
- import type { FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode } from './facture-electronique-rest-api-schemas-ereporting-invoice-type-code';
24
+ import type { InvoiceTypeCode } from './invoice-type-code';
25
25
  // May contain unused imports in some cases
26
26
  // @ts-ignore
27
27
  import type { Sellercountry } from './sellercountry';
@@ -50,7 +50,7 @@ export interface InvoiceInput {
50
50
  /**
51
51
  * Invoice type code
52
52
  */
53
- 'typeCode'?: FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode;
53
+ 'typeCode'?: InvoiceTypeCode;
54
54
  'currency'?: Currency;
55
55
  'dueDate'?: string | null;
56
56
  /**
@@ -15,74 +15,15 @@
15
15
 
16
16
 
17
17
  /**
18
- * 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 |
18
+ * Invoice type codes (UNTDID 1001).
19
19
  */
20
20
 
21
21
  export const InvoiceTypeCode = {
22
- /**
23
- * Commercial Invoice
24
- */
25
- INVOICE: '380',
26
- /**
27
- * Self-billed Invoice
28
- */
29
- SELF_BILLED_INVOICE: '389',
30
- /**
31
- * Factored Invoice
32
- */
33
- FACTORED_INVOICE: '393',
34
- /**
35
- * Self-billed Factored Invoice
36
- */
37
- SELF_BILLED_FACTORED_INVOICE: '501',
38
- /**
39
- * Prepayment Invoice
40
- */
41
- PREPAYMENT_INVOICE: '386',
42
- /**
43
- * Self-billed Prepayment Invoice
44
- */
45
- SELF_BILLED_PREPAYMENT_INVOICE: '500',
46
- /**
47
- * Corrective Invoice
48
- */
49
- CORRECTIVE_INVOICE: '384',
50
- /**
51
- * Self-billed Corrective Invoice
52
- */
53
- SELF_BILLED_CORRECTIVE_INVOICE: '471',
54
- /**
55
- * Factored Corrective Invoice
56
- */
57
- FACTORED_CORRECTIVE_INVOICE: '472',
58
- /**
59
- * Self-billed Factored Corrective Invoice
60
- */
61
- SELF_BILLED_FACTORED_CORRECTIVE_INVOICE: '473',
62
- /**
63
- * Credit Note
64
- */
65
- CREDIT_NOTE: '381',
66
- /**
67
- * Self-billed Credit Note
68
- */
69
- SELF_BILLED_CREDIT_NOTE: '261',
70
- /**
71
- * Global Allowance Credit Note
72
- */
73
- GLOBAL_ALLOWANCE_CREDIT_NOTE: '262',
74
- /**
75
- * Factored Credit Note
76
- */
77
- FACTORED_CREDIT_NOTE: '396',
78
- /**
79
- * Self-billed Factored Credit Note
80
- */
81
- SELF_BILLED_FACTORED_CREDIT_NOTE: '502',
82
- /**
83
- * Prepayment Credit Note
84
- */
85
- PREPAYMENT_CREDIT_NOTE: '503'
22
+ _380: '380',
23
+ _381: '381',
24
+ _384: '384',
25
+ _389: '389',
26
+ _386: '386'
86
27
  } as const;
87
28
 
88
29
  export type InvoiceTypeCode = typeof InvoiceTypeCode[keyof typeof InvoiceTypeCode];
@@ -15,7 +15,7 @@
15
15
 
16
16
  // May contain unused imports in some cases
17
17
  // @ts-ignore
18
- import type { InvoiceTypeCode } from './invoice-type-code';
18
+ import type { FactureElectroniqueModelsInvoiceTypeCode } from './facture-electronique-models-invoice-type-code';
19
19
  // May contain unused imports in some cases
20
20
  // @ts-ignore
21
21
  import type { InvoicingFrameworkCode } from './invoicing-framework-code';
@@ -54,7 +54,7 @@ export interface SimplifiedInvoiceData {
54
54
  /**
55
55
  * Document type (UNTDID 1001). Default: 380 (Invoice).
56
56
  */
57
- 'invoiceType'?: InvoiceTypeCode;
57
+ 'invoiceType'?: FactureElectroniqueModelsInvoiceTypeCode;
58
58
  'precedingInvoiceReference'?: string | null;
59
59
  'operationNature'?: OperationNature | null;
60
60
  'invoicingFramework'?: InvoicingFrameworkCode | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@factpulse/sdk",
3
- "version": "3.0.33",
3
+ "version": "3.0.35",
4
4
  "description": "OpenAPI client for @factpulse/sdk",
5
5
  "author": "OpenAPI-Generator Contributors",
6
6
  "repository": {
@@ -333,7 +333,7 @@ export class FactPulseClient {
333
333
  for (let attempt = 0; attempt <= this.config.maxRetries; attempt++) {
334
334
  await this.ensureAuthenticated();
335
335
  const form = new FormData();
336
- form.append('invoice_data', jsonData);
336
+ form.append('invoice_data', jsonData, { contentType: 'application/json', filename: 'invoice.json' });
337
337
  form.append('profile', profile);
338
338
  form.append('output_format', outputFormat);
339
339
  form.append('source_pdf', fs.createReadStream(pdfPath), { filename: path.basename(pdfPath), contentType: 'application/pdf' });
@@ -381,6 +381,16 @@ export class FactPulseClient {
381
381
  if (!taskId) throw new FactPulseValidationError("No task ID");
382
382
  if (!sync) return taskId;
383
383
  const result = await this.pollTask(taskId, timeout);
384
+
385
+ // Check for business error (task succeeded but business result is ERROR)
386
+ if (result.status === 'ERROR') {
387
+ const errorMsg = (result.errorMessage as string) || 'Business error';
388
+ const errors: ValidationErrorDetail[] = Array.isArray(result.details)
389
+ ? result.details.filter((e: unknown): e is ValidationErrorDetail => typeof e === 'object' && e !== null)
390
+ : [];
391
+ throw new FactPulseValidationError(errorMsg, errors);
392
+ }
393
+
384
394
  if (result.content_b64) return Buffer.from(result.content_b64 as string, 'base64');
385
395
  throw new FactPulseValidationError('No content');
386
396
  }
@@ -1,17 +0,0 @@
1
- # FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode
2
-
3
- Invoice type codes (UNTDID 1001).
4
-
5
- ## Enum
6
-
7
- * `_380` (value: `'380'`)
8
-
9
- * `_381` (value: `'381'`)
10
-
11
- * `_384` (value: `'384'`)
12
-
13
- * `_389` (value: `'389'`)
14
-
15
- * `_386` (value: `'386'`)
16
-
17
- [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)