TF Fiscal
Documentation

Reference

Error codes

Consolidated error code reference of the TF Fiscal Open API, grouped by layer and domain, with HTTP status, scenario and recommended handling.

Error shapes

Errors come in three shapes depending on which layer produced them, see General conventions:

LayerHTTPShapeCode field
Platform gateway (authentication, subscription, rate limit, file download links)401 / 403 / 404 / 429 / 503Platform envelope {success, errorType, code, message}code (integer)
Companies, NF-e, CT-e, DC-e, webhook registration400 / 404Array [{codigo, mensagem}], one entry per problemcodigo (string)
NF-e verification and identity lookup400 / 422 / 428 / 451 / 500 / 503Bare object {code, message}code (integer)

Messages are localized by the Language / Accept-Language headers (default Portuguese). Branch on codes, never on message text. In the array shape GW001, CER0005, NFe0001, CTe0001, DCe0001 and DCe0000x keep their alphanumeric values; all other codigo values are the platform error code as a numeric string.

Code ranges by domain:

RangeDomain
10001xxxRequest validation and platform faults
10003xxxCompany and certificate
10004xxxNF-e issuance, cancellation and correction letter
10005xxxTax engine
10009xxxOpen platform (authentication, subscription, rate limit, webhooks, download links)
10013xxxFile download
10015xxxNF-e verification
10016xxxIdentity lookup (CNPJ / CPF)
10017xxxCT-e
10019xxxDC-e

Gateway: authentication and authorization

Platform envelope shape, produced before the request reaches the API. 401 and 403 are configuration errors; retrying without a fix is pointless and may trip rate limits. See Authentication for the signing scheme.

HTTPcodeMeaningAction
40110009000Missing signature headers (token / sign / timestamp)Send all three headers on every request
40110009001Timestamp invalid or clock skew beyond ±300 sSync your clock (NTP); regenerate the timestamp per request, never reuse
40110009002Invalid tokenCheck the app_secret; if rotated, update your configuration
40110009003Signature mismatchRe-derive the signature; see the checklist in Authentication
40310009004Application disabledContact the platform
40310009015Application not effective (pending approval or rejected)Wait for approval / contact the platform
40310009014Integrator account disabledContact the platform
40310009005API not subscribedRequest subscription for the endpoint being called
42910009006Rate limit exceededBack off and retry (start at 1 s, double up to 30 s, add jitter); limits apply per application and per endpoint group

Download links (linkDanfe, linkDownloadXml, linkDacce, nfeLinkXml, cteLinkDacte, dceLinkDace and the like) are plain GET requests without signature headers; their failures are HTTP statuses with the platform envelope, see File download:

HTTPcodeMeaningAction
40110009035Download link invalid (path altered, token reused or signature mismatch)Use the link exactly as returned by the query API
40110009036Download link expiredQuery the document again for a fresh link
50310009037File not ready yet (rendering service busy)Retry the same link after Retry-After
40410013011Downloaded file not foundCheck where the link came from
42910013016Too many downloads from one IP through callback linksRetry after Retry-After

Request validation and platform faults

codeHTTPShapeScenarioAction
10001001400ArrayRequest field validation failed, one entry per field; also registration / update contract errors of the emissaoDCe section (both configuration blocks missing, update changing cnpj / municipality, lowering the series cursor, switching series)Fix per mensagem
10001000500BarePlatform-side fault on a verification or identity callRetry with backoff; if persistent, contact the platform with the failing timestamp and path

Companies and certificates

Array shape. See Companies.

codigoHTTPScenarioAction
GW001400Registration: city / state cannot be resolved to an IBGE code; issuance: recipient IBGE municipality code does not exist or is inconsistent with ufCheck the UF and city name / IBGE code
CER0005400Certificate password mismatchCheck the password
10003000404empresaId does not exist or does not belong to this applicationCheck the empresaId
10003002400CNPJ already registeredThe company exists; use the original empresaId
10003006400Registration data missing the IEProvide inscricaoEstadual
10003010400Certificate CNPJ does not match the companyUse the correct certificate
10003011400Certificate expiredUse a valid certificate
10003012400Certificate identical to the currently active oneNothing to upload
10009033400Invalid webhook registration (id mismatch / non-JSON contentType)Fix as described, see Register webhook

NF-e

Array shape. Business errors are HTTP 400; an unknown document is HTTP 404 with codigo NFe0001. SEFAZ rejections during issuance are not HTTP errors: they surface as query status Negada and the invoice.rejected webhook. See NF-e.

codigoHTTPScenarioAction
NFe0001404The nfeId for query / cancellation / correction letter does not existCheck the id sent at issuance and the empresaId
10004002400Too many pending issuance tasks for the CNPJRetry later
10004004400Company not issuable (not yet approved or certificate not ready)Wait for approval / link the certificate
10004012400Cancellation / correction letter: invoice not in authorized statusQuery to confirm the status
10004013400Cancellation: outside the 24-hour windowIssue a return invoice instead
10004014400Cancellation: refused by SEFAZ (status code and reason attached)Act on the SEFAZ reason
10004015400Correction letter: 20 letters already registered on the invoiceNo further letters; cancel + reissue or return invoice
10004016400Correction letter refused by SEFAZ (status code and reason attached)Act on the SEFAZ reason
10004017400Correction letter: fewer than 15 characters after sanitisingRewrite in Portuguese / ASCII
10004019400Correction letter: outside the 720-hour window after authorizationCancel + reissue or return invoice only
10004021 to 10004026400Return invoice references: missing reference / reference on a non-return invoice / original not found or not this company / original not authorized / original item not found / quantity above the original lineSee the return invoice rules in Issue NF-e
10004030400ambienteEmissao does not match the company's current environmentSubmit under the company environment or ask operations to switch it, see Environments
10004031400Value not supported (presencaConsumidor / multiple payments / unknown payment type / tipoPessoa inconsistent with the document / CPF buyer carrying inscricaoEstadual)Adjust to the supported range in Issue NF-e
10004034400CNPJ buyer without cliente.inscricaoEstadualSend the buyer's state registration (ICMS taxpayer)
10004043400Contract field missing (base reduction / ST margin and rate / deferral / unit tax amount / IPI code / pCredSN absent from both request and profile); mensagem names the field pathFill the field per the tax code matrix in Issue NF-e
10004044400Field not applicable to the tax code (substituicaoTributaria on a non-ST code, percentualCreditoSimples on a non-credit code)Remove the group
10004045400The CNPJ buyer's cliente.inscricaoEstadual fails the check-digit rule of the buyer's state (SEFAZ would reject with 209 after numbering)Check the buyer's IE and state
10004046400Tax code does not match the company regime (CRT 1/4 needs a 3-digit CSOSN, CRT 2/3 a 2-digit CST)Use the code family of the company's regime
10004047400A non-taxpayer buyer with a taxpayer-only code (10/30/70, 101/201/202/203) or with pCredSNUse 102 / 500 or 900 without credit
10005000400Rejected by the tax engine (regime / tax code mismatch, ST code for a non-taxpayer buyer, rate out of range)See the tax parameter rules in Issue NF-e

CT-e

Array shape. Business errors are HTTP 400; a missing document / task is HTTP 404 with codigo CTe0001. SEFAZ rejections during issuance surface as query status Negada and the cte.rejected webhook. See CT-e.

codigoHTTPScenarioAction
CTe0001404cteId not found or not owned by the companyCheck id and empresaId
10003000404empresaId not foundCheck empresaId
10017004400Company cannot issue (not approved / certificate not ready)Wait for approval / link the certificate
10017005 / 10017006400Concurrent duplicate request / too many pending tasks for the CNPJRetry later
10017007400Number series unresolved (none configured, or several enabled without a choice)Configure a model 57 series
10017010400ambienteEmissao differs from the company's environmentSubmit for the company's environment
10017011400Municipality IBGE code not foundCheck codigoIbge
10017012 / 10017013400Party missing / taker inconsistent with the IE indicatorAdd the party or change indicadorIeTomador
10017014400Invalid document references (missing, bad check digit, mixed groups, previous documents inconsistent with the service type)Adjust the references
10017015400Document type inconsistent with references (complementary / substitute)Send ctesComplementados / cteSubstituido per tipo
10017016400Components do not sum to the total, or aReceber above the totalFix the amounts
10017017 / 10017018 / 10017019400Invalid RNTRC / unsupported modal / invalid enum or format (mensagem names the field)Fix per mensagem
10017020 to 10017025400Tax parameter missing / not allowed / regime mismatch / icmsUfFim required / rate table row missing / unsupported CSTSee the tax parameters in CT-e
10017030400Same id with a different messageUse a new id or resend the original message
10017031400Production: an active / authorized document already exists for the idQuery the original
10017040 to 10017045400Status does not allow the event / cancellation window exceeded / invalid event text / SEFAZ rejected the event / correction sequence limit / referenced event not foundSee the cancellation and event rules in CT-e
10017048 / 10017049400Cancellation blocked by a registered correction letter / correction letter outside the 720-hour windowSee the cancellation and event rules in CT-e
10001001400Request field validation failed (one entry per field)Fix per mensagem

DC-e

Array shape. Business errors are HTTP 400; a missing document / task is HTTP 404 with codigo DCe0001. Cases with a documented example code keep that code; every other codigo is the platform's numeric error code. SEFAZ rejections during issuance surface as query status Negada and the dce.rejected webhook; SEFAZ rejections of the cancellation surface as dce.cancel_rejected. See DC-e.

codigoHTTPScenarioAction
DCe0001404dceId not found, not owned by the company, or cancellation requested before the document was materializedCheck id and empresaId; cancel Pendente documents only after authorization
10003000404empresaId not foundCheck empresaId
DCe00004400Company not configured for DC-e (missing tipoEmitente / model 99 series / Marketplace site), or ambiente differs from the company's current environmentSend emissaoDCe at registration or through an update with id; submit for the company's current environment and ask operations for the production switch
DCe00005400Marketplace / Carrier company without remetenteAdd the sender
DCe00006400remetente.endereco missingAdd the sender address
DCe00007400Brazilian sender without cpfCnpjAdd the sender document
DCe00008400Company cannot issue (not approved / certificate not ready)Wait for approval / link the certificate
DCe00009400Brazilian recipient without cpfCnpjAdd the recipient document
GW001400Municipality IBGE code not found or inconsistent with ufCheck cidade / uf
10019005 / 10019006400Concurrent duplicate request / too many pending tasks for the CNPJRetry later
10019007400Number series unresolved (several enabled series)Ask operations to consolidate the series
10019013400Issuer type Carrier not supported for issuance yetUse a Marketplace / OwnIssuer company
10019018400Invalid item (NCM length, quantity ≤ 0, negative unit price)Fix per mensagem
10019019400Invalid enum or format (mensagem names the field: tipoPessoa, modalidade, dataEmissao, documents, phone, e-mail, own-issuer remetente differing from the company)Fix per mensagem
10019020400Invalid carrier CNPJFix cnpjTransportadora
10019021400Additional information too longShorten the text
10019022400Invalid autorizacaoDownloadXml count or document; contains the issuer's own CNPJ; duplicate documentFix the list
10019030400Same id with a different messageUse a new id or resend the original message
10019031400Production: an active / authorized document already exists for the idQuery the original
10019040 to 10019043400Status does not allow cancellation / 24-hour window exceeded / cancellation already accepted / invalid reasonSee the cancellation rules in DC-e
10019048400dataEmissao outside the allowed window (more than 5 minutes ahead or more than 30 days back; mensagem carries the current limits)Use the current time or omit dataEmissao
10001001400Request field validation failed (one entry per field); registration / update contract errors of emissaoDCeFix per mensagem

NF-e verification

Bare shape {code, message}, HTTP 400. The request never enters validation. See NF-e verification.

codeEndpointMeaningAction
10015000XML verificationEmpty request bodySend the XML in the body
10015001XML verificationBody exceeds 1 MBAn authentic single NF-e never exceeds this; check that you are not wrapping or double-encoding
10015002XML verificationDTD detected (<!DOCTYPE)Strip DTDs; they are rejected as an XXE safeguard
10015003XML verificationEncoding is not UTF-8Convert to UTF-8 before submitting
10015104Chave lookupMalformed chave (length / characters / check digit)Validate locally first: 44 digits; the last digit is a mod-11 check digit
10015004Chave lookupInvoice not found in any sourceThe chave is unknown to the platform and the official data source; verify it with its issuer

Tier-1 validation errors

Returned with HTTP 200 inside validation.errors[] of the XML verification response. These are not transport errors: the request succeeded, the document failed. All are blocking (terminal REJECTED) except PROTOCOL_MISSING, which is a warning.

errors[].codeNumericMeaning
XML_MALFORMED10015100XML syntax invalid
XSD_INVALID10015101Does not conform to the NF-e 4.00 XSD layout
SIGNATURE_INVALID10015102Digital signature verification failed (content tampered, or certificate expired at signing time)
SIGNATURE_CERT_MISMATCH10015103Signing certificate CNPJ does not match the issuer
ACCESS_KEY_INVALID10015104chave structure / check digit invalid
ACCESS_KEY_MISMATCH10015105chave segments do not match the document fields
PROTOCOL_MISMATCH10015106Protocol block inconsistent with the document
PROTOCOL_MISSING10015107No protocol node (warning, non-blocking)
XML_VERSION_UNSUPPORTED10015108Layout version is not 4.00

Tier-2 outcomes

Not HTTP errors: they arrive through the invoice.verify.completed webhook.

validationStatusTerminalAction
VALIDATEDYesSafe to proceed (release goods, settle)
REJECTEDYesDo not proceed; reason explains the SEFAZ verdict (cancelled / denied / voided / not found / protocol mismatch)
VALIDATION_ERRORNoPlatform-side verification failure, not an invoice judgment; resubmit later with header forceRevalidate: true

Identity lookup

Bare shape {code, message}. Format and check-digit errors are rejected locally and never reach the upstream source; they consume no quota and are not billed. See Identity lookup.

codeHTTPResponsible partyMeaningAction
10016000400CallerInvalid CPF format (11 digits required)Check for stray formatting characters or wrong length
10016001400CallerInvalid CPF check digitsValidate locally with the mod-11 algorithm first
10016002400CallerInvalid date of birth (valid DDMMYYYY required)Note the day-month-year order, and that the date must actually exist
10016003400CallerCPF not foundThe CPF does not exist, or the CPF and date of birth do not match (deliberately indistinguishable)
10016004451Third party (lawful upstream block)LGPD: menor de 16 anos (Lei Felca), holder is under 16Data lawfully withheld; do not retry
10016005422Third party (lawful upstream block)LGPD: menor de idade, holder is 16 to 17Data lawfully withheld; do not retry
10016006428Third party (lawful upstream block)LGPD: idade nao verificavel - informe a data de nascimento para completar a verificacao, age cannot be verifiedThe platform already re-verified once with the date of birth; do not retry
10016010400CallerInvalid CNPJ format (14 digits required)Check for stray formatting characters
10016011400CallerInvalid CNPJ check digitsValidate locally with the mod-11 algorithm first
10016012400CallerCNPJ not foundNo such CNPJ in the official registry
10016020503Third party (upstream unavailable)Upstream data source is temporarily unavailableRetry with exponential backoff (start at 1 s, double up to 30 s, add jitter); contact the platform if it persists

Handling guidance

  • 401 / 403: configuration errors; fix the credential, subscription or clock. Do not retry as-is.
  • 400 / 404: the request or the business rule; fix per the code. A few codes are transient and can be retried later: 10004002, 10017005 / 10017006, 10019005 / 10019006.
  • 422 / 428 / 451: statutory blocks on identity lookups; retrying is pointless.
  • 429: back off with exponential delay and jitter (start at 1 s, double up to 30 s).
  • 503: retry the same request or link after Retry-After (10009037, 10016020).
  • 5xx: retry with backoff; if persistent, contact the platform with the failing timestamp and path.
  • Envelope errorType: 1 API error, 2 SEFAZ rejection, 3 system fault (retryable), 4 field validation failure (fix the request).
  • Never retry a rejected document blindly: Negada and REJECTED are terminal verdicts; act on the SEFAZ reason first.