|
| 1 | +# Invoicetronic\ExportApi |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +All URIs are relative to https://api.invoicetronic.com, except if the operation defines another base path. |
| 6 | + |
| 7 | +| Method | HTTP request | Description | |
| 8 | +| ------------- | ------------- | ------------- | |
| 9 | +| [**exportGet()**](ExportApi.md#exportGet) | **GET** /export | Export invoices as a ZIP archive | |
| 10 | + |
| 11 | + |
| 12 | +## `exportGet()` |
| 13 | + |
| 14 | +```php |
| 15 | +exportGet($type, $company_id, $year, $month, $quarter, $document_date_from, $document_date_to) |
| 16 | +``` |
| 17 | + |
| 18 | +Export invoices as a ZIP archive |
| 19 | + |
| 20 | +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. |
| 21 | + |
| 22 | +### Example |
| 23 | + |
| 24 | +```php |
| 25 | +<?php |
| 26 | +require_once(__DIR__ . '/vendor/autoload.php'); |
| 27 | + |
| 28 | + |
| 29 | +// Configure HTTP basic authorization: Basic |
| 30 | +$config = Invoicetronic\Configuration::getDefaultConfiguration() |
| 31 | + ->setUsername('YOUR_USERNAME') |
| 32 | + ->setPassword('YOUR_PASSWORD'); |
| 33 | + |
| 34 | + |
| 35 | +$apiInstance = new Invoicetronic\Api\ExportApi( |
| 36 | + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. |
| 37 | + // This is optional, `GuzzleHttp\Client` will be used as default. |
| 38 | + new GuzzleHttp\Client(), |
| 39 | + $config |
| 40 | +); |
| 41 | +$type = 'Both'; // string |
| 42 | +$company_id = 56; // int | Company id |
| 43 | +$year = 56; // int |
| 44 | +$month = 56; // int |
| 45 | +$quarter = 56; // int |
| 46 | +$document_date_from = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | UTC ISO 8601 (2024-11-29T12:34:56Z) |
| 47 | +$document_date_to = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime | UTC ISO 8601 (2024-11-29T12:34:56Z) |
| 48 | + |
| 49 | +try { |
| 50 | + $apiInstance->exportGet($type, $company_id, $year, $month, $quarter, $document_date_from, $document_date_to); |
| 51 | +} catch (Exception $e) { |
| 52 | + echo 'Exception when calling ExportApi->exportGet: ', $e->getMessage(), PHP_EOL; |
| 53 | +} |
| 54 | +``` |
| 55 | + |
| 56 | +### Parameters |
| 57 | + |
| 58 | +| Name | Type | Description | Notes | |
| 59 | +| ------------- | ------------- | ------------- | ------------- | |
| 60 | +| **type** | **string**| | [optional] [default to 'Both'] | |
| 61 | +| **company_id** | **int**| Company id | [optional] | |
| 62 | +| **year** | **int**| | [optional] | |
| 63 | +| **month** | **int**| | [optional] | |
| 64 | +| **quarter** | **int**| | [optional] | |
| 65 | +| **document_date_from** | **\DateTime**| UTC ISO 8601 (2024-11-29T12:34:56Z) | [optional] | |
| 66 | +| **document_date_to** | **\DateTime**| UTC ISO 8601 (2024-11-29T12:34:56Z) | [optional] | |
| 67 | + |
| 68 | +### Return type |
| 69 | + |
| 70 | +void (empty response body) |
| 71 | + |
| 72 | +### Authorization |
| 73 | + |
| 74 | +[Basic](../../README.md#Basic) |
| 75 | + |
| 76 | +### HTTP request headers |
| 77 | + |
| 78 | +- **Content-Type**: Not defined |
| 79 | +- **Accept**: `application/problem+json` |
| 80 | + |
| 81 | +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) |
| 82 | +[[Back to Model list]](../../README.md#models) |
| 83 | +[[Back to README]](../../README.md) |
0 commit comments