Class: NuvemfiscalSdkRuby::NfceApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ NfceApi

Returns a new instance of NfceApi.



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

def api_client
  @api_client
end

Instance Method Details

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

Comandos ESC/POS para impressão do DANFCE ESC/POS é um sistema de comando criado pela Epson usado em diversos sistemas de impressoras POS. Com o formato ESC/POS, você poderá imprimir nativamente em uma vasta quantidade de modelos de impressora térmicas utilizadas no Brasil e no mundo. Com ela, você consegue fazer o envio de comandos em ESC/POS direto para a porta da impressora.

Parameters:

  • id (String)

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

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

    the optional parameters

Options Hash (opts):

  • :modelo (Integer)

    Modelo da impressora: * `0` - Texto * `1` - Epson * `2` - Bematech * `3` - Daruma * `4` - Vox * `5` - Diebold * `6` - Epson P2 * `7` - CustomPos * `8` - Star * `9` - Zjiang * `10` - GPrinter * `11` - Datecs * `12` - Sunmi * `13` - Externo (default to 1)

  • :colunas (Integer)

    Define o máximo de caracteres, em uma linha, usando a fonte normal. Ex: 40, 42, 48, 58, 80. (default to 48)

  • :qrcode_lateral (Boolean)

    Imprime o QRCode na lateral do DANFCe. OBS: não suportado por alguns modelos de impressora. (default to false)

Returns:

  • (File)


30
31
32
33
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 30

def baixar_esc_pos_nfce(id, opts = {})
  data, _status_code, _headers = baixar_esc_pos_nfce_with_http_info(id, opts)
  data
end

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

Comandos ESC/POS para impressão do DANFCE ESC/POS é um sistema de comando criado pela Epson usado em diversos sistemas de impressoras POS. Com o formato ESC/POS, você poderá imprimir nativamente em uma vasta quantidade de modelos de impressora térmicas utilizadas no Brasil e no mundo. Com ela, você consegue fazer o envio de comandos em ESC/POS direto para a porta da impressora.

Parameters:

  • id (String)

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

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

    the optional parameters

Options Hash (opts):

  • :modelo (Integer)

    Modelo da impressora: * &#x60;0&#x60; - Texto * &#x60;1&#x60; - Epson * &#x60;2&#x60; - Bematech * &#x60;3&#x60; - Daruma * &#x60;4&#x60; - Vox * &#x60;5&#x60; - Diebold * &#x60;6&#x60; - Epson P2 * &#x60;7&#x60; - CustomPos * &#x60;8&#x60; - Star * &#x60;9&#x60; - Zjiang * &#x60;10&#x60; - GPrinter * &#x60;11&#x60; - Datecs * &#x60;12&#x60; - Sunmi * &#x60;13&#x60; - Externo (default to 1)

  • :colunas (Integer)

    Define o máximo de caracteres, em uma linha, usando a fonte normal. Ex: 40, 42, 48, 58, 80. (default to 48)

  • :qrcode_lateral (Boolean)

    Imprime o QRCode na lateral do DANFCe. OBS: não suportado por alguns modelos de impressora. (default to false)

Returns:

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

    File data, response status code and response headers



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
92
93
94
95
96
97
98
99
100
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 43

def baixar_esc_pos_nfce_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.baixar_esc_pos_nfce ...'
  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 NfceApi.baixar_esc_pos_nfce"
  end
  if @api_client.config.client_side_validation && !opts[:'modelo'].nil? && opts[:'modelo'] > 13
    fail ArgumentError, 'invalid value for "opts[:"modelo"]" when calling NfceApi.baixar_esc_pos_nfce, must be smaller than or equal to 13.'
  end

  if @api_client.config.client_side_validation && !opts[:'modelo'].nil? && opts[:'modelo'] < 0
    fail ArgumentError, 'invalid value for "opts[:"modelo"]" when calling NfceApi.baixar_esc_pos_nfce, must be greater than or equal to 0.'
  end

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'modelo'] = opts[:'modelo'] if !opts[:'modelo'].nil?
  query_params[:'colunas'] = opts[:'colunas'] if !opts[:'colunas'].nil?
  query_params[:'qrcode_lateral'] = opts[:'qrcode_lateral'] if !opts[:'qrcode_lateral'].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 => :"NfceApi.baixar_esc_pos_nfce",
    :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: NfceApi#baixar_esc_pos_nfce\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Baixar PDF do cancelamento

Parameters:

  • id (String)

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

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

    the optional parameters

Returns:

  • (File)


106
107
108
109
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 106

def baixar_pdf_cancelamento_nfce(id, opts = {})
  data, _status_code, _headers = baixar_pdf_cancelamento_nfce_with_http_info(id, opts)
  data
end

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

Baixar PDF do cancelamento

Parameters:

  • id (String)

    ID único da NFC-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



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
153
154
155
156
157
158
159
160
161
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 115

def baixar_pdf_cancelamento_nfce_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.baixar_pdf_cancelamento_nfce ...'
  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 NfceApi.baixar_pdf_cancelamento_nfce"
  end
  # resource path
  local_var_path = '/nfce/{id}/cancelamento/pdf'.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 => :"NfceApi.baixar_pdf_cancelamento_nfce",
    :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: NfceApi#baixar_pdf_cancelamento_nfce\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Baixar PDF do evento

Parameters:

  • id (String)

    ID único do evento gerado pela Nuvem Fiscal.

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

    the optional parameters

Returns:

  • (File)


167
168
169
170
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 167

def baixar_pdf_evento_nfce(id, opts = {})
  data, _status_code, _headers = baixar_pdf_evento_nfce_with_http_info(id, opts)
  data
end

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

Baixar PDF do evento

Parameters:

  • id (String)

    ID único do evento gerado pela Nuvem Fiscal.

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

    the optional parameters

Returns:

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

    File data, response status code and response headers



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
214
215
216
217
218
219
220
221
222
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 176

def baixar_pdf_evento_nfce_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.baixar_pdf_evento_nfce ...'
  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 NfceApi.baixar_pdf_evento_nfce"
  end
  # resource path
  local_var_path = '/nfce/eventos/{id}/pdf'.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 => :"NfceApi.baixar_pdf_evento_nfce",
    :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: NfceApi#baixar_pdf_evento_nfce\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Baixar PDF da inutilização

Parameters:

  • id (String)

    ID único do evento gerado pela Nuvem Fiscal.

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

    the optional parameters

Returns:

  • (File)


228
229
230
231
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 228

def baixar_pdf_inutilizacao_nfce(id, opts = {})
  data, _status_code, _headers = baixar_pdf_inutilizacao_nfce_with_http_info(id, opts)
  data
end

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

Baixar PDF da inutilização

Parameters:

  • id (String)

    ID único do evento gerado pela Nuvem Fiscal.

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

    the optional parameters

Returns:

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

    File data, response status code and response headers



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
275
276
277
278
279
280
281
282
283
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 237

def baixar_pdf_inutilizacao_nfce_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.baixar_pdf_inutilizacao_nfce ...'
  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 NfceApi.baixar_pdf_inutilizacao_nfce"
  end
  # resource path
  local_var_path = '/nfce/inutilizacoes/{id}/pdf'.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 => :"NfceApi.baixar_pdf_inutilizacao_nfce",
    :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: NfceApi#baixar_pdf_inutilizacao_nfce\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Baixar PDF do DANFCE

Parameters:

  • id (String)

    ID único da NFC-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)

  • :nome_fantasia (Boolean)

    Exibe o nome fantasia do emitente, desde que esteja presente no XML da nota. (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;

  • :resumido (Boolean)

    Poderá ser impresso apenas o DANFE NFC-e resumido ou ecológico, sem o detalhamento dos itens da venda, desde que a Unidade Federada permita esta opção em sua legislação e o consumidor assim o solicite. (default to false)

  • :qrcode_lateral (Boolean)

    Imprime o QRCode na lateral do DANFE NFC-e. *Disponível apenas para DANFE com 80 milímetros de largura*. (default to false)

  • :largura (Integer)

    Largura do DANFE NFC-e (em milímetros). (default to 80)

  • :margem (String)

    Define as margens do DANFE NFC-e (em milímetros). Essa propriedade pode ser especificada usando um, dois, três ou quatro valores (separados por vírgulas). Cada valor deve ser um número entre &#x60;0&#x60; e &#x60;9&#x60;. * Quando um valor é especificado, a mesma margem é aplicada para **todos os quatro lados**. * Quando dois valores são especificados, a primeira margem é aplicada aos **lados esquerdo e direito**, e a segunda aos **lados superior e inferior**. * Quando **três** valores são especificados, a primeira margem é aplicada ao **lado esquerdo**, a segunda aos **lados superior e inferior**, e a terceira ao **lado direito**. * Quando quatro valores são especificados, as margens são aplicadas aos lados esquerdo, superior, direito e inferior, nesta ordem (sentido horário). **Exemplos de uso**: * &#x60;margem&#x3D;1&#x60; - Margem esquerda: 1mm - Margem superior: 1mm - Margem direita: 1mm - Margem inferior: 1mm * &#x60;margem&#x3D;1,2&#x60; - Margem esquerda: 1mm - Margem superior: 2mm - Margem direita: 1mm - Margem inferior: 2mm * &#x60;margem&#x3D;1,2,3&#x60; - Margem esquerda: 1mm - Margem superior: 2mm - Margem direita: 3mm - Margem inferior: 2mm * &#x60;margem&#x3D;1,2,3,4&#x60; - Margem esquerda: 1mm - Margem superior: 2mm - Margem direita: 3mm - Margem inferior: 4mm (default to ‘2’)

Returns:

  • (File)


296
297
298
299
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 296

def baixar_pdf_nfce(id, opts = {})
  data, _status_code, _headers = baixar_pdf_nfce_with_http_info(id, opts)
  data
end

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

Baixar PDF do DANFCE

Parameters:

  • id (String)

    ID único da NFC-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)

  • :nome_fantasia (Boolean)

    Exibe o nome fantasia do emitente, desde que esteja presente no XML da nota. (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;

  • :resumido (Boolean)

    Poderá ser impresso apenas o DANFE NFC-e resumido ou ecológico, sem o detalhamento dos itens da venda, desde que a Unidade Federada permita esta opção em sua legislação e o consumidor assim o solicite. (default to false)

  • :qrcode_lateral (Boolean)

    Imprime o QRCode na lateral do DANFE NFC-e. *Disponível apenas para DANFE com 80 milímetros de largura*. (default to false)

  • :largura (Integer)

    Largura do DANFE NFC-e (em milímetros). (default to 80)

  • :margem (String)

    Define as margens do DANFE NFC-e (em milímetros). Essa propriedade pode ser especificada usando um, dois, três ou quatro valores (separados por vírgulas). Cada valor deve ser um número entre &#x60;0&#x60; e &#x60;9&#x60;. * Quando um valor é especificado, a mesma margem é aplicada para **todos os quatro lados**. * Quando dois valores são especificados, a primeira margem é aplicada aos **lados esquerdo e direito**, e a segunda aos **lados superior e inferior**. * Quando **três** valores são especificados, a primeira margem é aplicada ao **lado esquerdo**, a segunda aos **lados superior e inferior**, e a terceira ao **lado direito**. * Quando quatro valores são especificados, as margens são aplicadas aos lados esquerdo, superior, direito e inferior, nesta ordem (sentido horário). **Exemplos de uso**: * &#x60;margem&#x3D;1&#x60; - Margem esquerda: 1mm - Margem superior: 1mm - Margem direita: 1mm - Margem inferior: 1mm * &#x60;margem&#x3D;1,2&#x60; - Margem esquerda: 1mm - Margem superior: 2mm - Margem direita: 1mm - Margem inferior: 2mm * &#x60;margem&#x3D;1,2,3&#x60; - Margem esquerda: 1mm - Margem superior: 2mm - Margem direita: 3mm - Margem inferior: 2mm * &#x60;margem&#x3D;1,2,3,4&#x60; - Margem esquerda: 1mm - Margem superior: 2mm - Margem direita: 3mm - Margem inferior: 4mm (default to ‘2’)

Returns:

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

    File data, response status code and response headers



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
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 312

def baixar_pdf_nfce_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.baixar_pdf_nfce ...'
  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 NfceApi.baixar_pdf_nfce"
  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 NfceApi.baixar_pdf_nfce, the character length must be smaller than or equal to 120.'
  end

  if @api_client.config.client_side_validation && !opts[:'largura'].nil? && opts[:'largura'] > 80
    fail ArgumentError, 'invalid value for "opts[:"largura"]" when calling NfceApi.baixar_pdf_nfce, must be smaller than or equal to 80.'
  end

  if @api_client.config.client_side_validation && !opts[:'largura'].nil? && opts[:'largura'] < 40
    fail ArgumentError, 'invalid value for "opts[:"largura"]" when calling NfceApi.baixar_pdf_nfce, must be greater than or equal to 40.'
  end

  # resource path
  local_var_path = '/nfce/{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[:'nome_fantasia'] = opts[:'nome_fantasia'] if !opts[:'nome_fantasia'].nil?
  query_params[:'mensagem_rodape'] = opts[:'mensagem_rodape'] if !opts[:'mensagem_rodape'].nil?
  query_params[:'resumido'] = opts[:'resumido'] if !opts[:'resumido'].nil?
  query_params[:'qrcode_lateral'] = opts[:'qrcode_lateral'] if !opts[:'qrcode_lateral'].nil?
  query_params[:'largura'] = opts[:'largura'] if !opts[:'largura'].nil?
  query_params[:'margem'] = opts[:'margem'] if !opts[:'margem'].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 => :"NfceApi.baixar_pdf_nfce",
    :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: NfceApi#baixar_pdf_nfce\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#baixar_previa_pdf_nfce(body, opts = {}) ⇒ File

Prévia do PDF do DANFCE Através desse endpoint, é possível enviar os dados de uma NFC-e e gerar uma prévia do DANFCE. Os dados de entrada são os mesmos do endpoint de emissão de NFC-e (‘POST /nfce`). **Atenção**: O DANFE gerado por este endpoint é apenas para fins de visualização e não possui valor fiscal. Para a emissão de uma NF-e com valor fiscal, utilize o processo de emissão padrão descrito na documentação. **Informações adicionais**: - Cota: <a href="/docs/limites#dfe-eventos">dfe-eventos</a> - Consumo: 1 unidade por requisição.

Parameters:

  • body (NfePedidoEmissao)
  • 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)

  • :nome_fantasia (Boolean)

    Exibe o nome fantasia do emitente, desde que esteja presente no XML da nota. (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;

  • :resumido (Boolean)

    Poderá ser impresso apenas o DANFE NFC-e resumido ou ecológico, sem o detalhamento dos itens da venda, desde que a Unidade Federada permita esta opção em sua legislação e o consumidor assim o solicite. (default to false)

  • :qrcode_lateral (Boolean)

    Imprime o QRCode na lateral do DANFE NFC-e. *Disponível apenas para DANFE com 80 milímetros de largura*. (default to false)

  • :largura (Integer)

    Largura do DANFE NFC-e (em milímetros). (default to 80)

  • :margem (String)

    Define as margens do DANFE NFC-e (em milímetros). Essa propriedade pode ser especificada usando um, dois, três ou quatro valores (separados por vírgulas). Cada valor deve ser um número entre &#x60;0&#x60; e &#x60;9&#x60;. * Quando um valor é especificado, a mesma margem é aplicada para **todos os quatro lados**. * Quando dois valores são especificados, a primeira margem é aplicada aos **lados esquerdo e direito**, e a segunda aos **lados superior e inferior**. * Quando **três** valores são especificados, a primeira margem é aplicada ao **lado esquerdo**, a segunda aos **lados superior e inferior**, e a terceira ao **lado direito**. * Quando quatro valores são especificados, as margens são aplicadas aos lados esquerdo, superior, direito e inferior, nesta ordem (sentido horário). **Exemplos de uso**: * &#x60;margem&#x3D;1&#x60; - Margem esquerda: 1mm - Margem superior: 1mm - Margem direita: 1mm - Margem inferior: 1mm * &#x60;margem&#x3D;1,2&#x60; - Margem esquerda: 1mm - Margem superior: 2mm - Margem direita: 1mm - Margem inferior: 2mm * &#x60;margem&#x3D;1,2,3&#x60; - Margem esquerda: 1mm - Margem superior: 2mm - Margem direita: 3mm - Margem inferior: 2mm * &#x60;margem&#x3D;1,2,3,4&#x60; - Margem esquerda: 1mm - Margem superior: 2mm - Margem direita: 3mm - Margem inferior: 4mm (default to ‘2’)

Returns:

  • (File)


391
392
393
394
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 391

def baixar_previa_pdf_nfce(body, opts = {})
  data, _status_code, _headers = baixar_previa_pdf_nfce_with_http_info(body, opts)
  data
end

#baixar_previa_pdf_nfce_with_http_info(body, opts = {}) ⇒ Array<(File, Integer, Hash)>

Prévia do PDF do DANFCE Através desse endpoint, é possível enviar os dados de uma NFC-e e gerar uma prévia do DANFCE. Os dados de entrada são os mesmos do endpoint de emissão de NFC-e (&#x60;POST /nfce&#x60;). **Atenção**: O DANFE gerado por este endpoint é apenas para fins de visualização e não possui valor fiscal. Para a emissão de uma NF-e com valor fiscal, utilize o processo de emissão padrão descrito na documentação. **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:

  • body (NfePedidoEmissao)
  • 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)

  • :nome_fantasia (Boolean)

    Exibe o nome fantasia do emitente, desde que esteja presente no XML da nota. (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;

  • :resumido (Boolean)

    Poderá ser impresso apenas o DANFE NFC-e resumido ou ecológico, sem o detalhamento dos itens da venda, desde que a Unidade Federada permita esta opção em sua legislação e o consumidor assim o solicite. (default to false)

  • :qrcode_lateral (Boolean)

    Imprime o QRCode na lateral do DANFE NFC-e. *Disponível apenas para DANFE com 80 milímetros de largura*. (default to false)

  • :largura (Integer)

    Largura do DANFE NFC-e (em milímetros). (default to 80)

  • :margem (String)

    Define as margens do DANFE NFC-e (em milímetros). Essa propriedade pode ser especificada usando um, dois, três ou quatro valores (separados por vírgulas). Cada valor deve ser um número entre &#x60;0&#x60; e &#x60;9&#x60;. * Quando um valor é especificado, a mesma margem é aplicada para **todos os quatro lados**. * Quando dois valores são especificados, a primeira margem é aplicada aos **lados esquerdo e direito**, e a segunda aos **lados superior e inferior**. * Quando **três** valores são especificados, a primeira margem é aplicada ao **lado esquerdo**, a segunda aos **lados superior e inferior**, e a terceira ao **lado direito**. * Quando quatro valores são especificados, as margens são aplicadas aos lados esquerdo, superior, direito e inferior, nesta ordem (sentido horário). **Exemplos de uso**: * &#x60;margem&#x3D;1&#x60; - Margem esquerda: 1mm - Margem superior: 1mm - Margem direita: 1mm - Margem inferior: 1mm * &#x60;margem&#x3D;1,2&#x60; - Margem esquerda: 1mm - Margem superior: 2mm - Margem direita: 1mm - Margem inferior: 2mm * &#x60;margem&#x3D;1,2,3&#x60; - Margem esquerda: 1mm - Margem superior: 2mm - Margem direita: 3mm - Margem inferior: 2mm * &#x60;margem&#x3D;1,2,3,4&#x60; - Margem esquerda: 1mm - Margem superior: 2mm - Margem direita: 3mm - Margem inferior: 4mm (default to ‘2’)

Returns:

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

    File data, response status code and response headers



408
409
410
411
412
413
414
415
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
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 408

def baixar_previa_pdf_nfce_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.baixar_previa_pdf_nfce ...'
  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 NfceApi.baixar_previa_pdf_nfce"
  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 NfceApi.baixar_previa_pdf_nfce, the character length must be smaller than or equal to 120.'
  end

  if @api_client.config.client_side_validation && !opts[:'largura'].nil? && opts[:'largura'] > 80
    fail ArgumentError, 'invalid value for "opts[:"largura"]" when calling NfceApi.baixar_previa_pdf_nfce, must be smaller than or equal to 80.'
  end

  if @api_client.config.client_side_validation && !opts[:'largura'].nil? && opts[:'largura'] < 40
    fail ArgumentError, 'invalid value for "opts[:"largura"]" when calling NfceApi.baixar_previa_pdf_nfce, must be greater than or equal to 40.'
  end

  # resource path
  local_var_path = '/nfce/previa/pdf'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'logotipo'] = opts[:'logotipo'] if !opts[:'logotipo'].nil?
  query_params[:'nome_fantasia'] = opts[:'nome_fantasia'] if !opts[:'nome_fantasia'].nil?
  query_params[:'mensagem_rodape'] = opts[:'mensagem_rodape'] if !opts[:'mensagem_rodape'].nil?
  query_params[:'resumido'] = opts[:'resumido'] if !opts[:'resumido'].nil?
  query_params[:'qrcode_lateral'] = opts[:'qrcode_lateral'] if !opts[:'qrcode_lateral'].nil?
  query_params[:'largura'] = opts[:'largura'] if !opts[:'largura'].nil?
  query_params[:'margem'] = opts[:'margem'] if !opts[:'margem'].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']
  # 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] || 'File'

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

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

#baixar_previa_xml_nfce(body, opts = {}) ⇒ File

Prévia do XML da NFC-e Através desse endpoint, é possível enviar os dados de uma NFC-e e gerar uma prévia do XML, sem a assinatura digital. Os dados de entrada são os mesmos do endpoint de emissão de NFC-e (‘POST /nfce`). **Atenção**: O XML gerado por este endpoint é apenas para fins de visualização e não possui valor fiscal. Para a emissão de uma NF-e com valor fiscal, utilize o processo de emissão padrão descrito na documentação. **Informações adicionais**: - Cota: <a href="/docs/limites#dfe-eventos">dfe-eventos</a> - Consumo: 1 unidade por requisição.

Parameters:

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

    the optional parameters

Returns:

  • (File)


485
486
487
488
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 485

def baixar_previa_xml_nfce(body, opts = {})
  data, _status_code, _headers = baixar_previa_xml_nfce_with_http_info(body, opts)
  data
end

#baixar_previa_xml_nfce_with_http_info(body, opts = {}) ⇒ Array<(File, Integer, Hash)>

Prévia do XML da NFC-e Através desse endpoint, é possível enviar os dados de uma NFC-e e gerar uma prévia do XML, sem a assinatura digital. Os dados de entrada são os mesmos do endpoint de emissão de NFC-e (&#x60;POST /nfce&#x60;). **Atenção**: O XML gerado por este endpoint é apenas para fins de visualização e não possui valor fiscal. Para a emissão de uma NF-e com valor fiscal, utilize o processo de emissão padrão descrito na documentação. **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:

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

    the optional parameters

Returns:

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

    File data, response status code and response headers



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
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 495

def baixar_previa_xml_nfce_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.baixar_previa_xml_nfce ...'
  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 NfceApi.baixar_previa_xml_nfce"
  end
  # resource path
  local_var_path = '/nfce/previa/xml'

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

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

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

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

Baixar XML do cancelamento

Parameters:

  • id (String)

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

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

    the optional parameters

Returns:

  • (File)


552
553
554
555
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 552

def baixar_xml_cancelamento_nfce(id, opts = {})
  data, _status_code, _headers = baixar_xml_cancelamento_nfce_with_http_info(id, opts)
  data
end

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

Baixar XML do cancelamento

Parameters:

  • id (String)

    ID único da NFC-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



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
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 561

def baixar_xml_cancelamento_nfce_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.baixar_xml_cancelamento_nfce ...'
  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 NfceApi.baixar_xml_cancelamento_nfce"
  end
  # resource path
  local_var_path = '/nfce/{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 => :"NfceApi.baixar_xml_cancelamento_nfce",
    :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: NfceApi#baixar_xml_cancelamento_nfce\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Baixar XML do evento

Parameters:

  • id (String)

    ID único do evento gerado pela Nuvem Fiscal.

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

    the optional parameters

Returns:

  • (File)


613
614
615
616
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 613

def baixar_xml_evento_nfce(id, opts = {})
  data, _status_code, _headers = baixar_xml_evento_nfce_with_http_info(id, opts)
  data
end

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

Baixar XML do evento

Parameters:

  • id (String)

    ID único do evento gerado pela Nuvem Fiscal.

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

    the optional parameters

Returns:

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

    File data, response status code and response headers



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
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 622

def baixar_xml_evento_nfce_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.baixar_xml_evento_nfce ...'
  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 NfceApi.baixar_xml_evento_nfce"
  end
  # resource path
  local_var_path = '/nfce/eventos/{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 => :"NfceApi.baixar_xml_evento_nfce",
    :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: NfceApi#baixar_xml_evento_nfce\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Baixar XML da inutilização

Parameters:

  • id (String)

    ID único do evento gerado pela Nuvem Fiscal.

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

    the optional parameters

Returns:

  • (File)


674
675
676
677
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 674

def baixar_xml_inutilizacao_nfce(id, opts = {})
  data, _status_code, _headers = baixar_xml_inutilizacao_nfce_with_http_info(id, opts)
  data
end

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

Baixar XML da inutilização

Parameters:

  • id (String)

    ID único do evento gerado pela Nuvem Fiscal.

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

    the optional parameters

Returns:

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

    File data, response status code and response headers



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
720
721
722
723
724
725
726
727
728
729
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 683

def baixar_xml_inutilizacao_nfce_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.baixar_xml_inutilizacao_nfce ...'
  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 NfceApi.baixar_xml_inutilizacao_nfce"
  end
  # resource path
  local_var_path = '/nfce/inutilizacoes/{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 => :"NfceApi.baixar_xml_inutilizacao_nfce",
    :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: NfceApi#baixar_xml_inutilizacao_nfce\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Baixar XML da NFC-e processada Utilize esse endpoint para obter o XML da nota enviado para a SEFAZ, complementado com a informação do protocolo de autorização ou denegação de uso (TAG raiz nfeProc). O XML só estará disponível nesse endpoint caso a nota tenha sido autorizada ou denegada pela SEFAZ. Para obter o XML nos demais casos, utilize o endpoint ‘GET /nfce/id/xml/nota`.

Parameters:

  • id (String)

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

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

    the optional parameters

Returns:

  • (File)


736
737
738
739
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 736

def baixar_xml_nfce(id, opts = {})
  data, _status_code, _headers = baixar_xml_nfce_with_http_info(id, opts)
  data
end

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

Baixar XML da NFC-e Utilize esse endpoint para obter o XML da nota enviado para a SEFAZ. O XML estará disponível nesse endpoint mesmo em casos que a nota tenha sido rejeitada.

Parameters:

  • id (String)

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

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

    the optional parameters

Returns:

  • (File)


799
800
801
802
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 799

def baixar_xml_nfce_nota(id, opts = {})
  data, _status_code, _headers = baixar_xml_nfce_nota_with_http_info(id, opts)
  data
end

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

Baixar XML da NFC-e Utilize esse endpoint para obter o XML da nota enviado para a SEFAZ. O XML estará disponível nesse endpoint mesmo em casos que a nota tenha sido rejeitada.

Parameters:

  • id (String)

    ID único da NFC-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



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/nfce_api.rb', line 809

def baixar_xml_nfce_nota_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.baixar_xml_nfce_nota ...'
  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 NfceApi.baixar_xml_nfce_nota"
  end
  # resource path
  local_var_path = '/nfce/{id}/xml/nota'.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 => :"NfceApi.baixar_xml_nfce_nota",
    :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: NfceApi#baixar_xml_nfce_nota\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Baixar XML do Protocolo da SEFAZ

Parameters:

  • id (String)

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

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

    the optional parameters

Returns:

  • (File)


861
862
863
864
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 861

def baixar_xml_nfce_protocolo(id, opts = {})
  data, _status_code, _headers = baixar_xml_nfce_protocolo_with_http_info(id, opts)
  data
end

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

Baixar XML do Protocolo da SEFAZ

Parameters:

  • id (String)

    ID único da NFC-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



870
871
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
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 870

def baixar_xml_nfce_protocolo_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.baixar_xml_nfce_protocolo ...'
  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 NfceApi.baixar_xml_nfce_protocolo"
  end
  # resource path
  local_var_path = '/nfce/{id}/xml/protocolo'.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 => :"NfceApi.baixar_xml_nfce_protocolo",
    :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: NfceApi#baixar_xml_nfce_protocolo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

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

Baixar XML da NFC-e processada Utilize esse endpoint para obter o XML da nota enviado para a SEFAZ, complementado com a informação do protocolo de autorização ou denegação de uso (TAG raiz &#x60;nfeProc&#x60;). O XML só estará disponível nesse endpoint caso a nota tenha sido autorizada ou denegada pela SEFAZ. Para obter o XML nos demais casos, utilize o endpoint &#x60;GET /nfce/id/xml/nota&#x60;.

Parameters:

  • id (String)

    ID único da NFC-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



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
788
789
790
791
792
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 746

def baixar_xml_nfce_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.baixar_xml_nfce ...'
  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 NfceApi.baixar_xml_nfce"
  end
  # resource path
  local_var_path = '/nfce/{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 => :"NfceApi.baixar_xml_nfce",
    :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: NfceApi#baixar_xml_nfce\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#cancelar_nfce(id, opts = {}) ⇒ DfeCancelamento

Cancelar uma NFC-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 NFC-e gerado pela Nuvem Fiscal.

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

    the optional parameters

Options Hash (opts):

Returns:



924
925
926
927
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 924

def cancelar_nfce(id, opts = {})
  data, _status_code, _headers = cancelar_nfce_with_http_info(id, opts)
  data
end

#cancelar_nfce_with_http_info(id, opts = {}) ⇒ Array<(DfeCancelamento, Integer, Hash)>

Cancelar uma NFC-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 NFC-e gerado pela Nuvem Fiscal.

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

    the optional parameters

Options Hash (opts):

Returns:

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

    DfeCancelamento data, response status code and response headers



935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
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
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 935

def cancelar_nfce_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.cancelar_nfce ...'
  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 NfceApi.cancelar_nfce"
  end
  # resource path
  local_var_path = '/nfce/{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] || 'DfeCancelamento'

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

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

#consultar_cancelamento_nfce(id, opts = {}) ⇒ DfeCancelamento

Consultar o cancelamento da NFC-e

Parameters:

  • id (String)

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

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

    the optional parameters

Returns:



992
993
994
995
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 992

def consultar_cancelamento_nfce(id, opts = {})
  data, _status_code, _headers = consultar_cancelamento_nfce_with_http_info(id, opts)
  data
end

#consultar_cancelamento_nfce_with_http_info(id, opts = {}) ⇒ Array<(DfeCancelamento, Integer, Hash)>

Consultar o cancelamento da NFC-e

Parameters:

  • id (String)

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

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

    the optional parameters

Returns:

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

    DfeCancelamento data, response status code and response headers



1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1001

def consultar_cancelamento_nfce_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.consultar_cancelamento_nfce ...'
  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 NfceApi.consultar_cancelamento_nfce"
  end
  # resource path
  local_var_path = '/nfce/{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] || 'DfeCancelamento'

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

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

#consultar_evento_nfce(id, opts = {}) ⇒ DfeEvento

Consultar evento

Parameters:

  • id (String)

    ID único do evento gerado pela Nuvem Fiscal.

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

    the optional parameters

Returns:



1053
1054
1055
1056
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1053

def consultar_evento_nfce(id, opts = {})
  data, _status_code, _headers = consultar_evento_nfce_with_http_info(id, opts)
  data
end

#consultar_evento_nfce_with_http_info(id, opts = {}) ⇒ Array<(DfeEvento, Integer, Hash)>

Consultar evento

Parameters:

  • id (String)

    ID único do evento gerado pela Nuvem Fiscal.

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

    the optional parameters

Returns:

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

    DfeEvento data, response status code and response headers



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
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1062

def consultar_evento_nfce_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.consultar_evento_nfce ...'
  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 NfceApi.consultar_evento_nfce"
  end
  # resource path
  local_var_path = '/nfce/eventos/{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] || 'DfeEvento'

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

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

#consultar_inutilizacao_nfce(id, opts = {}) ⇒ DfeInutilizacao

Consultar a inutilização de sequência de numeração

Parameters:

  • id (String)

    ID único do evento gerado pela Nuvem Fiscal.

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

    the optional parameters

Returns:



1114
1115
1116
1117
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1114

def consultar_inutilizacao_nfce(id, opts = {})
  data, _status_code, _headers = consultar_inutilizacao_nfce_with_http_info(id, opts)
  data
end

#consultar_inutilizacao_nfce_with_http_info(id, opts = {}) ⇒ Array<(DfeInutilizacao, Integer, Hash)>

Consultar a inutilização de sequência de numeração

Parameters:

  • id (String)

    ID único do evento gerado pela Nuvem Fiscal.

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

    the optional parameters

Returns:

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

    DfeInutilizacao data, response status code and response headers



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
1166
1167
1168
1169
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1123

def consultar_inutilizacao_nfce_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.consultar_inutilizacao_nfce ...'
  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 NfceApi.consultar_inutilizacao_nfce"
  end
  # resource path
  local_var_path = '/nfce/inutilizacoes/{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] || 'DfeInutilizacao'

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

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

#consultar_lote_nfce(id, opts = {}) ⇒ DfeLote

Consultar lote de NFC-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:



1176
1177
1178
1179
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1176

def consultar_lote_nfce(id, opts = {})
  data, _status_code, _headers = consultar_lote_nfce_with_http_info(id, opts)
  data
end

#consultar_lote_nfce_with_http_info(id, opts = {}) ⇒ Array<(DfeLote, Integer, Hash)>

Consultar lote de NFC-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<(DfeLote, Integer, Hash)>)

    DfeLote data, response status code and response headers



1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1186

def consultar_lote_nfce_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.consultar_lote_nfce ...'
  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 NfceApi.consultar_lote_nfce"
  end
  # resource path
  local_var_path = '/nfce/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] || 'DfeLote'

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

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

#consultar_nfce(id, opts = {}) ⇒ Dfe

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

Parameters:

  • id (String)

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

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

    the optional parameters

Returns:



1239
1240
1241
1242
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1239

def consultar_nfce(id, opts = {})
  data, _status_code, _headers = consultar_nfce_with_http_info(id, opts)
  data
end

#consultar_nfce_with_http_info(id, opts = {}) ⇒ Array<(Dfe, Integer, Hash)>

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

Parameters:

  • id (String)

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

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

    the optional parameters

Returns:

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

    Dfe data, response status code and response headers



1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1249

def consultar_nfce_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.consultar_nfce ...'
  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 NfceApi.consultar_nfce"
  end
  # resource path
  local_var_path = '/nfce/{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] || 'Dfe'

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

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

#consultar_status_sefaz_nfce(cpf_cnpj, opts = {}) ⇒ DfeSefazStatus

Consulta do Status do Serviço na SEFAZ Autorizadora Consulta do status do serviço prestado pelo Portal da Secretaria de Fazenda Estadual. A Nuvem Fiscal mantém a última consulta em cache por 5 minutos, evitando sobrecarregar desnecessariamente os servidores da SEFAZ (conforme orientação do MOC - versão 7.0, item 5.5.3). Dessa forma, você poderá chamar esse endpoint quantas vezes quiser, sem preocupar-se em ter o seu CNPJ bloqueado por consumo indevido (Rejeição 656).

Parameters:

  • cpf_cnpj (String)

    CPF/CNPJ do emitente. Utilize o valor sem máscara.

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

    the optional parameters

Options Hash (opts):

  • :autorizador (String)

    Ambiente Autorizador. Autorizadores disponíveis: &#x60;AM&#x60;, &#x60;BA&#x60;, &#x60;CE&#x60;, &#x60;GO&#x60;, &#x60;MG&#x60;, &#x60;MS&#x60;, &#x60;MT&#x60;, &#x60;PE&#x60;, &#x60;PR&#x60;, &#x60;RS&#x60;, &#x60;SP&#x60;, &#x60;SVRS&#x60;. *Caso não seja informado, será utilizado o ambiente autorizador da UF do emitente.*

Returns:



1303
1304
1305
1306
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1303

def consultar_status_sefaz_nfce(cpf_cnpj, opts = {})
  data, _status_code, _headers = consultar_status_sefaz_nfce_with_http_info(cpf_cnpj, opts)
  data
end

#consultar_status_sefaz_nfce_with_http_info(cpf_cnpj, opts = {}) ⇒ Array<(DfeSefazStatus, Integer, Hash)>

Consulta do Status do Serviço na SEFAZ Autorizadora Consulta do status do serviço prestado pelo Portal da Secretaria de Fazenda Estadual. A Nuvem Fiscal mantém a última consulta em cache por 5 minutos, evitando sobrecarregar desnecessariamente os servidores da SEFAZ (conforme orientação do MOC - versão 7.0, item 5.5.3). Dessa forma, você poderá chamar esse endpoint quantas vezes quiser, sem preocupar-se em ter o seu CNPJ bloqueado por consumo indevido (Rejeição 656).

Parameters:

  • cpf_cnpj (String)

    CPF/CNPJ do emitente. Utilize o valor sem máscara.

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

    the optional parameters

Options Hash (opts):

  • :autorizador (String)

    Ambiente Autorizador. Autorizadores disponíveis: &#x60;AM&#x60;, &#x60;BA&#x60;, &#x60;CE&#x60;, &#x60;GO&#x60;, &#x60;MG&#x60;, &#x60;MS&#x60;, &#x60;MT&#x60;, &#x60;PE&#x60;, &#x60;PR&#x60;, &#x60;RS&#x60;, &#x60;SP&#x60;, &#x60;SVRS&#x60;. *Caso não seja informado, será utilizado o ambiente autorizador da UF do emitente.*

Returns:

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

    DfeSefazStatus data, response status code and response headers



1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1314

def consultar_status_sefaz_nfce_with_http_info(cpf_cnpj, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.consultar_status_sefaz_nfce ...'
  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 NfceApi.consultar_status_sefaz_nfce"
  end
  # resource path
  local_var_path = '/nfce/sefaz/status'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'cpf_cnpj'] = cpf_cnpj
  query_params[:'autorizador'] = opts[:'autorizador'] if !opts[:'autorizador'].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] || 'DfeSefazStatus'

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

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

#emitir_lote_nfce(body, opts = {}) ⇒ DfeLote

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

Parameters:

Returns:



1369
1370
1371
1372
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1369

def emitir_lote_nfce(body, opts = {})
  data, _status_code, _headers = emitir_lote_nfce_with_http_info(body, opts)
  data
end

#emitir_lote_nfce_with_http_info(body, opts = {}) ⇒ Array<(DfeLote, Integer, Hash)>

Emitir lote de NFC-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 NFC-e.

Parameters:

Returns:

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

    DfeLote data, response status code and response headers



1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1379

def emitir_lote_nfce_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.emitir_lote_nfce ...'
  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 NfceApi.emitir_lote_nfce"
  end
  # resource path
  local_var_path = '/nfce/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] || 'DfeLote'

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

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

#emitir_nfce(body, opts = {}) ⇒ Dfe

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

Parameters:

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

    the optional parameters

Returns:



1437
1438
1439
1440
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1437

def emitir_nfce(body, opts = {})
  data, _status_code, _headers = emitir_nfce_with_http_info(body, opts)
  data
end

#emitir_nfce_with_http_info(body, opts = {}) ⇒ Array<(Dfe, Integer, Hash)>

Emitir NFC-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:

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

    the optional parameters

Returns:

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

    Dfe data, response status code and response headers



1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1447

def emitir_nfce_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.emitir_nfce ...'
  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 NfceApi.emitir_nfce"
  end
  # resource path
  local_var_path = '/nfce'

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

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

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

#enviar_email_nfce(id, opts = {}) ⇒ EmailStatusResponse

Enviar e-mail Envia o XML e PDF da nota via email. **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 NFC-e gerado pela Nuvem Fiscal.

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

    the optional parameters

Options Hash (opts):

Returns:



1506
1507
1508
1509
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1506

def enviar_email_nfce(id, opts = {})
  data, _status_code, _headers = enviar_email_nfce_with_http_info(id, opts)
  data
end

#enviar_email_nfce_with_http_info(id, opts = {}) ⇒ Array<(EmailStatusResponse, Integer, Hash)>

Enviar e-mail Envia o XML e PDF da nota via email. **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 NFC-e gerado pela Nuvem Fiscal.

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

    the optional parameters

Options Hash (opts):

Returns:

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

    EmailStatusResponse data, response status code and response headers



1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1517

def enviar_email_nfce_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.enviar_email_nfce ...'
  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 NfceApi.enviar_email_nfce"
  end
  # resource path
  local_var_path = '/nfce/{id}/email'.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] || 'EmailStatusResponse'

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

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

#inutilizar_numeracao_nfce(body, opts = {}) ⇒ DfeInutilizacao

Inutilizar uma sequência de numeração de NFC-e **Informações adicionais**: - Cota: <a href="/docs/limites#dfe-eventos">dfe-eventos</a> - Consumo: 1 unidade por requisição.

Parameters:

Returns:



1575
1576
1577
1578
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1575

def inutilizar_numeracao_nfce(body, opts = {})
  data, _status_code, _headers = inutilizar_numeracao_nfce_with_http_info(body, opts)
  data
end

#inutilizar_numeracao_nfce_with_http_info(body, opts = {}) ⇒ Array<(DfeInutilizacao, Integer, Hash)>

Inutilizar uma sequência de numeração de NFC-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<(DfeInutilizacao, Integer, Hash)>)

    DfeInutilizacao data, response status code and response headers



1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1585

def inutilizar_numeracao_nfce_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.inutilizar_numeracao_nfce ...'
  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 NfceApi.inutilizar_numeracao_nfce"
  end
  # resource path
  local_var_path = '/nfce/inutilizacoes'

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

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

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

#listar_eventos_nfce(dfe_id, opts = {}) ⇒ DfeEventoListagem

Listar eventos Retorna a lista de eventos vinculados a um documento fiscal de acordo com os critérios de busca utilizados. Os eventos são retornados ordenados pela data da criação, com as mais recentes aparecendo primeiro.

Parameters:

  • dfe_id (String)

    ID único gerado pela Nuvem Fiscal para o documento fiscal.

  • 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)

Returns:



1646
1647
1648
1649
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1646

def listar_eventos_nfce(dfe_id, opts = {})
  data, _status_code, _headers = listar_eventos_nfce_with_http_info(dfe_id, opts)
  data
end

#listar_eventos_nfce_with_http_info(dfe_id, opts = {}) ⇒ Array<(DfeEventoListagem, Integer, Hash)>

Listar eventos Retorna a lista de eventos vinculados a um documento fiscal de acordo com os critérios de busca utilizados. Os eventos são retornados ordenados pela data da criação, com as mais recentes aparecendo primeiro.

Parameters:

  • dfe_id (String)

    ID único gerado pela Nuvem Fiscal para o documento fiscal.

  • 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)

Returns:

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

    DfeEventoListagem data, response status code and response headers



1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1659

def listar_eventos_nfce_with_http_info(dfe_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.listar_eventos_nfce ...'
  end
  # verify the required parameter 'dfe_id' is set
  if @api_client.config.client_side_validation && dfe_id.nil?
    fail ArgumentError, "Missing the required parameter 'dfe_id' when calling NfceApi.listar_eventos_nfce"
  end
  # resource path
  local_var_path = '/nfce/eventos'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'dfe_id'] = dfe_id
  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?

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

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

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

#listar_lotes_nfce(cpf_cnpj, ambiente, opts = {}) ⇒ DfeLoteListagem

Listar lotes de NFC-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:



1721
1722
1723
1724
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1721

def listar_lotes_nfce(cpf_cnpj, ambiente, opts = {})
  data, _status_code, _headers = listar_lotes_nfce_with_http_info(cpf_cnpj, ambiente, opts)
  data
end

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

Listar lotes de NFC-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<(DfeLoteListagem, Integer, Hash)>)

    DfeLoteListagem data, response status code and response headers



1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1736

def listar_lotes_nfce_with_http_info(cpf_cnpj, ambiente, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.listar_lotes_nfce ...'
  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 NfceApi.listar_lotes_nfce"
  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 NfceApi.listar_lotes_nfce"
  end
  # resource path
  local_var_path = '/nfce/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] || 'DfeLoteListagem'

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

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

#listar_nfce(cpf_cnpj, ambiente, opts = {}) ⇒ DfeListagem

Listar NFC-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:



1806
1807
1808
1809
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1806

def listar_nfce(cpf_cnpj, ambiente, opts = {})
  data, _status_code, _headers = listar_nfce_with_http_info(cpf_cnpj, ambiente, opts)
  data
end

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

Listar NFC-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<(DfeListagem, Integer, Hash)>)

    DfeListagem data, response status code and response headers



1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1823

def listar_nfce_with_http_info(cpf_cnpj, ambiente, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: NfceApi.listar_nfce ...'
  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 NfceApi.listar_nfce"
  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 NfceApi.listar_nfce"
  end
  # resource path
  local_var_path = '/nfce'

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

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

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

#sincronizar_nfce(id, opts = {}) ⇒ DfeSincronizacao

Sincroniza dados na NFC-e a partir da SEFAZ Realiza a sincronização dos dados a partir da consulta da situação atual da NFC-e na Base de Dados do Portal da Secretaria de Fazenda Estadual. **Cenários de uso**: * Sincronizar uma nota que se encontra com o status erro na Nuvem Fiscal, mas está autorizada na SEFAZ (útil em casos de erros de transmissão com a SEFAZ, como instabilidades e timeouts). * Sincronizar uma nota que se encontra com o status ‘autorizado`na Nuvem Fiscal, mas está cancelada na SEFAZ. * Sincronizar todos os eventos de Cancelamento, Carta de Correção e EPEC de uma nota que porventura não tenham sido feitos a partir da Nuvem Fiscal. **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 NFC-e gerado pela Nuvem Fiscal.

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

    the optional parameters

Returns:



1888
1889
1890
1891
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1888

def sincronizar_nfce(id, opts = {})
  data, _status_code, _headers = sincronizar_nfce_with_http_info(id, opts)
  data
end

#sincronizar_nfce_with_http_info(id, opts = {}) ⇒ Array<(DfeSincronizacao, Integer, Hash)>

Sincroniza dados na NFC-e a partir da SEFAZ Realiza a sincronização dos dados a partir da consulta da situação atual da NFC-e na Base de Dados do Portal da Secretaria de Fazenda Estadual. **Cenários de uso**: * Sincronizar uma nota que se encontra com o status &#x60;erro&#x60; na Nuvem Fiscal, mas está autorizada na SEFAZ (útil em casos de erros de transmissão com a SEFAZ, como instabilidades e timeouts). * Sincronizar uma nota que se encontra com o status &#x60;autorizado&#x60;na Nuvem Fiscal, mas está cancelada na SEFAZ. * Sincronizar todos os eventos de Cancelamento, Carta de Correção e EPEC de uma nota que porventura não tenham sido feitos a partir da Nuvem Fiscal. **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 NFC-e gerado pela Nuvem Fiscal.

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

    the optional parameters

Returns:

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

    DfeSincronizacao data, response status code and response headers



1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
# File 'lib/nuvemfiscal_sdk_ruby/api/nfce_api.rb', line 1898

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

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

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

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

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

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