> For the complete documentation index, see [llms.txt](https://integracao.gitbook.io/invoisys/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://integracao.gitbook.io/invoisys/endpoints/recebimento-notas/nf-e/api-entrada-de-nf-e-por-xml-1.md).

# Importar XML

### Endpoint

<mark style="color:green;">`POST`</mark> `https://sandbox-api.invoisys.io/v1/nfe-entrada/enviar-xml`

#### Headers

| Name          | Type   | Description          |
| ------------- | ------ | -------------------- |
| Accept        | string | `application/jso​n​` |
| Authorization | string | `bearer <valor>`     |

#### Request Body

| Name            | Type    | Description                                                                                                     |
| --------------- | ------- | --------------------------------------------------------------------------------------------------------------- |
| ambiente        | integer | <p>Ambiente de importação do XML<br><code>ENUM: 1 - Produção; 2 - Homologação</code><br><code>TAM: 1</code></p> |
| xml             | string  | XML em base64 da NF-e padrão MOC 4.0                                                                            |
| xmlCancelamento | string  | XML em base64 do cancelamento da NF-e padrão MOC 4.0                                                            |
| xmlCCe          | string  | XML em base64 do CC-e da NF-e padrão MOC 4.0                                                                    |

#### Response

{% tabs %}
{% tab title="200 - Sucesso" %}

```csharp
{
  "id": 4207,
  "mensagem": "XML de NF-e importado com sucesso;"
}
```

{% endtab %}

{% tab title="400 - Base64 inválido" %}

```csharp
{
  "id": null,
  "mensagem": "Base64 de CCe inválido;"
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}

#### Swagger

[Você pode acessar nossa API e realizar testes diretamente na nossa plataforma Swagger!](https://sandbox-api.invoisys.io/swagger/index.html)
{% endhint %}

## APIs Relacionadas 🎈

* [Consultar NF-es via NSUi](/invoisys/endpoints/recebimento-notas/nf-e/api-entrada-de-nf-e-xml-resumido-obtido.md)

## Referências à API 📌

* [Passo-a-Passo do Recebimento NF-e](/invoisys/getting-started/documentos-fiscais/recebimento/nf-e/passo-a-passo.md)
* [Fluxograma - Recebimento NF-e](/invoisys/getting-started/documentos-fiscais/recebimento/nf-e/fluxos-operacionais/fluxo-recebimento-nf-e.md)
