Class: NuvemfiscalSdkRuby::NfseApi

Inherits:
Object
  • Object
show all
Defined in:
lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ NfseApi

Returns a new instance of NfseApi.



19
20
21
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_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/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#baixar_pdf_nfse(id, opts = {}) ⇒ File

Baixar PDF do DANFSE

Parameters:

  • id (String)

    ID único da NFS-e gerado pela Nuvem Fiscal.

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

    the optional parameters

Options Hash (opts):

  • :logotipo (Boolean)

    Imprime o documento com logotipo, desde que esteja cadastrado na empresa. (default to false)

  • :mensagem_rodape (String)

    Imprime mensagem no rodapé do documento. O caractere `|` (pipe) poderá ser utilizado para definir a quantidade e o alinhamento das mensagens. **Exemplos de Uso:** * `"esquerda"` * `"esquerda|centro"` * `"esquerda|centro|direita"` * `"|centro"`, `"|centro|"` * `"|centro|direita"` * `"||direita"` * `"esquerda||direita"` Default: `""`

Returns:

  • (File)


28
29
30
31
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 28

def baixar_pdf_nfse(id, opts = {})
  data, _status_code, _headers = baixar_pdf_nfse_with_http_info(id, opts)
  data
end

#baixar_pdf_nfse_with_http_info(id, opts = {}) ⇒ Array<(File, Integer, Hash)>

Baixar PDF do DANFSE

Parameters:

  • id (String)

    ID único da NFS-e gerado pela Nuvem Fiscal.

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

    the optional parameters

Options Hash (opts):

  • :logotipo (Boolean)

    Imprime o documento com logotipo, desde que esteja cadastrado na empresa. (default to false)

  • :mensagem_rodape (String)

    Imprime mensagem no rodapé do documento. O caractere &#x60;|&#x60; (pipe) poderá ser utilizado para definir a quantidade e o alinhamento das mensagens. **Exemplos de Uso:** * &#x60;&quot;esquerda&quot;&#x60; * &#x60;&quot;esquerda|centro&quot;&#x60; * &#x60;&quot;esquerda|centro|direita&quot;&#x60; * &#x60;&quot;|centro&quot;&#x60;, &#x60;&quot;|centro|&quot;&#x60; * &#x60;&quot;|centro|direita&quot;&#x60; * &#x60;&quot;||direita&quot;&#x60; * &#x60;&quot;esquerda||direita&quot;&#x60; Default: &#x60;&quot;&quot;&#x60;

Returns:

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

    File data, response status code and response headers



39
40
41
42
43
44
45
46
47
48
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
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 39

def baixar_pdf_nfse_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfseApi.baixar_pdf_nfse ...'
  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 NfseApi.baixar_pdf_nfse"
  end
  if @api_client.config.client_side_validation && !opts[:'mensagem_rodape'].nil? && opts[:'mensagem_rodape'].to_s.length > 120
    fail ArgumentError, 'invalid value for "opts[:"mensagem_rodape"]" when calling NfseApi.baixar_pdf_nfse, the character length must be smaller than or equal to 120.'
  end

  # resource path
  local_var_path = '/nfse/{id}/pdf'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['jwt', 'oauth2']

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

#baixar_xml_cancelamento_nfse(id, opts = {}) ⇒ File

Baixar XML do evento de cancelamento

Parameters:

  • id (String)

    ID único da NFS-e gerado pela Nuvem Fiscal.

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

    the optional parameters

Returns:

  • (File)


97
98
99
100
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 97

def baixar_xml_cancelamento_nfse(id, opts = {})
  data, _status_code, _headers = baixar_xml_cancelamento_nfse_with_http_info(id, opts)
  data
end

#baixar_xml_cancelamento_nfse_with_http_info(id, opts = {}) ⇒ Array<(File, Integer, Hash)>

Baixar XML do evento de cancelamento

Parameters:

  • id (String)

    ID único da NFS-e gerado pela Nuvem Fiscal.

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

    the optional parameters

Returns:

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

    File data, response status code and response headers



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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 106

def baixar_xml_cancelamento_nfse_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfseApi.baixar_xml_cancelamento_nfse ...'
  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 NfseApi.baixar_xml_cancelamento_nfse"
  end
  # resource path
  local_var_path = '/nfse/{Id}/cancelamento/xml'.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(['*/*']) 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] || 'File'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['jwt', 'oauth2']

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

#baixar_xml_dps(id, opts = {}) ⇒ File

Baixar XML da DPS

Parameters:

  • id (String)

    ID único da NFS-e gerado pela Nuvem Fiscal.

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

    the optional parameters

Returns:

  • (File)


158
159
160
161
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 158

def baixar_xml_dps(id, opts = {})
  data, _status_code, _headers = baixar_xml_dps_with_http_info(id, opts)
  data
end

#baixar_xml_dps_with_http_info(id, opts = {}) ⇒ Array<(File, Integer, Hash)>

Baixar XML da DPS

Parameters:

  • id (String)

    ID único da NFS-e gerado pela Nuvem Fiscal.

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

    the optional parameters

Returns:

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

    File data, response status code and response headers



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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 167

def baixar_xml_dps_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfseApi.baixar_xml_dps ...'
  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 NfseApi.baixar_xml_dps"
  end
  # resource path
  local_var_path = '/nfse/{id}/xml/dps'.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(['*/*']) 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] || 'File'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['jwt', 'oauth2']

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

#baixar_xml_nfse(id, opts = {}) ⇒ File

Baixar XML da NFS-e processada

Parameters:

  • id (String)

    ID único da NFS-e gerado pela Nuvem Fiscal.

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

    the optional parameters

Returns:

  • (File)


219
220
221
222
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 219

def baixar_xml_nfse(id, opts = {})
  data, _status_code, _headers = baixar_xml_nfse_with_http_info(id, opts)
  data
end

#baixar_xml_nfse_with_http_info(id, opts = {}) ⇒ Array<(File, Integer, Hash)>

Baixar XML da NFS-e processada

Parameters:

  • id (String)

    ID único da NFS-e gerado pela Nuvem Fiscal.

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

    the optional parameters

Returns:

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

    File data, response status code and response headers



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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 228

def baixar_xml_nfse_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfseApi.baixar_xml_nfse ...'
  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 NfseApi.baixar_xml_nfse"
  end
  # resource path
  local_var_path = '/nfse/{id}/xml'.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(['*/*']) 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] || 'File'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['jwt', 'oauth2']

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

#cancelar_nfse(id, opts = {}) ⇒ NfseCancelamento

Cancelar uma NFS-e autorizada **Informações adicionais**: - Cota: <a href="/docs/limites#dfe-eventos">dfe-eventos</a> - Consumo: 1 unidade por requisição.

Parameters:

  • id (String)

    ID único da NFS-e gerado pela Nuvem Fiscal.

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

    the optional parameters

Options Hash (opts):

Returns:



282
283
284
285
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 282

def cancelar_nfse(id, opts = {})
  data, _status_code, _headers = cancelar_nfse_with_http_info(id, opts)
  data
end

#cancelar_nfse_with_http_info(id, opts = {}) ⇒ Array<(NfseCancelamento, Integer, Hash)>

Cancelar uma NFS-e autorizada **Informações adicionais**: - Cota: &lt;a href&#x3D;&quot;/docs/limites#dfe-eventos&quot;&gt;dfe-eventos&lt;/a&gt; - Consumo: 1 unidade por requisição.

Parameters:

  • id (String)

    ID único da NFS-e gerado pela Nuvem Fiscal.

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

    the optional parameters

Options Hash (opts):

Returns:

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

    NfseCancelamento data, response status code and response headers



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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 293

def cancelar_nfse_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfseApi.cancelar_nfse ...'
  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 NfseApi.cancelar_nfse"
  end
  # resource path
  local_var_path = '/nfse/{id}/cancelamento'.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']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])

  # return_type
  return_type = opts[:debug_return_type] || 'NfseCancelamento'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['jwt', 'oauth2']

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

#cidades_atendidas(opts = {}) ⇒ NfseCidadesAtendidas

Cidades atendidas Fornece uma relação completa de todos os municípios atendidos pela Nuvem Fiscal.

Parameters:

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

    the optional parameters

Returns:



350
351
352
353
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 350

def cidades_atendidas(opts = {})
  data, _status_code, _headers = cidades_atendidas_with_http_info(opts)
  data
end

#cidades_atendidas_with_http_info(opts = {}) ⇒ Array<(NfseCidadesAtendidas, Integer, Hash)>

Cidades atendidas Fornece uma relação completa de todos os municípios atendidos pela Nuvem Fiscal.

Parameters:

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

    the optional parameters

Returns:

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

    NfseCidadesAtendidas data, response status code and response headers



359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 359

def cidades_atendidas_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfseApi.cidades_atendidas ...'
  end
  # resource path
  local_var_path = '/nfse/cidades'

  # 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] || 'NfseCidadesAtendidas'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['jwt', 'oauth2']

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

#consultar_cancelamento_nfse(id, opts = {}) ⇒ NfseCancelamento

Consultar o cancelamento da NFS-e

Parameters:

  • id (String)

    ID único da NFS-e gerado pela Nuvem Fiscal.

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

    the optional parameters

Returns:



407
408
409
410
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 407

def consultar_cancelamento_nfse(id, opts = {})
  data, _status_code, _headers = consultar_cancelamento_nfse_with_http_info(id, opts)
  data
end

#consultar_cancelamento_nfse_with_http_info(id, opts = {}) ⇒ Array<(NfseCancelamento, Integer, Hash)>

Consultar o cancelamento da NFS-e

Parameters:

  • id (String)

    ID único da NFS-e gerado pela Nuvem Fiscal.

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

    the optional parameters

Returns:

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

    NfseCancelamento data, response status code and response headers



416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 416

def consultar_cancelamento_nfse_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfseApi.consultar_cancelamento_nfse ...'
  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 NfseApi.consultar_cancelamento_nfse"
  end
  # resource path
  local_var_path = '/nfse/{id}/cancelamento'.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] || 'NfseCancelamento'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['jwt', 'oauth2']

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

#consultar_lote_nfse(id, opts = {}) ⇒ RpsLote

Consultar lote de NFS-e Consulta os detalhes de um lote já existente. Forneça o ID único obtido de uma requisição de emissão ou de listagem de lotes e a Nuvem Fiscal irá retornar as informações do lote correspondente.

Parameters:

  • id (String)

    ID único do lote gerado pela Nuvem Fiscal.

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

    the optional parameters

Returns:



469
470
471
472
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 469

def consultar_lote_nfse(id, opts = {})
  data, _status_code, _headers = consultar_lote_nfse_with_http_info(id, opts)
  data
end

#consultar_lote_nfse_with_http_info(id, opts = {}) ⇒ Array<(RpsLote, Integer, Hash)>

Consultar lote de NFS-e Consulta os detalhes de um lote já existente. Forneça o ID único obtido de uma requisição de emissão ou de listagem de lotes e a Nuvem Fiscal irá retornar as informações do lote correspondente.

Parameters:

  • id (String)

    ID único do lote gerado pela Nuvem Fiscal.

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

    the optional parameters

Returns:

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

    RpsLote data, response status code and response headers



479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 479

def consultar_lote_nfse_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfseApi.consultar_lote_nfse ...'
  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 NfseApi.consultar_lote_nfse"
  end
  # resource path
  local_var_path = '/nfse/lotes/{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] || 'RpsLote'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['jwt', 'oauth2']

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

#consultar_metadados(codigo_ibge, opts = {}) ⇒ NfseCidadeMetadados

Consultar metadados Consulta a disponibilidade de emissão e alguns metadados de um município.

Parameters:

  • codigo_ibge (String)

    Código IBGE do município.

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

    the optional parameters

Returns:



532
533
534
535
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 532

def consultar_metadados(codigo_ibge, opts = {})
  data, _status_code, _headers = consultar_metadados_with_http_info(codigo_ibge, opts)
  data
end

#consultar_metadados_with_http_info(codigo_ibge, opts = {}) ⇒ Array<(NfseCidadeMetadados, Integer, Hash)>

Consultar metadados Consulta a disponibilidade de emissão e alguns metadados de um município.

Parameters:

  • codigo_ibge (String)

    Código IBGE do município.

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

    the optional parameters

Returns:

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

    NfseCidadeMetadados data, response status code and response headers



542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 542

def consultar_metadados_with_http_info(codigo_ibge, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfseApi.consultar_metadados ...'
  end
  # verify the required parameter 'codigo_ibge' is set
  if @api_client.config.client_side_validation && codigo_ibge.nil?
    fail ArgumentError, "Missing the required parameter 'codigo_ibge' when calling NfseApi.consultar_metadados"
  end
  # resource path
  local_var_path = '/nfse/cidades/{codigo_ibge}'.sub('{' + 'codigo_ibge' + '}', CGI.escape(codigo_ibge.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] || 'NfseCidadeMetadados'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['jwt', 'oauth2']

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

#consultar_nfse(id, opts = {}) ⇒ Nfse

Consultar NFS-e Consulta os detalhes de uma NFS-e já existente. Forneça o ID único obtido de uma requisição de criação ou de listagem de notas e a Nuvem Fiscal irá retornar as informações da nota correspondente.

Parameters:

  • id (String)

    ID único da NFS-e gerado pela Nuvem Fiscal.

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

    the optional parameters

Returns:



595
596
597
598
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 595

def consultar_nfse(id, opts = {})
  data, _status_code, _headers = consultar_nfse_with_http_info(id, opts)
  data
end

#consultar_nfse_with_http_info(id, opts = {}) ⇒ Array<(Nfse, Integer, Hash)>

Consultar NFS-e Consulta os detalhes de uma NFS-e já existente. Forneça o ID único obtido de uma requisição de criação ou de listagem de notas e a Nuvem Fiscal irá retornar as informações da nota correspondente.

Parameters:

  • id (String)

    ID único da NFS-e gerado pela Nuvem Fiscal.

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

    the optional parameters

Returns:

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

    Nfse data, response status code and response headers



605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 605

def consultar_nfse_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfseApi.consultar_nfse ...'
  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 NfseApi.consultar_nfse"
  end
  # resource path
  local_var_path = '/nfse/{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] || 'Nfse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['jwt', 'oauth2']

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

#emitir_lote_nfse(body, opts = {}) ⇒ RpsLote

Emitir lote de NFS-e **Informações adicionais**: - Cota: <a href="/docs/limites#dfe-eventos">dfe-eventos</a> - Consumo: 1 unidade por NFS-e.

Parameters:

Returns:



658
659
660
661
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 658

def emitir_lote_nfse(body, opts = {})
  data, _status_code, _headers = emitir_lote_nfse_with_http_info(body, opts)
  data
end

#emitir_lote_nfse_dps(body, opts = {}) ⇒ RpsLote

Emitir lote de NFS-e **Informações adicionais**: - Cota: <a href="/docs/limites#dfe-eventos">dfe-eventos</a> - Consumo: 1 unidade por NFS-e.

Parameters:

Returns:



726
727
728
729
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 726

def emitir_lote_nfse_dps(body, opts = {})
  data, _status_code, _headers = emitir_lote_nfse_dps_with_http_info(body, opts)
  data
end

#emitir_lote_nfse_dps_with_http_info(body, opts = {}) ⇒ Array<(RpsLote, Integer, Hash)>

Emitir lote de NFS-e **Informações adicionais**: - Cota: &lt;a href&#x3D;&quot;/docs/limites#dfe-eventos&quot;&gt;dfe-eventos&lt;/a&gt; - Consumo: 1 unidade por NFS-e.

Parameters:

Returns:

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

    RpsLote data, response status code and response headers



736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 736

def emitir_lote_nfse_dps_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfseApi.emitir_lote_nfse_dps ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling NfseApi.emitir_lote_nfse_dps"
  end
  # resource path
  local_var_path = '/nfse/dps/lotes'

  # 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']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'RpsLote'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['jwt', 'oauth2']

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

#emitir_lote_nfse_with_http_info(body, opts = {}) ⇒ Array<(RpsLote, Integer, Hash)>

Emitir lote de NFS-e **Informações adicionais**: - Cota: &lt;a href&#x3D;&quot;/docs/limites#dfe-eventos&quot;&gt;dfe-eventos&lt;/a&gt; - Consumo: 1 unidade por NFS-e.

Parameters:

Returns:

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

    RpsLote data, response status code and response headers



668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 668

def emitir_lote_nfse_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfseApi.emitir_lote_nfse ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling NfseApi.emitir_lote_nfse"
  end
  # resource path
  local_var_path = '/nfse/lotes'

  # 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']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'RpsLote'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['jwt', 'oauth2']

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

#emitir_nfse(body, opts = {}) ⇒ Nfse

Emitir NFS-e **Informações adicionais**: - Cota: <a href="/docs/limites#dfe-eventos">dfe-eventos</a> - Consumo: 1 unidade por requisição.

Parameters:

Returns:



794
795
796
797
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 794

def emitir_nfse(body, opts = {})
  data, _status_code, _headers = emitir_nfse_with_http_info(body, opts)
  data
end

#emitir_nfse_dps(body, opts = {}) ⇒ Nfse

Emitir NFS-e **Informações adicionais**: - Cota: <a href="/docs/limites#dfe-eventos">dfe-eventos</a> - Consumo: 1 unidade por requisição.

Parameters:

Returns:



862
863
864
865
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 862

def emitir_nfse_dps(body, opts = {})
  data, _status_code, _headers = emitir_nfse_dps_with_http_info(body, opts)
  data
end

#emitir_nfse_dps_with_http_info(body, opts = {}) ⇒ Array<(Nfse, Integer, Hash)>

Emitir NFS-e **Informações adicionais**: - Cota: &lt;a href&#x3D;&quot;/docs/limites#dfe-eventos&quot;&gt;dfe-eventos&lt;/a&gt; - Consumo: 1 unidade por requisição.

Parameters:

Returns:

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

    Nfse data, response status code and response headers



872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 872

def emitir_nfse_dps_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfseApi.emitir_nfse_dps ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling NfseApi.emitir_nfse_dps"
  end
  # resource path
  local_var_path = '/nfse/dps'

  # 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']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'Nfse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['jwt', 'oauth2']

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

#emitir_nfse_with_http_info(body, opts = {}) ⇒ Array<(Nfse, Integer, Hash)>

Emitir NFS-e **Informações adicionais**: - Cota: &lt;a href&#x3D;&quot;/docs/limites#dfe-eventos&quot;&gt;dfe-eventos&lt;/a&gt; - Consumo: 1 unidade por requisição.

Parameters:

Returns:

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

    Nfse data, response status code and response headers



804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 804

def emitir_nfse_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfseApi.emitir_nfse ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling NfseApi.emitir_nfse"
  end
  # resource path
  local_var_path = '/nfse'

  # 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']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'Nfse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['jwt', 'oauth2']

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

#listar_lotes_nfse(cpf_cnpj, ambiente, opts = {}) ⇒ RpsLoteListagem

Listar lotes de NFS-e Retorna a lista dos lotes de acordo com os critérios de busca utilizados. Os lotes são retornados ordenados pela data da criação, com os mais recentes aparecendo primeiro.

Parameters:

  • cpf_cnpj (String)

    Filtrar pelo CPF ou CNPJ do emitente. Utilize o valor sem máscara.

  • ambiente (String)

    Identificação do Ambiente. Valores aceitos: homologacao, producao

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

    the optional parameters

Options Hash (opts):

  • :top (Integer)

    Limite no número de objetos a serem retornados pela API, entre 1 e 100. (default to 10)

  • :skip (Integer)

    Quantidade de objetos que serão ignorados antes da lista começar a ser retornada. (default to 0)

  • :inlinecount (Boolean)

    Inclui no JSON de resposta, na propriedade &#x60;@count&#x60;, o número total de registros que o filtro retornaria, independente dos filtros de paginação. (default to false)

  • :referencia (String)

Returns:



935
936
937
938
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 935

def listar_lotes_nfse(cpf_cnpj, ambiente, opts = {})
  data, _status_code, _headers = listar_lotes_nfse_with_http_info(cpf_cnpj, ambiente, opts)
  data
end

#listar_lotes_nfse_with_http_info(cpf_cnpj, ambiente, opts = {}) ⇒ Array<(RpsLoteListagem, Integer, Hash)>

Listar lotes de NFS-e Retorna a lista dos lotes de acordo com os critérios de busca utilizados. Os lotes são retornados ordenados pela data da criação, com os mais recentes aparecendo primeiro.

Parameters:

  • cpf_cnpj (String)

    Filtrar pelo CPF ou CNPJ do emitente. Utilize o valor sem máscara.

  • ambiente (String)

    Identificação do Ambiente. Valores aceitos: homologacao, producao

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

    the optional parameters

Options Hash (opts):

  • :top (Integer)

    Limite no número de objetos a serem retornados pela API, entre 1 e 100. (default to 10)

  • :skip (Integer)

    Quantidade de objetos que serão ignorados antes da lista começar a ser retornada. (default to 0)

  • :inlinecount (Boolean)

    Inclui no JSON de resposta, na propriedade &#x60;@count&#x60;, o número total de registros que o filtro retornaria, independente dos filtros de paginação. (default to false)

  • :referencia (String)

Returns:

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

    RpsLoteListagem data, response status code and response headers



950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 950

def listar_lotes_nfse_with_http_info(cpf_cnpj, ambiente, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfseApi.listar_lotes_nfse ...'
  end
  # verify the required parameter 'cpf_cnpj' is set
  if @api_client.config.client_side_validation && cpf_cnpj.nil?
    fail ArgumentError, "Missing the required parameter 'cpf_cnpj' when calling NfseApi.listar_lotes_nfse"
  end
  # verify the required parameter 'ambiente' is set
  if @api_client.config.client_side_validation && ambiente.nil?
    fail ArgumentError, "Missing the required parameter 'ambiente' when calling NfseApi.listar_lotes_nfse"
  end
  # resource path
  local_var_path = '/nfse/lotes'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'cpf_cnpj'] = cpf_cnpj
  query_params[:'ambiente'] = ambiente
  query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?
  query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?
  query_params[:'$inlinecount'] = opts[:'inlinecount'] if !opts[:'inlinecount'].nil?
  query_params[:'referencia'] = opts[:'referencia'] if !opts[:'referencia'].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] || 'RpsLoteListagem'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['jwt', 'oauth2']

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

#listar_nfse(cpf_cnpj, ambiente, opts = {}) ⇒ NfseListagem

Listar NFS-e Retorna a lista de notas de acordo com os critérios de busca utilizados. As notas são retornadas ordenadas pela data da criação, com as mais recentes aparecendo primeiro.

Parameters:

  • cpf_cnpj (String)

    Filtrar pelo CPF ou CNPJ do emitente. Utilize o valor sem máscara.

  • ambiente (String)

    Identificação do Ambiente. Valores aceitos: homologacao, producao

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

    the optional parameters

Options Hash (opts):

  • :top (Integer)

    Limite no número de objetos a serem retornados pela API, entre 1 e 100. (default to 10)

  • :skip (Integer)

    Quantidade de objetos que serão ignorados antes da lista começar a ser retornada. (default to 0)

  • :inlinecount (Boolean)

    Inclui no JSON de resposta, na propriedade &#x60;@count&#x60;, o número total de registros que o filtro retornaria, independente dos filtros de paginação. (default to false)

  • :referencia (String)

    Seu identificador único para o documento.

  • :chave (String)

    Chave de acesso do DF-e.

  • :serie (String)

    Série do DF-e.

Returns:



1020
1021
1022
1023
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 1020

def listar_nfse(cpf_cnpj, ambiente, opts = {})
  data, _status_code, _headers = listar_nfse_with_http_info(cpf_cnpj, ambiente, opts)
  data
end

#listar_nfse_with_http_info(cpf_cnpj, ambiente, opts = {}) ⇒ Array<(NfseListagem, Integer, Hash)>

Listar NFS-e Retorna a lista de notas de acordo com os critérios de busca utilizados. As notas são retornadas ordenadas pela data da criação, com as mais recentes aparecendo primeiro.

Parameters:

  • cpf_cnpj (String)

    Filtrar pelo CPF ou CNPJ do emitente. Utilize o valor sem máscara.

  • ambiente (String)

    Identificação do Ambiente. Valores aceitos: homologacao, producao

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

    the optional parameters

Options Hash (opts):

  • :top (Integer)

    Limite no número de objetos a serem retornados pela API, entre 1 e 100. (default to 10)

  • :skip (Integer)

    Quantidade de objetos que serão ignorados antes da lista começar a ser retornada. (default to 0)

  • :inlinecount (Boolean)

    Inclui no JSON de resposta, na propriedade &#x60;@count&#x60;, o número total de registros que o filtro retornaria, independente dos filtros de paginação. (default to false)

  • :referencia (String)

    Seu identificador único para o documento.

  • :chave (String)

    Chave de acesso do DF-e.

  • :serie (String)

    Série do DF-e.

Returns:

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

    NfseListagem data, response status code and response headers



1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 1037

def listar_nfse_with_http_info(cpf_cnpj, ambiente, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfseApi.listar_nfse ...'
  end
  # verify the required parameter 'cpf_cnpj' is set
  if @api_client.config.client_side_validation && cpf_cnpj.nil?
    fail ArgumentError, "Missing the required parameter 'cpf_cnpj' when calling NfseApi.listar_nfse"
  end
  # verify the required parameter 'ambiente' is set
  if @api_client.config.client_side_validation && ambiente.nil?
    fail ArgumentError, "Missing the required parameter 'ambiente' when calling NfseApi.listar_nfse"
  end
  # resource path
  local_var_path = '/nfse'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'cpf_cnpj'] = cpf_cnpj
  query_params[:'ambiente'] = ambiente
  query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?
  query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?
  query_params[:'$inlinecount'] = opts[:'inlinecount'] if !opts[:'inlinecount'].nil?
  query_params[:'referencia'] = opts[:'referencia'] if !opts[:'referencia'].nil?
  query_params[:'chave'] = opts[:'chave'] if !opts[:'chave'].nil?
  query_params[:'serie'] = opts[:'serie'] if !opts[:'serie'].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] || 'NfseListagem'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['jwt', 'oauth2']

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

#sincronizar_nfse(id, opts = {}) ⇒ NfseSincronizacao

Sincroniza dados na NFS-e a partir da Prefeitura Realiza a sincronização dos dados a partir da consulta da situação atual da NFS-e na prefeitura. **Cenários de uso**: * Sincronizar uma nota que se encontra com o status ‘processando` na Nuvem Fiscal, mas está autorizada na prefeitura; * Sincronizar uma nota que se encontra com o status `erro` na Nuvem Fiscal, mas está autorizada na prefeitura (útil em casos de erros de transmissão, como instabilidades e timeouts); * Sincronizar uma nota que se encontra com o status `autorizada`na Nuvem Fiscal, mas está cancelada na prefeitura. **Informações adicionais**: - Cota: <a href="/docs/limites#dfe-eventos">dfe-eventos</a> - Consumo: 1 unidade por evento sincronizado ou requisição.

Parameters:

  • id (String)

    ID único da NFS-e gerado pela Nuvem Fiscal.

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

    the optional parameters

Options Hash (opts):

Returns:



1103
1104
1105
1106
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 1103

def sincronizar_nfse(id, opts = {})
  data, _status_code, _headers = sincronizar_nfse_with_http_info(id, opts)
  data
end

#sincronizar_nfse_with_http_info(id, opts = {}) ⇒ Array<(NfseSincronizacao, Integer, Hash)>

Sincroniza dados na NFS-e a partir da Prefeitura Realiza a sincronização dos dados a partir da consulta da situação atual da NFS-e na prefeitura. **Cenários de uso**: * Sincronizar uma nota que se encontra com o status &#x60;processando&#x60; na Nuvem Fiscal, mas está autorizada na prefeitura; * Sincronizar uma nota que se encontra com o status &#x60;erro&#x60; na Nuvem Fiscal, mas está autorizada na prefeitura (útil em casos de erros de transmissão, como instabilidades e timeouts); * Sincronizar uma nota que se encontra com o status &#x60;autorizada&#x60;na Nuvem Fiscal, mas está cancelada na prefeitura. **Informações adicionais**: - Cota: &lt;a href&#x3D;&quot;/docs/limites#dfe-eventos&quot;&gt;dfe-eventos&lt;/a&gt; - Consumo: 1 unidade por evento sincronizado ou requisição.

Parameters:

  • id (String)

    ID único da NFS-e gerado pela Nuvem Fiscal.

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

    the optional parameters

Options Hash (opts):

Returns:

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

    NfseSincronizacao data, response status code and response headers



1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
# File 'lib/nuvemfiscal_sdk_ruby/api/nfse_api.rb', line 1114

def sincronizar_nfse_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfseApi.sincronizar_nfse ...'
  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 NfseApi.sincronizar_nfse"
  end
  # resource path
  local_var_path = '/nfse/{id}/sincronizar'.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']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

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

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])

  # return_type
  return_type = opts[:debug_return_type] || 'NfseSincronizacao'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['jwt', 'oauth2']

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