Class: Invoicetronic_Sdk::ExportApi

Inherits:
Object
  • Object
show all
Defined in:
lib/invoicetronic_sdk/api/export_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ExportApi

Returns a new instance of ExportApi.



19
20
21
# File 'lib/invoicetronic_sdk/api/export_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/invoicetronic_sdk/api/export_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#export_get(opts = {}) ⇒ nil

Export invoices as a ZIP archive 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.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :type (String)
  • :company_id (Integer)

    Company id

  • :year (Integer)
  • :month (Integer)
  • :quarter (Integer)
  • :document_date_from (Time)

    UTC ISO 8601 (2024-11-29T12:34:56Z)

  • :document_date_to (Time)

    UTC ISO 8601 (2024-11-29T12:34:56Z)

Returns:

  • (nil)


33
34
35
36
# File 'lib/invoicetronic_sdk/api/export_api.rb', line 33

def export_get(opts = {})
  export_get_with_http_info(opts)
  nil
end

#export_get_with_http_info(opts = {}) ⇒ Array<(nil, Integer, Hash)>

Export invoices as a ZIP archive 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., &#x60;Consegnato&#x60; for private recipients, &#x60;AccettatoDalDestinatario&#x60;, &#x60;DecorrenzaTermini&#x60;, 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: - &#x60;year&#x60; + &#x60;month&#x60; (e.g., &#x60;year&#x3D;2026&amp;month&#x3D;3&#x60; for March 2026) - &#x60;year&#x60; + &#x60;quarter&#x60; (e.g., &#x60;year&#x3D;2026&amp;quarter&#x3D;1&#x60; for Q1 Jan-Mar) - &#x60;document_date_from&#x60; / &#x60;document_date_to&#x60; for a custom date range These options are mutually exclusive. The &#x60;year&#x60; parameter alone is not valid and requires either &#x60;month&#x60; or &#x60;quarter&#x60;. ### Response Returns &#x60;200&#x60; with a ZIP archive, or &#x60;204 No Content&#x60; if no invoices match the given filters. Files in the archive are organized by company VAT number (&#x60;vat/send/&#x60;, &#x60;vat/receive/&#x60;). ### 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 &#x60;429 Too Many Requests&#x60; response.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :type (String)
  • :company_id (Integer)

    Company id

  • :year (Integer)
  • :month (Integer)
  • :quarter (Integer)
  • :document_date_from (Time)

    UTC ISO 8601 (2024-11-29T12:34:56Z)

  • :document_date_to (Time)

    UTC ISO 8601 (2024-11-29T12:34:56Z)

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/invoicetronic_sdk/api/export_api.rb', line 49

def export_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ExportApi.export_get ...'
  end
  # resource path
  local_var_path = '/export'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
  query_params[:'company_id'] = opts[:'company_id'] if !opts[:'company_id'].nil?
  query_params[:'year'] = opts[:'year'] if !opts[:'year'].nil?
  query_params[:'month'] = opts[:'month'] if !opts[:'month'].nil?
  query_params[:'quarter'] = opts[:'quarter'] if !opts[:'quarter'].nil?
  query_params[:'document_date_from'] = opts[:'document_date_from'] if !opts[:'document_date_from'].nil?
  query_params[:'document_date_to'] = opts[:'document_date_to'] if !opts[:'document_date_to'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/problem+json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Basic']

  new_options = opts.merge(
    :operation => :"ExportApi.export_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ExportApi#export_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end