@invoicetronic/ts-sdk 1.8.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/README.md +16 -2
  3. package/api.ts +2 -2
  4. package/base.ts +2 -2
  5. package/common.ts +2 -2
  6. package/configuration.ts +3 -3
  7. package/dist/api.d.ts +2 -2
  8. package/dist/api.js +2 -2
  9. package/dist/base.d.ts +2 -2
  10. package/dist/base.js +2 -2
  11. package/dist/common.d.ts +2 -2
  12. package/dist/common.js +2 -2
  13. package/dist/configuration.d.ts +2 -2
  14. package/dist/configuration.js +3 -3
  15. package/dist/esm/api.d.ts +2 -2
  16. package/dist/esm/api.js +2 -2
  17. package/dist/esm/base.d.ts +2 -2
  18. package/dist/esm/base.js +2 -2
  19. package/dist/esm/common.d.ts +2 -2
  20. package/dist/esm/common.js +2 -2
  21. package/dist/esm/configuration.d.ts +2 -2
  22. package/dist/esm/configuration.js +3 -3
  23. package/dist/esm/index.d.ts +2 -2
  24. package/dist/esm/index.js +2 -2
  25. package/dist/esm/src/api/company-api.d.ts +2 -2
  26. package/dist/esm/src/api/company-api.js +2 -2
  27. package/dist/esm/src/api/export-api.d.ts +2 -2
  28. package/dist/esm/src/api/export-api.js +2 -2
  29. package/dist/esm/src/api/health-api.d.ts +2 -2
  30. package/dist/esm/src/api/health-api.js +2 -2
  31. package/dist/esm/src/api/log-api.d.ts +2 -2
  32. package/dist/esm/src/api/log-api.js +2 -2
  33. package/dist/esm/src/api/receive-api.d.ts +2 -2
  34. package/dist/esm/src/api/receive-api.js +2 -2
  35. package/dist/esm/src/api/send-api.d.ts +94 -57
  36. package/dist/esm/src/api/send-api.js +107 -61
  37. package/dist/esm/src/api/status-api.d.ts +2 -2
  38. package/dist/esm/src/api/status-api.js +2 -2
  39. package/dist/esm/src/api/update-api.d.ts +2 -2
  40. package/dist/esm/src/api/update-api.js +2 -2
  41. package/dist/esm/src/api/webhook-api.d.ts +27 -27
  42. package/dist/esm/src/api/webhook-api.js +22 -22
  43. package/dist/esm/src/models/company.d.ts +2 -2
  44. package/dist/esm/src/models/company.js +2 -2
  45. package/dist/esm/src/models/document-data.d.ts +2 -2
  46. package/dist/esm/src/models/document-data.js +2 -2
  47. package/dist/esm/src/models/event.d.ts +2 -2
  48. package/dist/esm/src/models/event.js +2 -2
  49. package/dist/esm/src/models/model-error.d.ts +2 -2
  50. package/dist/esm/src/models/model-error.js +2 -2
  51. package/dist/esm/src/models/problem-details.d.ts +2 -2
  52. package/dist/esm/src/models/problem-details.js +2 -2
  53. package/dist/esm/src/models/receive.d.ts +2 -2
  54. package/dist/esm/src/models/receive.js +2 -2
  55. package/dist/esm/src/models/send-reduced.d.ts +2 -2
  56. package/dist/esm/src/models/send-reduced.js +2 -2
  57. package/dist/esm/src/models/send.d.ts +2 -2
  58. package/dist/esm/src/models/send.js +2 -2
  59. package/dist/esm/src/models/status.d.ts +2 -2
  60. package/dist/esm/src/models/status.js +2 -2
  61. package/dist/esm/src/models/update.d.ts +2 -2
  62. package/dist/esm/src/models/update.js +2 -2
  63. package/dist/esm/src/models/web-hook-history.d.ts +2 -2
  64. package/dist/esm/src/models/web-hook-history.js +2 -2
  65. package/dist/esm/src/models/web-hook.d.ts +2 -2
  66. package/dist/esm/src/models/web-hook.js +2 -2
  67. package/dist/index.d.ts +2 -2
  68. package/dist/index.js +2 -2
  69. package/dist/src/api/company-api.d.ts +2 -2
  70. package/dist/src/api/company-api.js +2 -2
  71. package/dist/src/api/export-api.d.ts +2 -2
  72. package/dist/src/api/export-api.js +2 -2
  73. package/dist/src/api/health-api.d.ts +2 -2
  74. package/dist/src/api/health-api.js +2 -2
  75. package/dist/src/api/log-api.d.ts +2 -2
  76. package/dist/src/api/log-api.js +2 -2
  77. package/dist/src/api/receive-api.d.ts +2 -2
  78. package/dist/src/api/receive-api.js +2 -2
  79. package/dist/src/api/send-api.d.ts +94 -57
  80. package/dist/src/api/send-api.js +108 -62
  81. package/dist/src/api/status-api.d.ts +2 -2
  82. package/dist/src/api/status-api.js +2 -2
  83. package/dist/src/api/update-api.d.ts +2 -2
  84. package/dist/src/api/update-api.js +2 -2
  85. package/dist/src/api/webhook-api.d.ts +27 -27
  86. package/dist/src/api/webhook-api.js +22 -22
  87. package/dist/src/models/company.d.ts +2 -2
  88. package/dist/src/models/company.js +2 -2
  89. package/dist/src/models/document-data.d.ts +2 -2
  90. package/dist/src/models/document-data.js +2 -2
  91. package/dist/src/models/event.d.ts +2 -2
  92. package/dist/src/models/event.js +2 -2
  93. package/dist/src/models/model-error.d.ts +2 -2
  94. package/dist/src/models/model-error.js +2 -2
  95. package/dist/src/models/problem-details.d.ts +2 -2
  96. package/dist/src/models/problem-details.js +2 -2
  97. package/dist/src/models/receive.d.ts +2 -2
  98. package/dist/src/models/receive.js +2 -2
  99. package/dist/src/models/send-reduced.d.ts +2 -2
  100. package/dist/src/models/send-reduced.js +2 -2
  101. package/dist/src/models/send.d.ts +2 -2
  102. package/dist/src/models/send.js +2 -2
  103. package/dist/src/models/status.d.ts +2 -2
  104. package/dist/src/models/status.js +2 -2
  105. package/dist/src/models/update.d.ts +2 -2
  106. package/dist/src/models/update.js +2 -2
  107. package/dist/src/models/web-hook-history.d.ts +2 -2
  108. package/dist/src/models/web-hook-history.js +2 -2
  109. package/dist/src/models/web-hook.d.ts +2 -2
  110. package/dist/src/models/web-hook.js +2 -2
  111. package/docs/SendApi.md +25 -10
  112. package/docs/WebhookApi.md +5 -5
  113. package/index.ts +2 -2
  114. package/package.json +1 -1
  115. package/src/api/company-api.ts +2 -2
  116. package/src/api/export-api.ts +2 -2
  117. package/src/api/health-api.ts +2 -2
  118. package/src/api/log-api.ts +2 -2
  119. package/src/api/receive-api.ts +2 -2
  120. package/src/api/send-api.ts +125 -72
  121. package/src/api/status-api.ts +2 -2
  122. package/src/api/update-api.ts +2 -2
  123. package/src/api/webhook-api.ts +27 -27
  124. package/src/models/company.ts +2 -2
  125. package/src/models/document-data.ts +2 -2
  126. package/src/models/event.ts +2 -2
  127. package/src/models/model-error.ts +2 -2
  128. package/src/models/problem-details.ts +2 -2
  129. package/src/models/receive.ts +2 -2
  130. package/src/models/send-reduced.ts +2 -2
  131. package/src/models/send.ts +2 -2
  132. package/src/models/status.ts +2 -2
  133. package/src/models/update.ts +2 -2
  134. package/src/models/web-hook-history.ts +2 -2
  135. package/src/models/web-hook.ts +2 -2
@@ -3,9 +3,9 @@
3
3
  /* eslint-disable */
4
4
  /**
5
5
  * Invoicetronic API
6
- * The [Invoicetronic API][2] is a RESTful service that allows you to send and receive invoices through the Italian [Servizio di Interscambio (SDI)][1], or Interchange Service. The API is designed to be simple and easy to use, abstracting away SDI complexity while providing complete control over the invoice send/receive process. It provides advanced features as encryption at rest, multi-language pre-flight invoice validation, multiple upload formats, webhooks, event logging, client SDKs, and CLI tools. For more information, see [Invoicetronic website][2] [1]: https://www.fatturapa.gov.it/it/sistemainterscambio/cose-il-sdi/ [2]: https://invoicetronic.com/
6
+ * The [Invoicetronic API][2] is a RESTful service that allows you to send and receive invoices through the Italian [Servizio di Interscambio (SDI)][1], or Interchange Service. The API is designed to be simple and easy to use, abstracting away SDI complexity while providing complete control over the invoice send/receive process. It provides advanced features as encryption at rest, multi-language pre-flight invoice validation, multiple upload formats, webhooks, event logging, client SDKs, and CLI tools. For more information, see [Invoicetronic website][2] ## Before you start For the full integration guide, tutorials, SDKs and quickstarts, see the **[Documentation](https://invoicetronic.com/en/docs/)**. A few cross-cutting topics worth knowing before integrating: - **[Prerequisites](https://invoicetronic.com/en/docs/prerequisites/)** — what you need to start in Sandbox and what\'s required to move to production. - **[API Keys](https://invoicetronic.com/en/docs/apikeys/)** — how `ik_live_` and `ik_test_` keys select the environment. - **[Sandbox](https://invoicetronic.com/en/docs/sandbox/)** — free test environment that mirrors the live workflow, with no credits consumed. - **[Rate Limiting](https://invoicetronic.com/en/docs/ratelimiting/)** — per-second, per-minute and per-day limits; how to handle `429 Too Many Requests`. - **[Pagination](https://invoicetronic.com/en/docs/pagination/)** — `page` and `page_size` parameters and the `Invoicetronic-Total-Count` response header. - **[CORS](https://invoicetronic.com/en/docs/cors/)** — calling the API from the browser; allowed origins are configured per key. - **[Webhooks](https://invoicetronic.com/en/docs/webhooks/)** — real-time event notifications with HMAC-SHA256 signature validation. - **[Localization](https://invoicetronic.com/en/docs/accept-language/)** — use the `Accept-Language` header to receive error messages in Italian, English or German. [1]: https://www.fatturapa.gov.it/it/sistemainterscambio/cose-il-sdi/ [2]: https://invoicetronic.com/
7
7
  *
8
- * The version of the OpenAPI document: 1.12.0
8
+ * The version of the OpenAPI document: 1.14.0
9
9
  * Contact: info@invoicetronic.com
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -22,7 +22,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
22
22
  });
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.SendXmlPostSignatureEnum = exports.SendPostSignatureEnum = exports.SendJsonPostSignatureEnum = exports.SendFilePostSignatureEnum = exports.SendApi = exports.SendApiFactory = exports.SendApiFp = exports.SendApiAxiosParamCreator = void 0;
25
+ exports.SendXmlPostSignatureEnum = exports.SendPostSignatureEnum = exports.SendJsonPostSignatureEnum = exports.SendGetLatestStateEnum = exports.SendFilePostSignatureEnum = exports.SendApi = exports.SendApiFactory = exports.SendApiFp = exports.SendApiAxiosParamCreator = void 0;
26
26
  const axios_1 = require("axios");
27
27
  // URLSearchParams not necessarily used
28
28
  // @ts-ignore
@@ -38,15 +38,16 @@ const base_1 = require("../../base");
38
38
  const SendApiAxiosParamCreator = function (configuration) {
39
39
  return {
40
40
  /**
41
- * Add a new invoice by uploading a file. Supported formats are XML (FatturaPA) and P7M (signed). The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com).
41
+ * Add a new invoice by uploading a file. Supported formats are XML (FatturaPA) and P7M (signed). The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com). ### Idempotency To protect against duplicate submissions caused by network retries, you can send an optional `Idempotency-Key` header with any unique, client-generated value (up to 255 characters). - The first request with a given key is processed normally, and its response (status, body and `Location`) is stored for 24 hours. - Any subsequent request that reuses the same key within that window replays the original response instead of sending a second invoice to SDI. - If a request with the same key is still being processed, the retry receives `409 Conflict`. - If the same key is reused with a **different** invoice payload, the request is rejected with `422 Unprocessable Entity`: a given key must always map to the same request. Keys are scoped per account, so different accounts can use the same key value without interfering. If the idempotency store is temporarily unavailable, the request is processed normally without idempotency protection.
42
42
  * @summary Add an invoice by file
43
43
  * @param {File} file
44
44
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
45
45
  * @param {SendFilePostSignatureEnum} [signature] Whether to digitally sign the document.
46
+ * @param {string} [idempotencyKey] Optional client-generated key that makes the submission idempotent. Retrying the same request with the same key within 24 hours returns the original response instead of creating a duplicate invoice.
46
47
  * @param {*} [options] Override http request option.
47
48
  * @throws {RequiredError}
48
49
  */
49
- sendFilePost: (file_1, validate_1, signature_1, ...args_1) => __awaiter(this, [file_1, validate_1, signature_1, ...args_1], void 0, function* (file, validate, signature, options = {}) {
50
+ sendFilePost: (file_1, validate_1, signature_1, idempotencyKey_1, ...args_1) => __awaiter(this, [file_1, validate_1, signature_1, idempotencyKey_1, ...args_1], void 0, function* (file, validate, signature, idempotencyKey, options = {}) {
50
51
  // verify required parameter 'file' is not null or undefined
51
52
  (0, common_1.assertParamExists)('sendFilePost', 'file', file);
52
53
  const localVarPath = `/send/file`;
@@ -74,6 +75,9 @@ const SendApiAxiosParamCreator = function (configuration) {
74
75
  }
75
76
  localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
76
77
  localVarHeaderParameter['Accept'] = 'application/json';
78
+ if (idempotencyKey != null) {
79
+ localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
80
+ }
77
81
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
78
82
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
79
83
  localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
@@ -84,7 +88,7 @@ const SendApiAxiosParamCreator = function (configuration) {
84
88
  };
85
89
  }),
86
90
  /**
87
- * Retrieve a paginated list of send invoices. Results can be filtered by various criteria such as company, date ranges, document number, and free-text search (`q`). Use `ids` to fetch specific Send records in a single call (comma-separated, up to 100). Returns invoice metadata; set `include_payload` to true to include the full invoice content. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/).
91
+ * Retrieve a paginated list of send invoices. Results can be filtered by various criteria such as company, date ranges, document number, current SDI state (`latest_state`), and free-text search (`q`). Use `ids` to fetch specific Send records in a single call (comma-separated, up to 100). Returns invoice metadata; set `include_payload` to true to include the full invoice content. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/).
88
92
  * @summary List invoices
89
93
  * @param {number} [companyId] Company id
90
94
  * @param {string} [identifier] SDI identifier.
@@ -98,6 +102,7 @@ const SendApiAxiosParamCreator = function (configuration) {
98
102
  * @param {string} [documentDateFrom] UTC ISO 8601 (2024-11-29T12:34:56Z)
99
103
  * @param {string} [documentDateTo] UTC ISO 8601 (2024-11-29T12:34:56Z)
100
104
  * @param {string} [documentNumber] Document number.
105
+ * @param {SendGetLatestStateEnum} [latestState] Filter by the most recent SDI state for the invoice. Matches the `latest_state` field exposed inline on each Send.
101
106
  * @param {boolean} [includePayload] Include payload in the response. Defaults to false.
102
107
  * @param {string} [ids] Comma-separated list of Send ids (max 100). Filters the collection to the matching rows; unknown or unauthorized ids are silently skipped.
103
108
  * @param {number} [page] Page number.
@@ -107,7 +112,7 @@ const SendApiAxiosParamCreator = function (configuration) {
107
112
  * @param {*} [options] Override http request option.
108
113
  * @throws {RequiredError}
109
114
  */
110
- sendGet: (companyId_1, identifier_1, committente_1, prestatore_1, fileName_1, lastUpdateFrom_1, lastUpdateTo_1, dateSentFrom_1, dateSentTo_1, documentDateFrom_1, documentDateTo_1, documentNumber_1, includePayload_1, ids_1, page_1, pageSize_1, sort_1, q_1, ...args_1) => __awaiter(this, [companyId_1, identifier_1, committente_1, prestatore_1, fileName_1, lastUpdateFrom_1, lastUpdateTo_1, dateSentFrom_1, dateSentTo_1, documentDateFrom_1, documentDateTo_1, documentNumber_1, includePayload_1, ids_1, page_1, pageSize_1, sort_1, q_1, ...args_1], void 0, function* (companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, includePayload, ids, page, pageSize, sort, q, options = {}) {
115
+ sendGet: (companyId_1, identifier_1, committente_1, prestatore_1, fileName_1, lastUpdateFrom_1, lastUpdateTo_1, dateSentFrom_1, dateSentTo_1, documentDateFrom_1, documentDateTo_1, documentNumber_1, latestState_1, includePayload_1, ids_1, page_1, pageSize_1, sort_1, q_1, ...args_1) => __awaiter(this, [companyId_1, identifier_1, committente_1, prestatore_1, fileName_1, lastUpdateFrom_1, lastUpdateTo_1, dateSentFrom_1, dateSentTo_1, documentDateFrom_1, documentDateTo_1, documentNumber_1, latestState_1, includePayload_1, ids_1, page_1, pageSize_1, sort_1, q_1, ...args_1], void 0, function* (companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, latestState, includePayload, ids, page, pageSize, sort, q, options = {}) {
111
116
  const localVarPath = `/send`;
112
117
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
113
118
  const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL);
@@ -169,6 +174,9 @@ const SendApiAxiosParamCreator = function (configuration) {
169
174
  if (documentNumber !== undefined) {
170
175
  localVarQueryParameter['document_number'] = documentNumber;
171
176
  }
177
+ if (latestState !== undefined) {
178
+ localVarQueryParameter['latest_state'] = latestState;
179
+ }
172
180
  if (includePayload !== undefined) {
173
181
  localVarQueryParameter['include_payload'] = includePayload;
174
182
  }
@@ -304,15 +312,16 @@ const SendApiAxiosParamCreator = function (configuration) {
304
312
  };
305
313
  }),
306
314
  /**
307
- * Add a new invoice using a FatturaPA JSON representation. The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com).
315
+ * Add a new invoice using a FatturaPA JSON representation. Property names mirror the FatturaPA XML schema (PascalCase, e.g. `FatturaElettronicaHeader`). The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com). ### Idempotency To protect against duplicate submissions caused by network retries, you can send an optional `Idempotency-Key` header with any unique, client-generated value (up to 255 characters). - The first request with a given key is processed normally, and its response (status, body and `Location`) is stored for 24 hours. - Any subsequent request that reuses the same key within that window replays the original response instead of sending a second invoice to SDI. - If a request with the same key is still being processed, the retry receives `409 Conflict`. - If the same key is reused with a **different** invoice payload, the request is rejected with `422 Unprocessable Entity`: a given key must always map to the same request. Keys are scoped per account, so different accounts can use the same key value without interfering. If the idempotency store is temporarily unavailable, the request is processed normally without idempotency protection.
308
316
  * @summary Add an invoice by json
309
317
  * @param {object} body
310
318
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
311
319
  * @param {SendJsonPostSignatureEnum} [signature] Whether to digitally sign the document.
320
+ * @param {string} [idempotencyKey] Optional client-generated key that makes the submission idempotent. Retrying the same request with the same key within 24 hours returns the original response instead of creating a duplicate invoice.
312
321
  * @param {*} [options] Override http request option.
313
322
  * @throws {RequiredError}
314
323
  */
315
- sendJsonPost: (body_1, validate_1, signature_1, ...args_1) => __awaiter(this, [body_1, validate_1, signature_1, ...args_1], void 0, function* (body, validate, signature, options = {}) {
324
+ sendJsonPost: (body_1, validate_1, signature_1, idempotencyKey_1, ...args_1) => __awaiter(this, [body_1, validate_1, signature_1, idempotencyKey_1, ...args_1], void 0, function* (body, validate, signature, idempotencyKey, options = {}) {
316
325
  // verify required parameter 'body' is not null or undefined
317
326
  (0, common_1.assertParamExists)('sendJsonPost', 'body', body);
318
327
  const localVarPath = `/send/json`;
@@ -336,6 +345,9 @@ const SendApiAxiosParamCreator = function (configuration) {
336
345
  }
337
346
  localVarHeaderParameter['Content-Type'] = 'application/json';
338
347
  localVarHeaderParameter['Accept'] = 'application/json';
348
+ if (idempotencyKey != null) {
349
+ localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
350
+ }
339
351
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
340
352
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
341
353
  localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
@@ -346,15 +358,16 @@ const SendApiAxiosParamCreator = function (configuration) {
346
358
  };
347
359
  }),
348
360
  /**
349
- * Add a new invoice using a structured Send object. The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com).
361
+ * Add a new invoice using a structured Send object. The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com). ### Idempotency To protect against duplicate submissions caused by network retries, you can send an optional `Idempotency-Key` header with any unique, client-generated value (up to 255 characters). - The first request with a given key is processed normally, and its response (status, body and `Location`) is stored for 24 hours. - Any subsequent request that reuses the same key within that window replays the original response instead of sending a second invoice to SDI. - If a request with the same key is still being processed, the retry receives `409 Conflict`. - If the same key is reused with a **different** invoice payload, the request is rejected with `422 Unprocessable Entity`: a given key must always map to the same request. Keys are scoped per account, so different accounts can use the same key value without interfering. If the idempotency store is temporarily unavailable, the request is processed normally without idempotency protection.
350
362
  * @summary Add an invoice
351
363
  * @param {Send} send
352
364
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
353
365
  * @param {SendPostSignatureEnum} [signature] Whether to digitally sign the document.
366
+ * @param {string} [idempotencyKey] Optional client-generated key that makes the submission idempotent. Retrying the same request with the same key within 24 hours returns the original response instead of creating a duplicate invoice.
354
367
  * @param {*} [options] Override http request option.
355
368
  * @throws {RequiredError}
356
369
  */
357
- sendPost: (send_1, validate_1, signature_1, ...args_1) => __awaiter(this, [send_1, validate_1, signature_1, ...args_1], void 0, function* (send, validate, signature, options = {}) {
370
+ sendPost: (send_1, validate_1, signature_1, idempotencyKey_1, ...args_1) => __awaiter(this, [send_1, validate_1, signature_1, idempotencyKey_1, ...args_1], void 0, function* (send, validate, signature, idempotencyKey, options = {}) {
358
371
  // verify required parameter 'send' is not null or undefined
359
372
  (0, common_1.assertParamExists)('sendPost', 'send', send);
360
373
  const localVarPath = `/send`;
@@ -378,6 +391,9 @@ const SendApiAxiosParamCreator = function (configuration) {
378
391
  }
379
392
  localVarHeaderParameter['Content-Type'] = 'application/json';
380
393
  localVarHeaderParameter['Accept'] = 'application/json';
394
+ if (idempotencyKey != null) {
395
+ localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
396
+ }
381
397
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
382
398
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
383
399
  localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
@@ -426,7 +442,7 @@ const SendApiAxiosParamCreator = function (configuration) {
426
442
  };
427
443
  }),
428
444
  /**
429
- * Validate a JSON invoice without sending it to SDI. Use this to check for errors before actual submission. Returns validation results with any errors found. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/).
445
+ * Validate a FatturaPA JSON invoice without sending it to SDI. Property names mirror the FatturaPA XML schema (PascalCase, e.g. `FatturaElettronicaHeader`). Use this to check for errors before actual submission. Returns validation results with any errors found. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/).
430
446
  * @summary Validate an invoice by json
431
447
  * @param {object} body
432
448
  * @param {*} [options] Override http request option.
@@ -528,15 +544,16 @@ const SendApiAxiosParamCreator = function (configuration) {
528
544
  };
529
545
  }),
530
546
  /**
531
- * Add a new invoice using a raw XML document in FatturaPA format. The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com).
547
+ * Add a new invoice using a raw XML document in FatturaPA format. The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com). ### Idempotency To protect against duplicate submissions caused by network retries, you can send an optional `Idempotency-Key` header with any unique, client-generated value (up to 255 characters). - The first request with a given key is processed normally, and its response (status, body and `Location`) is stored for 24 hours. - Any subsequent request that reuses the same key within that window replays the original response instead of sending a second invoice to SDI. - If a request with the same key is still being processed, the retry receives `409 Conflict`. - If the same key is reused with a **different** invoice payload, the request is rejected with `422 Unprocessable Entity`: a given key must always map to the same request. Keys are scoped per account, so different accounts can use the same key value without interfering. If the idempotency store is temporarily unavailable, the request is processed normally without idempotency protection.
532
548
  * @summary Add an invoice by xml
533
549
  * @param {object} body
534
550
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
535
551
  * @param {SendXmlPostSignatureEnum} [signature] Whether to digitally sign the document.
552
+ * @param {string} [idempotencyKey] Optional client-generated key that makes the submission idempotent. Retrying the same request with the same key within 24 hours returns the original response instead of creating a duplicate invoice.
536
553
  * @param {*} [options] Override http request option.
537
554
  * @throws {RequiredError}
538
555
  */
539
- sendXmlPost: (body_1, validate_1, signature_1, ...args_1) => __awaiter(this, [body_1, validate_1, signature_1, ...args_1], void 0, function* (body, validate, signature, options = {}) {
556
+ sendXmlPost: (body_1, validate_1, signature_1, idempotencyKey_1, ...args_1) => __awaiter(this, [body_1, validate_1, signature_1, idempotencyKey_1, ...args_1], void 0, function* (body, validate, signature, idempotencyKey, options = {}) {
540
557
  // verify required parameter 'body' is not null or undefined
541
558
  (0, common_1.assertParamExists)('sendXmlPost', 'body', body);
542
559
  const localVarPath = `/send/xml`;
@@ -560,6 +577,9 @@ const SendApiAxiosParamCreator = function (configuration) {
560
577
  }
561
578
  localVarHeaderParameter['Content-Type'] = 'application/xml';
562
579
  localVarHeaderParameter['Accept'] = 'application/json';
580
+ if (idempotencyKey != null) {
581
+ localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
582
+ }
563
583
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
564
584
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
565
585
  localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
@@ -579,25 +599,26 @@ const SendApiFp = function (configuration) {
579
599
  const localVarAxiosParamCreator = (0, exports.SendApiAxiosParamCreator)(configuration);
580
600
  return {
581
601
  /**
582
- * Add a new invoice by uploading a file. Supported formats are XML (FatturaPA) and P7M (signed). The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com).
602
+ * Add a new invoice by uploading a file. Supported formats are XML (FatturaPA) and P7M (signed). The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com). ### Idempotency To protect against duplicate submissions caused by network retries, you can send an optional `Idempotency-Key` header with any unique, client-generated value (up to 255 characters). - The first request with a given key is processed normally, and its response (status, body and `Location`) is stored for 24 hours. - Any subsequent request that reuses the same key within that window replays the original response instead of sending a second invoice to SDI. - If a request with the same key is still being processed, the retry receives `409 Conflict`. - If the same key is reused with a **different** invoice payload, the request is rejected with `422 Unprocessable Entity`: a given key must always map to the same request. Keys are scoped per account, so different accounts can use the same key value without interfering. If the idempotency store is temporarily unavailable, the request is processed normally without idempotency protection.
583
603
  * @summary Add an invoice by file
584
604
  * @param {File} file
585
605
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
586
606
  * @param {SendFilePostSignatureEnum} [signature] Whether to digitally sign the document.
607
+ * @param {string} [idempotencyKey] Optional client-generated key that makes the submission idempotent. Retrying the same request with the same key within 24 hours returns the original response instead of creating a duplicate invoice.
587
608
  * @param {*} [options] Override http request option.
588
609
  * @throws {RequiredError}
589
610
  */
590
- sendFilePost(file, validate, signature, options) {
611
+ sendFilePost(file, validate, signature, idempotencyKey, options) {
591
612
  return __awaiter(this, void 0, void 0, function* () {
592
613
  var _a, _b, _c;
593
- const localVarAxiosArgs = yield localVarAxiosParamCreator.sendFilePost(file, validate, signature, options);
614
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.sendFilePost(file, validate, signature, idempotencyKey, options);
594
615
  const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
595
616
  const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['SendApi.sendFilePost']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
596
617
  return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
597
618
  });
598
619
  },
599
620
  /**
600
- * Retrieve a paginated list of send invoices. Results can be filtered by various criteria such as company, date ranges, document number, and free-text search (`q`). Use `ids` to fetch specific Send records in a single call (comma-separated, up to 100). Returns invoice metadata; set `include_payload` to true to include the full invoice content. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/).
621
+ * Retrieve a paginated list of send invoices. Results can be filtered by various criteria such as company, date ranges, document number, current SDI state (`latest_state`), and free-text search (`q`). Use `ids` to fetch specific Send records in a single call (comma-separated, up to 100). Returns invoice metadata; set `include_payload` to true to include the full invoice content. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/).
601
622
  * @summary List invoices
602
623
  * @param {number} [companyId] Company id
603
624
  * @param {string} [identifier] SDI identifier.
@@ -611,6 +632,7 @@ const SendApiFp = function (configuration) {
611
632
  * @param {string} [documentDateFrom] UTC ISO 8601 (2024-11-29T12:34:56Z)
612
633
  * @param {string} [documentDateTo] UTC ISO 8601 (2024-11-29T12:34:56Z)
613
634
  * @param {string} [documentNumber] Document number.
635
+ * @param {SendGetLatestStateEnum} [latestState] Filter by the most recent SDI state for the invoice. Matches the `latest_state` field exposed inline on each Send.
614
636
  * @param {boolean} [includePayload] Include payload in the response. Defaults to false.
615
637
  * @param {string} [ids] Comma-separated list of Send ids (max 100). Filters the collection to the matching rows; unknown or unauthorized ids are silently skipped.
616
638
  * @param {number} [page] Page number.
@@ -620,10 +642,10 @@ const SendApiFp = function (configuration) {
620
642
  * @param {*} [options] Override http request option.
621
643
  * @throws {RequiredError}
622
644
  */
623
- sendGet(companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, includePayload, ids, page, pageSize, sort, q, options) {
645
+ sendGet(companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, latestState, includePayload, ids, page, pageSize, sort, q, options) {
624
646
  return __awaiter(this, void 0, void 0, function* () {
625
647
  var _a, _b, _c;
626
- const localVarAxiosArgs = yield localVarAxiosParamCreator.sendGet(companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, includePayload, ids, page, pageSize, sort, q, options);
648
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.sendGet(companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, latestState, includePayload, ids, page, pageSize, sort, q, options);
627
649
  const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
628
650
  const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['SendApi.sendGet']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
629
651
  return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
@@ -680,36 +702,38 @@ const SendApiFp = function (configuration) {
680
702
  });
681
703
  },
682
704
  /**
683
- * Add a new invoice using a FatturaPA JSON representation. The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com).
705
+ * Add a new invoice using a FatturaPA JSON representation. Property names mirror the FatturaPA XML schema (PascalCase, e.g. `FatturaElettronicaHeader`). The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com). ### Idempotency To protect against duplicate submissions caused by network retries, you can send an optional `Idempotency-Key` header with any unique, client-generated value (up to 255 characters). - The first request with a given key is processed normally, and its response (status, body and `Location`) is stored for 24 hours. - Any subsequent request that reuses the same key within that window replays the original response instead of sending a second invoice to SDI. - If a request with the same key is still being processed, the retry receives `409 Conflict`. - If the same key is reused with a **different** invoice payload, the request is rejected with `422 Unprocessable Entity`: a given key must always map to the same request. Keys are scoped per account, so different accounts can use the same key value without interfering. If the idempotency store is temporarily unavailable, the request is processed normally without idempotency protection.
684
706
  * @summary Add an invoice by json
685
707
  * @param {object} body
686
708
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
687
709
  * @param {SendJsonPostSignatureEnum} [signature] Whether to digitally sign the document.
710
+ * @param {string} [idempotencyKey] Optional client-generated key that makes the submission idempotent. Retrying the same request with the same key within 24 hours returns the original response instead of creating a duplicate invoice.
688
711
  * @param {*} [options] Override http request option.
689
712
  * @throws {RequiredError}
690
713
  */
691
- sendJsonPost(body, validate, signature, options) {
714
+ sendJsonPost(body, validate, signature, idempotencyKey, options) {
692
715
  return __awaiter(this, void 0, void 0, function* () {
693
716
  var _a, _b, _c;
694
- const localVarAxiosArgs = yield localVarAxiosParamCreator.sendJsonPost(body, validate, signature, options);
717
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.sendJsonPost(body, validate, signature, idempotencyKey, options);
695
718
  const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
696
719
  const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['SendApi.sendJsonPost']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
697
720
  return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
698
721
  });
699
722
  },
700
723
  /**
701
- * Add a new invoice using a structured Send object. The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com).
724
+ * Add a new invoice using a structured Send object. The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com). ### Idempotency To protect against duplicate submissions caused by network retries, you can send an optional `Idempotency-Key` header with any unique, client-generated value (up to 255 characters). - The first request with a given key is processed normally, and its response (status, body and `Location`) is stored for 24 hours. - Any subsequent request that reuses the same key within that window replays the original response instead of sending a second invoice to SDI. - If a request with the same key is still being processed, the retry receives `409 Conflict`. - If the same key is reused with a **different** invoice payload, the request is rejected with `422 Unprocessable Entity`: a given key must always map to the same request. Keys are scoped per account, so different accounts can use the same key value without interfering. If the idempotency store is temporarily unavailable, the request is processed normally without idempotency protection.
702
725
  * @summary Add an invoice
703
726
  * @param {Send} send
704
727
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
705
728
  * @param {SendPostSignatureEnum} [signature] Whether to digitally sign the document.
729
+ * @param {string} [idempotencyKey] Optional client-generated key that makes the submission idempotent. Retrying the same request with the same key within 24 hours returns the original response instead of creating a duplicate invoice.
706
730
  * @param {*} [options] Override http request option.
707
731
  * @throws {RequiredError}
708
732
  */
709
- sendPost(send, validate, signature, options) {
733
+ sendPost(send, validate, signature, idempotencyKey, options) {
710
734
  return __awaiter(this, void 0, void 0, function* () {
711
735
  var _a, _b, _c;
712
- const localVarAxiosArgs = yield localVarAxiosParamCreator.sendPost(send, validate, signature, options);
736
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.sendPost(send, validate, signature, idempotencyKey, options);
713
737
  const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
714
738
  const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['SendApi.sendPost']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
715
739
  return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
@@ -732,7 +756,7 @@ const SendApiFp = function (configuration) {
732
756
  });
733
757
  },
734
758
  /**
735
- * Validate a JSON invoice without sending it to SDI. Use this to check for errors before actual submission. Returns validation results with any errors found. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/).
759
+ * Validate a FatturaPA JSON invoice without sending it to SDI. Property names mirror the FatturaPA XML schema (PascalCase, e.g. `FatturaElettronicaHeader`). Use this to check for errors before actual submission. Returns validation results with any errors found. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/).
736
760
  * @summary Validate an invoice by json
737
761
  * @param {object} body
738
762
  * @param {*} [options] Override http request option.
@@ -780,18 +804,19 @@ const SendApiFp = function (configuration) {
780
804
  });
781
805
  },
782
806
  /**
783
- * Add a new invoice using a raw XML document in FatturaPA format. The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com).
807
+ * Add a new invoice using a raw XML document in FatturaPA format. The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com). ### Idempotency To protect against duplicate submissions caused by network retries, you can send an optional `Idempotency-Key` header with any unique, client-generated value (up to 255 characters). - The first request with a given key is processed normally, and its response (status, body and `Location`) is stored for 24 hours. - Any subsequent request that reuses the same key within that window replays the original response instead of sending a second invoice to SDI. - If a request with the same key is still being processed, the retry receives `409 Conflict`. - If the same key is reused with a **different** invoice payload, the request is rejected with `422 Unprocessable Entity`: a given key must always map to the same request. Keys are scoped per account, so different accounts can use the same key value without interfering. If the idempotency store is temporarily unavailable, the request is processed normally without idempotency protection.
784
808
  * @summary Add an invoice by xml
785
809
  * @param {object} body
786
810
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
787
811
  * @param {SendXmlPostSignatureEnum} [signature] Whether to digitally sign the document.
812
+ * @param {string} [idempotencyKey] Optional client-generated key that makes the submission idempotent. Retrying the same request with the same key within 24 hours returns the original response instead of creating a duplicate invoice.
788
813
  * @param {*} [options] Override http request option.
789
814
  * @throws {RequiredError}
790
815
  */
791
- sendXmlPost(body, validate, signature, options) {
816
+ sendXmlPost(body, validate, signature, idempotencyKey, options) {
792
817
  return __awaiter(this, void 0, void 0, function* () {
793
818
  var _a, _b, _c;
794
- const localVarAxiosArgs = yield localVarAxiosParamCreator.sendXmlPost(body, validate, signature, options);
819
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.sendXmlPost(body, validate, signature, idempotencyKey, options);
795
820
  const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
796
821
  const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['SendApi.sendXmlPost']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
797
822
  return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
@@ -807,19 +832,20 @@ const SendApiFactory = function (configuration, basePath, axios) {
807
832
  const localVarFp = (0, exports.SendApiFp)(configuration);
808
833
  return {
809
834
  /**
810
- * Add a new invoice by uploading a file. Supported formats are XML (FatturaPA) and P7M (signed). The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com).
835
+ * Add a new invoice by uploading a file. Supported formats are XML (FatturaPA) and P7M (signed). The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com). ### Idempotency To protect against duplicate submissions caused by network retries, you can send an optional `Idempotency-Key` header with any unique, client-generated value (up to 255 characters). - The first request with a given key is processed normally, and its response (status, body and `Location`) is stored for 24 hours. - Any subsequent request that reuses the same key within that window replays the original response instead of sending a second invoice to SDI. - If a request with the same key is still being processed, the retry receives `409 Conflict`. - If the same key is reused with a **different** invoice payload, the request is rejected with `422 Unprocessable Entity`: a given key must always map to the same request. Keys are scoped per account, so different accounts can use the same key value without interfering. If the idempotency store is temporarily unavailable, the request is processed normally without idempotency protection.
811
836
  * @summary Add an invoice by file
812
837
  * @param {File} file
813
838
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
814
839
  * @param {SendFilePostSignatureEnum} [signature] Whether to digitally sign the document.
840
+ * @param {string} [idempotencyKey] Optional client-generated key that makes the submission idempotent. Retrying the same request with the same key within 24 hours returns the original response instead of creating a duplicate invoice.
815
841
  * @param {*} [options] Override http request option.
816
842
  * @throws {RequiredError}
817
843
  */
818
- sendFilePost(file, validate, signature, options) {
819
- return localVarFp.sendFilePost(file, validate, signature, options).then((request) => request(axios, basePath));
844
+ sendFilePost(file, validate, signature, idempotencyKey, options) {
845
+ return localVarFp.sendFilePost(file, validate, signature, idempotencyKey, options).then((request) => request(axios, basePath));
820
846
  },
821
847
  /**
822
- * Retrieve a paginated list of send invoices. Results can be filtered by various criteria such as company, date ranges, document number, and free-text search (`q`). Use `ids` to fetch specific Send records in a single call (comma-separated, up to 100). Returns invoice metadata; set `include_payload` to true to include the full invoice content. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/).
848
+ * Retrieve a paginated list of send invoices. Results can be filtered by various criteria such as company, date ranges, document number, current SDI state (`latest_state`), and free-text search (`q`). Use `ids` to fetch specific Send records in a single call (comma-separated, up to 100). Returns invoice metadata; set `include_payload` to true to include the full invoice content. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/).
823
849
  * @summary List invoices
824
850
  * @param {number} [companyId] Company id
825
851
  * @param {string} [identifier] SDI identifier.
@@ -833,6 +859,7 @@ const SendApiFactory = function (configuration, basePath, axios) {
833
859
  * @param {string} [documentDateFrom] UTC ISO 8601 (2024-11-29T12:34:56Z)
834
860
  * @param {string} [documentDateTo] UTC ISO 8601 (2024-11-29T12:34:56Z)
835
861
  * @param {string} [documentNumber] Document number.
862
+ * @param {SendGetLatestStateEnum} [latestState] Filter by the most recent SDI state for the invoice. Matches the `latest_state` field exposed inline on each Send.
836
863
  * @param {boolean} [includePayload] Include payload in the response. Defaults to false.
837
864
  * @param {string} [ids] Comma-separated list of Send ids (max 100). Filters the collection to the matching rows; unknown or unauthorized ids are silently skipped.
838
865
  * @param {number} [page] Page number.
@@ -842,8 +869,8 @@ const SendApiFactory = function (configuration, basePath, axios) {
842
869
  * @param {*} [options] Override http request option.
843
870
  * @throws {RequiredError}
844
871
  */
845
- sendGet(companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, includePayload, ids, page, pageSize, sort, q, options) {
846
- return localVarFp.sendGet(companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, includePayload, ids, page, pageSize, sort, q, options).then((request) => request(axios, basePath));
872
+ sendGet(companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, latestState, includePayload, ids, page, pageSize, sort, q, options) {
873
+ return localVarFp.sendGet(companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, latestState, includePayload, ids, page, pageSize, sort, q, options).then((request) => request(axios, basePath));
847
874
  },
848
875
  /**
849
876
  * Retrieve a send invoice by its internal id. The `id` is unique and assigned by the system when the invoice is created. Returns invoice metadata; set `include_payload` to true to include the full invoice content. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/).
@@ -878,28 +905,30 @@ const SendApiFactory = function (configuration, basePath, axios) {
878
905
  return localVarFp.sendIdentifierGet(identifier, includePayload, options).then((request) => request(axios, basePath));
879
906
  },
880
907
  /**
881
- * Add a new invoice using a FatturaPA JSON representation. The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com).
908
+ * Add a new invoice using a FatturaPA JSON representation. Property names mirror the FatturaPA XML schema (PascalCase, e.g. `FatturaElettronicaHeader`). The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com). ### Idempotency To protect against duplicate submissions caused by network retries, you can send an optional `Idempotency-Key` header with any unique, client-generated value (up to 255 characters). - The first request with a given key is processed normally, and its response (status, body and `Location`) is stored for 24 hours. - Any subsequent request that reuses the same key within that window replays the original response instead of sending a second invoice to SDI. - If a request with the same key is still being processed, the retry receives `409 Conflict`. - If the same key is reused with a **different** invoice payload, the request is rejected with `422 Unprocessable Entity`: a given key must always map to the same request. Keys are scoped per account, so different accounts can use the same key value without interfering. If the idempotency store is temporarily unavailable, the request is processed normally without idempotency protection.
882
909
  * @summary Add an invoice by json
883
910
  * @param {object} body
884
911
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
885
912
  * @param {SendJsonPostSignatureEnum} [signature] Whether to digitally sign the document.
913
+ * @param {string} [idempotencyKey] Optional client-generated key that makes the submission idempotent. Retrying the same request with the same key within 24 hours returns the original response instead of creating a duplicate invoice.
886
914
  * @param {*} [options] Override http request option.
887
915
  * @throws {RequiredError}
888
916
  */
889
- sendJsonPost(body, validate, signature, options) {
890
- return localVarFp.sendJsonPost(body, validate, signature, options).then((request) => request(axios, basePath));
917
+ sendJsonPost(body, validate, signature, idempotencyKey, options) {
918
+ return localVarFp.sendJsonPost(body, validate, signature, idempotencyKey, options).then((request) => request(axios, basePath));
891
919
  },
892
920
  /**
893
- * Add a new invoice using a structured Send object. The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com).
921
+ * Add a new invoice using a structured Send object. The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com). ### Idempotency To protect against duplicate submissions caused by network retries, you can send an optional `Idempotency-Key` header with any unique, client-generated value (up to 255 characters). - The first request with a given key is processed normally, and its response (status, body and `Location`) is stored for 24 hours. - Any subsequent request that reuses the same key within that window replays the original response instead of sending a second invoice to SDI. - If a request with the same key is still being processed, the retry receives `409 Conflict`. - If the same key is reused with a **different** invoice payload, the request is rejected with `422 Unprocessable Entity`: a given key must always map to the same request. Keys are scoped per account, so different accounts can use the same key value without interfering. If the idempotency store is temporarily unavailable, the request is processed normally without idempotency protection.
894
922
  * @summary Add an invoice
895
923
  * @param {Send} send
896
924
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
897
925
  * @param {SendPostSignatureEnum} [signature] Whether to digitally sign the document.
926
+ * @param {string} [idempotencyKey] Optional client-generated key that makes the submission idempotent. Retrying the same request with the same key within 24 hours returns the original response instead of creating a duplicate invoice.
898
927
  * @param {*} [options] Override http request option.
899
928
  * @throws {RequiredError}
900
929
  */
901
- sendPost(send, validate, signature, options) {
902
- return localVarFp.sendPost(send, validate, signature, options).then((request) => request(axios, basePath));
930
+ sendPost(send, validate, signature, idempotencyKey, options) {
931
+ return localVarFp.sendPost(send, validate, signature, idempotencyKey, options).then((request) => request(axios, basePath));
903
932
  },
904
933
  /**
905
934
  * Validate an invoice file without sending it to SDI. Supported formats are XML (FatturaPA) and P7M (signed). Use this to check for errors before actual submission. Returns validation results with any errors found. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/).
@@ -912,7 +941,7 @@ const SendApiFactory = function (configuration, basePath, axios) {
912
941
  return localVarFp.sendValidateFilePost(file, options).then((request) => request(axios, basePath));
913
942
  },
914
943
  /**
915
- * Validate a JSON invoice without sending it to SDI. Use this to check for errors before actual submission. Returns validation results with any errors found. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/).
944
+ * Validate a FatturaPA JSON invoice without sending it to SDI. Property names mirror the FatturaPA XML schema (PascalCase, e.g. `FatturaElettronicaHeader`). Use this to check for errors before actual submission. Returns validation results with any errors found. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/).
916
945
  * @summary Validate an invoice by json
917
946
  * @param {object} body
918
947
  * @param {*} [options] Override http request option.
@@ -942,16 +971,17 @@ const SendApiFactory = function (configuration, basePath, axios) {
942
971
  return localVarFp.sendValidateXmlPost(body, options).then((request) => request(axios, basePath));
943
972
  },
944
973
  /**
945
- * Add a new invoice using a raw XML document in FatturaPA format. The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com).
974
+ * Add a new invoice using a raw XML document in FatturaPA format. The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com). ### Idempotency To protect against duplicate submissions caused by network retries, you can send an optional `Idempotency-Key` header with any unique, client-generated value (up to 255 characters). - The first request with a given key is processed normally, and its response (status, body and `Location`) is stored for 24 hours. - Any subsequent request that reuses the same key within that window replays the original response instead of sending a second invoice to SDI. - If a request with the same key is still being processed, the retry receives `409 Conflict`. - If the same key is reused with a **different** invoice payload, the request is rejected with `422 Unprocessable Entity`: a given key must always map to the same request. Keys are scoped per account, so different accounts can use the same key value without interfering. If the idempotency store is temporarily unavailable, the request is processed normally without idempotency protection.
946
975
  * @summary Add an invoice by xml
947
976
  * @param {object} body
948
977
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
949
978
  * @param {SendXmlPostSignatureEnum} [signature] Whether to digitally sign the document.
979
+ * @param {string} [idempotencyKey] Optional client-generated key that makes the submission idempotent. Retrying the same request with the same key within 24 hours returns the original response instead of creating a duplicate invoice.
950
980
  * @param {*} [options] Override http request option.
951
981
  * @throws {RequiredError}
952
982
  */
953
- sendXmlPost(body, validate, signature, options) {
954
- return localVarFp.sendXmlPost(body, validate, signature, options).then((request) => request(axios, basePath));
983
+ sendXmlPost(body, validate, signature, idempotencyKey, options) {
984
+ return localVarFp.sendXmlPost(body, validate, signature, idempotencyKey, options).then((request) => request(axios, basePath));
955
985
  },
956
986
  };
957
987
  };
@@ -961,19 +991,20 @@ exports.SendApiFactory = SendApiFactory;
961
991
  */
962
992
  class SendApi extends base_1.BaseAPI {
963
993
  /**
964
- * Add a new invoice by uploading a file. Supported formats are XML (FatturaPA) and P7M (signed). The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com).
994
+ * Add a new invoice by uploading a file. Supported formats are XML (FatturaPA) and P7M (signed). The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com). ### Idempotency To protect against duplicate submissions caused by network retries, you can send an optional `Idempotency-Key` header with any unique, client-generated value (up to 255 characters). - The first request with a given key is processed normally, and its response (status, body and `Location`) is stored for 24 hours. - Any subsequent request that reuses the same key within that window replays the original response instead of sending a second invoice to SDI. - If a request with the same key is still being processed, the retry receives `409 Conflict`. - If the same key is reused with a **different** invoice payload, the request is rejected with `422 Unprocessable Entity`: a given key must always map to the same request. Keys are scoped per account, so different accounts can use the same key value without interfering. If the idempotency store is temporarily unavailable, the request is processed normally without idempotency protection.
965
995
  * @summary Add an invoice by file
966
996
  * @param {File} file
967
997
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
968
998
  * @param {SendFilePostSignatureEnum} [signature] Whether to digitally sign the document.
999
+ * @param {string} [idempotencyKey] Optional client-generated key that makes the submission idempotent. Retrying the same request with the same key within 24 hours returns the original response instead of creating a duplicate invoice.
969
1000
  * @param {*} [options] Override http request option.
970
1001
  * @throws {RequiredError}
971
1002
  */
972
- sendFilePost(file, validate, signature, options) {
973
- return (0, exports.SendApiFp)(this.configuration).sendFilePost(file, validate, signature, options).then((request) => request(this.axios, this.basePath));
1003
+ sendFilePost(file, validate, signature, idempotencyKey, options) {
1004
+ return (0, exports.SendApiFp)(this.configuration).sendFilePost(file, validate, signature, idempotencyKey, options).then((request) => request(this.axios, this.basePath));
974
1005
  }
975
1006
  /**
976
- * Retrieve a paginated list of send invoices. Results can be filtered by various criteria such as company, date ranges, document number, and free-text search (`q`). Use `ids` to fetch specific Send records in a single call (comma-separated, up to 100). Returns invoice metadata; set `include_payload` to true to include the full invoice content. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/).
1007
+ * Retrieve a paginated list of send invoices. Results can be filtered by various criteria such as company, date ranges, document number, current SDI state (`latest_state`), and free-text search (`q`). Use `ids` to fetch specific Send records in a single call (comma-separated, up to 100). Returns invoice metadata; set `include_payload` to true to include the full invoice content. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/).
977
1008
  * @summary List invoices
978
1009
  * @param {number} [companyId] Company id
979
1010
  * @param {string} [identifier] SDI identifier.
@@ -987,6 +1018,7 @@ class SendApi extends base_1.BaseAPI {
987
1018
  * @param {string} [documentDateFrom] UTC ISO 8601 (2024-11-29T12:34:56Z)
988
1019
  * @param {string} [documentDateTo] UTC ISO 8601 (2024-11-29T12:34:56Z)
989
1020
  * @param {string} [documentNumber] Document number.
1021
+ * @param {SendGetLatestStateEnum} [latestState] Filter by the most recent SDI state for the invoice. Matches the `latest_state` field exposed inline on each Send.
990
1022
  * @param {boolean} [includePayload] Include payload in the response. Defaults to false.
991
1023
  * @param {string} [ids] Comma-separated list of Send ids (max 100). Filters the collection to the matching rows; unknown or unauthorized ids are silently skipped.
992
1024
  * @param {number} [page] Page number.
@@ -996,8 +1028,8 @@ class SendApi extends base_1.BaseAPI {
996
1028
  * @param {*} [options] Override http request option.
997
1029
  * @throws {RequiredError}
998
1030
  */
999
- sendGet(companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, includePayload, ids, page, pageSize, sort, q, options) {
1000
- return (0, exports.SendApiFp)(this.configuration).sendGet(companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, includePayload, ids, page, pageSize, sort, q, options).then((request) => request(this.axios, this.basePath));
1031
+ sendGet(companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, latestState, includePayload, ids, page, pageSize, sort, q, options) {
1032
+ return (0, exports.SendApiFp)(this.configuration).sendGet(companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, latestState, includePayload, ids, page, pageSize, sort, q, options).then((request) => request(this.axios, this.basePath));
1001
1033
  }
1002
1034
  /**
1003
1035
  * Retrieve a send invoice by its internal id. The `id` is unique and assigned by the system when the invoice is created. Returns invoice metadata; set `include_payload` to true to include the full invoice content. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/).
@@ -1032,28 +1064,30 @@ class SendApi extends base_1.BaseAPI {
1032
1064
  return (0, exports.SendApiFp)(this.configuration).sendIdentifierGet(identifier, includePayload, options).then((request) => request(this.axios, this.basePath));
1033
1065
  }
1034
1066
  /**
1035
- * Add a new invoice using a FatturaPA JSON representation. The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com).
1067
+ * Add a new invoice using a FatturaPA JSON representation. Property names mirror the FatturaPA XML schema (PascalCase, e.g. `FatturaElettronicaHeader`). The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com). ### Idempotency To protect against duplicate submissions caused by network retries, you can send an optional `Idempotency-Key` header with any unique, client-generated value (up to 255 characters). - The first request with a given key is processed normally, and its response (status, body and `Location`) is stored for 24 hours. - Any subsequent request that reuses the same key within that window replays the original response instead of sending a second invoice to SDI. - If a request with the same key is still being processed, the retry receives `409 Conflict`. - If the same key is reused with a **different** invoice payload, the request is rejected with `422 Unprocessable Entity`: a given key must always map to the same request. Keys are scoped per account, so different accounts can use the same key value without interfering. If the idempotency store is temporarily unavailable, the request is processed normally without idempotency protection.
1036
1068
  * @summary Add an invoice by json
1037
1069
  * @param {object} body
1038
1070
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
1039
1071
  * @param {SendJsonPostSignatureEnum} [signature] Whether to digitally sign the document.
1072
+ * @param {string} [idempotencyKey] Optional client-generated key that makes the submission idempotent. Retrying the same request with the same key within 24 hours returns the original response instead of creating a duplicate invoice.
1040
1073
  * @param {*} [options] Override http request option.
1041
1074
  * @throws {RequiredError}
1042
1075
  */
1043
- sendJsonPost(body, validate, signature, options) {
1044
- return (0, exports.SendApiFp)(this.configuration).sendJsonPost(body, validate, signature, options).then((request) => request(this.axios, this.basePath));
1076
+ sendJsonPost(body, validate, signature, idempotencyKey, options) {
1077
+ return (0, exports.SendApiFp)(this.configuration).sendJsonPost(body, validate, signature, idempotencyKey, options).then((request) => request(this.axios, this.basePath));
1045
1078
  }
1046
1079
  /**
1047
- * Add a new invoice using a structured Send object. The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com).
1080
+ * Add a new invoice using a structured Send object. The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com). ### Idempotency To protect against duplicate submissions caused by network retries, you can send an optional `Idempotency-Key` header with any unique, client-generated value (up to 255 characters). - The first request with a given key is processed normally, and its response (status, body and `Location`) is stored for 24 hours. - Any subsequent request that reuses the same key within that window replays the original response instead of sending a second invoice to SDI. - If a request with the same key is still being processed, the retry receives `409 Conflict`. - If the same key is reused with a **different** invoice payload, the request is rejected with `422 Unprocessable Entity`: a given key must always map to the same request. Keys are scoped per account, so different accounts can use the same key value without interfering. If the idempotency store is temporarily unavailable, the request is processed normally without idempotency protection.
1048
1081
  * @summary Add an invoice
1049
1082
  * @param {Send} send
1050
1083
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
1051
1084
  * @param {SendPostSignatureEnum} [signature] Whether to digitally sign the document.
1085
+ * @param {string} [idempotencyKey] Optional client-generated key that makes the submission idempotent. Retrying the same request with the same key within 24 hours returns the original response instead of creating a duplicate invoice.
1052
1086
  * @param {*} [options] Override http request option.
1053
1087
  * @throws {RequiredError}
1054
1088
  */
1055
- sendPost(send, validate, signature, options) {
1056
- return (0, exports.SendApiFp)(this.configuration).sendPost(send, validate, signature, options).then((request) => request(this.axios, this.basePath));
1089
+ sendPost(send, validate, signature, idempotencyKey, options) {
1090
+ return (0, exports.SendApiFp)(this.configuration).sendPost(send, validate, signature, idempotencyKey, options).then((request) => request(this.axios, this.basePath));
1057
1091
  }
1058
1092
  /**
1059
1093
  * Validate an invoice file without sending it to SDI. Supported formats are XML (FatturaPA) and P7M (signed). Use this to check for errors before actual submission. Returns validation results with any errors found. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/).
@@ -1066,7 +1100,7 @@ class SendApi extends base_1.BaseAPI {
1066
1100
  return (0, exports.SendApiFp)(this.configuration).sendValidateFilePost(file, options).then((request) => request(this.axios, this.basePath));
1067
1101
  }
1068
1102
  /**
1069
- * Validate a JSON invoice without sending it to SDI. Use this to check for errors before actual submission. Returns validation results with any errors found. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/).
1103
+ * Validate a FatturaPA JSON invoice without sending it to SDI. Property names mirror the FatturaPA XML schema (PascalCase, e.g. `FatturaElettronicaHeader`). Use this to check for errors before actual submission. Returns validation results with any errors found. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/).
1070
1104
  * @summary Validate an invoice by json
1071
1105
  * @param {object} body
1072
1106
  * @param {*} [options] Override http request option.
@@ -1096,16 +1130,17 @@ class SendApi extends base_1.BaseAPI {
1096
1130
  return (0, exports.SendApiFp)(this.configuration).sendValidateXmlPost(body, options).then((request) => request(this.axios, this.basePath));
1097
1131
  }
1098
1132
  /**
1099
- * Add a new invoice using a raw XML document in FatturaPA format. The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com).
1133
+ * Add a new invoice using a raw XML document in FatturaPA format. The invoice will be signed (if requested), validated (if requested), and queued for delivery to SDI. Status updates from SDI will be available in the `update` endpoint. **Send** invoices are outbound sales invoices transmitted to customers through Italy\'s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 15 days in the [Sandbox](https://invoicetronic.com/en/docs/sandbox/). You can also upload invoices via the [Dashboard](https://dashboard.invoicetronic.com). ### Idempotency To protect against duplicate submissions caused by network retries, you can send an optional `Idempotency-Key` header with any unique, client-generated value (up to 255 characters). - The first request with a given key is processed normally, and its response (status, body and `Location`) is stored for 24 hours. - Any subsequent request that reuses the same key within that window replays the original response instead of sending a second invoice to SDI. - If a request with the same key is still being processed, the retry receives `409 Conflict`. - If the same key is reused with a **different** invoice payload, the request is rejected with `422 Unprocessable Entity`: a given key must always map to the same request. Keys are scoped per account, so different accounts can use the same key value without interfering. If the idempotency store is temporarily unavailable, the request is processed normally without idempotency protection.
1100
1134
  * @summary Add an invoice by xml
1101
1135
  * @param {object} body
1102
1136
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
1103
1137
  * @param {SendXmlPostSignatureEnum} [signature] Whether to digitally sign the document.
1138
+ * @param {string} [idempotencyKey] Optional client-generated key that makes the submission idempotent. Retrying the same request with the same key within 24 hours returns the original response instead of creating a duplicate invoice.
1104
1139
  * @param {*} [options] Override http request option.
1105
1140
  * @throws {RequiredError}
1106
1141
  */
1107
- sendXmlPost(body, validate, signature, options) {
1108
- return (0, exports.SendApiFp)(this.configuration).sendXmlPost(body, validate, signature, options).then((request) => request(this.axios, this.basePath));
1142
+ sendXmlPost(body, validate, signature, idempotencyKey, options) {
1143
+ return (0, exports.SendApiFp)(this.configuration).sendXmlPost(body, validate, signature, idempotencyKey, options).then((request) => request(this.axios, this.basePath));
1109
1144
  }
1110
1145
  }
1111
1146
  exports.SendApi = SendApi;
@@ -1115,6 +1150,17 @@ exports.SendFilePostSignatureEnum = {
1115
1150
  Force: 'Force',
1116
1151
  Auto: 'Auto'
1117
1152
  };
1153
+ exports.SendGetLatestStateEnum = {
1154
+ Inviato: 'Inviato',
1155
+ Consegnato: 'Consegnato',
1156
+ NonConsegnato: 'NonConsegnato',
1157
+ Scartato: 'Scartato',
1158
+ AccettatoDalDestinatario: 'AccettatoDalDestinatario',
1159
+ RifiutatoDalDestinatario: 'RifiutatoDalDestinatario',
1160
+ ImpossibilitaDiRecapito: 'ImpossibilitaDiRecapito',
1161
+ DecorrenzaTermini: 'DecorrenzaTermini',
1162
+ AttestazioneTrasmissioneFattura: 'AttestazioneTrasmissioneFattura'
1163
+ };
1118
1164
  exports.SendJsonPostSignatureEnum = {
1119
1165
  None: 'None',
1120
1166
  Apply: 'Apply',