Documentation

Look up invoices and download PDFs

List and read invoices, sync and cancel them at SEFAZ, download the DANFE, the PDF receipt and the XML files, and check the SEFAZ status.

List invoices

The list brings the NFC-e, NF-e and NFS-e of the token's organization, newest first. Every route on this page accepts only the organization's API token; X-Credential-Key is optional on the list and limits it to that credential's invoices.

curl "https://api.intopays.com/v1/fiscal-invoices?type=NFE&status=AUTHORIZED&startDate=2026-11-01&endDate=2026-11-15&withCounts=true" \
  -H "Authorization: Bearer $INTOPAYS_TOKEN"
FieldRequiredValues
typenoNFCE NFC-e, NFE NF-e, NFSE NFS-e (upper or lower case)
statusnoAUTHORIZED, REJECTED, CANCELLED or PENDING
environmentno1 production, 2 homologation
referenceCodenothe reference sent when issuing (the sale or the order)
startDate, endDatenoissue date as YYYY-MM-DD, Brasília time; both days are included
pagenopage, starting at 0 (default)
pageSizenoinvoices per page; default 50, maximum 100
searchnopart of the access key or of the invoice number
credentialIdnoonly the invoices of one credential (its id); with X-Credential-Key, the list is already only that credential's
withCountsnotrue to get the number of invoices per status
{
  "data": [
    {
      "id": "0193a8f9-2b7d-7c11-8e4f-1a2b3c4d5e6f",
      "type": "NFE",
      "typeName": "NF-e",
      "natureOperation": "VENDA DE MERCADORIA",
      "status": "AUTHORIZED",
      "accessKey": "29261111222333000181550010000007001578054412",
      "protocol": "129260000000001",
      "reason": "100 - Autorizado o uso da NF-e",
      "invoiceNumber": 700,
      "series": 1,
      "environment": 1,
      "totalAmount": 720,
      "referenceCode": "pedido-2087",
      "credentialName": "Loja Centro",
      "credentialUf": "BA",
      "createdAt": "2026-11-15T14:25:41.000Z"
    }
  ],
  "pageNumber": 0,
  "pageSize": 50,
  "total": 128,
  "counts": { "authorized": 128, "pending": 0, "rejected": 3, "cancelled": 1 }
}

total is the number of invoices matching the filters. counts uses the same filters except status. Each invoice in the list also carries its XMLs, in signedXml, responseXml and authorizedXml.

Read an invoice

Use the id returned when issuing or in the list:

curl https://api.intopays.com/v1/fiscal-invoices/0193a8f9-2b7d-7c11-8e4f-1a2b3c4d5e6f \
  -H "Authorization: Bearer $INTOPAYS_TOKEN"

The response is the invoice in the same format as the issuance (NFC-e, NF-e, NFS-e). An invoice of another organization answers 404.

statusMeaning
AUTHORIZEDAuthorized by SEFAZ; the invoice has fiscal value
REJECTEDRejected by SEFAZ or failed to send; reason holds the reason
CANCELLEDSEFAZ reported the invoice as canceled
PENDINGSent, still without an answer from SEFAZ

An issuance that fails before the invoice is sent (invalid data or certificate) is recorded as REJECTED, with accessKey set to ERROR and the error in reason.

NFS-e

The NFS-e (the service invoice; ?type=NFSE on the list) uses the same format. It is authorized by the Sefin Nacional (the national NFS-e environment), not by the state SEFAZ, and these fields change meaning:

FieldOn the NFS-e
invoiceNumber, seriesthe number and series of the DPS (Declaração de Prestação de Serviço, the service declaration)
dpsIdthe DPS identifier, 45 characters, set before sending
accessKeythe NFS-e access key, 50 characters; null until the Sefin authorizes
protocolthe NFS-e number, assigned by the Sefin
natureOperationthe service description, cut at 255 characters
cancelReasonCodethe cancellation reason code ("1", "2" or "9"), or null

Sync with SEFAZ

PATCH /v1/fiscal-invoices/<id>/sync asks SEFAZ, by access key, what it has for the invoice, and returns the invoice as it ended up:

curl -X PATCH https://api.intopays.com/v1/fiscal-invoices/0193a8f2-6c1e-7b40-9d2a-5e8f1c3b7a90/sync \
  -H "Authorization: Bearer $INTOPAYS_TOKEN"
  • A PENDING invoice: the SEFAZ answer closes it — AUTHORIZED (with protocol and authorized XML), CANCELLED or REJECTED. If SEFAZ still does not answer, the response is 200 with the invoice still PENDING; try again later.
  • An invoice already closed: the lookup fixes the status (for example, an invoice canceled directly at SEFAZ becomes CANCELLED), and Intopays sends the fiscal.update event to the webhooks when it changes. Without an answer from SEFAZ, 503.

A PENDING NFS-e is looked up at the Sefin Nacional by the DPS identifier (dpsId), and the answer closes the invoice.

While an invoice is PENDING, no new invoice of the same type and environment is issued with the credential. An invoice SEFAZ can never answer can be closed manually in the dashboard, under Notas fiscais → Emissões (Invoices → Issued). Closing an NFS-e manually uses up the DPS number (a rejection by the Sefin does not).

Download the PDF and the XML

The PDF is built from the invoice's XML: an A4 DANFE, with the access key barcode, for the NF-e; an 80 mm receipt, with a QR code, for the NFC-e (two pages: the consumer copy and the company copy); an A4 DANFSe for the NFS-e.

curl https://api.intopays.com/v1/fiscal-invoices/0193a8f9-2b7d-7c11-8e4f-1a2b3c4d5e6f/pdf \
  -H "Authorization: Bearer $INTOPAYS_TOKEN" \
  -o danfe.pdf

curl https://api.intopays.com/v1/fiscal-invoices/0193a8f9-2b7d-7c11-8e4f-1a2b3c4d5e6f/xml \
  -H "Authorization: Bearer $INTOPAYS_TOKEN" \
  -o nfe.xml

The PDF is named danfe-nfe-<number>.pdf or cupom-nfce-<number>.pdf; a PENDING invoice has no document. The XML is the authorized one (nfeProc, invoice + protocol); without it, the signed XML that was sent.

On the NFS-e, the PDF exists only for an invoice the Sefin generated (AUTHORIZED or CANCELLED) and is named danfse-<NFS-e number>.pdf. The XML is that of the authorized NFS-e or, without it, the signed DPS, named nfse-<access key or DPS id>.xml.

A ZIP file gathers the authorized XMLs of the invoices matching the list filters, without pagination; each file is named after its access key, and authorized NFS-e are included too:

curl "https://api.intopays.com/v1/fiscal-invoices/xmls.zip?startDate=2026-11-01&endDate=2026-11-30&environment=1" \
  -H "Authorization: Bearer $INTOPAYS_TOKEN" \
  -o notas-novembro.zip

Cancel

An authorized invoice — NFC-e, NF-e or NFS-e — is canceled with the cancellation event. For the NFC-e and the NF-e, it is registered at SEFAZ:

curl -X PATCH https://api.intopays.com/v1/fiscal-invoices/0193a8f2-6c1e-7b40-9d2a-5e8f1c3b7a90/cancel \
  -H "Authorization: Bearer $INTOPAYS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "reason": "Venda cancelada a pedido do cliente" }'
FieldRequiredValues
reasonyesthe justification, 15 to 255 characters (SEFAZ rule)
reasonCodenoNFS-e only: 1 error when issuing, 2 service not provided, 9 other (default). Any other value, or the field on an NFC-e or NF-e, answers 400

When the event is registered (135, or 155 when SEFAZ approves it after the deadline), the response is the invoice with status CANCELLED, cancelReason, cancelledAt and cancelXml (the signed event with the SEFAZ answer), and Intopays sends the fiscal.update event to the webhooks. The deadline is the state SEFAZ's: once it has passed, SEFAZ refuses and the response is 400 with its code and reason. Without an answer from SEFAZ, 503 and the invoice stays AUTHORIZED; sync it later to learn whether the cancellation was registered.

StatusResponseFix
400A justificativa (reason) precisa ter entre 15 e 255 caracteres (regra da SEFAZ).Write a justification of 15 to 255 characters
400Informe a justificativa do cancelamento (reason), de 15 a 255 caracteres.Send reason as text
400Só notas autorizadas podem ser canceladas.Only an AUTHORIZED invoice can be canceled
400Cancelamento rejeitado pela SEFAZ: 501 - Rejeicao: Prazo de cancelamento superior ao previsto na LegislacaoWhat SEFAZ answered; the deadline and rules are the state's
503A SEFAZ não respondeu ao cancelamento; a nota continua AUTHORIZED…Sync the invoice later
400O código do motivo (reasonCode) só existe no cancelamento da NFS-e; nesta nota informe só a justificativa (reason).Remove reasonCode when canceling an NFC-e or NF-e
400Código do motivo do cancelamento (reasonCode) inválido: use 1 (erro na emissão), 2 (serviço não prestado) ou 9 (outros).Use 1, 2 or 9 (NFS-e)
400Cancelamento rejeitado pela Sefin Nacional: E1801 - … — O prazo de cancelamento desta NFS-e, definido pelo município, já acabou.What the Sefin answered; the invoice stays AUTHORIZED (NFS-e)
503A Sefin Nacional não respondeu ao cancelamento; a nota continua AUTHORIZED. …Sync the invoice later (NFS-e)

An NF-e of an issuer without state registration is canceled at SVRS, where it was authorized.

The cancellation of an NFS-e is registered at the Sefin Nacional, and the invoice also gets cancelReasonCode. The deadline is the municipality's: when the Sefin refuses, the response is 400 with its message and the invoice stays AUTHORIZED — see Issue NFS-e.

Correction letter

The electronic correction letter (CC-e, event 110110) fixes an error on an authorized NF-e without cancelling it. The NFC-e and the NFS-e have no CC-e.

curl -X POST https://api.intopays.com/v1/fiscal-invoices/01HZX.../corrections \
  -H "Authorization: Bearer $INTOPAYS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "text": "Onde se lê Rua B, 10, leia-se Rua B, 100." }'
FieldRequiredValues
textyesthe correction, 15 to 1000 characters

The response (201) is the registered letter: { id, type: "CORRECTION", sequence, text, protocol, reason, createdAt }. Each new letter replaces the previous one and takes the next number (sequence, up to 20 per invoice): write every correction in it, not only the new one. GET /v1/fiscal-invoices/:id/corrections lists the invoice's letters and GET /v1/fiscal-invoices/:id/corrections/:eventId/xml downloads each one's XML (procEventoNFe).

The letter cannot correct (art. 7, § 1-A of Convênio SINIEF s/n/1970): the values that set the tax (base, rate, price, quantity, operation value), data that would change the sender or the recipient, nor the issue or exit dates. SEFAZ does not check the text: that responsibility is the issuer's.

StatusWhen
400not an NF-e, the invoice is not authorized, the text is out of range, the invoice already has 20 letters, or SEFAZ refused it (Carta de correção rejeitada pela SEFAZ: <code> - <reason>)
503SEFAZ did not answer: nothing was recorded. Send it again — if SEFAZ had registered it, it answers that the event exists (573)

Void numbers

A number void (inutilização) tells SEFAZ that a range of NF-e or NFC-e numbers will not be used — for example, numbers taken by rejected invoices. Choose the credential in X-Credential-Key:

curl -X POST https://api.intopays.com/v1/fiscal-invoices/number-voids \
  -H "Authorization: Bearer $INTOPAYS_TOKEN" \
  -H "X-Credential-Key: $INTOPAYS_FISCAL_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "type": "NFE", "environment": 2, "series": 1, "startNumber": 120, "endNumber": 122,
        "justification": "Numeros consumidos por notas rejeitadas" }'
FieldRequiredValues
typeyes"NFE" or "NFCE"
environmentyes1 production, 2 homologation
seriesyesthe series of the numbers
startNumber, endNumberyesthe range, inclusive; up to 10,000 numbers
justificationyesthe reason, 15 to 255 characters

The response (201) carries SEFAZ's protocol. GET /v1/fiscal-invoices/number-voids lists the voids (filters type, environment, page, pageSize), GET /v1/fiscal-invoices/number-voids/:id reads one and …/:id/xml downloads the procInutNFe. When the range covers the series' next number, the credential's counter moves past it.

SituationResponse
Inverted range / more than 10,000 numbers400 — SEFAZ would refuse it (224 / 201)
A number in the range was already used by an invoice (authorized, cancelled or pending)400 — rejection 241
The range starts after the series' next number400: the numbers in between would be issued first; void from the next number or adjust the counter in the panel
Issuer with a CPF400: the void layout only has CNPJ
Issuer in AC, BA or SP400: SEFAZ switched number voids off in those states on 11/11/2026 (NT 2023.002) — a skipped number needs no void there
No answer from SEFAZ503, nothing recorded. Send it again: the same range, already homologated, comes back with the same protocol (563)
SEFAZ refusal400 with Inutilização rejeitada pela SEFAZ: <code> - <reason>

E-mail the invoice

POST /v1/fiscal-invoices/<id>/email sends an authorized invoice to the customer, with the PDF and the XML attached, from [email protected] and with Reply-To set to the organization owner's e-mail (replies go to the store). The message goes only to the address in to; without to, to the invoice recipient's e-mail (recipient.email). Use it to send after issuing and to resend — in the dashboard, Enviar por e-mail (E-mail invoice) on the invoice page.

curl -X POST https://api.intopays.com/v1/fiscal-invoices/0193a8f9-2b7d-7c11-8e4f-1a2b3c4d5e6f/email \
  -H "Authorization: Bearer $INTOPAYS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "to": "[email protected]" }'
{ "sent": true, "to": "[email protected]", "sentAt": "2026-11-24T15:30:00.000Z" }

On issue, "options": { "sendEmail": true } with recipient.email sends the invoice by itself, once, when it is authorized. The invoice also gets emailSentAt and emailSentTo (the last send to the customer). On the NFS-e, the attached PDF is the DANFSe and the default recipient is the service taker's e-mail.

StatusResponseFix
400Esta nota foi cancelada: uma nota cancelada não é enviada por e-mail.—
400Só uma nota autorizada pode ser enviada por e-mail.Wait for authorization (or sync the invoice)
400Informe o e-mail do cliente (to)… / to inválido…Send a valid e-mail
400Esta nota já foi enviada por e-mail 5 vezes na última hora…Up to 5 sends per invoice and 200 per organization, per hour
400Não foi possível gerar o PDF da nota agora…Try again shortly

SEFAZ status

Before issuing, check whether the authorization web service of the SEFAZ of the credential's state is up, for the invoice type:

curl "https://api.intopays.com/v1/fiscal-invoices/sefaz-status?type=NFCE&environment=1" \
  -H "Authorization: Bearer $INTOPAYS_TOKEN" \
  -H "X-Credential-Key: $INTOPAYS_FISCAL_KEY"
{ "type": "NFCE", "typeName": "NFC-e", "environment": 1, "uf": "BA", "online": true, "message": "107 - Servico em Operacao" }

type is required; environment is 1 (default) or 2. online is true when SEFAZ answers with code 107, and false when it is down or did not answer — the response is still 200, with the same fields, and message carries the reason.

With type=NFSE, the check goes to the national NFS-e system instead of the state SEFAZ; the response has the same format, and message says whether the issuer's municipality accepts the national issuer:

onlinemessage
trueA Sefin Nacional respondeu: o município 2927408 tem convênio e aceita o emissor nacional da NFS-e neste ambiente.
trueA Sefin Nacional respondeu, mas o município 2927408 NÃO aceita o emissor nacional da NFS-e neste ambiente: a emissão será recusada (E0037). Emita no sistema da prefeitura. (the municipality does not accept the national issuer)
falseA Sefin Nacional recusou o certificado digital desta credencial (HTTP 403). (the certificate was refused)

Errors

StatusResponseFix
400Informe o tipo da nota (type)…Send type on the SEFAZ status
400O tipo de nota "…" não é aceito…Use NFCE, NFE or NFSE in the filter or in the SEFAZ status
400status deve ser um destes: PENDING, AUTHORIZED, REJECTED, CANCELLED.Use one of the four statuses in the filter
400environment deve ser 1 (produção) ou 2 (homologação).Use 1 or 2
400Informe a chave da credencial fiscal no cabeçalho X-Credential-Key.Send the API Key in the SEFAZ status
400Credencial fiscal não encontrada para o X-Credential-Key informado.Use the API Key of a credential of the token's organization
400Nota fiscal sem resposta da SEFAZ: ainda não há documento para imprimir.The invoice is PENDING; sync it before asking for the PDF
403This route is for integrations with an organization API token…Use an API token; a dashboard session does not call these routes
404Nota fiscal não encontrada. or no bodyThe invoice does not exist or belongs to another organization
404Esta nota não tem XML (nunca foi assinada).Issuance failed before the invoice was built: there is no XML to download
503A SEFAZ não respondeu à consulta. Tente de novo mais tarde.SEFAZ did not answer the sync of an invoice that was already closed

Errors come as { "success": false, "message": "…" }, except authentication and route errors (403, PDF/XML 404), which come as { "status": false, "message": "…" }.

Missing something on this page? Contact support from the dashboard and we'll update the docs.