@invoicetronic/ts-sdk 1.7.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.
- package/CHANGELOG.md +1 -1
- package/README.md +16 -2
- package/api.ts +2 -2
- package/base.ts +2 -2
- package/common.ts +2 -2
- package/configuration.ts +3 -3
- package/dist/api.d.ts +2 -2
- package/dist/api.js +2 -2
- package/dist/base.d.ts +2 -2
- package/dist/base.js +2 -2
- package/dist/common.d.ts +2 -2
- package/dist/common.js +2 -2
- package/dist/configuration.d.ts +2 -2
- package/dist/configuration.js +3 -3
- package/dist/esm/api.d.ts +2 -2
- package/dist/esm/api.js +2 -2
- package/dist/esm/base.d.ts +2 -2
- package/dist/esm/base.js +2 -2
- package/dist/esm/common.d.ts +2 -2
- package/dist/esm/common.js +2 -2
- package/dist/esm/configuration.d.ts +2 -2
- package/dist/esm/configuration.js +3 -3
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/src/api/company-api.d.ts +2 -2
- package/dist/esm/src/api/company-api.js +2 -2
- package/dist/esm/src/api/export-api.d.ts +2 -2
- package/dist/esm/src/api/export-api.js +2 -2
- package/dist/esm/src/api/health-api.d.ts +2 -2
- package/dist/esm/src/api/health-api.js +2 -2
- package/dist/esm/src/api/log-api.d.ts +2 -2
- package/dist/esm/src/api/log-api.js +2 -2
- package/dist/esm/src/api/receive-api.d.ts +17 -17
- package/dist/esm/src/api/receive-api.js +14 -14
- package/dist/esm/src/api/send-api.d.ts +99 -57
- package/dist/esm/src/api/send-api.js +114 -61
- package/dist/esm/src/api/status-api.d.ts +2 -2
- package/dist/esm/src/api/status-api.js +2 -2
- package/dist/esm/src/api/update-api.d.ts +2 -2
- package/dist/esm/src/api/update-api.js +2 -2
- package/dist/esm/src/api/webhook-api.d.ts +27 -27
- package/dist/esm/src/api/webhook-api.js +22 -22
- package/dist/esm/src/models/company.d.ts +4 -4
- package/dist/esm/src/models/company.js +2 -2
- package/dist/esm/src/models/document-data.d.ts +2 -2
- package/dist/esm/src/models/document-data.js +2 -2
- package/dist/esm/src/models/event.d.ts +3 -3
- package/dist/esm/src/models/event.js +2 -2
- package/dist/esm/src/models/model-error.d.ts +2 -2
- package/dist/esm/src/models/model-error.js +2 -2
- package/dist/esm/src/models/problem-details.d.ts +2 -2
- package/dist/esm/src/models/problem-details.js +2 -2
- package/dist/esm/src/models/receive.d.ts +6 -6
- package/dist/esm/src/models/receive.js +2 -2
- package/dist/esm/src/models/send-reduced.d.ts +18 -2
- package/dist/esm/src/models/send-reduced.js +13 -3
- package/dist/esm/src/models/send.d.ts +22 -6
- package/dist/esm/src/models/send.js +13 -2
- package/dist/esm/src/models/status.d.ts +10 -2
- package/dist/esm/src/models/status.js +2 -2
- package/dist/esm/src/models/update.d.ts +3 -3
- package/dist/esm/src/models/update.js +2 -2
- package/dist/esm/src/models/web-hook-history.d.ts +8 -4
- package/dist/esm/src/models/web-hook-history.js +2 -2
- package/dist/esm/src/models/web-hook.d.ts +9 -5
- package/dist/esm/src/models/web-hook.js +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/src/api/company-api.d.ts +2 -2
- package/dist/src/api/company-api.js +2 -2
- package/dist/src/api/export-api.d.ts +2 -2
- package/dist/src/api/export-api.js +2 -2
- package/dist/src/api/health-api.d.ts +2 -2
- package/dist/src/api/health-api.js +2 -2
- package/dist/src/api/log-api.d.ts +2 -2
- package/dist/src/api/log-api.js +2 -2
- package/dist/src/api/receive-api.d.ts +17 -17
- package/dist/src/api/receive-api.js +14 -14
- package/dist/src/api/send-api.d.ts +99 -57
- package/dist/src/api/send-api.js +115 -62
- package/dist/src/api/status-api.d.ts +2 -2
- package/dist/src/api/status-api.js +2 -2
- package/dist/src/api/update-api.d.ts +2 -2
- package/dist/src/api/update-api.js +2 -2
- package/dist/src/api/webhook-api.d.ts +27 -27
- package/dist/src/api/webhook-api.js +22 -22
- package/dist/src/models/company.d.ts +4 -4
- package/dist/src/models/company.js +2 -2
- package/dist/src/models/document-data.d.ts +2 -2
- package/dist/src/models/document-data.js +2 -2
- package/dist/src/models/event.d.ts +3 -3
- package/dist/src/models/event.js +2 -2
- package/dist/src/models/model-error.d.ts +2 -2
- package/dist/src/models/model-error.js +2 -2
- package/dist/src/models/problem-details.d.ts +2 -2
- package/dist/src/models/problem-details.js +2 -2
- package/dist/src/models/receive.d.ts +6 -6
- package/dist/src/models/receive.js +2 -2
- package/dist/src/models/send-reduced.d.ts +18 -2
- package/dist/src/models/send-reduced.js +14 -2
- package/dist/src/models/send.d.ts +22 -6
- package/dist/src/models/send.js +14 -3
- package/dist/src/models/status.d.ts +10 -2
- package/dist/src/models/status.js +2 -2
- package/dist/src/models/update.d.ts +3 -3
- package/dist/src/models/update.js +2 -2
- package/dist/src/models/web-hook-history.d.ts +8 -4
- package/dist/src/models/web-hook-history.js +2 -2
- package/dist/src/models/web-hook.d.ts +9 -5
- package/dist/src/models/web-hook.js +2 -2
- package/docs/Company.md +4 -4
- package/docs/Event.md +3 -3
- package/docs/Receive.md +12 -12
- package/docs/ReceiveApi.md +3 -3
- package/docs/Send.md +15 -13
- package/docs/SendApi.md +28 -10
- package/docs/SendReduced.md +2 -0
- package/docs/Status.md +4 -0
- package/docs/Update.md +3 -3
- package/docs/WebHook.md +7 -5
- package/docs/WebHookHistory.md +6 -4
- package/docs/WebhookApi.md +5 -5
- package/index.ts +2 -2
- package/package.json +1 -1
- package/src/api/company-api.ts +2 -2
- package/src/api/export-api.ts +2 -2
- package/src/api/health-api.ts +2 -2
- package/src/api/log-api.ts +2 -2
- package/src/api/receive-api.ts +17 -17
- package/src/api/send-api.ts +134 -72
- package/src/api/status-api.ts +2 -2
- package/src/api/update-api.ts +2 -2
- package/src/api/webhook-api.ts +27 -27
- package/src/models/company.ts +4 -4
- package/src/models/document-data.ts +2 -2
- package/src/models/event.ts +3 -3
- package/src/models/model-error.ts +2 -2
- package/src/models/problem-details.ts +2 -2
- package/src/models/receive.ts +6 -6
- package/src/models/send-reduced.ts +21 -2
- package/src/models/send.ts +23 -6
- package/src/models/status.ts +10 -2
- package/src/models/update.ts +3 -3
- package/src/models/web-hook-history.ts +8 -4
- package/src/models/web-hook.ts +9 -5
|
@@ -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.
|
|
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`). 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,7 +99,9 @@ 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.
|
|
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.
|
|
99
105
|
* @param {number} [page] Page number.
|
|
100
106
|
* @param {number} [pageSize] Items per page. Cannot be greater than 200.
|
|
101
107
|
* @param {string} [sort] Sort by field. Prefix with \'-\' for descending order.
|
|
@@ -103,7 +109,7 @@ export const SendApiAxiosParamCreator = function (configuration) {
|
|
|
103
109
|
* @param {*} [options] Override http request option.
|
|
104
110
|
* @throws {RequiredError}
|
|
105
111
|
*/
|
|
106
|
-
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, 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, 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, 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 = {}) {
|
|
107
113
|
const localVarPath = `/send`;
|
|
108
114
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
109
115
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
@@ -165,9 +171,15 @@ export const SendApiAxiosParamCreator = function (configuration) {
|
|
|
165
171
|
if (documentNumber !== undefined) {
|
|
166
172
|
localVarQueryParameter['document_number'] = documentNumber;
|
|
167
173
|
}
|
|
174
|
+
if (latestState !== undefined) {
|
|
175
|
+
localVarQueryParameter['latest_state'] = latestState;
|
|
176
|
+
}
|
|
168
177
|
if (includePayload !== undefined) {
|
|
169
178
|
localVarQueryParameter['include_payload'] = includePayload;
|
|
170
179
|
}
|
|
180
|
+
if (ids !== undefined) {
|
|
181
|
+
localVarQueryParameter['ids'] = ids;
|
|
182
|
+
}
|
|
171
183
|
if (page !== undefined) {
|
|
172
184
|
localVarQueryParameter['page'] = page;
|
|
173
185
|
}
|
|
@@ -297,15 +309,16 @@ export const SendApiAxiosParamCreator = function (configuration) {
|
|
|
297
309
|
};
|
|
298
310
|
}),
|
|
299
311
|
/**
|
|
300
|
-
* 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.
|
|
301
313
|
* @summary Add an invoice by json
|
|
302
314
|
* @param {object} body
|
|
303
315
|
* @param {boolean} [validate] Validate the document first, and reject it on failure.
|
|
304
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.
|
|
305
318
|
* @param {*} [options] Override http request option.
|
|
306
319
|
* @throws {RequiredError}
|
|
307
320
|
*/
|
|
308
|
-
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 = {}) {
|
|
309
322
|
// verify required parameter 'body' is not null or undefined
|
|
310
323
|
assertParamExists('sendJsonPost', 'body', body);
|
|
311
324
|
const localVarPath = `/send/json`;
|
|
@@ -329,6 +342,9 @@ export const SendApiAxiosParamCreator = function (configuration) {
|
|
|
329
342
|
}
|
|
330
343
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
331
344
|
localVarHeaderParameter['Accept'] = 'application/json';
|
|
345
|
+
if (idempotencyKey != null) {
|
|
346
|
+
localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
|
|
347
|
+
}
|
|
332
348
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
333
349
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
334
350
|
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
@@ -339,15 +355,16 @@ export const SendApiAxiosParamCreator = function (configuration) {
|
|
|
339
355
|
};
|
|
340
356
|
}),
|
|
341
357
|
/**
|
|
342
|
-
* 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.
|
|
343
359
|
* @summary Add an invoice
|
|
344
360
|
* @param {Send} send
|
|
345
361
|
* @param {boolean} [validate] Validate the document first, and reject it on failure.
|
|
346
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.
|
|
347
364
|
* @param {*} [options] Override http request option.
|
|
348
365
|
* @throws {RequiredError}
|
|
349
366
|
*/
|
|
350
|
-
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 = {}) {
|
|
351
368
|
// verify required parameter 'send' is not null or undefined
|
|
352
369
|
assertParamExists('sendPost', 'send', send);
|
|
353
370
|
const localVarPath = `/send`;
|
|
@@ -371,6 +388,9 @@ export const SendApiAxiosParamCreator = function (configuration) {
|
|
|
371
388
|
}
|
|
372
389
|
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
373
390
|
localVarHeaderParameter['Accept'] = 'application/json';
|
|
391
|
+
if (idempotencyKey != null) {
|
|
392
|
+
localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
|
|
393
|
+
}
|
|
374
394
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
375
395
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
376
396
|
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
@@ -419,7 +439,7 @@ export const SendApiAxiosParamCreator = function (configuration) {
|
|
|
419
439
|
};
|
|
420
440
|
}),
|
|
421
441
|
/**
|
|
422
|
-
* 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/).
|
|
423
443
|
* @summary Validate an invoice by json
|
|
424
444
|
* @param {object} body
|
|
425
445
|
* @param {*} [options] Override http request option.
|
|
@@ -521,15 +541,16 @@ export const SendApiAxiosParamCreator = function (configuration) {
|
|
|
521
541
|
};
|
|
522
542
|
}),
|
|
523
543
|
/**
|
|
524
|
-
* 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.
|
|
525
545
|
* @summary Add an invoice by xml
|
|
526
546
|
* @param {object} body
|
|
527
547
|
* @param {boolean} [validate] Validate the document first, and reject it on failure.
|
|
528
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.
|
|
529
550
|
* @param {*} [options] Override http request option.
|
|
530
551
|
* @throws {RequiredError}
|
|
531
552
|
*/
|
|
532
|
-
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 = {}) {
|
|
533
554
|
// verify required parameter 'body' is not null or undefined
|
|
534
555
|
assertParamExists('sendXmlPost', 'body', body);
|
|
535
556
|
const localVarPath = `/send/xml`;
|
|
@@ -553,6 +574,9 @@ export const SendApiAxiosParamCreator = function (configuration) {
|
|
|
553
574
|
}
|
|
554
575
|
localVarHeaderParameter['Content-Type'] = 'application/xml';
|
|
555
576
|
localVarHeaderParameter['Accept'] = 'application/json';
|
|
577
|
+
if (idempotencyKey != null) {
|
|
578
|
+
localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey);
|
|
579
|
+
}
|
|
556
580
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
557
581
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
558
582
|
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
@@ -571,25 +595,26 @@ export const SendApiFp = function (configuration) {
|
|
|
571
595
|
const localVarAxiosParamCreator = SendApiAxiosParamCreator(configuration);
|
|
572
596
|
return {
|
|
573
597
|
/**
|
|
574
|
-
* 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.
|
|
575
599
|
* @summary Add an invoice by file
|
|
576
600
|
* @param {File} file
|
|
577
601
|
* @param {boolean} [validate] Validate the document first, and reject it on failure.
|
|
578
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.
|
|
579
604
|
* @param {*} [options] Override http request option.
|
|
580
605
|
* @throws {RequiredError}
|
|
581
606
|
*/
|
|
582
|
-
sendFilePost(file, validate, signature, options) {
|
|
607
|
+
sendFilePost(file, validate, signature, idempotencyKey, options) {
|
|
583
608
|
return __awaiter(this, void 0, void 0, function* () {
|
|
584
609
|
var _a, _b, _c;
|
|
585
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.sendFilePost(file, validate, signature, options);
|
|
610
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.sendFilePost(file, validate, signature, idempotencyKey, options);
|
|
586
611
|
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
587
612
|
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['SendApi.sendFilePost']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
588
613
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
589
614
|
});
|
|
590
615
|
},
|
|
591
616
|
/**
|
|
592
|
-
* 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`). 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/).
|
|
593
618
|
* @summary List invoices
|
|
594
619
|
* @param {number} [companyId] Company id
|
|
595
620
|
* @param {string} [identifier] SDI identifier.
|
|
@@ -603,7 +628,9 @@ export const SendApiFp = function (configuration) {
|
|
|
603
628
|
* @param {string} [documentDateFrom] UTC ISO 8601 (2024-11-29T12:34:56Z)
|
|
604
629
|
* @param {string} [documentDateTo] UTC ISO 8601 (2024-11-29T12:34:56Z)
|
|
605
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.
|
|
606
632
|
* @param {boolean} [includePayload] Include payload in the response. Defaults to false.
|
|
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.
|
|
607
634
|
* @param {number} [page] Page number.
|
|
608
635
|
* @param {number} [pageSize] Items per page. Cannot be greater than 200.
|
|
609
636
|
* @param {string} [sort] Sort by field. Prefix with \'-\' for descending order.
|
|
@@ -611,10 +638,10 @@ export const SendApiFp = function (configuration) {
|
|
|
611
638
|
* @param {*} [options] Override http request option.
|
|
612
639
|
* @throws {RequiredError}
|
|
613
640
|
*/
|
|
614
|
-
sendGet(companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, includePayload, 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) {
|
|
615
642
|
return __awaiter(this, void 0, void 0, function* () {
|
|
616
643
|
var _a, _b, _c;
|
|
617
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.sendGet(companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, includePayload, 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);
|
|
618
645
|
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
619
646
|
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['SendApi.sendGet']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
620
647
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
@@ -671,36 +698,38 @@ export const SendApiFp = function (configuration) {
|
|
|
671
698
|
});
|
|
672
699
|
},
|
|
673
700
|
/**
|
|
674
|
-
* 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.
|
|
675
702
|
* @summary Add an invoice by json
|
|
676
703
|
* @param {object} body
|
|
677
704
|
* @param {boolean} [validate] Validate the document first, and reject it on failure.
|
|
678
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.
|
|
679
707
|
* @param {*} [options] Override http request option.
|
|
680
708
|
* @throws {RequiredError}
|
|
681
709
|
*/
|
|
682
|
-
sendJsonPost(body, validate, signature, options) {
|
|
710
|
+
sendJsonPost(body, validate, signature, idempotencyKey, options) {
|
|
683
711
|
return __awaiter(this, void 0, void 0, function* () {
|
|
684
712
|
var _a, _b, _c;
|
|
685
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.sendJsonPost(body, validate, signature, options);
|
|
713
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.sendJsonPost(body, validate, signature, idempotencyKey, options);
|
|
686
714
|
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
687
715
|
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['SendApi.sendJsonPost']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
688
716
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
689
717
|
});
|
|
690
718
|
},
|
|
691
719
|
/**
|
|
692
|
-
* 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.
|
|
693
721
|
* @summary Add an invoice
|
|
694
722
|
* @param {Send} send
|
|
695
723
|
* @param {boolean} [validate] Validate the document first, and reject it on failure.
|
|
696
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.
|
|
697
726
|
* @param {*} [options] Override http request option.
|
|
698
727
|
* @throws {RequiredError}
|
|
699
728
|
*/
|
|
700
|
-
sendPost(send, validate, signature, options) {
|
|
729
|
+
sendPost(send, validate, signature, idempotencyKey, options) {
|
|
701
730
|
return __awaiter(this, void 0, void 0, function* () {
|
|
702
731
|
var _a, _b, _c;
|
|
703
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.sendPost(send, validate, signature, options);
|
|
732
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.sendPost(send, validate, signature, idempotencyKey, options);
|
|
704
733
|
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
705
734
|
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['SendApi.sendPost']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
706
735
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
@@ -723,7 +752,7 @@ export const SendApiFp = function (configuration) {
|
|
|
723
752
|
});
|
|
724
753
|
},
|
|
725
754
|
/**
|
|
726
|
-
* 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/).
|
|
727
756
|
* @summary Validate an invoice by json
|
|
728
757
|
* @param {object} body
|
|
729
758
|
* @param {*} [options] Override http request option.
|
|
@@ -771,18 +800,19 @@ export const SendApiFp = function (configuration) {
|
|
|
771
800
|
});
|
|
772
801
|
},
|
|
773
802
|
/**
|
|
774
|
-
* 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.
|
|
775
804
|
* @summary Add an invoice by xml
|
|
776
805
|
* @param {object} body
|
|
777
806
|
* @param {boolean} [validate] Validate the document first, and reject it on failure.
|
|
778
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.
|
|
779
809
|
* @param {*} [options] Override http request option.
|
|
780
810
|
* @throws {RequiredError}
|
|
781
811
|
*/
|
|
782
|
-
sendXmlPost(body, validate, signature, options) {
|
|
812
|
+
sendXmlPost(body, validate, signature, idempotencyKey, options) {
|
|
783
813
|
return __awaiter(this, void 0, void 0, function* () {
|
|
784
814
|
var _a, _b, _c;
|
|
785
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.sendXmlPost(body, validate, signature, options);
|
|
815
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.sendXmlPost(body, validate, signature, idempotencyKey, options);
|
|
786
816
|
const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
|
|
787
817
|
const localVarOperationServerBasePath = (_c = (_b = operationServerMap['SendApi.sendXmlPost']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
|
|
788
818
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
@@ -797,19 +827,20 @@ export const SendApiFactory = function (configuration, basePath, axios) {
|
|
|
797
827
|
const localVarFp = SendApiFp(configuration);
|
|
798
828
|
return {
|
|
799
829
|
/**
|
|
800
|
-
* 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.
|
|
801
831
|
* @summary Add an invoice by file
|
|
802
832
|
* @param {File} file
|
|
803
833
|
* @param {boolean} [validate] Validate the document first, and reject it on failure.
|
|
804
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.
|
|
805
836
|
* @param {*} [options] Override http request option.
|
|
806
837
|
* @throws {RequiredError}
|
|
807
838
|
*/
|
|
808
|
-
sendFilePost(file, validate, signature, options) {
|
|
809
|
-
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));
|
|
810
841
|
},
|
|
811
842
|
/**
|
|
812
|
-
* 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`). 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/).
|
|
813
844
|
* @summary List invoices
|
|
814
845
|
* @param {number} [companyId] Company id
|
|
815
846
|
* @param {string} [identifier] SDI identifier.
|
|
@@ -823,7 +854,9 @@ export const SendApiFactory = function (configuration, basePath, axios) {
|
|
|
823
854
|
* @param {string} [documentDateFrom] UTC ISO 8601 (2024-11-29T12:34:56Z)
|
|
824
855
|
* @param {string} [documentDateTo] UTC ISO 8601 (2024-11-29T12:34:56Z)
|
|
825
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.
|
|
826
858
|
* @param {boolean} [includePayload] Include payload in the response. Defaults to false.
|
|
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.
|
|
827
860
|
* @param {number} [page] Page number.
|
|
828
861
|
* @param {number} [pageSize] Items per page. Cannot be greater than 200.
|
|
829
862
|
* @param {string} [sort] Sort by field. Prefix with \'-\' for descending order.
|
|
@@ -831,8 +864,8 @@ export const SendApiFactory = function (configuration, basePath, axios) {
|
|
|
831
864
|
* @param {*} [options] Override http request option.
|
|
832
865
|
* @throws {RequiredError}
|
|
833
866
|
*/
|
|
834
|
-
sendGet(companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, includePayload, page, pageSize, sort, q, options) {
|
|
835
|
-
return localVarFp.sendGet(companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, includePayload, 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));
|
|
836
869
|
},
|
|
837
870
|
/**
|
|
838
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/).
|
|
@@ -867,28 +900,30 @@ export const SendApiFactory = function (configuration, basePath, axios) {
|
|
|
867
900
|
return localVarFp.sendIdentifierGet(identifier, includePayload, options).then((request) => request(axios, basePath));
|
|
868
901
|
},
|
|
869
902
|
/**
|
|
870
|
-
* 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.
|
|
871
904
|
* @summary Add an invoice by json
|
|
872
905
|
* @param {object} body
|
|
873
906
|
* @param {boolean} [validate] Validate the document first, and reject it on failure.
|
|
874
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.
|
|
875
909
|
* @param {*} [options] Override http request option.
|
|
876
910
|
* @throws {RequiredError}
|
|
877
911
|
*/
|
|
878
|
-
sendJsonPost(body, validate, signature, options) {
|
|
879
|
-
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));
|
|
880
914
|
},
|
|
881
915
|
/**
|
|
882
|
-
* 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.
|
|
883
917
|
* @summary Add an invoice
|
|
884
918
|
* @param {Send} send
|
|
885
919
|
* @param {boolean} [validate] Validate the document first, and reject it on failure.
|
|
886
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.
|
|
887
922
|
* @param {*} [options] Override http request option.
|
|
888
923
|
* @throws {RequiredError}
|
|
889
924
|
*/
|
|
890
|
-
sendPost(send, validate, signature, options) {
|
|
891
|
-
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));
|
|
892
927
|
},
|
|
893
928
|
/**
|
|
894
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/).
|
|
@@ -901,7 +936,7 @@ export const SendApiFactory = function (configuration, basePath, axios) {
|
|
|
901
936
|
return localVarFp.sendValidateFilePost(file, options).then((request) => request(axios, basePath));
|
|
902
937
|
},
|
|
903
938
|
/**
|
|
904
|
-
* 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/).
|
|
905
940
|
* @summary Validate an invoice by json
|
|
906
941
|
* @param {object} body
|
|
907
942
|
* @param {*} [options] Override http request option.
|
|
@@ -931,16 +966,17 @@ export const SendApiFactory = function (configuration, basePath, axios) {
|
|
|
931
966
|
return localVarFp.sendValidateXmlPost(body, options).then((request) => request(axios, basePath));
|
|
932
967
|
},
|
|
933
968
|
/**
|
|
934
|
-
* 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.
|
|
935
970
|
* @summary Add an invoice by xml
|
|
936
971
|
* @param {object} body
|
|
937
972
|
* @param {boolean} [validate] Validate the document first, and reject it on failure.
|
|
938
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.
|
|
939
975
|
* @param {*} [options] Override http request option.
|
|
940
976
|
* @throws {RequiredError}
|
|
941
977
|
*/
|
|
942
|
-
sendXmlPost(body, validate, signature, options) {
|
|
943
|
-
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));
|
|
944
980
|
},
|
|
945
981
|
};
|
|
946
982
|
};
|
|
@@ -949,19 +985,20 @@ export const SendApiFactory = function (configuration, basePath, axios) {
|
|
|
949
985
|
*/
|
|
950
986
|
export class SendApi extends BaseAPI {
|
|
951
987
|
/**
|
|
952
|
-
* 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.
|
|
953
989
|
* @summary Add an invoice by file
|
|
954
990
|
* @param {File} file
|
|
955
991
|
* @param {boolean} [validate] Validate the document first, and reject it on failure.
|
|
956
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.
|
|
957
994
|
* @param {*} [options] Override http request option.
|
|
958
995
|
* @throws {RequiredError}
|
|
959
996
|
*/
|
|
960
|
-
sendFilePost(file, validate, signature, options) {
|
|
961
|
-
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));
|
|
962
999
|
}
|
|
963
1000
|
/**
|
|
964
|
-
* 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`). 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/).
|
|
965
1002
|
* @summary List invoices
|
|
966
1003
|
* @param {number} [companyId] Company id
|
|
967
1004
|
* @param {string} [identifier] SDI identifier.
|
|
@@ -975,7 +1012,9 @@ export class SendApi extends BaseAPI {
|
|
|
975
1012
|
* @param {string} [documentDateFrom] UTC ISO 8601 (2024-11-29T12:34:56Z)
|
|
976
1013
|
* @param {string} [documentDateTo] UTC ISO 8601 (2024-11-29T12:34:56Z)
|
|
977
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.
|
|
978
1016
|
* @param {boolean} [includePayload] Include payload in the response. Defaults to false.
|
|
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.
|
|
979
1018
|
* @param {number} [page] Page number.
|
|
980
1019
|
* @param {number} [pageSize] Items per page. Cannot be greater than 200.
|
|
981
1020
|
* @param {string} [sort] Sort by field. Prefix with \'-\' for descending order.
|
|
@@ -983,8 +1022,8 @@ export class SendApi extends BaseAPI {
|
|
|
983
1022
|
* @param {*} [options] Override http request option.
|
|
984
1023
|
* @throws {RequiredError}
|
|
985
1024
|
*/
|
|
986
|
-
sendGet(companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, includePayload, page, pageSize, sort, q, options) {
|
|
987
|
-
return SendApiFp(this.configuration).sendGet(companyId, identifier, committente, prestatore, fileName, lastUpdateFrom, lastUpdateTo, dateSentFrom, dateSentTo, documentDateFrom, documentDateTo, documentNumber, includePayload, 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));
|
|
988
1027
|
}
|
|
989
1028
|
/**
|
|
990
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/).
|
|
@@ -1019,28 +1058,30 @@ export class SendApi extends BaseAPI {
|
|
|
1019
1058
|
return SendApiFp(this.configuration).sendIdentifierGet(identifier, includePayload, options).then((request) => request(this.axios, this.basePath));
|
|
1020
1059
|
}
|
|
1021
1060
|
/**
|
|
1022
|
-
* 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.
|
|
1023
1062
|
* @summary Add an invoice by json
|
|
1024
1063
|
* @param {object} body
|
|
1025
1064
|
* @param {boolean} [validate] Validate the document first, and reject it on failure.
|
|
1026
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.
|
|
1027
1067
|
* @param {*} [options] Override http request option.
|
|
1028
1068
|
* @throws {RequiredError}
|
|
1029
1069
|
*/
|
|
1030
|
-
sendJsonPost(body, validate, signature, options) {
|
|
1031
|
-
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));
|
|
1032
1072
|
}
|
|
1033
1073
|
/**
|
|
1034
|
-
* 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.
|
|
1035
1075
|
* @summary Add an invoice
|
|
1036
1076
|
* @param {Send} send
|
|
1037
1077
|
* @param {boolean} [validate] Validate the document first, and reject it on failure.
|
|
1038
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.
|
|
1039
1080
|
* @param {*} [options] Override http request option.
|
|
1040
1081
|
* @throws {RequiredError}
|
|
1041
1082
|
*/
|
|
1042
|
-
sendPost(send, validate, signature, options) {
|
|
1043
|
-
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));
|
|
1044
1085
|
}
|
|
1045
1086
|
/**
|
|
1046
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/).
|
|
@@ -1053,7 +1094,7 @@ export class SendApi extends BaseAPI {
|
|
|
1053
1094
|
return SendApiFp(this.configuration).sendValidateFilePost(file, options).then((request) => request(this.axios, this.basePath));
|
|
1054
1095
|
}
|
|
1055
1096
|
/**
|
|
1056
|
-
* 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/).
|
|
1057
1098
|
* @summary Validate an invoice by json
|
|
1058
1099
|
* @param {object} body
|
|
1059
1100
|
* @param {*} [options] Override http request option.
|
|
@@ -1083,16 +1124,17 @@ export class SendApi extends BaseAPI {
|
|
|
1083
1124
|
return SendApiFp(this.configuration).sendValidateXmlPost(body, options).then((request) => request(this.axios, this.basePath));
|
|
1084
1125
|
}
|
|
1085
1126
|
/**
|
|
1086
|
-
* 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.
|
|
1087
1128
|
* @summary Add an invoice by xml
|
|
1088
1129
|
* @param {object} body
|
|
1089
1130
|
* @param {boolean} [validate] Validate the document first, and reject it on failure.
|
|
1090
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.
|
|
1091
1133
|
* @param {*} [options] Override http request option.
|
|
1092
1134
|
* @throws {RequiredError}
|
|
1093
1135
|
*/
|
|
1094
|
-
sendXmlPost(body, validate, signature, options) {
|
|
1095
|
-
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));
|
|
1096
1138
|
}
|
|
1097
1139
|
}
|
|
1098
1140
|
export const SendFilePostSignatureEnum = {
|
|
@@ -1101,6 +1143,17 @@ export const SendFilePostSignatureEnum = {
|
|
|
1101
1143
|
Force: 'Force',
|
|
1102
1144
|
Auto: 'Auto'
|
|
1103
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
|
+
};
|
|
1104
1157
|
export const SendJsonPostSignatureEnum = {
|
|
1105
1158
|
None: 'None',
|
|
1106
1159
|
Apply: 'Apply',
|