# Consultar NSUi (Número Sequencial Único)

### Endpoint

<mark style="color:blue;">`GET`</mark> `https://sandbox-api.invoisys.io/v1/cte-entrada/eventos-nsui/{cnpj}/{nsui}`

#### Headers

| Name          | Type   | Description        |
| ------------- | ------ | ------------------ |
| Accept        | string | `application/json` |
| Authorization | string | `bearer <valor>`   |

#### Request Body

| Name | Type    | Description                                 |
| ---- | ------- | ------------------------------------------- |
| cnpj | integer | CNPJ do destinatário da NF-e                |
| nsui | integer | Próximo número sequencial único requisitado |

#### Response

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

```csharp
{
  "tipoDoc": 2,
  "nsuiMaxDisponivel": 794,
  "documentos": [
    {
      "nsuiMaxDisponivel": 794,
      "nsui": 790,
      "docId": 1229554,
      "createDate": "2024-09-09T23:41:40.46734",
      "tipoDoc": 2,
      "chaveDoc": "35240954389083000181550030000000291415436575",
      "serie": "3",
      "numero": "29",
      "dataHoraEmissao": "2024-09-09T17:45:18",
      "tipoEvento": 1001,
      "descricaoEvento": "XML Completo",
      "xmlEvento": "PG5mZVByb2MgdmVyc2FvPSI0LjAwIiB4bWxucz0iaHR0cDovL3d3dy5wb3JAgICA8L2lkZT4NCiAgICAgIDxlbWl0Pg0KICAgICAgICA8Q05QSj41NDM4OTA4MzAwMDE4M..."
    },
    {
      "nsuiMaxDisponivel": 794,
      "nsui": 791,
      "docId": 1232596,
      "createDate": "2024-09-10T13:11:40.387571",
      "tipoDoc": 2,
      "chaveDoc": "35240950924801000111550010000004471126376898",
      "serie": "1",
      "numero": "447",
      "dataHoraEmissao": "2024-09-10T10:02:34",
      "tipoEvento": 110110,
      "descricaoEvento": "Carta de Correcao Registrada",
      "xmlEvento": "DQogIDxjU2l0TkZlPjE8L2NTaXRORmU+DQo8L3Jlc05GZT4GTAS34SdfaATGAS..."
    },
    {
      "nsuiMaxDisponivel": 794,
      "nsui": 792,
      "docId": 1232597,
      "createDate": "2024-09-10T13:11:40.406302",
      "tipoDoc": 2,
      "chaveDoc": "35240950924801000111550010000004481963984658",
      "serie": "1",
      "numero": "448",
      "dataHoraEmissao": "2024-09-10T10:05:35",
      "tipoEvento": 1001,
      "descricaoEvento": "XML Completo",
      "xmlEvento": "PHJlc05GZSB4bWxuczp4c2Q9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWEVsfasEr.."
    },
    {
      "nsuiMaxDisponivel": 794,
      "nsui": 793,
      "docId": 1232597,
      "createDate": "2024-09-10T13:11:41.099346",
      "tipoDoc": 2,
      "chaveDoc": "35240950924801000111550010000004481916289035",
      "serie": "1",
      "numero": "448",
      "dataHoraEmissao": "2024-09-10T10:05:35",
      "tipoEvento": 110111,
      "descricaoEvento": "Cancelamento",
      "xmlEvento": "PHJlc0V2ZW50byB4bWxuczp4c2Q9Imh0dHA6LEuMDEiIHhXZlbnRvPjIwMjQVudG8+NTEwNjM.."
    {
      "nsuiMaxDisponivel": 794,
      "nsui": 794,
      "docId": 1232596,
      "createDate": "2024-09-10T13:11:42.077968",
      "tipoDoc": 2,
      "chaveDoc": "35240950924801000111550010000004471114256784",
      "serie": "1",
      "numero": "447",
      "dataHoraEmissao": "2024-09-10T10:02:34",
      "tipoEvento": 310610,
      "descricaoEvento": "MDF-e Autorizado",
      "xmlEvento": "PHJlc0V2ZW50byB4bWxuczp4c2Q9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hIiB4.."
    }
  ]
}
```

{% endtab %}

{% tab title="400 - CNPJ ou NSUi inexistente" %}

```csharp
{
  "tipoDoc": 0,
  "nsuiMaxDisponivel": 0,
  "documentos": []
}
```

{% endtab %}
{% endtabs %}

### Enumeradores

<details>

<summary>TipoEvento</summary>

• XML Completo = 1001\
&#x20;  o   XML completo do CT-e.

• Carta de Correção = 110110\
&#x20;  o   XML do CC-e do CT-e.

• Cancelamento = 110111\
&#x20;  o   XML do cancelamento do CT-e;

• Comprovante de Entrega do CT-e = 610130

• Registro de Passagem Autorização = 610500

• Registro de Passagem Automatico MDFe = 610552

• MDF-e autorizado = 610610

• MDF-e cancelado = 610611

• Vistoria SUFRAMA = 990900

• Confirmacao de Internalizacao da Mercadoria na SUFRAMA = 990910

</details>

{% 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 🎈

* [Token de acesso (3.0)](https://integracao.gitbook.io/invoisys/endpoints/autorizacao/autenticacao-1)

## Referências à API 📌

* Passo-a-Passo do Recebimento CT-e
* Fluxograma - Recebimento CT-e


---

# 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/ct-e/api-entrada-de-nf-e-xml-resumido-obtido.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.
