|
| 1 | +/** |
| 2 | + * Invoicetronic API |
| 3 | + * 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/ |
| 4 | + * |
| 5 | + * The version of the OpenAPI document: 1 |
| 6 | + * Contact: info@invoicetronic.com |
| 7 | + * |
| 8 | + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). |
| 9 | + * https://openapi-generator.tech |
| 10 | + * Do not edit the class manually. |
| 11 | + * |
| 12 | + */ |
| 13 | + |
| 14 | + |
| 15 | +import ApiClient from "../ApiClient"; |
| 16 | +import ProblemDetails from '../model/ProblemDetails'; |
| 17 | + |
| 18 | +/** |
| 19 | +* Export service. |
| 20 | +* @module api/ExportApi |
| 21 | +* @version 1.3 |
| 22 | +*/ |
| 23 | +export default class ExportApi { |
| 24 | + |
| 25 | + /** |
| 26 | + * Constructs a new ExportApi. |
| 27 | + * @alias module:api/ExportApi |
| 28 | + * @class |
| 29 | + * @param {module:ApiClient} [apiClient] Optional API client implementation to use, |
| 30 | + * default to {@link module:ApiClient#instance} if unspecified. |
| 31 | + */ |
| 32 | + constructor(apiClient) { |
| 33 | + this.apiClient = apiClient || ApiClient.instance; |
| 34 | + } |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + /** |
| 39 | + * Export invoices as a ZIP archive |
| 40 | + * Export invoices as a ZIP archive of FatturaPA XML files, suitable for import into accounting software (TeamSystem, Zucchetti, etc.). **Sent invoices** are only included when they have reached a definitive state (e.g., `Consegnato` for private recipients, `AccettatoDalDestinatario`, `DecorrenzaTermini`, etc.). Invoices still being processed by SDI are excluded. **Received invoices** are always included. Unread invoices are automatically marked as read and counted as operations. ### Period filters You can filter by period using either: - `year` + `month` (e.g., `year=2026&month=3` for March 2026) - `year` + `quarter` (e.g., `year=2026&quarter=1` for Q1 Jan-Mar) - `document_date_from` / `document_date_to` for a custom date range These options are mutually exclusive. The `year` parameter alone is not valid and requires either `month` or `quarter`. ### Response Returns `200` with a ZIP archive, or `204 No Content` if no invoices match the given filters. Files in the archive are organized by company VAT number (`{vat}/send/`, `{vat}/receive/`). ### Rate limiting This endpoint has a dedicated rate limit: only one export request per user can be processed at a time. Concurrent requests will receive a `429 Too Many Requests` response. |
| 41 | + * @param {Object} opts Optional parameters |
| 42 | + * @param {module:model/String} [type = 'Both')] |
| 43 | + * @param {Number} [companyId] Company id |
| 44 | + * @param {Number} [year] |
| 45 | + * @param {Number} [month] |
| 46 | + * @param {Number} [quarter] |
| 47 | + * @param {Date} [documentDateFrom] UTC ISO 8601 (2024-11-29T12:34:56Z) |
| 48 | + * @param {Date} [documentDateTo] UTC ISO 8601 (2024-11-29T12:34:56Z) |
| 49 | + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response |
| 50 | + */ |
| 51 | + exportGetWithHttpInfo(opts) { |
| 52 | + opts = opts || {}; |
| 53 | + let postBody = null; |
| 54 | + |
| 55 | + let pathParams = { |
| 56 | + }; |
| 57 | + let queryParams = { |
| 58 | + 'type': opts['type'], |
| 59 | + 'company_id': opts['companyId'], |
| 60 | + 'year': opts['year'], |
| 61 | + 'month': opts['month'], |
| 62 | + 'quarter': opts['quarter'], |
| 63 | + 'document_date_from': opts['documentDateFrom'], |
| 64 | + 'document_date_to': opts['documentDateTo'] |
| 65 | + }; |
| 66 | + let headerParams = { |
| 67 | + }; |
| 68 | + let formParams = { |
| 69 | + }; |
| 70 | + |
| 71 | + let authNames = ['Basic']; |
| 72 | + let contentTypes = []; |
| 73 | + let accepts = ['application/problem+json']; |
| 74 | + let returnType = null; |
| 75 | + return this.apiClient.callApi( |
| 76 | + '/export', 'GET', |
| 77 | + pathParams, queryParams, headerParams, formParams, postBody, |
| 78 | + authNames, contentTypes, accepts, returnType, null |
| 79 | + ); |
| 80 | + } |
| 81 | + |
| 82 | + /** |
| 83 | + * Export invoices as a ZIP archive |
| 84 | + * Export invoices as a ZIP archive of FatturaPA XML files, suitable for import into accounting software (TeamSystem, Zucchetti, etc.). **Sent invoices** are only included when they have reached a definitive state (e.g., `Consegnato` for private recipients, `AccettatoDalDestinatario`, `DecorrenzaTermini`, etc.). Invoices still being processed by SDI are excluded. **Received invoices** are always included. Unread invoices are automatically marked as read and counted as operations. ### Period filters You can filter by period using either: - `year` + `month` (e.g., `year=2026&month=3` for March 2026) - `year` + `quarter` (e.g., `year=2026&quarter=1` for Q1 Jan-Mar) - `document_date_from` / `document_date_to` for a custom date range These options are mutually exclusive. The `year` parameter alone is not valid and requires either `month` or `quarter`. ### Response Returns `200` with a ZIP archive, or `204 No Content` if no invoices match the given filters. Files in the archive are organized by company VAT number (`{vat}/send/`, `{vat}/receive/`). ### Rate limiting This endpoint has a dedicated rate limit: only one export request per user can be processed at a time. Concurrent requests will receive a `429 Too Many Requests` response. |
| 85 | + * @param {Object} opts Optional parameters |
| 86 | + * @param {module:model/String} opts.type (default to 'Both') |
| 87 | + * @param {Number} opts.companyId Company id |
| 88 | + * @param {Number} opts.year |
| 89 | + * @param {Number} opts.month |
| 90 | + * @param {Number} opts.quarter |
| 91 | + * @param {Date} opts.documentDateFrom UTC ISO 8601 (2024-11-29T12:34:56Z) |
| 92 | + * @param {Date} opts.documentDateTo UTC ISO 8601 (2024-11-29T12:34:56Z) |
| 93 | + * @return {Promise} a {@link https://www.promisejs.org/|Promise} |
| 94 | + */ |
| 95 | + exportGet(opts) { |
| 96 | + return this.exportGetWithHttpInfo(opts) |
| 97 | + .then(function(response_and_data) { |
| 98 | + return response_and_data.data; |
| 99 | + }); |
| 100 | + } |
| 101 | + |
| 102 | + |
| 103 | +} |
0 commit comments