# Enviar NFC-e (Completo)

## Endpoint

<mark style="color:green;">`POST`</mark> `https://sandbox-api.invoisys.com.br/api/nfce/envioxmlnormal`

API utilizada no Modelo Completo para uma NFC-e

#### Headers

| Name          | Type   | Description                          |
| ------------- | ------ | ------------------------------------ |
| Content-type  | string | `application/x-www-form-urlencoded​` |
| Accept        | string | `application/json​`                  |
| Authorization | string | `bearer <valor>​`                    |

#### Request Body

| Name     | Type    | Description                                                                                                                                                                  |
| -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ambiente | integer | Informar o tipo de ambiente a ser utilizado​                                                                                                                                 |
| xml      | string  | <p>Neste campo deverá ser informado todo o XML do documento.<br>Os campos do XML que possuem aspas ("exemplo") deverão ter uma contra barra antes das aspas ("exemplo")​</p> |

{% tabs %}
{% tab title="201 Documento Emitido com Sucesso" %}
{% tabs %}
{% tab title="DocumentoEmitido" %}

```javascript
{
  "dadosDoDocumento": {
    "id": 0000,
    "chaveDeAcesso": "",
    "dataHoraEmissao": "2019-10-04T16:26:05.5087083Z",
    "dataDeAutorizacao": "2019-10-04T16:26:05Z",
    "documentoComErro": false,
    "codigoStatusSEFAZ": "100",
    "descricaoStatusSEFAZ": "Autorizado o uso da NF-e",
    "protocoloSEFAZ": "00000000000000",
    "urlConsultaViaQRCode": null,
    "urlConsultaViaChaveDeAcesso": null
  },
  "acoes": {
    "corrigirDocumento": false,
    "cancelar": false,
    "enviarContingencia": false,
    "tentarNovamenteMaisTarde": false,
    "entrarEmContatoComSuporteImediatamente": false
  },
  "excecao": null
}
```

{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

## Modelo de Envio 📝

```javascript
{
    "ambiente": 2,
    "xml": "<NFe xmlns=\"http://www.portalfiscal.inf.br/nfe\"><infNFe versao=\"4.00\" Id=\"NFe13181017921427000125650100000000201123456787\"><ide><cUF>13</cUF><cNF>12345678</cNF><natOp>Venda</natOp><mod>65</mod><serie>000</serie><nNF>000</nNF><dhEmi>2018-12-27T07:30:52-04:00</dhEmi><tpNF>1</tpNF><idDest>1</idDest><cMunFG>1302003</cMunFG><tpImp>4</tpImp><tpEmis>1</tpEmis><cDV>7</cDV><tpAmb>2</tpAmb><finNFe>1</finNFe><indFinal>1</indFinal><indPres>1</indPres><procEmi>0</procEmi><verProc>1.0.0</verProc></ide><emit><CNPJ>17921427000125</CNPJ><xNome>INVOISYS SISTEMAS LTDA</xNome><xFant>INVOISYS SISTEMAS</xFant><enderEmit><xLgr>Rua TESTE</xLgr><nro>71</nro><xBairro>BAIRRO TESTE</xBairro><cMun>1302603</cMun><xMun>MANAUS</xMun><UF>AM</UF><CEP>05372150</CEP><cPais>1058</cPais><xPais>BRASIL</xPais></enderEmit><IE>999999990</IE><CRT>3</CRT></emit><det nItem=\"1\"><prod><cProd>Teste</cProd><cEAN>SEM GTIN</cEAN><xProd>NOTA FISCAL EMITIDA EM AMBIENTE DE HOMOLOGACAO - SEM VALOR FISCAL</xProd><NCM>02109100</NCM><CFOP>5102</CFOP><uCom>UNID</uCom><qCom>1.0000</qCom><vUnCom>1.0000000000</vUnCom><vProd>1.00</vProd><cEANTrib>SEM GTIN</cEANTrib><uTrib>UNID</uTrib><qTrib>1.0000</qTrib><vUnTrib>1.0000000000</vUnTrib><indTot>1</indTot></prod><imposto><vTotTrib>0.00</vTotTrib><ICMS><ICMS00><orig>0</orig><CST>00</CST><modBC>3</modBC><vBC>1.00</vBC><pICMS>10.0000</pICMS><vICMS>0.10</vICMS></ICMS00></ICMS></imposto></det><total><ICMSTot><vBC>1.00</vBC><vICMS>0.10</vICMS><vICMSDeson>0.00</vICMSDeson><vFCP>0.00</vFCP><vBCST>0.00</vBCST><vST>0.00</vST><vFCPST>0.00</vFCPST><vFCPSTRet>0.00</vFCPSTRet><vProd>1.00</vProd><vFrete>0.00</vFrete><vSeg>0.00</vSeg><vDesc>0.00</vDesc><vII>0.00</vII><vIPI>0.00</vIPI><vIPIDevol>0.00</vIPIDevol><vPIS>0.00</vPIS><vCOFINS>0.00</vCOFINS><vOutro>0.00</vOutro><vNF>1.00</vNF><vTotTrib>0.00</vTotTrib></ICMSTot></total><transp><modFrete>9</modFrete></transp><pag><detPag><tPag>01</tPag><vPag>1.00</vPag></detPag></pag></infNFe></NFe>"
}
```

## Exemplos de Códigos 💻

{% tabs %}
{% tab title="Java" %}
{% code title="\[Unirest]" %}

```javascript
HttpResponse<String> response = Unirest.post("https://sandbox-api.invoisys.com.br/api/nfce/envioxmlnormal")
  .header("content-type", "application/json")
  .body("{\"ambiente\":\"integer (optional)\",\"xml\":\"string (optional)\"}")
  .asString();
```

{% endcode %}

{% code title="\[OkHttp]" %}

```java
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"ambiente\":\"integer (optional)\",\"xml\":\"string (optional)\"}");
Request request = new Request.Builder()
  .url("https://sandbox-api.invoisys.com.br/api/nfce/envioxmlnormal")
  .post(body)
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}
{% code title="\[XMLHttpRequest]" %}

```javascript
var data = JSON.stringify({
  "ambiente": "integer (optional)",
  "xml": "string (optional)"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://sandbox-api.invoisys.com.br/api/nfce/envioxmlnormal");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
```

{% endcode %}

{% code title="\[jQuery]" %}

```javascript
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://sandbox-api.invoisys.com.br/api/nfce/envioxmlnormal",
  "method": "POST",
  "headers": {
    "content-type": "application/json"
  },
  "processData": false,
  "data": "{\"ambiente\":\"integer (optional)\",\"xml\":\"string (optional)\"}"
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
```

{% endcode %}
{% endtab %}

{% tab title="C#" %}

```csharp
var client = new RestClient("https://sandbox-api.invoisys.com.br/api/nfce/envioxmlnormal");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"ambiente\":\"integer (optional)\",\"xml\":\"string (optional)\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

{% endtab %}
{% endtabs %}

## API's Relacionadas 🎈

* [Envio Contingência Completo](/invoisys/endpoints/emissao-notas/nfc-e-1/api-envio-contingencia-completo-da-nfc-e.md)
* [Ambiente para Emissão](/invoisys/endpoints/outras-consultas/enumeradores/api-tipo-de-ambiente.md)
* [Id da UF](/invoisys/endpoints/outras-consultas/uf/api-uf.md)
* [Natureza da Operação](/invoisys/endpoints/outras-consultas/enumeradores/api-natureza-da-operacao.md)
* [Indicador de Forma de Pagamento](/invoisys/endpoints/outras-consultas/enumeradores/api-indicador-forma-de-pagamento.md)
* [Tipo da Operação](/invoisys/endpoints/outras-consultas/enumeradores/api-tipo-de-operacao.md)
* [Destino da Operação](/invoisys/endpoints/outras-consultas/enumeradores/api-destino-da-operacao.md)
* [Tipo Impressão do DANFE](/invoisys/endpoints/outras-consultas/enumeradores/api-tipo-de-impressao-do-danfe.md)
* [Finalidade Emissão](/invoisys/endpoints/outras-consultas/enumeradores/api-finalidade-de-emissao.md)
* [Indicador de Presença](/invoisys/endpoints/outras-consultas/enumeradores/api-indicador-de-presenca.md)
* [Id Empresa](/invoisys/endpoints/cadastros-basicos/empresa-1/api-consultar-lista-de-empresas.md)
* [Id Produto](/invoisys/endpoints/cadastros-basicos/produto/api-consultar-produto-por-id.md)
* [Modalidade Frete](/invoisys/endpoints/outras-consultas/enumeradores/api-modalidade-de-frete.md)
* [Meio de Pagamento](/invoisys/endpoints/outras-consultas/enumeradores/api-tipo-de-forma-da-pagamento.md)
* [Tipo Integração Pagamento](/invoisys/endpoints/outras-consultas/enumeradores/api-tipo-integracao-pagamento.md)
* [Bandeira Cartão](/invoisys/endpoints/outras-consultas/enumeradores/api-bandeira-cartao.md)
* [Consulta de Município](/invoisys/endpoints/outras-consultas/municipio/api-municipios.md)

## Referências à API 📌

* [Passo-a-Passo da NFC-e](/invoisys/getting-started/documentos-fiscais/emissao/nfc-e/passo-a-passo.md)
* [Fluxograma - Envio Normal](/invoisys/getting-started/documentos-fiscais/emissao/nfc-e/fluxo-operacional/envio-normal-nfc-e-fluxo-completo.md)
* [Fluxograma - Envio Contigência SEFAZ​](/invoisys/getting-started/documentos-fiscais/emissao/nfc-e/fluxo-operacional/envio-contingencia-sefaz-nfc-e-flux.md)
* [Fluxograma - Envio Contingência Off-Line](/invoisys/getting-started/documentos-fiscais/emissao/nfc-e/fluxo-operacional/envio-contingencia-off-line-nfc-e-fluxo-completo.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://integracao.gitbook.io/invoisys/endpoints/emissao-notas/nfc-e-1/api-envio-normal-completo-da-nfc-e.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
