@factpulse/sdk 3.0.25 → 3.0.26

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 (68) hide show
  1. package/.openapi-generator/FILES +4 -4
  2. package/CHANGELOG.md +3 -3
  3. package/README.md +19 -38
  4. package/dist/esm/models/chorus-pro-credentials.d.ts +19 -7
  5. package/dist/esm/models/chorus-pro-destination.d.ts +2 -2
  6. package/dist/esm/models/{facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials.d.ts → facture-electronique-models-invoice-type-code.d.ts} +63 -18
  7. package/dist/esm/models/{facture-electronique-rest-api-schemas-ereporting-invoice-type-code.js → facture-electronique-models-invoice-type-code.js} +66 -7
  8. package/dist/{models/facture-electronique-rest-api-schemas-ereporting-invoice-type-code.d.ts → esm/models/facture-electronique-rest-api-schemas-processing-chorus-pro-credentials.d.ts} +11 -9
  9. package/dist/esm/models/get-chorus-pro-id-request.d.ts +2 -2
  10. package/dist/esm/models/get-invoice-request.d.ts +2 -2
  11. package/dist/esm/models/get-structure-request.d.ts +2 -2
  12. package/dist/esm/models/index.d.ts +2 -2
  13. package/dist/esm/models/index.js +2 -2
  14. package/dist/esm/models/invoice-input.d.ts +2 -2
  15. package/dist/esm/models/invoice-type-code.d.ts +6 -65
  16. package/dist/esm/models/invoice-type-code.js +6 -65
  17. package/dist/esm/models/search-structure-request.d.ts +2 -2
  18. package/dist/esm/models/simplified-invoice-data.d.ts +2 -2
  19. package/dist/esm/models/submit-invoice-request.d.ts +2 -2
  20. package/dist/esm/src/helpers/client.js +1 -1
  21. package/dist/models/chorus-pro-credentials.d.ts +19 -7
  22. package/dist/models/chorus-pro-destination.d.ts +2 -2
  23. package/dist/{esm/models/facture-electronique-rest-api-schemas-ereporting-invoice-type-code.d.ts → models/facture-electronique-models-invoice-type-code.d.ts} +67 -8
  24. package/dist/models/{facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials.d.ts → facture-electronique-models-invoice-type-code.js} +67 -18
  25. package/dist/models/{facture-electronique-rest-api-schemas-ereporting-invoice-type-code.js → facture-electronique-rest-api-schemas-processing-chorus-pro-credentials.d.ts} +11 -13
  26. package/dist/models/get-chorus-pro-id-request.d.ts +2 -2
  27. package/dist/models/get-invoice-request.d.ts +2 -2
  28. package/dist/models/get-structure-request.d.ts +2 -2
  29. package/dist/models/index.d.ts +2 -2
  30. package/dist/models/index.js +2 -2
  31. package/dist/models/invoice-input.d.ts +2 -2
  32. package/dist/models/invoice-type-code.d.ts +6 -65
  33. package/dist/models/invoice-type-code.js +6 -65
  34. package/dist/models/search-structure-request.d.ts +2 -2
  35. package/dist/models/simplified-invoice-data.d.ts +2 -2
  36. package/dist/models/submit-invoice-request.d.ts +2 -2
  37. package/dist/src/helpers/client.js +1 -1
  38. package/docs/ChorusProCredentials.md +9 -9
  39. package/docs/ChorusProDestination.md +1 -1
  40. package/docs/FactureElectroniqueModelsInvoiceTypeCode.md +39 -0
  41. package/docs/FactureElectroniqueRestApiSchemasProcessingChorusProCredentials.md +29 -0
  42. package/docs/GetChorusProIdRequest.md +1 -1
  43. package/docs/GetInvoiceRequest.md +1 -1
  44. package/docs/GetStructureRequest.md +1 -1
  45. package/docs/InvoiceInput.md +1 -1
  46. package/docs/InvoiceTypeCode.md +6 -28
  47. package/docs/SearchStructureRequest.md +1 -1
  48. package/docs/SimplifiedInvoiceData.md +1 -1
  49. package/docs/SubmitInvoiceRequest.md +1 -1
  50. package/models/chorus-pro-credentials.ts +19 -7
  51. package/models/chorus-pro-destination.ts +2 -2
  52. package/models/{facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials.ts → facture-electronique-models-invoice-type-code.ts} +67 -18
  53. package/models/{facture-electronique-rest-api-schemas-ereporting-invoice-type-code.ts → facture-electronique-rest-api-schemas-processing-chorus-pro-credentials.ts} +11 -13
  54. package/models/get-chorus-pro-id-request.ts +2 -2
  55. package/models/get-invoice-request.ts +2 -2
  56. package/models/get-structure-request.ts +2 -2
  57. package/models/index.ts +2 -2
  58. package/models/invoice-input.ts +2 -2
  59. package/models/invoice-type-code.ts +6 -65
  60. package/models/search-structure-request.ts +2 -2
  61. package/models/simplified-invoice-data.ts +2 -2
  62. package/models/submit-invoice-request.ts +2 -2
  63. package/package.json +1 -1
  64. package/src/helpers/client.ts +1 -1
  65. package/docs/FactureElectroniqueRestApiSchemasChorusProChorusProCredentials.md +0 -29
  66. package/docs/FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode.md +0 -17
  67. /package/dist/esm/models/{facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials.js → facture-electronique-rest-api-schemas-processing-chorus-pro-credentials.js} +0 -0
  68. /package/dist/models/{facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials.js → facture-electronique-rest-api-schemas-processing-chorus-pro-credentials.js} +0 -0
@@ -9,7 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { FactureElectroniqueRestApiSchemasChorusProChorusProCredentials } from './facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials';
12
+ import type { ChorusProCredentials } from './chorus-pro-credentials';
13
13
  import type { SubmitGrossAmount } from './submit-gross-amount';
14
14
  import type { SubmitNetAmount } from './submit-net-amount';
15
15
  import type { SubmitVatAmount } from './submit-vat-amount';
@@ -17,7 +17,7 @@ import type { SubmitVatAmount } from './submit-vat-amount';
17
17
  * Submit an invoice to Chorus Pro.
18
18
  */
19
19
  export interface SubmitInvoiceRequest {
20
- 'credentials'?: FactureElectroniqueRestApiSchemasChorusProChorusProCredentials | null;
20
+ 'credentials'?: ChorusProCredentials | null;
21
21
  /**
22
22
  * Invoice number
23
23
  */
@@ -311,7 +311,7 @@ export class FactPulseClient {
311
311
  const response = yield this.httpClient.post(`${this.config.apiUrl}/api/v1/processing/generate-invoice`, form, {
312
312
  headers: Object.assign(Object.assign({}, form.getHeaders()), { Authorization: `Bearer ${this.accessToken}` }), timeout: 60000,
313
313
  });
314
- taskId = response.data.task_id;
314
+ taskId = response.data.taskId;
315
315
  break;
316
316
  }
317
317
  catch (error) {
@@ -10,15 +10,27 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  /**
13
- * Optional Chorus Pro credentials. **MODE 1 - JWT retrieval (recommended):** Do not provide this `credentials` field in the payload. Credentials will be automatically retrieved via client_uid from JWT (0-trust). **MODE 2 - Credentials in payload:** Provide all required fields below. Useful for tests or third-party integrations.
13
+ * Chorus Pro credentials for Zero-Trust mode. **Zero-Trust Mode**: Credentials are passed in each request and are NEVER stored. **Security**: - Credentials are never persisted in the database - They are used only for the duration of the request - Secure transmission via HTTPS **Use cases**: - High-security environments (banks, administrations) - Strict GDPR compliance - Tests with temporary credentials - Users who don\'t want to store their credentials
14
14
  */
15
15
  export interface ChorusProCredentials {
16
- 'pisteClientId'?: string | null;
17
- 'pisteClientSecret'?: string | null;
18
- 'chorusLogin'?: string | null;
19
- 'chorusPassword'?: string | null;
20
16
  /**
21
- * [MODE 2] Use sandbox mode (default: True)
17
+ * PISTE Client ID (government API portal)
22
18
  */
23
- 'sandboxMode'?: boolean;
19
+ 'pisteClientId': string;
20
+ /**
21
+ * PISTE Client Secret
22
+ */
23
+ 'pisteClientSecret': string;
24
+ /**
25
+ * Chorus Pro login
26
+ */
27
+ 'chorusProLogin': string;
28
+ /**
29
+ * Chorus Pro password
30
+ */
31
+ 'chorusProPassword': string;
32
+ /**
33
+ * Use sandbox environment (true) or production (false)
34
+ */
35
+ 'sandbox'?: boolean;
24
36
  }
@@ -9,13 +9,13 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { ChorusProCredentials } from './chorus-pro-credentials';
12
+ import type { FactureElectroniqueRestApiSchemasProcessingChorusProCredentials } from './facture-electronique-rest-api-schemas-processing-chorus-pro-credentials';
13
13
  /**
14
14
  * Specific configuration for Chorus Pro destination.
15
15
  */
16
16
  export interface ChorusProDestination {
17
17
  'type'?: ChorusProDestinationTypeEnum;
18
- 'credentials'?: ChorusProCredentials | null;
18
+ 'credentials'?: FactureElectroniqueRestApiSchemasProcessingChorusProCredentials | null;
19
19
  }
20
20
  export declare const ChorusProDestinationTypeEnum: {
21
21
  readonly ChorusPro: "chorus_pro";
@@ -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];
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
1
4
  /**
2
5
  * FactPulse REST API
3
6
  * REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d \'{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }\' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d \'{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }\' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://factpulse.fr/api/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://factpulse.fr/documentation-api/
@@ -9,28 +12,74 @@
9
12
  * https://openapi-generator.tech
10
13
  * Do not edit the class manually.
11
14
  */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.FactureElectroniqueModelsInvoiceTypeCode = void 0;
12
17
  /**
13
- * Chorus Pro credentials for Zero-Trust mode. **Zero-Trust Mode**: Credentials are passed in each request and are NEVER stored. **Security**: - Credentials are never persisted in the database - They are used only for the duration of the request - Secure transmission via HTTPS **Use cases**: - High-security environments (banks, administrations) - Strict GDPR compliance - Tests with temporary credentials - Users who don\'t want to store their credentials
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 |
14
19
  */
15
- export interface FactureElectroniqueRestApiSchemasChorusProChorusProCredentials {
20
+ exports.FactureElectroniqueModelsInvoiceTypeCode = {
16
21
  /**
17
- * PISTE Client ID (government API portal)
18
- */
19
- 'pisteClientId': string;
22
+ * Commercial Invoice
23
+ */
24
+ INVOICE: '380',
20
25
  /**
21
- * PISTE Client Secret
22
- */
23
- 'pisteClientSecret': string;
26
+ * Self-billed Invoice
27
+ */
28
+ SELF_BILLED_INVOICE: '389',
24
29
  /**
25
- * Chorus Pro login
26
- */
27
- 'chorusProLogin': string;
30
+ * Factored Invoice
31
+ */
32
+ FACTORED_INVOICE: '393',
28
33
  /**
29
- * Chorus Pro password
30
- */
31
- 'chorusProPassword': string;
34
+ * Self-billed Factored Invoice
35
+ */
36
+ SELF_BILLED_FACTORED_INVOICE: '501',
32
37
  /**
33
- * Use sandbox environment (true) or production (false)
34
- */
35
- 'sandbox'?: boolean;
36
- }
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'
85
+ };
@@ -1,6 +1,3 @@
1
- "use strict";
2
- /* tslint:disable */
3
- /* eslint-disable */
4
1
  /**
5
2
  * FactPulse REST API
6
3
  * REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures. ## 🎯 Main Features ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search) ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF) ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage) ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations ## 🔒 Authentication All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ``` ### How to obtain a JWT token? #### 🔑 Method 1: `/api/token/` API (Recommended) **URL:** `https://factpulse.fr/api/token/` This method is **recommended** for integration in your applications and CI/CD workflows. **Prerequisites:** Having set a password on your account **For users registered via email/password:** - You already have a password, use it directly **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API **Request example:** ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d \'{ \"username\": \"your_email@example.com\", \"password\": \"your_password\" }\' ``` **Optional `client_uid` parameter:** To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`: ```bash curl -X POST https://factpulse.fr/api/token/ \\ -H \"Content-Type: application/json\" \\ -d \'{ \"username\": \"your_email@example.com\", \"password\": \"your_password\", \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\" }\' ``` The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client **Response:** ```json { \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\", // Access token (validity: 30 min) \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\" // Refresh token (validity: 7 days) } ``` **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool #### 🖥️ Method 2: Dashboard Generation (Alternative) **URL:** https://factpulse.fr/api/dashboard/ This method is suitable for quick tests or occasional use via the graphical interface. **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation ### 📚 Full Documentation For more information on authentication and API usage: https://factpulse.fr/documentation-api/
@@ -12,15 +9,16 @@
12
9
  * https://openapi-generator.tech
13
10
  * Do not edit the class manually.
14
11
  */
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode = void 0;
17
12
  /**
18
- * Invoice type codes (UNTDID 1001).
13
+ * Optional Chorus Pro credentials. **MODE 1 - JWT retrieval (recommended):** Do not provide this `credentials` field in the payload. Credentials will be automatically retrieved via client_uid from JWT (0-trust). **MODE 2 - Credentials in payload:** Provide all required fields below. Useful for tests or third-party integrations.
19
14
  */
20
- exports.FactureElectroniqueRestApiSchemasEreportingInvoiceTypeCode = {
21
- _380: '380',
22
- _381: '381',
23
- _384: '384',
24
- _389: '389',
25
- _386: '386'
26
- };
15
+ export interface FactureElectroniqueRestApiSchemasProcessingChorusProCredentials {
16
+ 'pisteClientId'?: string | null;
17
+ 'pisteClientSecret'?: string | null;
18
+ 'chorusLogin'?: string | null;
19
+ 'chorusPassword'?: string | null;
20
+ /**
21
+ * [MODE 2] Use sandbox mode (default: True)
22
+ */
23
+ 'sandboxMode'?: boolean;
24
+ }
@@ -9,12 +9,12 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { FactureElectroniqueRestApiSchemasChorusProChorusProCredentials } from './facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials';
12
+ import type { ChorusProCredentials } from './chorus-pro-credentials';
13
13
  /**
14
14
  * Get Chorus Pro ID from SIRET.
15
15
  */
16
16
  export interface GetChorusProIdRequest {
17
- 'credentials'?: FactureElectroniqueRestApiSchemasChorusProChorusProCredentials | null;
17
+ 'credentials'?: ChorusProCredentials | null;
18
18
  /**
19
19
  * Structure SIRET (14 digits)
20
20
  */
@@ -9,12 +9,12 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { FactureElectroniqueRestApiSchemasChorusProChorusProCredentials } from './facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials';
12
+ import type { ChorusProCredentials } from './chorus-pro-credentials';
13
13
  /**
14
14
  * Get an invoice.
15
15
  */
16
16
  export interface GetInvoiceRequest {
17
- 'credentials'?: FactureElectroniqueRestApiSchemasChorusProChorusProCredentials | null;
17
+ 'credentials'?: ChorusProCredentials | null;
18
18
  /**
19
19
  * Chorus Pro invoice ID
20
20
  */
@@ -9,12 +9,12 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { FactureElectroniqueRestApiSchemasChorusProChorusProCredentials } from './facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials';
12
+ import type { ChorusProCredentials } from './chorus-pro-credentials';
13
13
  /**
14
14
  * Get structure details.
15
15
  */
16
16
  export interface GetStructureRequest {
17
- 'credentials'?: FactureElectroniqueRestApiSchemasChorusProChorusProCredentials | null;
17
+ 'credentials'?: ChorusProCredentials | null;
18
18
  /**
19
19
  * Chorus Pro structure ID
20
20
  */
@@ -138,8 +138,8 @@ export * from './error-source';
138
138
  export * from './extraction-info';
139
139
  export * from './factur-xinvoice';
140
140
  export * from './factur-xpdfinfo';
141
- export * from './facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials';
142
- export * from './facture-electronique-rest-api-schemas-ereporting-invoice-type-code';
141
+ export * from './facture-electronique-models-invoice-type-code';
142
+ export * from './facture-electronique-rest-api-schemas-processing-chorus-pro-credentials';
143
143
  export * from './field-status';
144
144
  export * from './file-info';
145
145
  export * from './files-info';
@@ -154,8 +154,8 @@ __exportStar(require("./error-source"), exports);
154
154
  __exportStar(require("./extraction-info"), exports);
155
155
  __exportStar(require("./factur-xinvoice"), exports);
156
156
  __exportStar(require("./factur-xpdfinfo"), exports);
157
- __exportStar(require("./facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials"), exports);
158
- __exportStar(require("./facture-electronique-rest-api-schemas-ereporting-invoice-type-code"), exports);
157
+ __exportStar(require("./facture-electronique-models-invoice-type-code"), exports);
158
+ __exportStar(require("./facture-electronique-rest-api-schemas-processing-chorus-pro-credentials"), exports);
159
159
  __exportStar(require("./field-status"), exports);
160
160
  __exportStar(require("./file-info"), exports);
161
161
  __exportStar(require("./files-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,12 +9,12 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { FactureElectroniqueRestApiSchemasChorusProChorusProCredentials } from './facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials';
12
+ import type { ChorusProCredentials } from './chorus-pro-credentials';
13
13
  /**
14
14
  * Search structures by criteria.
15
15
  */
16
16
  export interface SearchStructureRequest {
17
- 'credentials'?: FactureElectroniqueRestApiSchemasChorusProChorusProCredentials | null;
17
+ 'credentials'?: ChorusProCredentials | null;
18
18
  'structureIdentifier'?: string | null;
19
19
  'structureIdentifierType'?: string | null;
20
20
  'companyName'?: string | null;
@@ -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;
@@ -9,7 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { FactureElectroniqueRestApiSchemasChorusProChorusProCredentials } from './facture-electronique-rest-api-schemas-chorus-pro-chorus-pro-credentials';
12
+ import type { ChorusProCredentials } from './chorus-pro-credentials';
13
13
  import type { SubmitGrossAmount } from './submit-gross-amount';
14
14
  import type { SubmitNetAmount } from './submit-net-amount';
15
15
  import type { SubmitVatAmount } from './submit-vat-amount';
@@ -17,7 +17,7 @@ import type { SubmitVatAmount } from './submit-vat-amount';
17
17
  * Submit an invoice to Chorus Pro.
18
18
  */
19
19
  export interface SubmitInvoiceRequest {
20
- 'credentials'?: FactureElectroniqueRestApiSchemasChorusProChorusProCredentials | null;
20
+ 'credentials'?: ChorusProCredentials | null;
21
21
  /**
22
22
  * Invoice number
23
23
  */
@@ -359,7 +359,7 @@ class FactPulseClient {
359
359
  const response = yield this.httpClient.post(`${this.config.apiUrl}/api/v1/processing/generate-invoice`, form, {
360
360
  headers: Object.assign(Object.assign({}, form.getHeaders()), { Authorization: `Bearer ${this.accessToken}` }), timeout: 60000,
361
361
  });
362
- taskId = response.data.task_id;
362
+ taskId = response.data.taskId;
363
363
  break;
364
364
  }
365
365
  catch (error) {