# Consultar o lote RPS na Prefeitura

## Endpoint

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

#### 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           |
| ----- | ------ | --------------------- |
| idRPS | string | ID do RPS na invoiSys |

#### Response

{% tabs %}
{% tab title="302 " %}

```javascript
{
  "id": 3704,
  // Número da NFS-e após a conversão do RPS
  "numeroNFSe": 19,
  "numeroRPS": 59,
  "serieRPS": "489",
  // Indica se a Prefeitura retornou sucesso na conversão do RPS
  "sucesso": true,
  // Código de Autenticação
  "autenticidade": "8A5E211F65B360EAE5C68970ED7E3D54",
  "linkImpressao": "",
  "xml": "<ns:return xmlns:ns=\"http://services.enfsws.es\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n\r\n&lt;es:esConsultarLoteRpsResposta xmlns:es=\"http://www.equiplano.com.br/esnfs\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.equiplano.com.br/esnfs esConsultarLoteRpsResposta_v01.xsd\"&gt;\r\n\r\n  &lt;listaNfse class=\"list\"&gt;\r\n\r\n    &lt;nfse&gt;\r\n\r\n      &lt;nrNfse&gt;19&lt;/nrNfse&gt;\r\n\r\n      &lt;cdAutenticacao&gt;8A5E211F65B360EAE5C68970ED7E3D54&lt;/cdAutenticacao&gt;\r\n\r\n      &lt;dtEmissaoNfs&gt;2021-08-20T15:52:51&lt;/dtEmissaoNfs&gt;\r\n\r\n      &lt;nrRps&gt;59&lt;/nrRps&gt;\r\n\r\n      &lt;nrEmissorRps&gt;1&lt;/nrEmissorRps&gt;\r\n\r\n    &lt;/nfse&gt;\r\n\r\n  &lt;/listaNfse&gt;\r\n\r\n&lt;/es:esConsultarLoteRpsResposta&gt;\r\n\r\n</ns:return>",
  "excecao": [],
  // Indica o status da NFS-e
  "status": "Autorizado"
}
```

{% endtab %}

{% tab title="400 " %}

```csharp
[
  // Indica a rejeição ocorrida na conversão do RPS
  "Erro: 1604 - Esse lote está aguardando processamento."
]
```

{% endtab %}
{% endtabs %}

### Modelo de Envio 📝

```csharp
{
  "idRPS": 23896
}
```

{% hint style="info" %}

#### Swagger

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

## Referências à API 📌

* [Passo-a-Passo da NFS-e](/invoisys/getting-started/documentos-fiscais/emissao/nfs-e/passo-a-passo.md)
* [Fluxograma - Envio Assíncrono](/invoisys/getting-started/documentos-fiscais/emissao/nfs-e/fluxo-operacional/fluxo-envio-assincrono-da-nfs-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/emissao-notas/nfs-e-1/api-consultar-rps-na-prefeitura.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.
