Todas as URIs relativas a https://api.nuvemfiscal.com.br
Método | Endpoint | Descrição |
---|---|---|
BaixarPdfCancelamentoCte | GET /cte/{id}/cancelamento/pdf | Baixar PDF do cancelamento |
BaixarPdfCartaCorrecaoCte | GET /cte/{id}/carta-correcao/pdf | Baixar PDF da carta de correção |
BaixarPdfCte | GET /cte/{id}/pdf | Baixar PDF do DACTE |
BaixarPdfEventoCte | GET /cte/eventos/{id}/pdf | Baixar PDF do evento |
BaixarXmlCancelamentoCte | GET /cte/{id}/cancelamento/xml | Baixar XML do cancelamento |
BaixarXmlCartaCorrecaoCte | GET /cte/{id}/carta-correcao/xml | Baixar XML da carta de correção |
BaixarXmlCte | GET /cte/{id}/xml | Baixar XML do CT-e processado |
BaixarXmlCteConhecimento | GET /cte/{id}/xml/conhecimento | Baixar XML do CT-e |
BaixarXmlCteProtocolo | GET /cte/{id}/xml/protocolo | Baixar XML do Protocolo da SEFAZ |
BaixarXmlEventoCte | GET /cte/eventos/{id}/xml | Baixar XML do evento |
CancelarCte | POST /cte/{id}/cancelamento | Cancelar um CT-e autorizado |
ConsultarCancelamentoCte | GET /cte/{id}/cancelamento | Consultar o cancelamento do CT-e |
ConsultarCartaCorrecaoCte | GET /cte/{id}/carta-correcao | Consultar a solicitação de correção do CT-e |
ConsultarCte | GET /cte/{id} | Consultar CT-e |
ConsultarEventoCte | GET /cte/eventos/{id} | Consultar evento |
ConsultarStatusSefazCte | GET /cte/sefaz/status | Consulta do Status do Serviço na SEFAZ Autorizadora |
CriarCartaCorrecaoCte | POST /cte/{id}/carta-correcao | Solicitar correção do CT-e |
EmitirCte | POST /cte | Emitir CT-e |
ListarCte | GET /cte | Listar CT-e |
SincronizarCte | POST /cte/{id}/sincronizar | Sincroniza dados no CT-e a partir da SEFAZ |
FileParameter BaixarPdfCancelamentoCte (string id)
Baixar PDF do cancelamento
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using NuvemFiscal.Sdk.Api;
using NuvemFiscal.Sdk.Client;
using NuvemFiscal.Sdk.Model;
namespace Example
{
public class BaixarPdfCancelamentoCteExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.nuvemfiscal.com.br";
// Configure API key authorization: jwt
config.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("Authorization", "Bearer");
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new CteApi(httpClient, config, httpClientHandler);
var id = "id_example"; // string | ID único do CT-e gerado pela Nuvem Fiscal.
try
{
// Baixar PDF do cancelamento
FileParameter result = apiInstance.BaixarPdfCancelamentoCte(id);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CteApi.BaixarPdfCancelamentoCte: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Esses métodos retornam um objeto ApiResponse que contêm os dados da resposta, o código de status e os headers HTTP.
try
{
// Baixar PDF do cancelamento
ApiResponse<FileParameter> response = apiInstance.BaixarPdfCancelamentoCteWithHttpInfo(id);
Debug.Write("Código de status: " + response.StatusCode);
Debug.Write("Headers da resposta: " + response.Headers);
Debug.Write("Conteúdo da resposta: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exceção ao chamar CteApi.BaixarPdfCancelamentoCteWithHttpInfo: " + e.Message);
Debug.Print("Código de status: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Nome | Tipo | Descrição | Comentários |
---|---|---|---|
id | string | ID único do CT-e gerado pela Nuvem Fiscal. |
- Content-Type: Não especificado
- Accept: /
Código status | Descrição | Headers da resposta |
---|---|---|
200 | Successful response | - |
[Voltar ao topo] [Voltar à listagem da API] [Voltar à lista de DTOs] [Voltar ao README]
FileParameter BaixarPdfCartaCorrecaoCte (string id)
Baixar PDF da carta de correção
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using NuvemFiscal.Sdk.Api;
using NuvemFiscal.Sdk.Client;
using NuvemFiscal.Sdk.Model;
namespace Example
{
public class BaixarPdfCartaCorrecaoCteExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.nuvemfiscal.com.br";
// Configure API key authorization: jwt
config.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("Authorization", "Bearer");
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new CteApi(httpClient, config, httpClientHandler);
var id = "id_example"; // string | ID único do CT-e gerado pela Nuvem Fiscal.
try
{
// Baixar PDF da carta de correção
FileParameter result = apiInstance.BaixarPdfCartaCorrecaoCte(id);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CteApi.BaixarPdfCartaCorrecaoCte: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Esses métodos retornam um objeto ApiResponse que contêm os dados da resposta, o código de status e os headers HTTP.
try
{
// Baixar PDF da carta de correção
ApiResponse<FileParameter> response = apiInstance.BaixarPdfCartaCorrecaoCteWithHttpInfo(id);
Debug.Write("Código de status: " + response.StatusCode);
Debug.Write("Headers da resposta: " + response.Headers);
Debug.Write("Conteúdo da resposta: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exceção ao chamar CteApi.BaixarPdfCartaCorrecaoCteWithHttpInfo: " + e.Message);
Debug.Print("Código de status: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Nome | Tipo | Descrição | Comentários |
---|---|---|---|
id | string | ID único do CT-e gerado pela Nuvem Fiscal. |
- Content-Type: Não especificado
- Accept: /
Código status | Descrição | Headers da resposta |
---|---|---|
200 | Successful response | - |
[Voltar ao topo] [Voltar à listagem da API] [Voltar à lista de DTOs] [Voltar ao README]
FileParameter BaixarPdfCte (string id, bool? logotipo = null)
Baixar PDF do DACTE
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using NuvemFiscal.Sdk.Api;
using NuvemFiscal.Sdk.Client;
using NuvemFiscal.Sdk.Model;
namespace Example
{
public class BaixarPdfCteExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.nuvemfiscal.com.br";
// Configure API key authorization: jwt
config.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("Authorization", "Bearer");
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new CteApi(httpClient, config, httpClientHandler);
var id = "id_example"; // string | ID único do CT-e gerado pela Nuvem Fiscal.
var logotipo = false; // bool? | Imprime o documento com logotipo, desde que esteja cadastrado na empresa. (optional) (default to false)
try
{
// Baixar PDF do DACTE
FileParameter result = apiInstance.BaixarPdfCte(id, logotipo);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CteApi.BaixarPdfCte: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Esses métodos retornam um objeto ApiResponse que contêm os dados da resposta, o código de status e os headers HTTP.
try
{
// Baixar PDF do DACTE
ApiResponse<FileParameter> response = apiInstance.BaixarPdfCteWithHttpInfo(id, logotipo);
Debug.Write("Código de status: " + response.StatusCode);
Debug.Write("Headers da resposta: " + response.Headers);
Debug.Write("Conteúdo da resposta: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exceção ao chamar CteApi.BaixarPdfCteWithHttpInfo: " + e.Message);
Debug.Print("Código de status: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Nome | Tipo | Descrição | Comentários |
---|---|---|---|
id | string | ID único do CT-e gerado pela Nuvem Fiscal. | |
logotipo | bool? | Imprime o documento com logotipo, desde que esteja cadastrado na empresa. | [optional] [default to false] |
- Content-Type: Não especificado
- Accept: /
Código status | Descrição | Headers da resposta |
---|---|---|
200 | Successful response | - |
[Voltar ao topo] [Voltar à listagem da API] [Voltar à lista de DTOs] [Voltar ao README]
FileParameter BaixarPdfEventoCte (string id)
Baixar PDF do evento
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using NuvemFiscal.Sdk.Api;
using NuvemFiscal.Sdk.Client;
using NuvemFiscal.Sdk.Model;
namespace Example
{
public class BaixarPdfEventoCteExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.nuvemfiscal.com.br";
// Configure API key authorization: jwt
config.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("Authorization", "Bearer");
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new CteApi(httpClient, config, httpClientHandler);
var id = "id_example"; // string | ID único do evento gerado pela Nuvem Fiscal.
try
{
// Baixar PDF do evento
FileParameter result = apiInstance.BaixarPdfEventoCte(id);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CteApi.BaixarPdfEventoCte: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Esses métodos retornam um objeto ApiResponse que contêm os dados da resposta, o código de status e os headers HTTP.
try
{
// Baixar PDF do evento
ApiResponse<FileParameter> response = apiInstance.BaixarPdfEventoCteWithHttpInfo(id);
Debug.Write("Código de status: " + response.StatusCode);
Debug.Write("Headers da resposta: " + response.Headers);
Debug.Write("Conteúdo da resposta: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exceção ao chamar CteApi.BaixarPdfEventoCteWithHttpInfo: " + e.Message);
Debug.Print("Código de status: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Nome | Tipo | Descrição | Comentários |
---|---|---|---|
id | string | ID único do evento gerado pela Nuvem Fiscal. |
- Content-Type: Não especificado
- Accept: /
Código status | Descrição | Headers da resposta |
---|---|---|
200 | Successful response | - |
[Voltar ao topo] [Voltar à listagem da API] [Voltar à lista de DTOs] [Voltar ao README]
FileParameter BaixarXmlCancelamentoCte (string id)
Baixar XML do cancelamento
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using NuvemFiscal.Sdk.Api;
using NuvemFiscal.Sdk.Client;
using NuvemFiscal.Sdk.Model;
namespace Example
{
public class BaixarXmlCancelamentoCteExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.nuvemfiscal.com.br";
// Configure API key authorization: jwt
config.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("Authorization", "Bearer");
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new CteApi(httpClient, config, httpClientHandler);
var id = "id_example"; // string | ID único do CT-e gerado pela Nuvem Fiscal.
try
{
// Baixar XML do cancelamento
FileParameter result = apiInstance.BaixarXmlCancelamentoCte(id);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CteApi.BaixarXmlCancelamentoCte: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Esses métodos retornam um objeto ApiResponse que contêm os dados da resposta, o código de status e os headers HTTP.
try
{
// Baixar XML do cancelamento
ApiResponse<FileParameter> response = apiInstance.BaixarXmlCancelamentoCteWithHttpInfo(id);
Debug.Write("Código de status: " + response.StatusCode);
Debug.Write("Headers da resposta: " + response.Headers);
Debug.Write("Conteúdo da resposta: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exceção ao chamar CteApi.BaixarXmlCancelamentoCteWithHttpInfo: " + e.Message);
Debug.Print("Código de status: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Nome | Tipo | Descrição | Comentários |
---|---|---|---|
id | string | ID único do CT-e gerado pela Nuvem Fiscal. |
- Content-Type: Não especificado
- Accept: /
Código status | Descrição | Headers da resposta |
---|---|---|
200 | Successful response | - |
[Voltar ao topo] [Voltar à listagem da API] [Voltar à lista de DTOs] [Voltar ao README]
FileParameter BaixarXmlCartaCorrecaoCte (string id)
Baixar XML da carta de correção
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using NuvemFiscal.Sdk.Api;
using NuvemFiscal.Sdk.Client;
using NuvemFiscal.Sdk.Model;
namespace Example
{
public class BaixarXmlCartaCorrecaoCteExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.nuvemfiscal.com.br";
// Configure API key authorization: jwt
config.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("Authorization", "Bearer");
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new CteApi(httpClient, config, httpClientHandler);
var id = "id_example"; // string | ID único do CT-e gerado pela Nuvem Fiscal.
try
{
// Baixar XML da carta de correção
FileParameter result = apiInstance.BaixarXmlCartaCorrecaoCte(id);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CteApi.BaixarXmlCartaCorrecaoCte: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Esses métodos retornam um objeto ApiResponse que contêm os dados da resposta, o código de status e os headers HTTP.
try
{
// Baixar XML da carta de correção
ApiResponse<FileParameter> response = apiInstance.BaixarXmlCartaCorrecaoCteWithHttpInfo(id);
Debug.Write("Código de status: " + response.StatusCode);
Debug.Write("Headers da resposta: " + response.Headers);
Debug.Write("Conteúdo da resposta: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exceção ao chamar CteApi.BaixarXmlCartaCorrecaoCteWithHttpInfo: " + e.Message);
Debug.Print("Código de status: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Nome | Tipo | Descrição | Comentários |
---|---|---|---|
id | string | ID único do CT-e gerado pela Nuvem Fiscal. |
- Content-Type: Não especificado
- Accept: /
Código status | Descrição | Headers da resposta |
---|---|---|
200 | Successful response | - |
[Voltar ao topo] [Voltar à listagem da API] [Voltar à lista de DTOs] [Voltar ao README]
FileParameter BaixarXmlCte (string id)
Baixar XML do CT-e processado
Utilize esse endpoint para obter o XML do conhecimento enviado para a SEFAZ, complementado com a informação do protocolo de autorização de uso (TAG raiz cteProc
). O XML só estará disponível nesse endpoint caso o conhecimento tenha sido autorizado pela SEFAZ. Para obter o XML nos demais casos, utilize o endpoint GET /cte/{id}/xml/conhecimento
.
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using NuvemFiscal.Sdk.Api;
using NuvemFiscal.Sdk.Client;
using NuvemFiscal.Sdk.Model;
namespace Example
{
public class BaixarXmlCteExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.nuvemfiscal.com.br";
// Configure API key authorization: jwt
config.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("Authorization", "Bearer");
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new CteApi(httpClient, config, httpClientHandler);
var id = "id_example"; // string | ID único do CT-e gerado pela Nuvem Fiscal.
try
{
// Baixar XML do CT-e processado
FileParameter result = apiInstance.BaixarXmlCte(id);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CteApi.BaixarXmlCte: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Esses métodos retornam um objeto ApiResponse que contêm os dados da resposta, o código de status e os headers HTTP.
try
{
// Baixar XML do CT-e processado
ApiResponse<FileParameter> response = apiInstance.BaixarXmlCteWithHttpInfo(id);
Debug.Write("Código de status: " + response.StatusCode);
Debug.Write("Headers da resposta: " + response.Headers);
Debug.Write("Conteúdo da resposta: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exceção ao chamar CteApi.BaixarXmlCteWithHttpInfo: " + e.Message);
Debug.Print("Código de status: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Nome | Tipo | Descrição | Comentários |
---|---|---|---|
id | string | ID único do CT-e gerado pela Nuvem Fiscal. |
- Content-Type: Não especificado
- Accept: /
Código status | Descrição | Headers da resposta |
---|---|---|
200 | Successful response | - |
[Voltar ao topo] [Voltar à listagem da API] [Voltar à lista de DTOs] [Voltar ao README]
FileParameter BaixarXmlCteConhecimento (string id)
Baixar XML do CT-e
Utilize esse endpoint para obter o XML do conhecimento enviado para a SEFAZ. O XML estará disponível nesse endpoint mesmo em casos que o conhecimento tenha sido rejeitado.
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using NuvemFiscal.Sdk.Api;
using NuvemFiscal.Sdk.Client;
using NuvemFiscal.Sdk.Model;
namespace Example
{
public class BaixarXmlCteConhecimentoExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.nuvemfiscal.com.br";
// Configure API key authorization: jwt
config.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("Authorization", "Bearer");
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new CteApi(httpClient, config, httpClientHandler);
var id = "id_example"; // string | ID único da CT-e gerado pela Nuvem Fiscal.
try
{
// Baixar XML do CT-e
FileParameter result = apiInstance.BaixarXmlCteConhecimento(id);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CteApi.BaixarXmlCteConhecimento: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Esses métodos retornam um objeto ApiResponse que contêm os dados da resposta, o código de status e os headers HTTP.
try
{
// Baixar XML do CT-e
ApiResponse<FileParameter> response = apiInstance.BaixarXmlCteConhecimentoWithHttpInfo(id);
Debug.Write("Código de status: " + response.StatusCode);
Debug.Write("Headers da resposta: " + response.Headers);
Debug.Write("Conteúdo da resposta: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exceção ao chamar CteApi.BaixarXmlCteConhecimentoWithHttpInfo: " + e.Message);
Debug.Print("Código de status: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Nome | Tipo | Descrição | Comentários |
---|---|---|---|
id | string | ID único da CT-e gerado pela Nuvem Fiscal. |
- Content-Type: Não especificado
- Accept: /
Código status | Descrição | Headers da resposta |
---|---|---|
200 | Successful response | - |
[Voltar ao topo] [Voltar à listagem da API] [Voltar à lista de DTOs] [Voltar ao README]
FileParameter BaixarXmlCteProtocolo (string id)
Baixar XML do Protocolo da SEFAZ
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using NuvemFiscal.Sdk.Api;
using NuvemFiscal.Sdk.Client;
using NuvemFiscal.Sdk.Model;
namespace Example
{
public class BaixarXmlCteProtocoloExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.nuvemfiscal.com.br";
// Configure API key authorization: jwt
config.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("Authorization", "Bearer");
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new CteApi(httpClient, config, httpClientHandler);
var id = "id_example"; // string | ID único da CT-e gerado pela Nuvem Fiscal.
try
{
// Baixar XML do Protocolo da SEFAZ
FileParameter result = apiInstance.BaixarXmlCteProtocolo(id);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CteApi.BaixarXmlCteProtocolo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Esses métodos retornam um objeto ApiResponse que contêm os dados da resposta, o código de status e os headers HTTP.
try
{
// Baixar XML do Protocolo da SEFAZ
ApiResponse<FileParameter> response = apiInstance.BaixarXmlCteProtocoloWithHttpInfo(id);
Debug.Write("Código de status: " + response.StatusCode);
Debug.Write("Headers da resposta: " + response.Headers);
Debug.Write("Conteúdo da resposta: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exceção ao chamar CteApi.BaixarXmlCteProtocoloWithHttpInfo: " + e.Message);
Debug.Print("Código de status: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Nome | Tipo | Descrição | Comentários |
---|---|---|---|
id | string | ID único da CT-e gerado pela Nuvem Fiscal. |
- Content-Type: Não especificado
- Accept: /
Código status | Descrição | Headers da resposta |
---|---|---|
200 | Successful response | - |
[Voltar ao topo] [Voltar à listagem da API] [Voltar à lista de DTOs] [Voltar ao README]
FileParameter BaixarXmlEventoCte (string id)
Baixar XML do evento
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using NuvemFiscal.Sdk.Api;
using NuvemFiscal.Sdk.Client;
using NuvemFiscal.Sdk.Model;
namespace Example
{
public class BaixarXmlEventoCteExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.nuvemfiscal.com.br";
// Configure API key authorization: jwt
config.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("Authorization", "Bearer");
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new CteApi(httpClient, config, httpClientHandler);
var id = "id_example"; // string | ID único do evento gerado pela Nuvem Fiscal.
try
{
// Baixar XML do evento
FileParameter result = apiInstance.BaixarXmlEventoCte(id);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CteApi.BaixarXmlEventoCte: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Esses métodos retornam um objeto ApiResponse que contêm os dados da resposta, o código de status e os headers HTTP.
try
{
// Baixar XML do evento
ApiResponse<FileParameter> response = apiInstance.BaixarXmlEventoCteWithHttpInfo(id);
Debug.Write("Código de status: " + response.StatusCode);
Debug.Write("Headers da resposta: " + response.Headers);
Debug.Write("Conteúdo da resposta: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exceção ao chamar CteApi.BaixarXmlEventoCteWithHttpInfo: " + e.Message);
Debug.Print("Código de status: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Nome | Tipo | Descrição | Comentários |
---|---|---|---|
id | string | ID único do evento gerado pela Nuvem Fiscal. |
- Content-Type: Não especificado
- Accept: /
Código status | Descrição | Headers da resposta |
---|---|---|
200 | Successful response | - |
[Voltar ao topo] [Voltar à listagem da API] [Voltar à lista de DTOs] [Voltar ao README]
DfeCancelamento CancelarCte (string id, CtePedidoCancelamento body = null)
Cancelar um CT-e autorizado
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using NuvemFiscal.Sdk.Api;
using NuvemFiscal.Sdk.Client;
using NuvemFiscal.Sdk.Model;
namespace Example
{
public class CancelarCteExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.nuvemfiscal.com.br";
// Configure API key authorization: jwt
config.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("Authorization", "Bearer");
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new CteApi(httpClient, config, httpClientHandler);
var id = "id_example"; // string | ID único do CT-e gerado pela Nuvem Fiscal.
var body = new CtePedidoCancelamento(); // CtePedidoCancelamento | (optional)
try
{
// Cancelar um CT-e autorizado
DfeCancelamento result = apiInstance.CancelarCte(id, body);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CteApi.CancelarCte: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Esses métodos retornam um objeto ApiResponse que contêm os dados da resposta, o código de status e os headers HTTP.
try
{
// Cancelar um CT-e autorizado
ApiResponse<DfeCancelamento> response = apiInstance.CancelarCteWithHttpInfo(id, body);
Debug.Write("Código de status: " + response.StatusCode);
Debug.Write("Headers da resposta: " + response.Headers);
Debug.Write("Conteúdo da resposta: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exceção ao chamar CteApi.CancelarCteWithHttpInfo: " + e.Message);
Debug.Print("Código de status: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Nome | Tipo | Descrição | Comentários |
---|---|---|---|
id | string | ID único do CT-e gerado pela Nuvem Fiscal. | |
body | CtePedidoCancelamento | [optional] |
- Content-Type: application/json
- Accept: application/json
Código status | Descrição | Headers da resposta |
---|---|---|
200 | Successful response | - |
[Voltar ao topo] [Voltar à listagem da API] [Voltar à lista de DTOs] [Voltar ao README]
DfeCancelamento ConsultarCancelamentoCte (string id)
Consultar o cancelamento do CT-e
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using NuvemFiscal.Sdk.Api;
using NuvemFiscal.Sdk.Client;
using NuvemFiscal.Sdk.Model;
namespace Example
{
public class ConsultarCancelamentoCteExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.nuvemfiscal.com.br";
// Configure API key authorization: jwt
config.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("Authorization", "Bearer");
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new CteApi(httpClient, config, httpClientHandler);
var id = "id_example"; // string | ID único do CT-e gerado pela Nuvem Fiscal.
try
{
// Consultar o cancelamento do CT-e
DfeCancelamento result = apiInstance.ConsultarCancelamentoCte(id);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CteApi.ConsultarCancelamentoCte: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Esses métodos retornam um objeto ApiResponse que contêm os dados da resposta, o código de status e os headers HTTP.
try
{
// Consultar o cancelamento do CT-e
ApiResponse<DfeCancelamento> response = apiInstance.ConsultarCancelamentoCteWithHttpInfo(id);
Debug.Write("Código de status: " + response.StatusCode);
Debug.Write("Headers da resposta: " + response.Headers);
Debug.Write("Conteúdo da resposta: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exceção ao chamar CteApi.ConsultarCancelamentoCteWithHttpInfo: " + e.Message);
Debug.Print("Código de status: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Nome | Tipo | Descrição | Comentários |
---|---|---|---|
id | string | ID único do CT-e gerado pela Nuvem Fiscal. |
- Content-Type: Não especificado
- Accept: application/json
Código status | Descrição | Headers da resposta |
---|---|---|
200 | Successful response | - |
[Voltar ao topo] [Voltar à listagem da API] [Voltar à lista de DTOs] [Voltar ao README]
CteCartaCorrecao ConsultarCartaCorrecaoCte (string id)
Consultar a solicitação de correção do CT-e
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using NuvemFiscal.Sdk.Api;
using NuvemFiscal.Sdk.Client;
using NuvemFiscal.Sdk.Model;
namespace Example
{
public class ConsultarCartaCorrecaoCteExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.nuvemfiscal.com.br";
// Configure API key authorization: jwt
config.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("Authorization", "Bearer");
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new CteApi(httpClient, config, httpClientHandler);
var id = "id_example"; // string | ID único do CT-e gerado pela Nuvem Fiscal.
try
{
// Consultar a solicitação de correção do CT-e
CteCartaCorrecao result = apiInstance.ConsultarCartaCorrecaoCte(id);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CteApi.ConsultarCartaCorrecaoCte: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Esses métodos retornam um objeto ApiResponse que contêm os dados da resposta, o código de status e os headers HTTP.
try
{
// Consultar a solicitação de correção do CT-e
ApiResponse<CteCartaCorrecao> response = apiInstance.ConsultarCartaCorrecaoCteWithHttpInfo(id);
Debug.Write("Código de status: " + response.StatusCode);
Debug.Write("Headers da resposta: " + response.Headers);
Debug.Write("Conteúdo da resposta: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exceção ao chamar CteApi.ConsultarCartaCorrecaoCteWithHttpInfo: " + e.Message);
Debug.Print("Código de status: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Nome | Tipo | Descrição | Comentários |
---|---|---|---|
id | string | ID único do CT-e gerado pela Nuvem Fiscal. |
- Content-Type: Não especificado
- Accept: application/json
Código status | Descrição | Headers da resposta |
---|---|---|
200 | Successful response | - |
[Voltar ao topo] [Voltar à listagem da API] [Voltar à lista de DTOs] [Voltar ao README]
Dfe ConsultarCte (string id)
Consultar CT-e
Consulta os detalhes de um CT-e já existente. Forneça o ID único obtido de uma requisição de emissão ou de listagem de CT-e e a Nuvem Fiscal irá retornar as informações do CT-e correspondente.
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using NuvemFiscal.Sdk.Api;
using NuvemFiscal.Sdk.Client;
using NuvemFiscal.Sdk.Model;
namespace Example
{
public class ConsultarCteExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.nuvemfiscal.com.br";
// Configure API key authorization: jwt
config.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("Authorization", "Bearer");
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new CteApi(httpClient, config, httpClientHandler);
var id = "id_example"; // string | ID único do CT-e gerado pela Nuvem Fiscal.
try
{
// Consultar CT-e
Dfe result = apiInstance.ConsultarCte(id);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CteApi.ConsultarCte: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Esses métodos retornam um objeto ApiResponse que contêm os dados da resposta, o código de status e os headers HTTP.
try
{
// Consultar CT-e
ApiResponse<Dfe> response = apiInstance.ConsultarCteWithHttpInfo(id);
Debug.Write("Código de status: " + response.StatusCode);
Debug.Write("Headers da resposta: " + response.Headers);
Debug.Write("Conteúdo da resposta: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exceção ao chamar CteApi.ConsultarCteWithHttpInfo: " + e.Message);
Debug.Print("Código de status: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Nome | Tipo | Descrição | Comentários |
---|---|---|---|
id | string | ID único do CT-e gerado pela Nuvem Fiscal. |
- Content-Type: Não especificado
- Accept: application/json
Código status | Descrição | Headers da resposta |
---|---|---|
200 | Successful response | - |
[Voltar ao topo] [Voltar à listagem da API] [Voltar à lista de DTOs] [Voltar ao README]
DfeEvento ConsultarEventoCte (string id)
Consultar evento
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using NuvemFiscal.Sdk.Api;
using NuvemFiscal.Sdk.Client;
using NuvemFiscal.Sdk.Model;
namespace Example
{
public class ConsultarEventoCteExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.nuvemfiscal.com.br";
// Configure API key authorization: jwt
config.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("Authorization", "Bearer");
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new CteApi(httpClient, config, httpClientHandler);
var id = "id_example"; // string | ID único do evento gerado pela Nuvem Fiscal.
try
{
// Consultar evento
DfeEvento result = apiInstance.ConsultarEventoCte(id);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CteApi.ConsultarEventoCte: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Esses métodos retornam um objeto ApiResponse que contêm os dados da resposta, o código de status e os headers HTTP.
try
{
// Consultar evento
ApiResponse<DfeEvento> response = apiInstance.ConsultarEventoCteWithHttpInfo(id);
Debug.Write("Código de status: " + response.StatusCode);
Debug.Write("Headers da resposta: " + response.Headers);
Debug.Write("Conteúdo da resposta: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exceção ao chamar CteApi.ConsultarEventoCteWithHttpInfo: " + e.Message);
Debug.Print("Código de status: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Nome | Tipo | Descrição | Comentários |
---|---|---|---|
id | string | ID único do evento gerado pela Nuvem Fiscal. |
- Content-Type: Não especificado
- Accept: application/json
Código status | Descrição | Headers da resposta |
---|---|---|
200 | Successful response | - |
[Voltar ao topo] [Voltar à listagem da API] [Voltar à lista de DTOs] [Voltar ao README]
DfeSefazStatus ConsultarStatusSefazCte (string cpfCnpj, string autorizador = null)
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 3.0.0a, item 4.6.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).
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using NuvemFiscal.Sdk.Api;
using NuvemFiscal.Sdk.Client;
using NuvemFiscal.Sdk.Model;
namespace Example
{
public class ConsultarStatusSefazCteExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.nuvemfiscal.com.br";
// Configure API key authorization: jwt
config.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("Authorization", "Bearer");
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new CteApi(httpClient, config, httpClientHandler);
var cpfCnpj = "cpfCnpj_example"; // string | CPF/CNPJ do emitente. Utilize o valor sem máscara.
var autorizador = "autorizador_example"; // string | Ambiente Autorizador. Autorizadores disponíveis: `MT`, `MS`, `MG`, `PR`, `RS`, `SP`, `SVRS`, `SVSP`, `AN`. *Caso não seja informado, será utilizado o ambiente autorizador da UF do emitente.* (optional)
try
{
// Consulta do Status do Serviço na SEFAZ Autorizadora
DfeSefazStatus result = apiInstance.ConsultarStatusSefazCte(cpfCnpj, autorizador);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CteApi.ConsultarStatusSefazCte: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Esses métodos retornam um objeto ApiResponse que contêm os dados da resposta, o código de status e os headers HTTP.
try
{
// Consulta do Status do Serviço na SEFAZ Autorizadora
ApiResponse<DfeSefazStatus> response = apiInstance.ConsultarStatusSefazCteWithHttpInfo(cpfCnpj, autorizador);
Debug.Write("Código de status: " + response.StatusCode);
Debug.Write("Headers da resposta: " + response.Headers);
Debug.Write("Conteúdo da resposta: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exceção ao chamar CteApi.ConsultarStatusSefazCteWithHttpInfo: " + e.Message);
Debug.Print("Código de status: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Nome | Tipo | Descrição | Comentários |
---|---|---|---|
cpfCnpj | string | CPF/CNPJ do emitente. Utilize o valor sem máscara. | |
autorizador | string | Ambiente Autorizador. Autorizadores disponíveis: `MT`, `MS`, `MG`, `PR`, `RS`, `SP`, `SVRS`, `SVSP`, `AN`. Caso não seja informado, será utilizado o ambiente autorizador da UF do emitente. | [optional] |
- Content-Type: Não especificado
- Accept: application/json
Código status | Descrição | Headers da resposta |
---|---|---|
200 | Successful response | - |
[Voltar ao topo] [Voltar à listagem da API] [Voltar à lista de DTOs] [Voltar ao README]
CteCartaCorrecao CriarCartaCorrecaoCte (string id, CtePedidoCartaCorrecao body)
Solicitar correção do CT-e
É possível enviar até 20 correções diferentes, sendo que será válido sempre a última correção enviada.
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using NuvemFiscal.Sdk.Api;
using NuvemFiscal.Sdk.Client;
using NuvemFiscal.Sdk.Model;
namespace Example
{
public class CriarCartaCorrecaoCteExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.nuvemfiscal.com.br";
// Configure API key authorization: jwt
config.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("Authorization", "Bearer");
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new CteApi(httpClient, config, httpClientHandler);
var id = "id_example"; // string | ID único do CT-e gerado pela Nuvem Fiscal.
var body = new CtePedidoCartaCorrecao(); // CtePedidoCartaCorrecao |
try
{
// Solicitar correção do CT-e
CteCartaCorrecao result = apiInstance.CriarCartaCorrecaoCte(id, body);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CteApi.CriarCartaCorrecaoCte: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Esses métodos retornam um objeto ApiResponse que contêm os dados da resposta, o código de status e os headers HTTP.
try
{
// Solicitar correção do CT-e
ApiResponse<CteCartaCorrecao> response = apiInstance.CriarCartaCorrecaoCteWithHttpInfo(id, body);
Debug.Write("Código de status: " + response.StatusCode);
Debug.Write("Headers da resposta: " + response.Headers);
Debug.Write("Conteúdo da resposta: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exceção ao chamar CteApi.CriarCartaCorrecaoCteWithHttpInfo: " + e.Message);
Debug.Print("Código de status: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Nome | Tipo | Descrição | Comentários |
---|---|---|---|
id | string | ID único do CT-e gerado pela Nuvem Fiscal. | |
body | CtePedidoCartaCorrecao |
- Content-Type: application/json
- Accept: application/json
Código status | Descrição | Headers da resposta |
---|---|---|
200 | Successful response | - |
[Voltar ao topo] [Voltar à listagem da API] [Voltar à lista de DTOs] [Voltar ao README]
Dfe EmitirCte (CtePedidoEmissao body)
Emitir CT-e
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using NuvemFiscal.Sdk.Api;
using NuvemFiscal.Sdk.Client;
using NuvemFiscal.Sdk.Model;
namespace Example
{
public class EmitirCteExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.nuvemfiscal.com.br";
// Configure API key authorization: jwt
config.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("Authorization", "Bearer");
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new CteApi(httpClient, config, httpClientHandler);
var body = new CtePedidoEmissao(); // CtePedidoEmissao |
try
{
// Emitir CT-e
Dfe result = apiInstance.EmitirCte(body);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CteApi.EmitirCte: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Esses métodos retornam um objeto ApiResponse que contêm os dados da resposta, o código de status e os headers HTTP.
try
{
// Emitir CT-e
ApiResponse<Dfe> response = apiInstance.EmitirCteWithHttpInfo(body);
Debug.Write("Código de status: " + response.StatusCode);
Debug.Write("Headers da resposta: " + response.Headers);
Debug.Write("Conteúdo da resposta: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exceção ao chamar CteApi.EmitirCteWithHttpInfo: " + e.Message);
Debug.Print("Código de status: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Nome | Tipo | Descrição | Comentários |
---|---|---|---|
body | CtePedidoEmissao |
- Content-Type: application/json
- Accept: application/json
Código status | Descrição | Headers da resposta |
---|---|---|
200 | Successful response | - |
[Voltar ao topo] [Voltar à listagem da API] [Voltar à lista de DTOs] [Voltar ao README]
DfeListagem ListarCte (string cpfCnpj, string ambiente, int? top = null, int? skip = null, bool? inlinecount = null, string referencia = null, string chave = null, string serie = null)
Listar CT-e
Retorna a lista de CT-e de acordo com os critérios de busca utilizados. Os CT-e são retornados ordenados pela data da criação, com os mais recentes aparecendo primeiro.
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using NuvemFiscal.Sdk.Api;
using NuvemFiscal.Sdk.Client;
using NuvemFiscal.Sdk.Model;
namespace Example
{
public class ListarCteExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.nuvemfiscal.com.br";
// Configure API key authorization: jwt
config.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("Authorization", "Bearer");
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new CteApi(httpClient, config, httpClientHandler);
var cpfCnpj = "cpfCnpj_example"; // string | Filtrar pelo CPF ou CNPJ do emitente. Utilize o valor sem máscara.
var ambiente = "ambiente_example"; // string | Identificação do Ambiente. Valores aceitos: homologacao, producao
var top = 10; // int? | Limite no número de objetos a serem retornados pela API, entre 1 e 100. (optional) (default to 10)
var skip = 0; // int? | Quantidade de objetos que serão ignorados antes da lista começar a ser retornada. (optional) (default to 0)
var inlinecount = false; // bool? | Inclui no JSON de resposta, na propriedade `@count`, o número total de registros que o filtro retornaria, independente dos filtros de paginação. (optional) (default to false)
var referencia = "referencia_example"; // string | Seu identificador único para o documento. (optional)
var chave = "chave_example"; // string | Chave de acesso do DF-e. (optional)
var serie = "serie_example"; // string | Série do DF-e. (optional)
try
{
// Listar CT-e
DfeListagem result = apiInstance.ListarCte(cpfCnpj, ambiente, top, skip, inlinecount, referencia, chave, serie);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CteApi.ListarCte: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Esses métodos retornam um objeto ApiResponse que contêm os dados da resposta, o código de status e os headers HTTP.
try
{
// Listar CT-e
ApiResponse<DfeListagem> response = apiInstance.ListarCteWithHttpInfo(cpfCnpj, ambiente, top, skip, inlinecount, referencia, chave, serie);
Debug.Write("Código de status: " + response.StatusCode);
Debug.Write("Headers da resposta: " + response.Headers);
Debug.Write("Conteúdo da resposta: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exceção ao chamar CteApi.ListarCteWithHttpInfo: " + e.Message);
Debug.Print("Código de status: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Nome | Tipo | Descrição | Comentários |
---|---|---|---|
cpfCnpj | string | Filtrar pelo CPF ou CNPJ do emitente. Utilize o valor sem máscara. | |
ambiente | string | Identificação do Ambiente. Valores aceitos: homologacao, producao | |
top | int? | Limite no número de objetos a serem retornados pela API, entre 1 e 100. | [optional] [default to 10] |
skip | int? | Quantidade de objetos que serão ignorados antes da lista começar a ser retornada. | [optional] [default to 0] |
inlinecount | bool? | Inclui no JSON de resposta, na propriedade `@count`, o número total de registros que o filtro retornaria, independente dos filtros de paginação. | [optional] [default to false] |
referencia | string | Seu identificador único para o documento. | [optional] |
chave | string | Chave de acesso do DF-e. | [optional] |
serie | string | Série do DF-e. | [optional] |
- Content-Type: Não especificado
- Accept: application/json
Código status | Descrição | Headers da resposta |
---|---|---|
200 | Successful response | - |
[Voltar ao topo] [Voltar à listagem da API] [Voltar à lista de DTOs] [Voltar ao README]
DfeSincronizacao SincronizarCte (string id)
Sincroniza dados no CT-e a partir da SEFAZ
Realiza a sincronização dos dados a partir da consulta da situação atual da CT-e na Base de Dados do Portal da Secretaria de Fazenda Estadual. Cenários de uso: * Sincronizar um CT-e que se encontra com o status erro
na Nuvem Fiscal, mas está autorizado na SEFAZ (útil em casos de erros de transmissão com a SEFAZ, como instabilidades e timeouts). * Sincronizar um CT-e que se encontra com o status autorizado
na Nuvem Fiscal, mas está cancelado na SEFAZ. * Sincronizar todos os eventos de Cancelamento e Carta de Correção de um CT-e que porventura não tenham sido feitos a partir da Nuvem Fiscal.
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using NuvemFiscal.Sdk.Api;
using NuvemFiscal.Sdk.Client;
using NuvemFiscal.Sdk.Model;
namespace Example
{
public class SincronizarCteExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.nuvemfiscal.com.br";
// Configure API key authorization: jwt
config.AddApiKey("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("Authorization", "Bearer");
// Configure OAuth2 access token for authorization: oauth2
config.AccessToken = "YOUR_ACCESS_TOKEN";
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new CteApi(httpClient, config, httpClientHandler);
var id = "id_example"; // string | ID único do CT-e gerado pela Nuvem Fiscal.
try
{
// Sincroniza dados no CT-e a partir da SEFAZ
DfeSincronizacao result = apiInstance.SincronizarCte(id);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling CteApi.SincronizarCte: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Esses métodos retornam um objeto ApiResponse que contêm os dados da resposta, o código de status e os headers HTTP.
try
{
// Sincroniza dados no CT-e a partir da SEFAZ
ApiResponse<DfeSincronizacao> response = apiInstance.SincronizarCteWithHttpInfo(id);
Debug.Write("Código de status: " + response.StatusCode);
Debug.Write("Headers da resposta: " + response.Headers);
Debug.Write("Conteúdo da resposta: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exceção ao chamar CteApi.SincronizarCteWithHttpInfo: " + e.Message);
Debug.Print("Código de status: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Nome | Tipo | Descrição | Comentários |
---|---|---|---|
id | string | ID único do CT-e gerado pela Nuvem Fiscal. |
- Content-Type: Não especificado
- Accept: application/json
Código status | Descrição | Headers da resposta |
---|---|---|
200 | Successful response | - |
[Voltar ao topo] [Voltar à listagem da API] [Voltar à lista de DTOs] [Voltar ao README]