Documentation › NFS-e issuance
Batch issuance
Up to 200,000 invoices in one call, by JSON (50,000) or spreadsheet, with a result and reprocessing per row.
Up to 50,000 invoices in one call as JSON, or 200,000 through the dashboard spreadsheet,
with a result per row. Same engine as single issuance and the spreadsheet.
Always send referencia in each item: it is what makes resending the batch
safe.
POST /v1/lotes --202--> validando
|
ao_validar = emitir_validas ao_validar = aguardar
| |
| aguardando_emissao
| |
| POST /v1/lotes/{id}/emissao
v v
processando (as notas transmitindo)
|
v
concluido --> webhook LOTE_EMISSAO_CONCLUIDO
| Step | Route | What happens |
|---|---|---|
| Create | POST /v1/lotes |
Always 202. Readiness with bloqueio returns 412, and nothing is created. |
| Track | GET /v1/lotes/{id} |
status: validando, aguardando_emissao, processando, concluido or erro, and the counts. |
| Result per row | GET /v1/lotes/{id}/itens |
Each row with the invoice status, or com_erro_validacao, aguardando_emissao, ja_existente. |
Issue (with aguardar) |
POST /v1/lotes/{id}/emissao |
"todas" or a list of rows. Only once. |
| Fix and issue again | POST /v1/lotes/{id}/reprocessamento |
Only rows with errors, rejeitada, or falha_transmissao with dps_enviada: "nao". |
| Report | GET /v1/lotes/{id}/relatorio |
The spreadsheet with the result of each row. |
Limits: with the production key, 50,000 items in JSON and 200,000 rows in a
spreadsheet; 100 with the test key. JSON up to 80 MB, spreadsheet up to 60 MB. One POST /v1/lotes counts as one call
against the request limit. Batch items enter the queue behind single invoices.
Do not confuse validating with issuing. Validation always runs, right after
the batch is created. With emitir_validas (default), the valid rows are issued
next. With aguardar, nothing is issued until you call
POST /v1/lotes/{id}/emissao.
Send referencia in every item: it is what makes it safe to send the batch again.
See Idempotency.
Endpoints in this section, with in-page testing
- GET/v1/lotes · List batches
- POST/v1/lotes · Create an issuance batch
- GET/v1/lotes/{id} · Get a batch
- GET/v1/lotes/{id}/itens · Result per row
- GET/v1/lotes/{id}/relatorio · Spreadsheet report
- GET/v1/lotes/{id}/etiquetas · DACE labels for a DC-e batch, 10 × 15, in one PDF
- POST/v1/lotes/{id}/emissao · Issue a batch that was waiting
- POST/v1/lotes/{id}/reprocessamento · Fix rows and issue again