@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
@@ -2,9 +2,9 @@
2
2
  /* eslint-disable */
3
3
  /**
4
4
  * Invoicetronic API
5
- * 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/
5
+ * 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/
6
6
  *
7
- * The version of the OpenAPI document: 1.12.0
7
+ * The version of the OpenAPI document: 1.14.0
8
8
  * Contact: info@invoicetronic.com
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -35,15 +35,16 @@ import { BASE_PATH, BaseAPI, operationServerMap } from '../../base';
35
35
  export const SendApiAxiosParamCreator = function (configuration) {
36
36
  return {
37
37
  /**
38
- * 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).
38
+ * 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.
39
39
  * @summary Add an invoice by file
40
40
  * @param {File} file
41
41
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
42
42
  * @param {SendFilePostSignatureEnum} [signature] Whether to digitally sign the document.
43
+ * @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.
43
44
  * @param {*} [options] Override http request option.
44
45
  * @throws {RequiredError}
45
46
  */
46
- 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 = {}) {
47
+ 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 = {}) {
47
48
  // verify required parameter 'file' is not null or undefined
48
49
  assertParamExists('sendFilePost', 'file', file);
49
50
  const localVarPath = `/send/file`;
@@ -71,6 +72,9 @@ export const SendApiAxiosParamCreator = function (configuration) {
71
72
  }
72
73
  localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
73
74
  localVarHeaderParameter['Accept'] = 'application/json';
75
+ if (idempotencyKey != null) {
76
+ localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
77
+ }
74
78
  setSearchParams(localVarUrlObj, localVarQueryParameter);
75
79
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
76
80
  localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
@@ -81,7 +85,7 @@ export const SendApiAxiosParamCreator = function (configuration) {
81
85
  };
82
86
  }),
83
87
  /**
84
- * 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/).
88
+ * 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/).
85
89
  * @summary List invoices
86
90
  * @param {number} [companyId] Company id
87
91
  * @param {string} [identifier] SDI identifier.
@@ -95,6 +99,7 @@ export const SendApiAxiosParamCreator = function (configuration) {
95
99
  * @param {string} [documentDateFrom] UTC ISO 8601 (2024-11-29T12:34:56Z)
96
100
  * @param {string} [documentDateTo] UTC ISO 8601 (2024-11-29T12:34:56Z)
97
101
  * @param {string} [documentNumber] Document number.
102
+ * @param {SendGetLatestStateEnum} [latestState] Filter by the most recent SDI state for the invoice. Matches the `latest_state` field exposed inline on each Send.
98
103
  * @param {boolean} [includePayload] Include payload in the response. Defaults to false.
99
104
  * @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.
100
105
  * @param {number} [page] Page number.
@@ -104,7 +109,7 @@ export const SendApiAxiosParamCreator = function (configuration) {
104
109
  * @param {*} [options] Override http request option.
105
110
  * @throws {RequiredError}
106
111
  */
107
- 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 = {}) {
112
+ 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 = {}) {
108
113
  const localVarPath = `/send`;
109
114
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
110
115
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
@@ -166,6 +171,9 @@ export const SendApiAxiosParamCreator = function (configuration) {
166
171
  if (documentNumber !== undefined) {
167
172
  localVarQueryParameter['document_number'] = documentNumber;
168
173
  }
174
+ if (latestState !== undefined) {
175
+ localVarQueryParameter['latest_state'] = latestState;
176
+ }
169
177
  if (includePayload !== undefined) {
170
178
  localVarQueryParameter['include_payload'] = includePayload;
171
179
  }
@@ -301,15 +309,16 @@ export const SendApiAxiosParamCreator = function (configuration) {
301
309
  };
302
310
  }),
303
311
  /**
304
- * 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).
312
+ * 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.
305
313
  * @summary Add an invoice by json
306
314
  * @param {object} body
307
315
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
308
316
  * @param {SendJsonPostSignatureEnum} [signature] Whether to digitally sign the document.
317
+ * @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.
309
318
  * @param {*} [options] Override http request option.
310
319
  * @throws {RequiredError}
311
320
  */
312
- 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 = {}) {
321
+ 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 = {}) {
313
322
  // verify required parameter 'body' is not null or undefined
314
323
  assertParamExists('sendJsonPost', 'body', body);
315
324
  const localVarPath = `/send/json`;
@@ -333,6 +342,9 @@ export const SendApiAxiosParamCreator = function (configuration) {
333
342
  }
334
343
  localVarHeaderParameter['Content-Type'] = 'application/json';
335
344
  localVarHeaderParameter['Accept'] = 'application/json';
345
+ if (idempotencyKey != null) {
346
+ localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
347
+ }
336
348
  setSearchParams(localVarUrlObj, localVarQueryParameter);
337
349
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
338
350
  localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
@@ -343,15 +355,16 @@ export const SendApiAxiosParamCreator = function (configuration) {
343
355
  };
344
356
  }),
345
357
  /**
346
- * 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).
358
+ * 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.
347
359
  * @summary Add an invoice
348
360
  * @param {Send} send
349
361
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
350
362
  * @param {SendPostSignatureEnum} [signature] Whether to digitally sign the document.
363
+ * @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.
351
364
  * @param {*} [options] Override http request option.
352
365
  * @throws {RequiredError}
353
366
  */
354
- 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 = {}) {
367
+ 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 = {}) {
355
368
  // verify required parameter 'send' is not null or undefined
356
369
  assertParamExists('sendPost', 'send', send);
357
370
  const localVarPath = `/send`;
@@ -375,6 +388,9 @@ export const SendApiAxiosParamCreator = function (configuration) {
375
388
  }
376
389
  localVarHeaderParameter['Content-Type'] = 'application/json';
377
390
  localVarHeaderParameter['Accept'] = 'application/json';
391
+ if (idempotencyKey != null) {
392
+ localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
393
+ }
378
394
  setSearchParams(localVarUrlObj, localVarQueryParameter);
379
395
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
380
396
  localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
@@ -423,7 +439,7 @@ export const SendApiAxiosParamCreator = function (configuration) {
423
439
  };
424
440
  }),
425
441
  /**
426
- * 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/).
442
+ * 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/).
427
443
  * @summary Validate an invoice by json
428
444
  * @param {object} body
429
445
  * @param {*} [options] Override http request option.
@@ -525,15 +541,16 @@ export const SendApiAxiosParamCreator = function (configuration) {
525
541
  };
526
542
  }),
527
543
  /**
528
- * 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).
544
+ * 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.
529
545
  * @summary Add an invoice by xml
530
546
  * @param {object} body
531
547
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
532
548
  * @param {SendXmlPostSignatureEnum} [signature] Whether to digitally sign the document.
549
+ * @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.
533
550
  * @param {*} [options] Override http request option.
534
551
  * @throws {RequiredError}
535
552
  */
536
- 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 = {}) {
553
+ 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 = {}) {
537
554
  // verify required parameter 'body' is not null or undefined
538
555
  assertParamExists('sendXmlPost', 'body', body);
539
556
  const localVarPath = `/send/xml`;
@@ -557,6 +574,9 @@ export const SendApiAxiosParamCreator = function (configuration) {
557
574
  }
558
575
  localVarHeaderParameter['Content-Type'] = 'application/xml';
559
576
  localVarHeaderParameter['Accept'] = 'application/json';
577
+ if (idempotencyKey != null) {
578
+ localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
579
+ }
560
580
  setSearchParams(localVarUrlObj, localVarQueryParameter);
561
581
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
562
582
  localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
@@ -575,25 +595,26 @@ export const SendApiFp = function (configuration) {
575
595
  const localVarAxiosParamCreator = SendApiAxiosParamCreator(configuration);
576
596
  return {
577
597
  /**
578
- * 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).
598
+ * 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.
579
599
  * @summary Add an invoice by file
580
600
  * @param {File} file
581
601
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
582
602
  * @param {SendFilePostSignatureEnum} [signature] Whether to digitally sign the document.
603
+ * @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.
583
604
  * @param {*} [options] Override http request option.
584
605
  * @throws {RequiredError}
585
606
  */
586
- sendFilePost(file, validate, signature, options) {
607
+ sendFilePost(file, validate, signature, idempotencyKey, options) {
587
608
  return __awaiter(this, void 0, void 0, function* () {
588
609
  var _a, _b, _c;
589
- const localVarAxiosArgs = yield localVarAxiosParamCreator.sendFilePost(file, validate, signature, options);
610
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.sendFilePost(file, validate, signature, idempotencyKey, options);
590
611
  const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
591
612
  const localVarOperationServerBasePath = (_c = (_b = operationServerMap['SendApi.sendFilePost']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
592
613
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
593
614
  });
594
615
  },
595
616
  /**
596
- * 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/).
617
+ * 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/).
597
618
  * @summary List invoices
598
619
  * @param {number} [companyId] Company id
599
620
  * @param {string} [identifier] SDI identifier.
@@ -607,6 +628,7 @@ export const SendApiFp = function (configuration) {
607
628
  * @param {string} [documentDateFrom] UTC ISO 8601 (2024-11-29T12:34:56Z)
608
629
  * @param {string} [documentDateTo] UTC ISO 8601 (2024-11-29T12:34:56Z)
609
630
  * @param {string} [documentNumber] Document number.
631
+ * @param {SendGetLatestStateEnum} [latestState] Filter by the most recent SDI state for the invoice. Matches the `latest_state` field exposed inline on each Send.
610
632
  * @param {boolean} [includePayload] Include payload in the response. Defaults to false.
611
633
  * @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.
612
634
  * @param {number} [page] Page number.
@@ -616,10 +638,10 @@ export const SendApiFp = function (configuration) {
616
638
  * @param {*} [options] Override http request option.
617
639
  * @throws {RequiredError}
618
640
  */
619
- sendGet(companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, includePayload, ids, page, pageSize, sort, q, options) {
641
+ sendGet(companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, latestState, includePayload, ids, page, pageSize, sort, q, options) {
620
642
  return __awaiter(this, void 0, void 0, function* () {
621
643
  var _a, _b, _c;
622
- const localVarAxiosArgs = yield localVarAxiosParamCreator.sendGet(companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, includePayload, ids, page, pageSize, sort, q, options);
644
+ 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);
623
645
  const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
624
646
  const localVarOperationServerBasePath = (_c = (_b = operationServerMap['SendApi.sendGet']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
625
647
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
@@ -676,36 +698,38 @@ export const SendApiFp = function (configuration) {
676
698
  });
677
699
  },
678
700
  /**
679
- * 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).
701
+ * 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.
680
702
  * @summary Add an invoice by json
681
703
  * @param {object} body
682
704
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
683
705
  * @param {SendJsonPostSignatureEnum} [signature] Whether to digitally sign the document.
706
+ * @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.
684
707
  * @param {*} [options] Override http request option.
685
708
  * @throws {RequiredError}
686
709
  */
687
- sendJsonPost(body, validate, signature, options) {
710
+ sendJsonPost(body, validate, signature, idempotencyKey, options) {
688
711
  return __awaiter(this, void 0, void 0, function* () {
689
712
  var _a, _b, _c;
690
- const localVarAxiosArgs = yield localVarAxiosParamCreator.sendJsonPost(body, validate, signature, options);
713
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.sendJsonPost(body, validate, signature, idempotencyKey, options);
691
714
  const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
692
715
  const localVarOperationServerBasePath = (_c = (_b = operationServerMap['SendApi.sendJsonPost']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
693
716
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
694
717
  });
695
718
  },
696
719
  /**
697
- * 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).
720
+ * 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.
698
721
  * @summary Add an invoice
699
722
  * @param {Send} send
700
723
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
701
724
  * @param {SendPostSignatureEnum} [signature] Whether to digitally sign the document.
725
+ * @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.
702
726
  * @param {*} [options] Override http request option.
703
727
  * @throws {RequiredError}
704
728
  */
705
- sendPost(send, validate, signature, options) {
729
+ sendPost(send, validate, signature, idempotencyKey, options) {
706
730
  return __awaiter(this, void 0, void 0, function* () {
707
731
  var _a, _b, _c;
708
- const localVarAxiosArgs = yield localVarAxiosParamCreator.sendPost(send, validate, signature, options);
732
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.sendPost(send, validate, signature, idempotencyKey, options);
709
733
  const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
710
734
  const localVarOperationServerBasePath = (_c = (_b = operationServerMap['SendApi.sendPost']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
711
735
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
@@ -728,7 +752,7 @@ export const SendApiFp = function (configuration) {
728
752
  });
729
753
  },
730
754
  /**
731
- * 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/).
755
+ * 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/).
732
756
  * @summary Validate an invoice by json
733
757
  * @param {object} body
734
758
  * @param {*} [options] Override http request option.
@@ -776,18 +800,19 @@ export const SendApiFp = function (configuration) {
776
800
  });
777
801
  },
778
802
  /**
779
- * 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).
803
+ * 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.
780
804
  * @summary Add an invoice by xml
781
805
  * @param {object} body
782
806
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
783
807
  * @param {SendXmlPostSignatureEnum} [signature] Whether to digitally sign the document.
808
+ * @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.
784
809
  * @param {*} [options] Override http request option.
785
810
  * @throws {RequiredError}
786
811
  */
787
- sendXmlPost(body, validate, signature, options) {
812
+ sendXmlPost(body, validate, signature, idempotencyKey, options) {
788
813
  return __awaiter(this, void 0, void 0, function* () {
789
814
  var _a, _b, _c;
790
- const localVarAxiosArgs = yield localVarAxiosParamCreator.sendXmlPost(body, validate, signature, options);
815
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.sendXmlPost(body, validate, signature, idempotencyKey, options);
791
816
  const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
792
817
  const localVarOperationServerBasePath = (_c = (_b = operationServerMap['SendApi.sendXmlPost']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
793
818
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
@@ -802,19 +827,20 @@ export const SendApiFactory = function (configuration, basePath, axios) {
802
827
  const localVarFp = SendApiFp(configuration);
803
828
  return {
804
829
  /**
805
- * 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).
830
+ * 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.
806
831
  * @summary Add an invoice by file
807
832
  * @param {File} file
808
833
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
809
834
  * @param {SendFilePostSignatureEnum} [signature] Whether to digitally sign the document.
835
+ * @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.
810
836
  * @param {*} [options] Override http request option.
811
837
  * @throws {RequiredError}
812
838
  */
813
- sendFilePost(file, validate, signature, options) {
814
- return localVarFp.sendFilePost(file, validate, signature, options).then((request) => request(axios, basePath));
839
+ sendFilePost(file, validate, signature, idempotencyKey, options) {
840
+ return localVarFp.sendFilePost(file, validate, signature, idempotencyKey, options).then((request) => request(axios, basePath));
815
841
  },
816
842
  /**
817
- * 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/).
843
+ * 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/).
818
844
  * @summary List invoices
819
845
  * @param {number} [companyId] Company id
820
846
  * @param {string} [identifier] SDI identifier.
@@ -828,6 +854,7 @@ export const SendApiFactory = function (configuration, basePath, axios) {
828
854
  * @param {string} [documentDateFrom] UTC ISO 8601 (2024-11-29T12:34:56Z)
829
855
  * @param {string} [documentDateTo] UTC ISO 8601 (2024-11-29T12:34:56Z)
830
856
  * @param {string} [documentNumber] Document number.
857
+ * @param {SendGetLatestStateEnum} [latestState] Filter by the most recent SDI state for the invoice. Matches the `latest_state` field exposed inline on each Send.
831
858
  * @param {boolean} [includePayload] Include payload in the response. Defaults to false.
832
859
  * @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.
833
860
  * @param {number} [page] Page number.
@@ -837,8 +864,8 @@ export const SendApiFactory = function (configuration, basePath, axios) {
837
864
  * @param {*} [options] Override http request option.
838
865
  * @throws {RequiredError}
839
866
  */
840
- sendGet(companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, includePayload, ids, page, pageSize, sort, q, options) {
841
- 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));
867
+ sendGet(companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, latestState, includePayload, ids, page, pageSize, sort, q, options) {
868
+ 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));
842
869
  },
843
870
  /**
844
871
  * 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/).
@@ -873,28 +900,30 @@ export const SendApiFactory = function (configuration, basePath, axios) {
873
900
  return localVarFp.sendIdentifierGet(identifier, includePayload, options).then((request) => request(axios, basePath));
874
901
  },
875
902
  /**
876
- * 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).
903
+ * 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.
877
904
  * @summary Add an invoice by json
878
905
  * @param {object} body
879
906
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
880
907
  * @param {SendJsonPostSignatureEnum} [signature] Whether to digitally sign the document.
908
+ * @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.
881
909
  * @param {*} [options] Override http request option.
882
910
  * @throws {RequiredError}
883
911
  */
884
- sendJsonPost(body, validate, signature, options) {
885
- return localVarFp.sendJsonPost(body, validate, signature, options).then((request) => request(axios, basePath));
912
+ sendJsonPost(body, validate, signature, idempotencyKey, options) {
913
+ return localVarFp.sendJsonPost(body, validate, signature, idempotencyKey, options).then((request) => request(axios, basePath));
886
914
  },
887
915
  /**
888
- * 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).
916
+ * 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.
889
917
  * @summary Add an invoice
890
918
  * @param {Send} send
891
919
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
892
920
  * @param {SendPostSignatureEnum} [signature] Whether to digitally sign the document.
921
+ * @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.
893
922
  * @param {*} [options] Override http request option.
894
923
  * @throws {RequiredError}
895
924
  */
896
- sendPost(send, validate, signature, options) {
897
- return localVarFp.sendPost(send, validate, signature, options).then((request) => request(axios, basePath));
925
+ sendPost(send, validate, signature, idempotencyKey, options) {
926
+ return localVarFp.sendPost(send, validate, signature, idempotencyKey, options).then((request) => request(axios, basePath));
898
927
  },
899
928
  /**
900
929
  * 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/).
@@ -907,7 +936,7 @@ export const SendApiFactory = function (configuration, basePath, axios) {
907
936
  return localVarFp.sendValidateFilePost(file, options).then((request) => request(axios, basePath));
908
937
  },
909
938
  /**
910
- * 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/).
939
+ * 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/).
911
940
  * @summary Validate an invoice by json
912
941
  * @param {object} body
913
942
  * @param {*} [options] Override http request option.
@@ -937,16 +966,17 @@ export const SendApiFactory = function (configuration, basePath, axios) {
937
966
  return localVarFp.sendValidateXmlPost(body, options).then((request) => request(axios, basePath));
938
967
  },
939
968
  /**
940
- * 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).
969
+ * 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.
941
970
  * @summary Add an invoice by xml
942
971
  * @param {object} body
943
972
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
944
973
  * @param {SendXmlPostSignatureEnum} [signature] Whether to digitally sign the document.
974
+ * @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.
945
975
  * @param {*} [options] Override http request option.
946
976
  * @throws {RequiredError}
947
977
  */
948
- sendXmlPost(body, validate, signature, options) {
949
- return localVarFp.sendXmlPost(body, validate, signature, options).then((request) => request(axios, basePath));
978
+ sendXmlPost(body, validate, signature, idempotencyKey, options) {
979
+ return localVarFp.sendXmlPost(body, validate, signature, idempotencyKey, options).then((request) => request(axios, basePath));
950
980
  },
951
981
  };
952
982
  };
@@ -955,19 +985,20 @@ export const SendApiFactory = function (configuration, basePath, axios) {
955
985
  */
956
986
  export class SendApi extends BaseAPI {
957
987
  /**
958
- * 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).
988
+ * 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.
959
989
  * @summary Add an invoice by file
960
990
  * @param {File} file
961
991
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
962
992
  * @param {SendFilePostSignatureEnum} [signature] Whether to digitally sign the document.
993
+ * @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.
963
994
  * @param {*} [options] Override http request option.
964
995
  * @throws {RequiredError}
965
996
  */
966
- sendFilePost(file, validate, signature, options) {
967
- return SendApiFp(this.configuration).sendFilePost(file, validate, signature, options).then((request) => request(this.axios, this.basePath));
997
+ sendFilePost(file, validate, signature, idempotencyKey, options) {
998
+ return SendApiFp(this.configuration).sendFilePost(file, validate, signature, idempotencyKey, options).then((request) => request(this.axios, this.basePath));
968
999
  }
969
1000
  /**
970
- * 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/).
1001
+ * 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/).
971
1002
  * @summary List invoices
972
1003
  * @param {number} [companyId] Company id
973
1004
  * @param {string} [identifier] SDI identifier.
@@ -981,6 +1012,7 @@ export class SendApi extends BaseAPI {
981
1012
  * @param {string} [documentDateFrom] UTC ISO 8601 (2024-11-29T12:34:56Z)
982
1013
  * @param {string} [documentDateTo] UTC ISO 8601 (2024-11-29T12:34:56Z)
983
1014
  * @param {string} [documentNumber] Document number.
1015
+ * @param {SendGetLatestStateEnum} [latestState] Filter by the most recent SDI state for the invoice. Matches the `latest_state` field exposed inline on each Send.
984
1016
  * @param {boolean} [includePayload] Include payload in the response. Defaults to false.
985
1017
  * @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.
986
1018
  * @param {number} [page] Page number.
@@ -990,8 +1022,8 @@ export class SendApi extends BaseAPI {
990
1022
  * @param {*} [options] Override http request option.
991
1023
  * @throws {RequiredError}
992
1024
  */
993
- sendGet(companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, includePayload, ids, page, pageSize, sort, q, options) {
994
- return 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));
1025
+ sendGet(companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, latestState, includePayload, ids, page, pageSize, sort, q, options) {
1026
+ return 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));
995
1027
  }
996
1028
  /**
997
1029
  * 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/).
@@ -1026,28 +1058,30 @@ export class SendApi extends BaseAPI {
1026
1058
  return SendApiFp(this.configuration).sendIdentifierGet(identifier, includePayload, options).then((request) => request(this.axios, this.basePath));
1027
1059
  }
1028
1060
  /**
1029
- * 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).
1061
+ * 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.
1030
1062
  * @summary Add an invoice by json
1031
1063
  * @param {object} body
1032
1064
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
1033
1065
  * @param {SendJsonPostSignatureEnum} [signature] Whether to digitally sign the document.
1066
+ * @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.
1034
1067
  * @param {*} [options] Override http request option.
1035
1068
  * @throws {RequiredError}
1036
1069
  */
1037
- sendJsonPost(body, validate, signature, options) {
1038
- return SendApiFp(this.configuration).sendJsonPost(body, validate, signature, options).then((request) => request(this.axios, this.basePath));
1070
+ sendJsonPost(body, validate, signature, idempotencyKey, options) {
1071
+ return SendApiFp(this.configuration).sendJsonPost(body, validate, signature, idempotencyKey, options).then((request) => request(this.axios, this.basePath));
1039
1072
  }
1040
1073
  /**
1041
- * 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).
1074
+ * 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.
1042
1075
  * @summary Add an invoice
1043
1076
  * @param {Send} send
1044
1077
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
1045
1078
  * @param {SendPostSignatureEnum} [signature] Whether to digitally sign the document.
1079
+ * @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.
1046
1080
  * @param {*} [options] Override http request option.
1047
1081
  * @throws {RequiredError}
1048
1082
  */
1049
- sendPost(send, validate, signature, options) {
1050
- return SendApiFp(this.configuration).sendPost(send, validate, signature, options).then((request) => request(this.axios, this.basePath));
1083
+ sendPost(send, validate, signature, idempotencyKey, options) {
1084
+ return SendApiFp(this.configuration).sendPost(send, validate, signature, idempotencyKey, options).then((request) => request(this.axios, this.basePath));
1051
1085
  }
1052
1086
  /**
1053
1087
  * 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/).
@@ -1060,7 +1094,7 @@ export class SendApi extends BaseAPI {
1060
1094
  return SendApiFp(this.configuration).sendValidateFilePost(file, options).then((request) => request(this.axios, this.basePath));
1061
1095
  }
1062
1096
  /**
1063
- * 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/).
1097
+ * 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/).
1064
1098
  * @summary Validate an invoice by json
1065
1099
  * @param {object} body
1066
1100
  * @param {*} [options] Override http request option.
@@ -1090,16 +1124,17 @@ export class SendApi extends BaseAPI {
1090
1124
  return SendApiFp(this.configuration).sendValidateXmlPost(body, options).then((request) => request(this.axios, this.basePath));
1091
1125
  }
1092
1126
  /**
1093
- * 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).
1127
+ * 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.
1094
1128
  * @summary Add an invoice by xml
1095
1129
  * @param {object} body
1096
1130
  * @param {boolean} [validate] Validate the document first, and reject it on failure.
1097
1131
  * @param {SendXmlPostSignatureEnum} [signature] Whether to digitally sign the document.
1132
+ * @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.
1098
1133
  * @param {*} [options] Override http request option.
1099
1134
  * @throws {RequiredError}
1100
1135
  */
1101
- sendXmlPost(body, validate, signature, options) {
1102
- return SendApiFp(this.configuration).sendXmlPost(body, validate, signature, options).then((request) => request(this.axios, this.basePath));
1136
+ sendXmlPost(body, validate, signature, idempotencyKey, options) {
1137
+ return SendApiFp(this.configuration).sendXmlPost(body, validate, signature, idempotencyKey, options).then((request) => request(this.axios, this.basePath));
1103
1138
  }
1104
1139
  }
1105
1140
  export const SendFilePostSignatureEnum = {
@@ -1108,6 +1143,17 @@ export const SendFilePostSignatureEnum = {
1108
1143
  Force: 'Force',
1109
1144
  Auto: 'Auto'
1110
1145
  };
1146
+ export const SendGetLatestStateEnum = {
1147
+ Inviato: 'Inviato',
1148
+ Consegnato: 'Consegnato',
1149
+ NonConsegnato: 'NonConsegnato',
1150
+ Scartato: 'Scartato',
1151
+ AccettatoDalDestinatario: 'AccettatoDalDestinatario',
1152
+ RifiutatoDalDestinatario: 'RifiutatoDalDestinatario',
1153
+ ImpossibilitaDiRecapito: 'ImpossibilitaDiRecapito',
1154
+ DecorrenzaTermini: 'DecorrenzaTermini',
1155
+ AttestazioneTrasmissioneFattura: 'AttestazioneTrasmissioneFattura'
1156
+ };
1111
1157
  export const SendJsonPostSignatureEnum = {
1112
1158
  None: 'None',
1113
1159
  Apply: 'Apply',