TF Fiscal

Other fiscal documents

CT-e Transport

5 endpoints

The CT-e API (model 57, layout 4.00 + NT2025/001) lets you issue, cancel, correct (CC-e) and consult Electronic Bills of Lading. The CT-e documents the provision of a cargo transport service. It supports 6 modes (road, air, waterway, rail, pipeline, multimodal) and 4 types of CT-e (Normal, Supplement, Annulment, Replacement). The business data goes in the /create body; the technical access-key fields (cCT, cDV, cUF, dhEmi, mod) are calculated automatically by the server. The fields serie and nCT are optional: they are allocated automatically when omitted (or set to 0), but are honored when sent (useful for skipping the numbering, e.g. after a duplicate at the tax authority).

EndpointMethodDescription
/api/cte/createPOSTIssue CT-e
/api/cte/cancelPOSTCancel CT-e (event 110111)
/api/cte/ccePOSTCorrection Letter — CC-e (event 110110)
/api/cte/consultPOSTConsult the status of the CT-e

The service taker (whoever pays the freight) is defined in ide.toma: 0=Sender, 1=Dispatcher, 2=Receiver, 3=Recipient, 4=Others (in this case fill in ide.toma4).

POST/api/cte/create

Issue CT-e

Issues a CT-e from the submitted body. The client sends only the business data; the technical access-key identification fields are calculated by the server (see the note below the ide table). Credit is debited only in production (tpAmb=1) and when the CT-e is authorized. The examples below cover the most common case: road mode (modal=01) and Normal CT-e (tpCTe=0).

Required headers

HeaderTypeDescription
tokenstringToken of the issuing company
signstringMD5 signature: MD5(token + path + body + timestamp)
timestampstringUnix timestamp in seconds (5-minute window)
Required fields in the request: ide (tpAmb, CFOP, natOp, modal, tpCTe, toma, cMunIni, UFIni, cMunFim, UFFim); emit with CNPJ or CPF and xNome; rem with CNPJ or CPF; dest with CNPJ or CPF; vPrest.vTPrest > 0; imp (with one ICMS variant). For tpCTe=0 (Normal): infCTeNorm with infCarga (proPred + at least 1 infQ) and infModal (the mode corresponding to ide.modal; for modal=01, rodo.RNTRC is required). All other fields are optional.

Body — root

FieldTypeDescription
ide *objectCT-e identification
emit *objectIssuer data (carrier)
rem *objectCargo sender
dest *objectCargo recipient
vPrest *objectService provision values
imp *objectTaxes (ICMS + tributes)
infCTeNorm *objectNormal CT-e body — required when tpCTe=0 (Normal) or 3 (Replacement)
expedobjectDispatcher (optional)
recebobjectReceiver (optional)
complobjectComplementary data (observations, flow, delivery)
infCteCompobjectKey of the supplemented CT-e — required when tpCTe=1 (Supplement): { chCTe }
infCteAnuobjectKey of the annulled CT-e — required when tpCTe=2 (Annulment): { chCte, dEmi }
autXMLarrayCNPJs/CPFs authorized to access the XML: [{ CNPJ } | { CPF }]
infRespTecobjectTechnical contact — filled in automatically by the server per UF

ide — Identification

FieldTypeDescription
tpAmb *intEnvironment: 1=production, 2=staging
CFOP *intFiscal operation code (e.g.: 5353 within the state, 6353 interstate)
natOp *stringNature of the operation (e.g.: "PRESTACAO DE SERVICO DE TRANSPORTE")
modal *stringMode: "01"=road, "02"=air, "03"=waterway, "04"=rail, "05"=pipeline, "06"=multimodal
tpCTe *intCT-e type: 0=Normal, 1=Supplement, 2=Annulment, 3=Replacement
tpServ *intService type: 0=Normal, 1=Subcontracting, 2=Reshipment, 3=Intermediate Reshipment, 4=Service Linked to Multimodal
toma *intService taker: 0=Sender, 1=Dispatcher, 2=Receiver, 3=Recipient, 4=Others
toma4objectService taker data — required when toma=4 (see table below)
indIETomaintService taker IE indicator: 1=ICMS taxpayer, 2=Exempt, 9=Non-taxpayer (when 9, the service taker's IE is omitted automatically)
cMunIni *longIBGE code of the service start municipality (7 digits)
xMunInistringName of the start municipality
UFIni *stringStart UF (2 letters)
cMunFim *longIBGE code of the service end municipality (7 digits)
xMunFimstringName of the end municipality
UFFim *stringEnd UF (2 letters)
cMunEnvlongIBGE code of the issuance municipality
xMunEnvstringName of the issuance municipality
UFEnvstringIssuance UF
retiraintPickup at origin: 0=Yes, 1=No. Default: 1
xDetRetirastringPickup details
tpImpintDACTE format: 1=Portrait, 2=Landscape. Default: 1
infPercursoarrayRoute UFs: [{ UFPer }]
dhContstringDate/time of entry into contingency (ISO 8601)
xJuststringContingency justification
serieintCT-e series (3 digits of the access key). Optional — auto-allocated (the company's CT-e series) when omitted or 0; respected when sent
nCTlongCT-e number (part of the access key). Optional — auto-incremented by the server when omitted or 0; respected when sent (useful for skipping numbering, e.g.: after a duplicate)

Filled in automatically by the server — you do not need to send them: mod (fixed at 57), cCT (8-digit numeric code), cDV (check digit), cUF (derived from the issuer's UF), dhEmi (current date/time), tpEmis (default 1=Normal), procEmi and verProc.

toma4 — "Others" service taker (when ide.toma=4)

FieldTypeDescription
CNPJ ⚠ / CPF ⚠stringService taker's document (one of the two)
IEstringState Registration
xNomestringCompany name/name
xFant, fone, emailstringTrade name, phone, e-mail
enderTomaobjectAddress: { xLgr, nro, xCpl, xBairro, cMun, xMun, CEP, UF, cPais, xPais }

emit — Issuer (carrier)

FieldTypeDescription
CNPJ ⚠stringIssuer's CNPJ (14 digits)
CPF ⚠stringIssuer's CPF (11 digits)
IEstringState Registration
IESTstringState Registration of the tax substitute
xNome *stringCompany name
xFantstringTrade name
CRTintTax Regime Code: 1=Simples Nacional, 2=SN exceeding sublimit, 3=Normal Regime, 4=MEI. Default: 3
enderEmitobjectAddress: { xLgr, nro, xCpl, xBairro, cMun, xMun, CEP, UF, fone }

rem — Sender

FieldTypeDescription
CNPJ ⚠ / CPF ⚠stringSender's document (one of the two)
IEstringState Registration (or "ISENTO")
xNomestringCompany name/name
xFant, fone, emailstringTrade name, phone, e-mail
enderRemeobjectSender's address (structure below)
locColetaarrayPickup locations (optional): [{ CNPJ|CPF, xNome, xLgr, nro, xBairro, cMun, xMun, UF }]

dest — Recipient

FieldTypeDescription
CNPJ ⚠ / CPF ⚠stringRecipient's document (one of the two)
IEstringState Registration (or "ISENTO")
xNomestringCompany name/name
fone, email, ISUFstringPhone, e-mail, SUFRAMA Registration
enderDestobjectRecipient's address (structure below)
locEntobjectDelivery location (optional): { CNPJ|CPF, xNome, xLgr, nro, xBairro, cMun, xMun, UF }

exped / receb — Dispatcher / Receiver (optional)

FieldTypeDescription
CNPJ / CPFstringDocument (one of the two)
IE, xNome, fone, emailstringState Registration, name, phone, e-mail
enderExped / enderRecebobjectAddress (same generic structure below)

Address (enderEmit / enderReme / enderExped / enderReceb / enderDest)

FieldTypeDescription
xLgrstringStreet
nrostringNumber
xCplstringComplement
xBairrostringNeighborhood
cMunstringIBGE municipality code (7 digits)
xMunstringMunicipality name
CEPstringPostal code (8 digits) — not used in enderEmit
UFstringState abbreviation (2 letters)
cPaisstringCountry code (optional, default 1058 Brazil)
xPaisstringCountry name (optional)
fonestringPhone (only in enderEmit)

vPrest — Service Provision Values

FieldTypeDescription
vTPrest *decimalTotal value of the service provision (> 0)
vRecdecimalAmount receivable
ComparrayValue components: [{ xNome, vComp }] — e.g.: "FRETE PESO", "PEDÁGIO", "GRIS"

imp — Taxes

FieldTypeDescription
ICMS *objectICMS taxation — fill in only one of the variants (see below)
vTotTribdecimalApproximate total value of tributes
infAdFiscostringAdditional information of interest to the tax authority
ICMSUFFimobjectDIFAL (interstate sharing, optional): { vBCUFFim, pFCPUFFim, pICMSUFFim, pICMSInter, vFCPUFFim, vICMSUFFim, vICMSUFIni }
infTribFedobjectFederal tributes (optional): { vPIS, vCOFINS, vIR, vINSS, vCSLL }

ICMS — variants (fill in only one)

VariantWhen to useFields
ICMS00Normal taxation{ vBC, pICMS, vICMS } (CST 00)
ICMS20With reduction of calculation base{ pRedBC, vBC, pICMS, vICMS } (CST 20)
ICMS45Exempt / non-taxed / deferred{ CST } — "40"=Exempt, "41"=Non-taxed, "51"=Deferred
ICMS60ICMS charged by tax substitution{ vBCSTRet, vICMSSTRet, pICMSSTRet, vCred } (CST 60)
ICMS90Others (special regime){ pRedBC, vBC, pICMS, vICMS, vCred } (CST 90)
ICMSOutraUFICMS due to another UF{ pRedBCOutraUF, vBCOutraUF, pICMSOutraUF, vICMSOutraUF }
ICMSSNSimples Nacional issuer{ CST: "90", indSN: 1 }

infCTeNorm — Normal CT-e (required for tpCTe=0/3)

FieldTypeDescription
infCarga *objectCargo information (table below)
infDocobjectTransported documents (table below)
infModal *objectMode information (table below)
docAntobjectPrevious documents (subcontracting/reshipment): { emiDocAnt[]{ CNPJ|CPF, IE, UF, xNome, idDocAnt[] } }
segarrayCargo insurance: [{ respSeg, xSeg, CNPJ, nApol, nAver, vCarga }] — respSeg: 1=Sender…6=Service taker
cobrobjectBilling/invoices: { fat{ nFat, vOrig, vDesc, vLiq }, dup[]{ nDup, dVenc, vDup } }
veicNovosarrayNew vehicles transported: [{ chassi, cCor, xCor, cMod, vUnit, vFrete }]
infCteSubobjectReplacement — required when tpCTe=3: { chCte, indAltToma, refNF, tomaICMS, tomaNaoICMS }

infCTeNorm.infCarga — Cargo

FieldTypeDescription
proPred *stringPredominant product
vCargadecimalTotal cargo value
xOutCatstringOther cargo characteristics (e.g.: FRIA, GRANEL, REFRIGERADA)
vCargaAverbdecimalCargo value for endorsement purposes
infQ[] *arrayQuantities — minimum 1: [{ cUnid, tpMed, qCarga }]
infQ[].cUnidstringUnit: "00"=M³, "01"=KG, "02"=TON, "03"=UNIT, "04"=LITERS, "05"=MMBTU
infQ[].tpMedstringMeasurement type (e.g.: "PESO BRUTO", "PESO DECLARADO")
infQ[].qCargadecimalQuantity

infCTeNorm.infDoc — Transported documents

FieldTypeDescription
infNFearrayNF-es by access key: [{ chave, PIN, dPrev, infUnidCarga[], infUnidTransp[] }] — chave with 44 digits
infNFarrayPaper invoices (legacy): [{ mod, serie, nDoc, dEmi, vBC, vICMS, vProd, vNF, nCFOP, nPeso, … }]
infOutrosarrayOther documents: [{ tpDoc, descOutros, nDoc, dEmi, vDocFisc }] — tpDoc: "00"=Declaration, "10"=Pipeline, "99"=Others

infCTeNorm.infModal — Modes (fill in only the one corresponding to ide.modal)

ModeObjectFields
01 Roadrodo{ RNTRC* } — RNTRC with 8 digits or "ISENTO". Optional: occ[] (pickup orders)
02 Airaereo{ nMinu, nOCA, dPrevAereo, natCarga{ xDime, cInfManu[] }, tarifa{ CL, cTar, vTar }, peri[] } — dPrevAereo AAAA-MM-DD
03 Waterwayaquav{ vPrest, vAFRMM, xNavio, nViag, direc, irin, tpNav, balsa[], detCont[] } — direc: N/L/S/O; tpNav: 0=Interior, 1=Coastal
04 Railferrov{ tpTraf, respFat, ferrEmi, vFrete, chCTeFerroOrigem, ferroEnv[] } — tpTraf: 0=Own, 1=Mutual, 2=Road-rail, 3=Road
05 Pipelineduto{ vTar, dIni, dFim } — dates AAAA-MM-DD
06 Multimodalmultimodal{ COTM, indNegociavel, seg[] } — indNegociavel: 0=No, 1=Yes

The entire infModal block accepts versaoModal (default "4.00").

compl — Complementary data (optional)

FieldTypeDescription
xCaracAd, xCaracSer, xEmistringAdditional characteristic of the transport / of the service / issuer name
origCalc, destCalcstringOrigin / destination municipality for freight calculation
xObsstringGeneral observations
ObsCont / ObsFiscoarrayFree observations of the taxpayer / tax authority: [{ xCampo, xTexto }]
fluxo, EntregaobjectCargo flow (origin/passage/destination/route) and delivery forecast

* Required field. ⚠ At least one of CNPJ or CPF is required in the group.

POST/api/cte/cancel

Cancel CT-e

Cancels an authorized CT-e (event 110111). Requires that the CT-e has been authorized (has a protocol) and is not yet cancelled.

Required headers

HeaderTypeDescription
tokenstringToken of the issuing company
signstringMD5 signature
timestampstringUnix timestamp in seconds

Body

FieldTypeDescription
chCTe *stringAccess key of the CT-e (44 digits)
xJust *stringCancellation justification (minimum 15 characters as required by the tax authority)
nProtstringAuthorization protocol. Optional: when omitted, uses the protocol registered at issuance

* Required field.

POST/api/cte/cce

Correction Letter (CC-e)

Registers an Electronic Correction Letter (event 110110) on an authorized CT-e. The CC-e cannot correct values that impact the tax, registration data that change the issuer/service taker/sender/recipient, or the issuance date. Each correction indicates the group, field and new value.

Required headers

HeaderTypeDescription
tokenstringToken of the issuing company
signstringMD5 signature
timestampstringUnix timestamp in seconds

Body

FieldTypeDescription
chCTe *stringAccess key of the CT-e (44 digits)
infCorrecao[] *arrayCorrections (minimum 1, up to 20)
infCorrecao[].grupoAlterado *stringChanged group (e.g.: "ide", "rem", "dest")
infCorrecao[].campoAlterado *stringChanged field (e.g.: "xNome")
infCorrecao[].valorAlterado *stringNew value
infCorrecao[].nroItemAlteradointNumber of the changed item (when the group is a list)

* Required field. The condition of use (xCondUso) is filled in automatically by the server.

POST/api/cte/consult

Consult the status of the CT-e

Consults the status of the CT-e at the tax authority from the access key. When the CT-e is cancelled (local record), the response reflects the cancellation.

Required headers

HeaderTypeDescription
tokenstringToken of the issuing company
signstringMD5 signature
timestampstringUnix timestamp in seconds

Body

FieldTypeDescription
chCTe *stringAccess key of the CT-e (44 digits)

* Required field.

GET/api/cte/get_list

List CT-e (paginated)

Lists the company's CT-e with pagination. Parameters are passed via query string (not in the body). The time filter is optional, but if used, both start_create_time and end_create_time are required.

Required headers

HeaderTypeDescription
tokenstringIssuing company token
signstringMD5 signature (path includes the query string)
timestampstringUnix timestamp in seconds

Query string

ParameterTypeDescription
page *intPage number (≥ 1)
page_size *intPage size (1–50)
start_create_timelongUnix timestamp in milliseconds — start (requires end_create_time)
end_create_timelongUnix timestamp in milliseconds — end
statusstringFilter by status. Values: "Success" (authorized), "Canceled" (canceled), "Processing" (processing), "Failed" (failed), "Unknown" (unknown)

* Required field.