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


---

# 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/recebimento-notas/nf-e/api-entrada-de-nf-e-por-xml-1.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.
