Class: Invoicetronic_Sdk::ReceiveApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ReceiveApi

Returns a new instance of ReceiveApi.



19
20
21
# File 'lib/invoicetronic_sdk/api/receive_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/receive_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#receive_get(opts = {}) ⇒ Array<Receive>

List incoming invoices Retrieve a paginated list of receive invoices. Results can be filtered by various criteria such as company, date ranges, sender, document number, and free-text search (‘q`). Returns invoice metadata; set `include_payload` to true to include the full invoice content. Invoices are marked as read (`is_read` = true) only when `include_payload` is true. Receive invoices are inbound purchase invoices received from suppliers through Italy’s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 24 hours in the [Sandbox](invoicetronic.com/en/docs/sandbox/). Inbound invoices are routed to your account via the recipient VAT number, so the recipient company must exist in Invoicetronic for the invoice to be matched. If an invoice arrives before its company has been registered, it is held by our SDI infrastructure and automatically re-processed once the company is created—no invoice is lost. See [Prerequisites](invoicetronic.com/en/docs/prerequisites/) for the recommended setup order.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :company_id (Integer)

    Company id

  • :identifier (String)

    SDI identifier.

  • :unread (Boolean)

    Unread items only.

  • :committente (String)

    Vat number or fiscal code.

  • :prestatore (String)

    Vat number or fiscal code.

  • :file_name (String)

    File name.

  • :last_update_from (Time)

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

  • :last_update_to (Time)

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

  • :date_sent_from (Time)

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

  • :date_sent_to (Time)

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

  • :document_date_from (Time)

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

  • :document_date_to (Time)

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

  • :document_number (String)

    Document number.

  • :include_payload (Boolean)

    Include payload in the response. Defaults to false.

  • :page (Integer)

    Page number. (default to 1)

  • :page_size (Integer)

    Items per page. Cannot be greater than 200. (default to 100)

  • :sort (String)

    Sort by field. Prefix with &#39;-&#39; for descending order.

  • :q (String)

    Full-text search across committente, prestatore, identifier, and file name.

Returns:



44
45
46
47
# File 'lib/invoicetronic_sdk/api/receive_api.rb', line 44

def receive_get(opts = {})
  data, _status_code, _headers = receive_get_with_http_info(opts)
  data
end

#receive_get_with_http_info(opts = {}) ⇒ Array<(Array<Receive>, Integer, Hash)>

List incoming invoices Retrieve a paginated list of receive invoices. Results can be filtered by various criteria such as company, date ranges, sender, document number, and free-text search (&#x60;q&#x60;). Returns invoice metadata; set &#x60;include_payload&#x60; to true to include the full invoice content. Invoices are marked as read (&#x60;is_read&#x60; &#x3D; true) only when &#x60;include_payload&#x60; is true. Receive invoices are inbound purchase invoices received from suppliers through Italy&#39;s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 24 hours in the [Sandbox](invoicetronic.com/en/docs/sandbox/). Inbound invoices are routed to your account via the recipient VAT number, so the recipient company must exist in Invoicetronic for the invoice to be matched. If an invoice arrives before its company has been registered, it is held by our SDI infrastructure and automatically re-processed once the company is created—no invoice is lost. See [Prerequisites](invoicetronic.com/en/docs/prerequisites/) for the recommended setup order.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :company_id (Integer)

    Company id

  • :identifier (String)

    SDI identifier.

  • :unread (Boolean)

    Unread items only.

  • :committente (String)

    Vat number or fiscal code.

  • :prestatore (String)

    Vat number or fiscal code.

  • :file_name (String)

    File name.

  • :last_update_from (Time)

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

  • :last_update_to (Time)

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

  • :date_sent_from (Time)

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

  • :date_sent_to (Time)

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

  • :document_date_from (Time)

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

  • :document_date_to (Time)

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

  • :document_number (String)

    Document number.

  • :include_payload (Boolean)

    Include payload in the response. Defaults to false.

  • :page (Integer)

    Page number. (default to 1)

  • :page_size (Integer)

    Items per page. Cannot be greater than 200. (default to 100)

  • :sort (String)

    Sort by field. Prefix with &#39;-&#39; for descending order.

  • :q (String)

    Full-text search across committente, prestatore, identifier, and file name.

Returns:

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

    Array<Receive> data, response status code and response headers



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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/invoicetronic_sdk/api/receive_api.rb', line 71

def receive_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReceiveApi.receive_get ...'
  end
  # resource path
  local_var_path = '/receive'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'company_id'] = opts[:'company_id'] if !opts[:'company_id'].nil?
  query_params[:'identifier'] = opts[:'identifier'] if !opts[:'identifier'].nil?
  query_params[:'unread'] = opts[:'unread'] if !opts[:'unread'].nil?
  query_params[:'committente'] = opts[:'committente'] if !opts[:'committente'].nil?
  query_params[:'prestatore'] = opts[:'prestatore'] if !opts[:'prestatore'].nil?
  query_params[:'file_name'] = opts[:'file_name'] if !opts[:'file_name'].nil?
  query_params[:'last_update_from'] = opts[:'last_update_from'] if !opts[:'last_update_from'].nil?
  query_params[:'last_update_to'] = opts[:'last_update_to'] if !opts[:'last_update_to'].nil?
  query_params[:'date_sent_from'] = opts[:'date_sent_from'] if !opts[:'date_sent_from'].nil?
  query_params[:'date_sent_to'] = opts[:'date_sent_to'] if !opts[:'date_sent_to'].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?
  query_params[:'document_number'] = opts[:'document_number'] if !opts[:'document_number'].nil?
  query_params[:'include_payload'] = opts[:'include_payload'] if !opts[:'include_payload'].nil?
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'q'] = opts[:'q'] if !opts[:'q'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/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] || 'Array<Receive>'

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

  new_options = opts.merge(
    :operation => :"ReceiveApi.receive_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: ReceiveApi#receive_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#receive_id_delete(id, opts = {}) ⇒ Receive

Delete an incoming invoice by id Permanently delete a receive invoice by its internal id. This action cannot be undone. Receive invoices are inbound purchase invoices received from suppliers through Italy’s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 24 hours in the [Sandbox](invoicetronic.com/en/docs/sandbox/). Inbound invoices are routed to your account via the recipient VAT number, so the recipient company must exist in Invoicetronic for the invoice to be matched. If an invoice arrives before its company has been registered, it is held by our SDI infrastructure and automatically re-processed once the company is created—no invoice is lost. See [Prerequisites](invoicetronic.com/en/docs/prerequisites/) for the recommended setup order.

Parameters:

  • id (Integer)

    Item id

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

    the optional parameters

Returns:



138
139
140
141
# File 'lib/invoicetronic_sdk/api/receive_api.rb', line 138

def receive_id_delete(id, opts = {})
  data, _status_code, _headers = receive_id_delete_with_http_info(id, opts)
  data
end

#receive_id_delete_with_http_info(id, opts = {}) ⇒ Array<(Receive, Integer, Hash)>

Delete an incoming invoice by id Permanently delete a receive invoice by its internal id. This action cannot be undone. Receive invoices are inbound purchase invoices received from suppliers through Italy&#39;s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 24 hours in the [Sandbox](invoicetronic.com/en/docs/sandbox/). Inbound invoices are routed to your account via the recipient VAT number, so the recipient company must exist in Invoicetronic for the invoice to be matched. If an invoice arrives before its company has been registered, it is held by our SDI infrastructure and automatically re-processed once the company is created—no invoice is lost. See [Prerequisites](invoicetronic.com/en/docs/prerequisites/) for the recommended setup order.

Parameters:

  • id (Integer)

    Item id

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

    the optional parameters

Returns:

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

    Receive data, response status code and response headers



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/invoicetronic_sdk/api/receive_api.rb', line 148

def receive_id_delete_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReceiveApi.receive_id_delete ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ReceiveApi.receive_id_delete"
  end
  # resource path
  local_var_path = '/receive/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/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] || 'Receive'

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

  new_options = opts.merge(
    :operation => :"ReceiveApi.receive_id_delete",
    :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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ReceiveApi#receive_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#receive_id_get(id, opts = {}) ⇒ Receive

Get an incoming invoice by id Retrieve an incoming invoice by its internal id. The ‘id` is unique and assigned by the system when the invoice is received. Returns invoice metadata; set `include_payload` to true to include the full invoice content. The invoice is marked as read (`is_read` = true) only when `include_payload` is true. Receive invoices are inbound purchase invoices received from suppliers through Italy’s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 24 hours in the [Sandbox](invoicetronic.com/en/docs/sandbox/). Inbound invoices are routed to your account via the recipient VAT number, so the recipient company must exist in Invoicetronic for the invoice to be matched. If an invoice arrives before its company has been registered, it is held by our SDI infrastructure and automatically re-processed once the company is created—no invoice is lost. See [Prerequisites](invoicetronic.com/en/docs/prerequisites/) for the recommended setup order.

Parameters:

  • id (Integer)

    Item id

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

    the optional parameters

Options Hash (opts):

  • :include_payload (Boolean)

    Include payload in the response. Defaults to false. (default to false)

Returns:



202
203
204
205
# File 'lib/invoicetronic_sdk/api/receive_api.rb', line 202

def receive_id_get(id, opts = {})
  data, _status_code, _headers = receive_id_get_with_http_info(id, opts)
  data
end

#receive_id_get_with_http_info(id, opts = {}) ⇒ Array<(Receive, Integer, Hash)>

Get an incoming invoice by id Retrieve an incoming invoice by its internal id. The &#x60;id&#x60; is unique and assigned by the system when the invoice is received. Returns invoice metadata; set &#x60;include_payload&#x60; to true to include the full invoice content. The invoice is marked as read (&#x60;is_read&#x60; &#x3D; true) only when &#x60;include_payload&#x60; is true. Receive invoices are inbound purchase invoices received from suppliers through Italy&#39;s SDI (Sistema di Interscambio). Preserved for two years in the live environment and 24 hours in the [Sandbox](invoicetronic.com/en/docs/sandbox/). Inbound invoices are routed to your account via the recipient VAT number, so the recipient company must exist in Invoicetronic for the invoice to be matched. If an invoice arrives before its company has been registered, it is held by our SDI infrastructure and automatically re-processed once the company is created—no invoice is lost. See [Prerequisites](invoicetronic.com/en/docs/prerequisites/) for the recommended setup order.

Parameters:

  • id (Integer)

    Item id

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

    the optional parameters

Options Hash (opts):

  • :include_payload (Boolean)

    Include payload in the response. Defaults to false. (default to false)

Returns:

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

    Receive data, response status code and response headers



213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# File 'lib/invoicetronic_sdk/api/receive_api.rb', line 213

def receive_id_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReceiveApi.receive_id_get ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ReceiveApi.receive_id_get"
  end
  # resource path
  local_var_path = '/receive/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'include_payload'] = opts[:'include_payload'] if !opts[:'include_payload'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/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] || 'Receive'

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

  new_options = opts.merge(
    :operation => :"ReceiveApi.receive_id_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: ReceiveApi#receive_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#receive_id_payload_get(id, opts = {}) ⇒ nil

Get a receive invoice payload by id Retrieve only the payload of a receive invoice, without the full invoice metadata. This is useful when you already have the invoice metadata and only need the XML content. The response is a ‘text/plain` string, identical to the `payload` field returned by the standard GET endpoint with `include_payload=true`. The invoice is marked as read (`is_read` = true) and counted as an operation, same as when retrieving the full invoice with `include_payload=true`.

Parameters:

  • id (Integer)

    Item id

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

    the optional parameters

Returns:

  • (nil)


267
268
269
270
# File 'lib/invoicetronic_sdk/api/receive_api.rb', line 267

def receive_id_payload_get(id, opts = {})
  receive_id_payload_get_with_http_info(id, opts)
  nil
end

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

Get a receive invoice payload by id Retrieve only the payload of a receive invoice, without the full invoice metadata. This is useful when you already have the invoice metadata and only need the XML content. The response is a &#x60;text/plain&#x60; string, identical to the &#x60;payload&#x60; field returned by the standard GET endpoint with &#x60;include_payload&#x3D;true&#x60;. The invoice is marked as read (&#x60;is_read&#x60; &#x3D; true) and counted as an operation, same as when retrieving the full invoice with &#x60;include_payload&#x3D;true&#x60;.

Parameters:

  • id (Integer)

    Item id

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
# File 'lib/invoicetronic_sdk/api/receive_api.rb', line 277

def receive_id_payload_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReceiveApi.receive_id_payload_get ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ReceiveApi.receive_id_payload_get"
  end
  # resource path
  local_var_path = '/receive/{id}/payload'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # 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 => :"ReceiveApi.receive_id_payload_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: ReceiveApi#receive_id_payload_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end