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