webmania®
  • Contact

Region and language

Brazil

  • PTPortuguês (Brasil)
  • ENEnglish
  • ESEspañol
Sign in Book a demo
Solutions
Fiscal IssuerFiscal MonitorTax ReconciliationArtificial Intelligence

Document guide

NF‑e (electronic invoice)NFS‑e (service invoice)CT‑e and CT‑e OS (freight bills)NFC‑e (consumer receipt)DC‑e (content declaration)MDF‑e (cargo manifest)NFCom (telecom invoice)CIOT (road freight code)Tax payment slips

Tax intelligence and security

ByPass®Webmania® TaxesTax reformSecurityWebmania® Trust Center
Brazil tax guide

Start here

Brazil tax guideComplete guide

Popular chapters

NF‑e · Electronic invoiceNFS‑e · Service invoiceCT‑e · Freight billTax reformGlossary
Industries
Technology & SaaSRetail & CommerceLogistics & TransportationEnterprise

By company size

Mid-sized Companies

Other industries

ManufacturingBanks & FintechsServices & Subscriptions
Developers
See all documentation →

Tax & Invoicing

Goods invoice (NF‑e)Service invoice (NFS‑e)Telecom invoice (NFCom)Fiscal Monitor

Logistics & Transport

Freight bill (CT‑e)Cargo manifest (MDF‑e)Content declaration (DC‑e)CIOT / PEF (ANTT)

Payments & Management

GNREDARE‑ICMS SPDUA‑ESB2B Management

Resources

Docs for LLMs (llms.txt)Webmania® Status (in Portuguese)SEFAZ Monitor (in Portuguese)City Hall Monitor (in Portuguese)
Company

Webmania

About WebmaniaCustomers
ContactPortuguês (Brasil)
Sign in →Book a demo
Fiscal IssuerIssue NF‑e, NFS‑e, CT‑e and other documents from the panel or the API→Fiscal MonitorReceive the invoices issued to your CNPJs, straight from SEFAZ and city halls→Tax ReconciliationCheck the new CBS tax against the Federal Revenue before you pay→Artificial IntelligenceUnderstand rejections, set up taxes and update records with AI→

Document guide

NF‑eElectronic invoiceNFS‑eService invoiceCT‑e and CT‑e OSFreight billNFC‑eConsumer receiptDC‑eElectronic content declarationMDF‑eCargo manifestNFComTelecom invoice

Document guide

CIOTRoad freight registration codeTax payment slipsGNRE, DARE‑ICMS SP and DUA‑ES from the NF‑e

Tax intelligence and security

ByPass®ERP values without recalculationWebmania® TaxesSet up your Tax ClassesTax reformIBS, CBS and the Selective TaxSecurityCertificate, data and Trust CenterWebmania® Trust CenterSecurity, privacy and subprocessors

Not sure where to start?

Book a demo →

Tax & Invoicing

Goods invoiceNF‑e, NFC‑e, CC‑e and MDeService invoiceNFS‑eTelecom invoiceNFComFiscal MonitorXML download

Logistics & Transport

Freight billCT‑e and CT‑e OSCargo manifestMDF‑eContent declarationDC‑eCIOT / PEF (ANTT)Freight payment

Payments & Management

GNREState tax payment slipDARE‑ICMS SPSão Paulo state ICMSDUA‑ESEspírito Santo payment slipB2B ManagementManage your companies
Ready for LLMs and SDKsAI-ready documentation, with official SDKsllms.txt# Webmania® documentation- NF‑e - NFS‑e Open llms.txt

Live status (in Portuguese): Webmania® Status · SEFAZ Monitor · City Hall Monitor

See all documentation →
Technology & SaaSThe tax layer of your software, through REST APIs.Learn more →Technology team
Retail & CommerceNFC‑e and NF‑e at the checkout and online, by API.Learn more →Retail operation
Logistics & TransportationCT‑e and MDF‑e built into your transportation system.Learn more →Logistics operation
EnterpriseHigh volumes, with VIP Support and governance.Learn more →Enterprise operation

By company size

Mid-sized CompaniesOperations that are scaling up

Other industries

ManufacturingNF‑e at the volume of your operationBanks & FintechsNFS‑e for fees and servicesServices & SubscriptionsNFS‑e at large scale

Not sure where to start?

Book a demo →

Webmania

About WebmaniaThe tax infrastructure and intelligence behind 100,000+ active company IDs (CNPJs).Meet Webmania →CustomersHow companies in different industries issue and monitor their tax documents.See our customers →ContactQuestions about operating in Brazil? Our team replies in your language.Talk to our team →

In numbers

15 million+tax documents per month
1.2 billion+API requests per year
100,000+active company IDs (CNPJs)
99.95%availability

Not sure where to start?

Book a demo →

Start here

Brazil tax guideNew to Brazil? The invoices, taxes and approvals of a sale, explained on one page.Start reading →

Go deeper

Complete guideEvery tax document in detail: when you need it, how to issue, cancel and correct it.Open the complete guide →

Goods and services

NF‑eElectronic invoiceNFC‑eConsumer receiptNFS‑eService invoiceNFComTelecom invoice

Transport

CT‑eFreight billMDF‑eCargo manifestCIOTRoad freight codeDC‑eContent declaration

Taxes and reform

Tax payment slipsGNRE, DARE and DUATax reformCBS and IBS, 2026–2033Tax ClassTax rules, set onceGlossaryTax terms, explained

Not sure which documents your operation needs?

Book a demo →
  • CT-e REST API
  • Quick guide
    • CT-e or CT-e OS?
    • CT-e lifecycle
    • Transport modes
  • SDKs & LLMs
    • LLM-ready
    • Webmania SDKs
    • Examples
  • Authentication
  • Notifications
    • Notification fields
    • Notification example
  • Issuing a CT-e
    • General information
      • Simplified issuing
    • Service
    • Cargo
      • Quantities
      • Cargo flow
    • Service locations
    • Parties
    • Delivery
    • Taxpayer notes
    • Notes for the tax authority
    • Tax documents
      • Transport units
      • Cargo units
    • Previous documents
      • Issuer
      • Document
    • New vehicles
    • Billing
      • Invoice
      • Installments
    • Advance payment
    • Taxes
      • ICMS
        • ICMS sharing
    • Road
      • Pickup orders
        • Issuer
    • Air
      • Fare
      • Cargo nature
      • Dangerous goods
    • Water
      • Container
        • Document
    • Rail
      • Railways
    • Pipeline
    • Multimodal
      • Insurance
  • Issuing a CT-e OS
    • General information
    • Service
    • Cargo
      • Quantities
      • Insurance
    • Service locations
    • Payer
    • Tax documents
    • Billing
      • Invoice
      • Installments
    • Taxes
      • ICMS
        • ICMS sharing
    • Road
      • Vehicle
        • Owner
    • Taxpayer notes
    • Notes for the tax authority
  • Tax reformNEW
    • IBS/CBS
    • IBS/CBS — Simples Nacional
    • State IBS
    • City IBS
    • CBS
    • Presumed credit
    • Government purchasesNEW
    • Linked paymentsNEW
  • Functions
    • Download XML and PDF
      • Access credentials
      • Token
    • Lookup
    • Cancellation
    • Delivery confirmation
    • Delivery confirmation cancellation
    • Correction letter
    • Link a paymentNEW
    • Cancel a payment linkNEW
    • Look up payment eventsNEW
  • Contingency
    • EPEC
  • Infrastructure
  • Request limits
  • Changelog
⚡ Follow in real time (in Portuguese): Status | SEFAZ Monitor | City Hall Monitor

Last updated: December 6, 2026 · v1.3.1

Region and language

Brazil

  • PTPortuguês (Brasil)
  • ENEnglish
  • ESEspañol
View Markdown index (in Portuguese)
View Markdown indexLists the sections with links (in Portuguese)Open in ChatGPTReads the index and fetches only the sections it needsOpen in ClaudeReads the index and fetches only the sections it needs

Electronic Freight Bill REST API

Documentation for issuing electronic freight bills (CT-e and CT-e OS)

Issue CT-e straight from your system Issue CT-e straight from your system

The Webmania® REST API issues the CT-e and the CT-e OS at SEFAZ, the state tax authority. It creates the XML and the DACTE (the printable summary of the CT-e) and sends the result by notification. It also registers the events of each document: cancellation, correction letter, delivery confirmation and payment link. To start, read the Quick guide. To issue other document types, see all the APIs.

What is the CT-e? The CT-e (Conhecimento de Transporte Eletrônico) is the electronic freight bill: the tax document of a transport service. The carrier issues it for each freight job. It names who sends the cargo, who receives it and who pays for the freight (the tomador); see Parties. The API issues both models at the same endpoint, and the modelo field sets which one:

CT-e

For cargo transport, in one of the six transport modes: road, air, water, rail, pipeline or multimodal. Send modelo = cte; see Issuing a CT-e.

CT-e OS

For the transport of passengers, valuables or excess baggage, by road. Send modelo = cte_os, with the tomador (payer) object; see Issuing a CT-e OS.

Brazilian tax terms you will see. They keep their Brazilian names in the payload and on the CT-e:
SEFAZ: the state tax authority. It authorizes each CT-e and answers with a status code; 100 = authorized.
DACTE: the printable summary of the CT-e that travels with the cargo; the legal document is the XML.
CFOP: the 4-digit code that says what kind of transaction it is (first digit 5 = inside the state, 6 = to another state). Field impostos.cfop.
ICMS: the state tax on transport between cities or states, tax base × rate. Group impostos.icms; its CST (tax status code) goes in classificacao_tributaria.
RNTRC / ANTT: the carrier's registration with ANTT, the national land transport agency. Field rntrc of the road mode.
CNPJ / CPF / IE: the company ID (14 digits), the individual taxpayer ID (11 digits) and the state registration of each party.
IBS / CBS / cClassTrib: the new taxes of the tax reform and the code that says how they apply; see Tax reform.
Every term in plain English: glossary of Brazilian tax terms.

Availability and security
High availability, scalable and redundant servers at the highest PCI DSS security level, on Amazon Web Services, the global leader in cloud computing.
Storage
Secure, encrypted and unlimited storage of the tax documents on Amazon S3.
REST API integration
Works with every programming language through JSON, with low latency on a global infrastructure.
Automatic numbering
Issue CT-e through the API and the Webmania® Panel at the same time, with numbering managed automatically.
DACTE and email delivery
Automatic DACTE that prints on common printers, and secure delivery of the CT-e by email.
Expert support
Expert help with tax integration and programming.

Quick guide

Send every API request over encrypted HTTPS to https://api.webmania.com.br. The /2/ prefix means you are using version 2.0 of the API.

URL HTTP Verb CT-e CT-e OS Function
/2/cte/emissao POST
Available
Available
Issue a CT-e
/2/cte/emissao/simplificada POST
Available
Not available yet
Simplified CT-e issuing
/2/cte/entrega POST
Available
Not used
Add the delivery event to the CT-e
/2/cte/correcao POST
Available
Available
Add a correction letter to the CT-e
/2/cte/evento POST
Available
Available
Link a payment to the CT-e (event 110300)
/2/cte/consulta/{identifier} GET
Available
Available
Look up a CT-e by UUID (36 characters) or access key (44 characters)
/2/cte/consulta/evento/{identifier} GET
Available
Available
Look up the payment events of the CT-e
/2/cte/cancelar PUT
Available
Available
Cancel a CT-e
/2/cte/entrega/cancelar PUT
Available
Not used
Cancel the delivery event of the CT-e
/2/cte/evento/cancelar PUT
Available
Available
Cancel a payment link (event 110301)

Responses are in JSON. Send Authorization: Bearer YOUR_ACCESS_TOKEN in every call and Content-Type: application/json in calls with a body; see Authentication.

Check both the HTTP status and the JSON body of the response. Validation errors can return HTTP 200 with the error field. An HTTP 2xx status does not prove the tax authorization: follow the status and motivo fields of the CT-e. For example, an authentication failure returns HTTP 401 with this message ("Restricted access. Token missing or invalid."):

{
  "error": "Acesso restrito. Token não informado ou inválido."
}

How to integrate the CT-e:

  1. Get the Access Token Copy the Access Token of the company from the Webmania® Panel and send it in the Authorization header.
  2. Choose the document CT-e for cargo transport; CT-e OS for passengers, valuables or excess baggage. The modelo field sets which one.
  3. Issue the document POST to /2/cte/emissao, with ambiente = 2 (sandbox) for tests. The response has the uuid of the CT-e; store it in your system.
  4. Get the result Webmania notifies your url_notificacao when the CT-e is authorized, rejected, denied or canceled.
  5. Download the XML and the DACTE When the CT-e is authorized, download the files from the xml and dacte URLs of the response.
  6. Register the eventsif needed Correction letter, delivery confirmation and payment link are events of an authorized CT-e. See the lifecycle.
  7. Look up the CT-eif needed By UUID or access key, to check the status at any time.
  8. Cancel the CT-eif needed If the transport service does not take place, cancel the authorized CT-e with a justification.

Quick guide
CT-e or CT-e OS?

The CT-e (the electronic freight bill) and the CT-e OS (the bill for passenger, valuables and excess baggage transport) are issued at the same endpoint, POST /2/cte/emissao. The service you provide decides which document to issue:

CT-e or CT-e OS: which document to issue To choose the document, look at what the service carries. Cargo transport is documented by the CT-e: modelo cte, with servico.tipo from 0 to 4, in one of the six transport modes. The transport of passengers, valuables or excess baggage is documented by the CT-e OS: modelo cte_os, with servico.tipo 6, 7 or 8, in the road mode, issued at POST /2/cte/emissao with the tomador object. For the CT-e, if the data comes from an NF-e that was already issued, use simplified issuing, POST /2/cte/emissao/simplificada, with the NF-e XML in nfe_xml; otherwise, use standard issuing, POST /2/cte/emissao. Which document to issue? What does the service carry? the modelo sets the document CT-e modelo = cte servico.tipo 0 to 4 · six modes CT-e OS modelo = cte_os servico.tipo 6, 7 or 8 · road Does the data come from an issued NF-e? the NF-e XML goes in nfe_xml Simplified POST /2/cte/ emissao/simplificada Standard POST /2/cte/emissao Issuing a CT-e OS POST /2/cte/emissao with the tomador object Cargo People, valuables or baggage Yes No
Document Decision Issuing endpoint
Simplified issuing exists only for the CT-e. After the import, the NF-e content follows the rules of standard issuing: send the required fields that the XML does not provide.
What changesCT-eCT-e OS
What it is forCargo transportTransport of passengers, valuables or excess baggage
modeloctecte_os
servico.tipoOptional: 0 to 4, with 0 (Normal) as the defaultRequired: 6, 7 or 8
Transport modeAll six in Transport modesRoad (modalidade = 1)
tomador (payer)Required when indicador_tomador = 4Always required
Simplified issuingAvailable, from the XML of an NF-eNot available
Delivery confirmationAvailableNot available
Issuing fieldsIssuing a CT-eIssuing a CT-e OS

Quick guide
CT-e lifecycle

Every CT-e and CT-e OS gets a uuid as soon as the API accepts the issuing request. From then on, it goes through the statuses below. They appear in the response, in the lookup and in the notifications:

CT-e lifecycle The CT-e starts as processando while SEFAZ, the state tax authority, reviews the document. If SEFAZ and the SVC are unavailable, it stays in contingencia and Webmania sends it again automatically, after checking SEFAZ so the same CT-e is not issued twice. The result is aprovado, with the XML and the DACTE, or reprovado, with the reason. An authorized CT-e can be canceled with PUT /2/cte/cancelar and becomes cancelado. It also accepts events that do not change the status: correction letter, delivery confirmation (CT-e only) and payment link. POST /2/cte/emissao Processing processando waiting for SEFAZ Authorized aprovado XML and DACTE available Rejected reprovado read the reason and fix it Contingency contingencia SEFAZ and SVC unavailable Canceled cancelado PUT /2/cte/cancelar Correction letter POST /2/cte/correcao Delivery confirmation POST /2/cte/entrega CT-e only Payment link POST /2/cte/evento SEFAZ and SVC down resend
After authorization Authorized Waiting for the result: not a final status Rejected Automatic retry
The processando and contingencia statuses are not notified and do not prove authorization: follow the CT-e through the lookup, without issuing it again. SEFAZ can also deny the use of the CT-e (denegado); see the table below.
StatusWhat it meansWhat to do
processandoSEFAZ has not given the result of the CT-e yet.Wait for the notification or look up the CT-e. Do not issue it again.
contingenciaSEFAZ and the SVC (its backup authorization servers) are unavailable. Webmania sends the CT-e again automatically when the connection comes back, after checking SEFAZ.Follow the same uuid, without issuing again. See Contingency.
aprovadoSEFAZ authorized the CT-e; the XML and the DACTE are available.Download the XML and the DACTE. Register the events you need or, if the service does not take place, cancel it.
reprovadoSEFAZ rejected the CT-e; motivo has the response.Fix the data pointed out in motivo and issue a new CT-e.
denegadoSEFAZ denied the use of the CT-e; motivo has the response.Do not use this CT-e. Read the motivo before you issue again.
canceladoSEFAZ approved the cancellation.Do not use this CT-e for the transport service.

After the authorization, the CT-e accepts the events below. All of them need a CT-e with status aprovado:

EventEndpointWhat changes
CancellationPUT /2/cte/cancelarThe CT-e becomes cancelado.
Correction letterPOST /2/cte/correcaoThe CT-e stays aprovado; the CC-e has its own XML and DACCE (the printable summary of the correction letter).
Delivery confirmationPOST /2/cte/entregaCT-e only. The CT-e stays aprovado; the confirmation can be canceled.
Payment linkPOST /2/cte/eventoThe CT-e stays aprovado; the link can be canceled and looked up.

Quick guide
Transport modes

The CT-e is issued in one of six transport modes, chosen in modalidade. Each mode has its own object in the request. In the air, water, rail, pipeline and multimodal modes, the object is required when you choose that modalidade.

Transport modemodalidadeObjectFields
Road (trucks)1rodoviarioRoad · for the CT-e OS, Road (CT-e OS)
Air (aircraft)2aereoAir
Water (ships and barges)3aquaviarioWater
Rail (trains)4ferroviarioRail
Pipeline5dutoviarioPipeline
Multimodal (two or more modes)6multimodalMultimodal

SDKs & LLMs

Take this reference to your AI assistant, integrate the API with an official SDK, or start from the ready-made modules and examples.

LLM-ready

Send an AI the section index of this reference: it reads the index and fetches only the sections it needs, in Markdown. The Markdown is in Portuguese; the assistant can answer in English.

  • Section index Start here Every section of this reference with its URL and size, so the AI reads only what it needs. View Markdown index
  • Page in Markdown The full reference in plain text, with the same tables and examples. View as Markdown
  • Open in ChatGPT Reads the index and fetches only the sections it needs. Open in ChatGPT
  • Open in Claude Reads the index and fetches only the sections it needs. Open in Claude
  • llms.txt Starting point for agents, with every public reference. Open llms.txt

Webmania SDKs

Official open-source SDKs on GitHub to integrate the Webmania APIs in the language of your project. Each repository includes installation, examples and the operations it covers.

  • Node.js / TypeScript Available

    Node.js >= 22 README

    git clone https://github.com/webmaniabr/webmania-node.git

  • Python Available

    Python >= 3.11 README

    git clone https://github.com/webmaniabr/webmania-python.git

  • PHP Available

    PHP >= 8.3 README

    git clone https://github.com/webmaniabr/webmania-php.git

  • Perl Available

    Perl 5.36 README

    git clone https://github.com/webmaniabr/webmania-perl.git

  • Go Available

    Go 1.26 README

    git clone https://github.com/webmaniabr/webmania-go.git

  • C Available

    C11, Linux arm64 README

    git clone https://github.com/webmaniabr/webmania-c.git

  • C++ Available

    C++, Linux arm64 README

    git clone https://github.com/webmaniabr/webmania-cpp.git

  • Lua Available

    Lua 5.4, Linux arm64 README

    git clone https://github.com/webmaniabr/webmania-lua.git

  • Dart Available

    Dart >= 3.8.3, Linux arm64 README

    git clone https://github.com/webmaniabr/webmania-dart.git

  • R Available

    R >= 4.6.2, Linux arm64 README

    git clone https://github.com/webmaniabr/webmania-r.git

  • Java Available

    Java 17+ README

    git clone https://github.com/webmaniabr/webmania-java.git

  • Kotlin Available

    Kotlin 2.4 / JVM 17+ README

    git clone https://github.com/webmaniabr/webmania-kotlin.git

  • Scala Available

    Scala 3.3 / JVM 17+ README

    git clone https://github.com/webmaniabr/webmania-scala.git

  • Clojure Available

    Clojure 1.12 / JVM 17+ README

    git clone https://github.com/webmaniabr/webmania-clojure.git

  • Ruby Available

    Ruby 3.3, Ruby 3.4 README

    git clone https://github.com/webmaniabr/webmania-ruby.git

  • .NET (C#) Available

    .NET 10 README

    git clone https://github.com/webmaniabr/webmania-dotnet.git

  • PowerShell Available

    PowerShell 7.6 README

    git clone https://github.com/webmaniabr/webmania-powershell.git

  • Elixir Available

    Elixir ~> 1.18, Linux arm64 README

    git clone https://github.com/webmaniabr/webmania-elixir.git

  • Rust Available

    Rust >= 1.85 README

    git clone https://github.com/webmaniabr/webmania-rust.git

  • Haskell Available

    GHC 9.6.7, Linux arm64 README

    git clone https://github.com/webmaniabr/webmania-haskell.git

  • Swift Available

    macOS 13+, iOS 16+ README

    git clone https://github.com/webmaniabr/webmania-swift.git

Examples

Test the CT-e REST API without writing a line of code, and speed up your integration with the official Webmania® tools.

  • Postman collection Instant tests Ready-made requests to test the API without writing code. Open in Postman
  • Video Test the REST API without a line of code (in Portuguese). Watch on YouTube

Authentication

To use the API, authenticate every request with an HTTP header. Use the Authorization header in this format:

Authorization: Bearer {Access-Token}

You find the API 2.0 Access-Token in the Webmania® Panel. Include it in every request. Send the request body in JSON, with the Content-Type and Accept headers set to application/json.

Keep your credentials safe. Never publish the Access Token in the source code of a website, app or system where other people can easily read it.

For mobile apps (iOS and Android), we recommend issuing the documents on your server (back end). The app code should only send the request; the processing should happen on your server.

Notifications

To keep your platform up to date, Webmania® sends automatic notifications (webhooks) for every result of the CT-e and the CT-e OS. With them, you do not need to build a routine of periodic lookups: wait for the webhook and update the document in your system when it arrives.

The notification is sent by POST, in JSON, to the URL in url_notificacao of the issuing request. Without this parameter, it goes to the notification URL registered for the company. Use the uuid to identify the CT-e and update your database.

Notified statusWhen it is sent
aprovadoSEFAZ authorized the CT-e; the body has the chave, the xml and the dacte.
reprovadoSEFAZ rejected the CT-e; the body has the motivo.
denegadoSEFAZ denied the use of the CT-e; the body has the motivo.
canceladoThe cancellation was approved; the body has the xml_cancelamento.
When there is no notification. The processando and contingencia statuses are not notified. In these cases, do not issue the CT-e again: wait for the next notification or check the result in the lookup.

What is the UUID? The UUID (Universally Unique Identifier) is a unique 36-character ID, in the 8-4-4-4-12 format, that Webmania gives to each CT-e.

It is created as soon as our API receives the request successfully, that is, after it passes our validations and before anything is sent to SEFAZ. So the UUID exists whatever the status of the CT-e at SEFAZ: it applies to aprovado, reprovado, cancelado, processando and contingencia.

Once created, the UUID is permanent: it does not change on retries, contingency or resending. The access key is a different field and can change. So use the UUID, not the access key, as your reference in the database.

Notifications
Notification fields

The notification body has the same format as the CT-e lookup:

Parameter Type Description
uuid string Unique ID of the CT-eUse the UUID to match the notification you receive.
chave string or null Access key of the CT-e at SEFAZ, when available.
serie number or null Series of the document, when assigned.
cte number or null CT-e number
Managed automatically by the issuer. It can be null while no number is assigned.
status string Status of the CT-e; see the lifecycle.
aprovado
reprovado
cancelado
processando
contingencia
denegado
motivo string or null Reason for the status, when available.
E.g.: Autorizado o uso do CT-e (use of the CT-e authorized)
modelo string Document model: cte or cte_os.
epec boolean Tells whether the document was issued in EPEC. Learn more
xml string URL of the CT-e XML
xml_cancelamento string URL of the XML of the canceled CT-e
Available only for a canceled CT-e.
dacte string URL of the DACTE (the printable summary of the CT-e)
log object or array SEFAZ response or validation details. It can be an empty array while there is no response.

Notifications
Notification example

The notification is sent with the POST method, in application/json format:

-X POST \
-header "Content-type: application/json" \

Example of a notification for an authorized CT-e:

{
    "uuid": "00000000-0000-0000-0000-000000000000",
    "chave": "00000000000000000000000000000000000000000000",
    "serie": 1,
    "cte": 123,
    "status": "aprovado",
    "motivo": "Autorizado o uso do CT-e",
    "epec": false,
    "xml": "https://api.webmania.com.br/xmlcte/[chave]",
    "dacte": "https://api.webmania.com.br/dacte/[chave]",
    "log": {}
}

Issuing a CT-e

The CT-e (the electronic freight bill) documents a cargo transport service in one of the six transport modes. Send the data in the request body, in JSON, with modelo = cte. To reuse the data of an NF-e (electronic invoice) that was already issued, use simplified issuing.

To issue a CT-e, send a POST request to /2/cte/emissao.

  curl -X POST \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "ambiente": 1,
    "modelo": "cte",
    "modalidade": 1,
    ...
  }' \
  https://api.webmania.com.br/2/cte/emissao

The example below shows the structure of a request in the sandbox (ambiente: 2). Replace the sample data and complete the required groups and the taxes that apply to the transaction before you send it.

{
    "ambiente": 2,
    "finalidade": "0",
    "natureza_operacao": "Prestação de serviço de transporte - interestadual",
    "modalidade": "1",
    "modelo": "cte",
    "data_emissao": "2023-10-27 09:21:22", // Optional. Replace with a date within the last 168 hours
    "inscricao_suframa": "123456789", // Optional. SUFRAMA registration of the issuer. Omit it if there is none
    "local_inicio_prestacao": {
        "cidade": "Curitiba",
        "uf": "PR"
    },
    "local_termino_prestacao": {
        "cidade": "São Paulo",
        "uf": "SP"
    },
    "contribuicao_tomador": "9",
    "indicador_tomador": "0",
    "entrega": {
        "data_inicial": "2023-10-27 09:21:22"
    },
    "pagamento_antecipado": {
        "tipo": 3, // Optional. 1 = this CT-e is itself the advance payment (credit); 3 = payment made earlier
        "chaves": ["13260706074104000127570010000001231210730009"] // Sample 44-digit key. Replace it with the real key of the advance payment document, issued by the same CNPJ as the issuer. Required when tipo=3 and not allowed when tipo=1
    },
    "impostos": {
        "cfop": "0000",
        "classificacao_tributaria": "00",
        "ibs_cbs": {
            "cbs": {
                "alc_zfm_cbs": {
                    "aliquota_efetiva_referencia": "8.8000" // Effective reference rate (% with 4 decimal places) for the ZFM/ALC regime
                }
            }
        }
    },
    "remetente": {
        "nome_razao": "Remetente Carga",
        "cnpj": "00000000000000",
        "nome_fantasia": "Rementente",
        "telefone": "11999999999",
        "endereco": "Rua Exemplo",
        "numero": "321",
        "complemento": "Edifício",
        "bairro": "Jardim",
        "cep": "82400000",
        "cidade": "Curitiba",
        "uf": "PR"
    },
    "destinatario": {
        "nome_razao": "Destinatario Carga",
        "cnpj": "00000000000000",
        "telefone": "11999999999",
        "endereco": "Rua Exemplo",
        "numero": "123",
        "bairro": "Jardim",
        "cidade": "São Paulo",
        "cep": "01153000",
        "uf": "SP"
    },
    "servico": {
        "tipo": 0,
        "valor_total": 100,
        "valor_recebido": 100
    },
    "carga": {
        "valor_total": 100,
        "produto_predominante": "Chocolate",
        "quantidades": [
            {
                "unidade_medida": "1",
                "tipo_medida": "LITROS",
                "quantidade": 2
            }
        ]
    },
    "documentos_fiscais": [
        {
            "tipo": "1",
            "chave": "00000000000000000000000000000000000000000000"
        }
    ],
    "rodoviario": {
        "rntrc": "00000000"
    }
}

Example of an HTTP 200 response with the fields uuid, chave, serie, cte, status, motivo, modelo, epec, xml, dacte and log, described in Notification fields. HTTP 200 does not confirm the authorization: check the status in the lifecycle.

{
  "uuid": "00000000-0000-0000-0000-000000000000", // Unique ID
  "chave": "00000000000000000000000000000000000000000000", // Access key at SEFAZ
  "serie": 1, // CT-e series
  "cte": 123, // CT-e number
  "status": "aprovado", // aprovado, reprovado, cancelado, processando, contingencia or denegado
  "motivo": "Autorizado o uso do CT-e", // Reason for the status
  "modelo": "cte", // Document model
  "epec": false, // Whether the EPEC event was issued
  "xml": "https://api.webmania.com.br/xmlcte/[chave]",
  "dacte": "https://api.webmania.com.br/dacte/[chave]",
  "log": {} // Sample object of the SEFAZ response; it can be [] while there is no response
}

The final result is sent by POST to the url_notificacao; see Notifications.

Issuing a CT-e
General information

The CT-e has six transport modes, one for each way of carrying the cargo: Road, Air, Water, Rail, Pipeline and Multimodal (more than one mode under a single contract). Each mode has its own group of fields, sent in the parameters rodoviario, aereo, aquaviario, ferroviario, dutoviario and multimodal.

Fill in the fields that apply to your document. Some parameters have more details: click the parameter name to see them. The table below lists the fields for issuing a CT-e in the Standard and Simplified formats.

Simplified issuing

The Webmania CT-e API offers two ways to issue the document: Standard and Simplified. In Standard issuing, you send all the information of the document. In Simplified issuing, you reuse the information of an NF-e that was already issued. Send the XML of that NF-e in the nfe_xml parameter, as a string encoded in base64. The data reused from the NF-e depends on the fields used when the NF-e was issued, such as the sender, the recipient, the cargo value, the start and end locations of the service and the other information documented in the table below.

After the import, the content follows the rules of Standard issuing. Required fields that the XML does not fill in are still required. The examples below are partial samples, not a complete issuing request.

Parameter Standard Simplified Type Size Description
ID
Optional
Optional
string 1-15 Purchase order number or processing ID
Tracks issuing requests by order or processing ID. Learn more (in Portuguese)
ambiente
Required
Required
integer 1 SEFAZ environment
1 - Production
2 - Sandbox (test environment)
url_notificacao
Optional
Optional
string - - - Notification URL for every status update of the CT-e
nfe_xml
Simplified issuing only
Required
string - - - XML of the NF-e to import, encoded in base64
modelo
Required
Required, modelo cte
string - - - Model of the document to issue; send cte
modalidade
Required
Required
integer 1 Transport mode of the document 1 - Road
2 - Air
3 - Water
4 - Rail
5 - Pipeline
6 - Multimodal
natureza_operacao
Required
Required
string 1-60 Description of the nature of the transaction
finalidade
Required
Required
string 1 Type of CT-e
0 - Normal
1 - Value complement
3 - Replacement
data_emissaoNEW
Optional
Optional
string - - - Issue date and time of the document
Recommended format:
Y-m-d H:i:s

When it is not sent, or is null, the processing date and time are used.

The API applies a 10-minute margin to the 168-hour backdating limit: send a date that is at most 167 hours and 50 minutes in the past. Future dates beyond the 5-minute tolerance are refused.
cte_referenciado
Required when finalidade is 1 or 3.
Required when finalidade is 1 or 3.
string 44 Access key of the CT-e that this document replaces or complements
contribuicao_tomador
Required
Required
integer 1 ICMS (state sales tax) taxpayer type of the payer (tomador) of the service
1 - ICMS taxpayer
2 - Taxpayer exempt from state registration (IE)
9 - Not an ICMS taxpayer
indicador_tomador
Required
Required
integer 1 Which party is the payer (tomador) of the CT-e 0 - Sender (remetente)
1 - Shipper (expedidor)
2 - Receiver (recebedor)
3 - Recipient (destinatario)
4 - Other
alteracao_tomador
Optional
Optional
boolean 1 Tells whether the payer changed in a replacement CT-e.The API can calculate it when it finds the referenced CT-e with the data needed to compare the payer.
globalizadoNEW
Optional
In simplified issuing, the API sets false
boolean 1 Tells whether the CT-e is a consolidated (globalizado) CT-e.
informacao_globalizadoNEW
Optional
Optional
string 15-256 Information about the consolidated CT-e. Fill in additional information, the law of the special regime, and so on.
servico
Required
Required
object - - - Information about the service provided
carga
Required
Required after the import; send the required fields that the NF-e does not provide
object - - - Information about the cargo being carried
documentos_fiscais
Required, except when modalidade is 6
Optional; the imported NF-e is used
array - - - Array with the information of the documents the cargo travels with
local_inicio_prestacao
Required
Optional; the pickup location of the NF-e is used when present, otherwise the address of the issuer
object - - - Start location of the service
local_termino_prestacao
Required
Optional; the delivery location of the NF-e is used when present, otherwise the address of the recipient
object - - - End location of the service
remetente
Required
Optional; the sender is taken from the NF-e
object - - - Sender of the cargo
destinatario
Required
Optional; the recipient is taken from the NF-e
object - - - Recipient of the cargo
tomador
Required when indicador_tomador is 4
Required when indicador_tomador is 4
object - - - Payer of the service Required when the indicador_tomador parameter is 4
expedidor
Required when indicador_tomador is 1
Required when indicador_tomador is 1; it can be taken from the pickup location of the NF-e
object - - - Shipper of the cargo
recebedor
Required when indicador_tomador is 2
Required when indicador_tomador is 2
object - - - Receiver of the cargo
entrega
Optional
Optional
object - - - Expected delivery date and time
observacoes_contribuinte
Optional
Optional
array - - - Free-form additional notes of the taxpayer
observacoes_fisco
Optional
Optional
array - - - Free-form additional notes for the tax authority
detalhes_retirada
Optional
Optional
string 1-160 Additional information about the cargo pickup
caracteristica_transporte
Optional
Optional
string 1-15 Additional feature of the transport. Examples: REENTREGA (redelivery), DEVOLUÇÃO (return) and REFATURAMENTO (rebilling)
caracteristica_servico
Optional
Optional
string 1-30 Additional feature of the service. Examples: ENTREGA EXPRESSA (express delivery), LOGÍSTICA REVERSA (reverse logistics), CONVENCIONAL (standard) and EMERGENCIAL (emergency)
observacoes_gerais
Optional
Optional
string 1-2000 Additional information of the document
informacoes_adicionais_fisco
Optional
Optional
string or null up to 2000 Additional information for the tax authority
inscricao_suframa
Optional
Optional
string 8-9 SUFRAMA registration of the issuer (SUFRAMA is the Manaus Free Trade Zone authority)
pagamento_antecipado
Optional
Optional
object - - - Advance payment of the transport service
When tipo=1, this CT-e is itself the advance payment. When tipo=3, send the access keys of the documents whose payment was made earlier.

Issuing a CT-e
Service

Send the details of the transport service in the servico object.

Parameter Standard Simplified Type Size Description
valor_total
Required
Required
decimal 13v2 Total value of the service
0.00
valor_recebido
Required
Required
decimal 13v2 Amount received for the service
0.00
tipo
Optional
Optional
integer 1 Type of service provided. 0 - Normal (default)
1 - Subcontracting
2 - Redispatch
3 - Intermediate redispatch
4 - Service linked to a multimodal transport

componentes
Optional
Optional
object --- Components of the service price Send an object where each key is the name of a price component and each value is the amount of that component

Example fragment with the service values of the CT-e:

{
  "servico": {
      "valor_total": 12000,
      "valor_recebido": 9500,
      "componentes": {
          "FRETE PESO": 8000
      }
  }
}

Issuing a CT-e
Cargo

Send the cargo details in the carga object. Its fields follow the rules in the table below.

Parameter Standard Simplified Type Size Description
valor_total
Required, except when modalidade is 5
Taken from the NF-e when available; required after the import, except in mode 5 (pipeline)
decimal 13v2 Total value of the cargo, from 0 to 9999999999999.99
produto_predominante
Required
Optional; the product with the largest volume on the NF-e is used
string 1-60 Description of the main product in the cargo
valor_averbacao
Optional
Optional
decimal 13v2 Value of the cargo registered with the insurer (averbação)
caracteristicas
Optional
Optional
string 1-30 Additional cargo feature Examples: Fria (cold), Granel (bulk) or Refrigerada (refrigerated)
quantidades
Required
Taken from the gross weight or the number of packages on the NF-e when available; required after the import
array 1-n Quantities of the cargo
fluxo
Required in the air mode
Required in the air mode
object - - - Planned cargo flow

Example of the cargo on the CT-e:

{
  "carga": {
    "valor_total": 100,
    "produto_predominante": "Chocolate",
    "quantidades": [
      {
        "unidade_medida": "4",
        "tipo_medida": "LITROS",
        "quantidade": 2
      }
    ]
  }
}

Issuing a CT-e > Cargo
Quantities

Send the quantities of the cargo in the quantidades array. Each item is an object.

Parameter Standard Simplified Type Size Description
quantidade
Required
Taken from the NF-e when available; required after the import
decimal 11v4 Quantity of the cargo item, from 0 to 99999999999.9999.
unidade_medida
Required
Taken from the NF-e when available; required after the import
string 1 Unit of measure of the cargo item.
0 - M3 (cubic meters)
1 - KG
2 - TON
3 - UNIDADE (units)
4 - LITROS (liters)
5 - MMBTU
tipo_medida
Required
The NF-e data is used when available.
string 1-20 Type of measure of the cargo item, in free text.
Examples: PESO BRUTO (gross weight), PESO DECLARADO (declared weight), LITRAGEM (volume in liters), CAIXAS (boxes), etc.

Example of the cargo quantities on the CT-e:

{
  "carga": {
    "quantidades": [
      {
        "unidade_medida": "4",
        "tipo_medida": "LITROS",
        "quantidade": 2
      }
    ]
  }
}

Issuing a CT-e > Cargo
Cargo flow

Send the planned cargo flow in the carga.fluxo object.

Parameter Standard Simplified Type Size Description
origem
Required in the air mode
Required in the air mode
string 1-60 Abbreviation or internal code of the origin branch, port, station or airport.
passagens
Optional
Optional
array 0-n Array of strings with the abbreviation or internal code of each branch, port, station or airport the cargo passes through. Each string has 1 to 15 characters.
destino
Required in the air mode
Required in the air mode
string 1-60 Abbreviation or internal code of the destination branch, port, station or airport
rota
Optional
Optional
string 1-10 Delivery route code

Issuing a CT-e
Service locations

Send the start and end locations of the transport service in the local_inicio_prestacao and local_termino_prestacao objects. Their fields follow the rules below.

Parameter Standard Simplified Type Size Description
cidade
Required when cod_ibge is not sent or when cod_ibge is 5300108 (DF)
Taken from the NF-e when available; the same rule applies after the import
string - - - City nameSend 'EXTERIOR' for transport to or from another country.
uf
Required when cod_ibge is not sent
Optional; the address on the NF-e is used
string 2 State abbreviation (UF)Send 'EX' for transport to or from another country.
cod_ibge
Required when cidade is not sent
Optional; the address on the NF-e is used
string 7 Official city code (IBGE)Send 9999999 for transport to or from another country.

Example of the start and end locations of the service on the CT-e:

{
    "local_inicio_prestacao": {
        "cidade": "Curitiba",
        "uf": "PR",
        "cod_ibge": "4106902"
    },
    "local_termino_prestacao": {
        "cidade": "Rio de Janeiro",
        "uf": "RJ",
        "cod_ibge": "3304557"
    }
}

Issuing a CT-e
Parties

The parties of the CT-e are the individuals or companies that play a role in the freight job. A party can be the sender, the recipient, the shipper, the receiver or the payer. Send them in the remetente, destinatario, expedidor, recebedor and tomador objects, in this order, following the rules below. The sender sends the cargo; it is usually the seller on the NF-e. The recipient is the party the cargo is addressed to. The shipper hands the cargo to the carrier when it is not the sender. The receiver takes the cargo from the carrier when it is not the recipient. The payer pays for the transport service.

nome_razao is required for the sender and the recipient, and for the payer when indicador_tomador = 4. For the shipper and the receiver, this field is optional. When you send it, also send endereco, numero and bairro. These three address fields are required for the sender, the recipient and the payer with indicador_tomador = 4. For a Brazilian party with nome_razao, send cep, cidade, uf and either cpf or cnpj, never both. In simplified issuing, the same rules apply to the data imported from the XML.

Parameter Standard Simplified Type Size Description
cnpj
Required for a company
Required for a company
string 14 CNPJ, the 14-digit company ID (each branch has its own)
Do not send for a foreign party
cpf
Required for an individual
Required for an individual
string 11 CPF, the 11-digit individual taxpayer ID
Do not send for a foreign party
nome_razao
Required for remetente, destinatario and tomador with indicador_tomador = 4; optional for expedidor and recebedor
The same rules apply after the XML import
string 2-60 Name or company name
nome_fantasia
Optional
Optional
string 2-60 Trade name of the company
ie
Optional
Optional
string 0-14 IE (Inscrição Estadual), the state registration number of a company that pays ICMS
email
Optional
Optional
string - - - Email address
telefone
Optional
Optional
string 6-14 Phone number
endereco
Required depending on the party role and on nome_razao, as described above
The same rules apply after the XML import
string 2-255 Street
numero
Required depending on the party role and on nome_razao, as described above
The same rules apply after the XML import
string 1-60 Street number
complemento
Optional
Optional
string 1-60 Address complement (suite, floor)
bairro
Required depending on the party role and on nome_razao, as described above
The same rules apply after the XML import
string 2-60 District (neighborhood)
cep
Required for a Brazilian party with nome_razao
Required for a Brazilian party with nome_razao after the import
string 8-9 Postal code (CEP)
Do not send for a foreign party
cidade
Required for a Brazilian party with nome_razao; the postal code (CEP) lookup may update the value
The same rules apply after the XML import
string 2-255 City name
Do not send for a foreign party
uf
Required for a Brazilian party with nome_razao; the postal code (CEP) lookup may update the value
The same rules apply after the XML import
string 2 State abbreviation (UF)
Do not send for a foreign party
codigo_pais
Required for a foreign party
Required for a foreign party
string 1-4 Country code from the list of the Brazilian Central Bank (BACEN) Example: Brazil = 1058
pais
Required for a foreign party
Required for a foreign party
string 2-60 Name of the foreign country

Example fragment with one party of the CT-e. It is not a complete request. Replace the CPF with the real data of the recipient before you use it:

{
    "destinatario": {
        "nome_razao": "Destinatário Carga",
        "cpf": "00000000000",
        "telefone": "47999999999",
        "endereco": "Rua Naftali Reiss",
        "numero": "415",
        "complemento": "Residência",
        "bairro": "Bacacheri",
        "cep": "80035040",
        "cidade": "Curitiba",
        "uf": "PR"
    }
}

Example of a foreign party on the CT-e:

{
    "destinatario": {
        "nome_razao": "ACME S.A.",
        "endereco": "Av. Libertador",
        "numero": "1200",
        "bairro": "Centro",
        "codigo_pais": "639",
        "pais": "Argentina"
    }
}

Issuing a CT-e
Delivery

The optional entrega object holds the planned delivery of the CT-e in the data, data_inicial and data_final fields. Send data for a fixed date, or data_inicial and/or data_final for a period. Do not send data together with data_inicial or data_final. The fields are validated as dates; the formats below are input examples.

Parameter Standard Simplified Type Size Description
data
Optional; do not send together with data_inicial or data_final
Optional; do not send together with data_inicial or data_final
string (date) --- Delivery date, for delivery on a fixed date, as a date or a date and time
Y-m-d or Y-m-d H:i:s
data_inicial
Optional; do not send together with data
Optional; do not send together with data
string (date) --- Start date of the delivery period, as a date or a date and time.
Y-m-d or Y-m-d H:i:s
data_final
Optional; do not send together with data
Optional; do not send together with data
string (date) --- End date of the delivery period, as a date or a date and time
Y-m-d or Y-m-d H:i:s

Example of a fixed delivery date on the CT-e:

{
  "entrega": {
      "data": "2023-10-27"
  }
}

Example of a delivery period on the CT-e:

{
  "entrega": {
      "data_inicial": "2024-02-02",
      "data_final": "2024-03-03 15:14:25"
  }
}

Issuing a CT-e
Taxpayer notes

The optional observacoes_contribuinte array accepts up to 10 note objects. Each object must have the required fields identificacao and descricao, following the rules below.

Parameter Standard Simplified Type Size Description
identificacao
Required in each note
Required in each note
string 1-20 Field name for the taxpayer note
descricao
Required in each note
Required in each note
string 1-160 Text of the taxpayer note for this field

Example fragment with taxpayer notes on the CT-e. It is not a complete request:

{
  "observacoes_contribuinte": [
    {
      "identificacao": "LEI DA TRANSPARENCIA",
      "descricao": "O valor aproximado de tributos incidentes sobre o preço deste serviço é de R$ 152,00"
    },
    {
      "identificacao": "ContatoEntrega",
      "descricao": "João Pedro da Silva"
    }
  ]
}

Issuing a CT-e
Notes for the tax authority

The optional observacoes_fisco array accepts up to 10 note objects. Each object must have the required fields identificacao and descricao, following the rules below.

Parameter Standard Simplified Type Size Description
identificacao
Required in each note
Required in each note
string 1-20 Field name for the note to the tax authority
descricao
Required in each note
Required in each note
string 1-60 Text of the note to the tax authority for this field

Example fragment with notes for the tax authority on the CT-e. It is not a complete request:

{
  "observacoes_fisco": [
    {
      "identificacao": "RegimeEspecial",
      "descricao": "123456"
    }
  ]
}

Issuing a CT-e
Tax documents

Send the tax documents that travel with the cargo in the documentos_fiscais array. Each element of the array is one tax document, as an object.

Parameter Required Type Size Description
tipo
Required
string 1 Type of the linked document
1 - NFe (electronic invoice)
2 - NF (paper invoice)
3 - Declaration
4 - Pipeline
5 - CF-e SAT
6 - NFC-e (consumer receipt)
9 - Other
chave
Required for NF-e
string 44 Access key
serie
Required for NF
string 1-3 Series of the document
numero
Required for NF
string 1-20 Document number
data_emissao
Required for NF
string (date) --- Issue date, as a date or a date and time
Y-m-d or Y-m-d H:i:s
modelo
Required for NF
string 1 Document model: 1 or 4
base_calculo
Required for NF
decimal 13v2 Tax base of the document
base_calculo_st
Required for NF
decimal 13v2 Tax base for ICMS-ST (ICMS tax substitution) of the document
icms
Required for NF
decimal 13v2 ICMS amount of the document
icms_st
Required for NF
decimal 13v2 ICMS-ST (ICMS tax substitution) amount of the document
valor_produtos
Required for NF
decimal 13v2 Value of the products on the NF
cfop
Required for NF
string 4-5 CFOP (transaction code)
valor_total
Required for NF
decimal 13v2 Total value of the document
pin
Optional
string 2-9 SUFRAMA PIN (Manaus Free Trade Zone)
previsao_entrega
Optional
string (date) --- Planned delivery date, as a date or a date and time
Y-m-d or Y-m-d H:i:s
peso
Optional
decimal 12v3 Weight of the items on the invoice
numero_romaneio
Optional for NF (tipo = 2); do not send for the other types
string 1-20 Packing list number (romaneio)
numero_pedido
Optional for NF (tipo = 2); do not send for the other types
string 1-20 Order number
descricao
Optional
string 1-100 Document description, for types 3, 4, 5, 6 and 9
unidades_carga
Optional
array of objects 0-n Cargo units linked directly to the tax document
unidades_transporte
Optional
array of objects 0-n Transport units of the goods

Example fragment with NF-e tax documents. It is not a complete request. Replace the keys with the real documents:

{
    "documentos_fiscais": [
        {
            "tipo": "1",
            "chave": "00000000000000000000000000000000000000000000"
        },
        {
            "tipo": "1",
            "chave": "00000000000000000000000000000000000000000000"
        },
        {
            "tipo": "1",
            "chave": "00000000000000000000000000000000000000000000"
        }
    ]
}

Issuing a CT-e > Tax documents
Transport units

Send the transport units in the unidades_transporte array of each documentos_fiscais object. Each element is one transport unit, such as a truck, a trailer, a ship, a barge, an aircraft or a rail car.

Parameter Standard Simplified Type Size Description
tipo
Required
Required
string 1 Type of transport unit
1 - Road tractor
2 - Road trailer
3 - Ship
4 - Barge
5 - Aircraft
6 - Rail car
7 - Other
identificacao
Required
Required
string 1-20 Transport unit ID
Send the ID that matches the type of transport unit. For example, for a road tractor or trailer, send the license plate.
lacres
Optional
Optional
array (string 1-20) 0-n Seals of the transport unit
quantidade_rateada
Optional
Optional
decimal 3v3 Apportioned quantity (weight, volume)
unidades_carga
Optional
Optional
array 0-n Cargo units (containers, ULD, other)

Example fragment with one transport unit in a tax document. It is not a complete request. Replace the key and the IDs with the real data:

{
    "documentos_fiscais": [
        {
            "tipo": "1",
            "chave": "00000000000000000000000000000000000000000000",
            "unidades_transporte": [
                {
                    "tipo": "1",
                    "identificacao": "ABC1D23",
                    "lacres": ["00000000", "00000000"],
                    "unidades_carga": [
                        {
                            "tipo": "1",
                            "identificacao": "Container 00000"
                        }
                    ]
                }
            ]
        }
    ]
}

Issuing a CT-e > Tax documents
Cargo units

Send the cargo units in the unidades_carga array of each documentos_fiscais object, or in the unidades_carga array of one of its unidades_transporte. Each element is one cargo unit.

Parameter Standard Simplified Type Size Description
tipo
Required
Required
string 1 Type of cargo unit
1 - Container
2 - ULD
3 - Pallet
4 - Other
identificacao
Required
Required
string 1-20 Cargo unit ID
Send the ID of the cargo unit, for example the container number.
lacres
Optional
Optional
array (string 1-20) 0-n Seals of the cargo unit
quantidade_rateada
Optional
Optional
decimal 3v3 Apportioned quantity (weight, volume)

Example fragment with one cargo unit in a tax document. It is not a complete request. Replace the key and the IDs with the real data:

{
    "documentos_fiscais": [
        {
            "tipo": "1",
            "chave": "00000000000000000000000000000000000000000000",
            "unidades_carga": [
                {
                    "tipo": "1",
                    "identificacao": "Container 00000",
                    "lacres": ["00000000", "00000000"]
                }
            ]
        }
    ]
}

Issuing a CT-e
Previous documents

Link previous documents, the transport documents issued earlier for the same cargo, to the CT-e in the documentos_anteriores array.

Parameter Required Type Size Description
emissor
Required
object --- Issuer of the documents
documentos
Required for each emissor sent
array 1-n IDs of the previous documents of this issuer
Issuer
Parameter Required Type Size Description
nome_razao
Required
string 1-60 Name or company name of the issuer
cnpj
Required for a company
string 14 CNPJ (company ID)
00.000.000/0000-00
cpf
Required for an individual
string 11 CPF number (individual taxpayer ID)
000.000.000-00
ie
Required when uf is sent
string 0-14 State registration number (IE)
uf
Required when ie is sent
string 2 State of the issuer's address
Document
Parameter Required Type Size Description
chave
Required for an electronic document
string 44 Access key of the document
tipo
Required when chave is not sent (paper document)
decimal --- Document type
7 - ATRE
8 - DTA (customs transit declaration)
9 - International air waybill
10 – International road consignment note (Carta de Porte Internacional)
11 – Standalone freight bill (Conhecimento Avulso)
12 - TIF (international rail transport)
13 - BL (Bill of Lading)
serie
Required for a paper document
string 1-3 Series of the document
numero
Required for a paper document
string 1-30 Document number
data_emissao
Required when chave is not sent (paper document)
string --- Issue date, as a date or a date and time
Y-m-d or Y-m-d H:i:s

JSON fragment with previous documents. Replace the example CNPJ and key with the real data. The fragment is not a complete issuing request.

{
    "documentos_anteriores": [
      {
        "emissor": {
          "cnpj": "00.000.000/0000-00",
          "nome_razao": "Empresa Emissora"
        },
        "documentos": [
          {
            "chave": "00000000000000000000000000000000000000000000"
          }
        ]
      }
    ]
}

Issuing a CT-e
New vehicles

When you transport new vehicles, send their details in the veiculos_novos array.

Parameter Required Type Size Description
chassi
Required
string 17 Chassis number of the vehicle
cor
Required
string 1-4 Color code of the vehicle
cor_descricao
Required
string 1-40 Color name or description of the vehicle
marca_modelo
Required
string 1-6 Make/model of the vehicle
valor_unitario
Required
decimal 13v2 Unit value of the vehicle
valor_frete_unitario
Required
decimal 13v2 Freight value of the vehicle

Issuing a CT-e
Billing

Send the billing details in the cobranca object.

Parameter Standard Simplified Type Size Description
fatura
Optional
Optional
object --- Billing invoice (fatura)
duplicatas
Optional
Optional
array 0-n Billing installments (duplicatas)
Invoice (fatura)
Parameter Standard Simplified Type Size Description
numero
Optional
Optional
string 1-60 Invoice number
valor_original
Optional
Optional
decimal 13v2 Original value of the invoice
valor_desconto
Optional
Optional
decimal 13v2 Discount amount of the invoice
valor_liquido
Optional
Optional
decimal 13v2 Net value of the invoice
Installment (duplicata)
Parameter Standard Simplified Type Size Description
numero
Optional
Optional
string 1-60 Installment number
data_vencimento
Optional
Optional
string --- Due date
Y-m-d
valor
Required in each installment sent
Required in each installment sent
decimal 13v2 Installment amount

Issuing a CT-e
Advance payment

Send the advance payment in the pagamento_antecipado object, at the root of the request.

Parameter Standard Simplified Type Size Description
tipo
Required when the group is used
Required when the group is used
integer 1 Type of advance payment
1 - This CT-e is itself the advance payment (credit)
3 - Service paid earlier (requires chaves)
chaves
Required when tipo=3. Not allowed when tipo=1.
Required when tipo=3. Not allowed when tipo=1.
array 1-99 Access keys of the CT-e (models 57 or 67) whose payment covers the current service in advance
Each key must have exactly 44 digits. Required when tipo=3 and not allowed when tipo=1.

The API checks the structure and the check digit of each key. Each key must have the same CNPJ base (the first eight characters of the CNPJ) as the issuer of the CT-e. Duplicate keys are not accepted.

JSON fragment of an advance payment with tipo 3. The 44-digit key is an example: replace it with the real key of the advance payment document, with the same CNPJ base as the issuer. The fragment is not a complete issuing request.

{
  "pagamento_antecipado": {
    "tipo": 3,
    "chaves": [
      "13260706074104000127570010000001231210730009"
    ]
  }
}

Issuing a CT-e
Taxes

Send the tax details in the impostos object.

Parameter Standard Simplified Type Size Description
cfop
Required
Required
string 4-5 CFOP, the 4-digit code that says what kind of transaction this is. The first digit gives the place: 5 = inside the state, 6 = to another state, 7 = abroad
classificacao_tributaria
Required
Required
string 2 CST of ICMS (tax status code): tells the tax authority how ICMS applies to this service
00 - Normal ICMS taxation
20 - ICMS with a reduced tax base
40 - ICMS exempt
41 - ICMS not taxed
51 - ICMS deferred
60 - ICMS charged earlier by tax substitution (ICMS-ST)
90 - ICMS other
SN - Simples Nacional (small business regime)
beneficio_fiscal
Optional
Optional
string 1-10 Tax benefit code of the state (UF)
icms
Optional; the automatic rate is applied
Optional; the automatic rate is applied
object --- Values and rates of ICMS, the state tax on transport between cities or states. It is the tax base × the rate; each state sets its own rates

Issuing a CT-e > Taxes
ICMS

Parameter Standard Simplified Type Size Description
aliquota
Optional
Optional
decimal 3v2 ICMS rate
percentual_reducao
Optional
Optional
decimal 3v2 Reduction percentage of the tax base
bc_st_retido
Optional
Optional
decimal 13v2 Tax base of the ICMS-ST withheld. Under tax substitution, one company in the chain collects in advance the ICMS of the next steps
aliquota_st_retido
Optional
Optional
decimal 3v2 Rate of the ICMS-ST (ICMS withheld by tax substitution)
credito_outorgado
Optional
Optional
decimal 13v2 Amount of the granted tax credit (crédito outorgado)
devido_origem
Optional
Optional
boolean 1 Flag for tax owed to the origin state
partilha
Optional
Optional
object - - - Group for interstate services to a final consumer that is not an ICMS taxpayer
ICMS Sharing
Parameter Standard Simplified Type Size Description
base_calculo
Optional; when missing, the calculated ICMS base is used
Optional; when missing, the calculated ICMS base is used
decimal 13v2 Tax base for the destination state
aliquota_fcp_uf_destino
Required when partilha is sent
Required when partilha is sent
decimal 3v2 FCP (poverty fund surcharge, a small extra ICMS percentage some states charge) rate in the destination state
aliquota_icms_uf_destino
Required when partilha is sent
Required when partilha is sent
decimal 3v2 ICMS rate in the destination state
aliquota_icms_uf_origem
Required when partilha is sent
Required when partilha is sent
decimal 3v2 ICMS rate in the origin state
aliquota_icms_interestadual
Required when partilha is sent
Required when partilha is sent
decimal 3v2 Interstate ICMS rate
valor_icms_uf_remetente
Required
Required
decimal 3v2 Interstate ICMS rate

Issuing a CT-e
Road

The road mode covers cargo carried by truck. Its data goes in the rodoviario object. The table below lists the parameters you can send.

Parameter Standard Simplified Type Size Description
rntrc
Required
Required
string 8 RNTRC, the carrier's number in the national register of road cargo carriers kept by ANTT (the national land transport agency)
ordens_coleta
Optional
Optional
array 0-10 Pickup orders

Issuing a CT-e > Road
Pickup orders

A pickup order is the order to collect the cargo. Send pickup orders in the ordens_coleta array, inside rodoviario. You can send up to 10 orders.

Parameter Standard Simplified Type Size Description
numero
Required
Required
string 1-6 Pickup order number
data_emissao
Required
Required
string --- Issue date, as a date or a date and time
Y-m-d or Y-m-d H:i:s
serie
Optional
Optional
string 1-3 Pickup order series
emissor
Required
Required
object - - - Issuer of the pickup order
Issuer
Parameter Standard Simplified Type Size Description
cnpj
Required
Required
string 14 CNPJ (company ID)
00.000.000/0000-00
ie
Required
Required
string 1-14 State registration (IE) number
uf
Required
Required
string 2 State (UF) of the issuer's address
telefone
Optional
Optional
string 6-14 Issuer's phone number

JSON fragment for the road mode. Replace the RNTRC, the CNPJ and the issuer data with real data. The fragment is not a complete issuing request.

{
  "rodoviario": {
    "rntrc": "00000000",
    "ordens_coleta": [
      {
        "numero": "10",
        "data_emissao": "2023-10-20",
        "emissor": {
          "cnpj": "00.000.000/0000-00",
          "ie": "00000000000000",
          "uf": "PR"
        }
      }
    ]
  }
}

Issuing a CT-e
Air

The air mode covers cargo carried by airplane. Its data goes in the aereo object, required when modalidade is 2. In that case, previsao_entrega, tarifa, tarifa.classe and tarifa.valor are required. The table below lists the parameters.

Parameter Standard Simplified Type Size Description
previsao_entrega
Required
Required
string 10 Expected delivery date Y-m-d
numero_minuta
Optional
Optional
string 9 Minuta number (the air cargo dispatch form)
numero_oca
Optional
Optional
string 11 Operational number of the air waybill (OCA)
tarifa
Required
Required
object - - - Fare information
natureza_carga
Optional
Optional
object - - - Cargo nature
produtos_perigosos
Optional
Optional
array 0-n Information on products classified as dangerous goods
Fare
Parameter Standard Simplified Type Size Description
classe
Required
Required
string 1 Fare class
M - Minimum fare
G - General fare
E - Specific fare
valor
Required
Required
decimal 13v2 Fare amount
codigo
Optional
Optional
string 1-4 Fare code
Cargo Nature
Parameter Standard Simplified Type Size Description
dimensoes
Optional
Optional
string 5-14 Dimensions Format: 1234X1234X1234 (cm)
informacoes_manuseio
Optional
Optional
array(string) 0-n Handling information 1 - shipper's certificate for shipping a live animal
2 - dangerous goods as per the attached Shipper's Declaration
3 - cargo aircraft only
4 - dangerous goods
5 - dangerous goods in excepted quantities
6 - dry ice for cooling
7 - not restricted
8 - dangerous goods in consolidated cargo
9 - government authority approval attached
10 – lithium ion batteries in compliance with Section II of PI965 – CAO 11 - lithium ion batteries in compliance with Section II of PI966
12 - lithium ion batteries in compliance with Section II of PI967
13 – lithium metal batteries in compliance with Section II of PI968 — CAO
14 - lithium metal batteries in compliance with Section II of PI969
15 - lithium metal batteries in compliance with Section II of PI970
99 - other
Dangerous Goods
Parameter Standard Simplified Type Size Description
numero_onu
Required
Required
string 4 UN number of the dangerous good
descricao_volumes
Required
Required
string 1-20 Total number of packages that contain dangerous goods, sent as text
quantidade_total
Required
Required
decimal 11v4 Quantity of the dangerous item
unidade_medida
Required for each dangerous good sent
Required for each dangerous good sent
string 1 Unit of measure of the item
1 - KG
2 - KG G (gross)
3 - Liters
4 - TI (transport index)
5 - Unit

Sample fragment for the air mode, not a complete request. Replace the date and the values with the data of your operation.

{
  "aereo": {
    "previsao_entrega": "2023-11-02",
    "tarifa": {
      "classe": "M",
      "codigo": "AAAA",
      "valor": 1000
    }
  }
}

Issuing a CT-e
Water

The water mode covers cargo carried by ship or barge, on inland waterways or along the coast. Its data goes in the aquaviario object, required when modalidade is 3. In that case, valor_prestacao, adicional_frete, identificacao_navio and irin_navio are required. The table below lists the parameters.

Parameter Standard Simplified Type Size Description
irin_navio
Required
Required
string 1-10 IRIN of the ship (its international radio identification)
identificacao_navio
Required
Required
string 1-60 Ship identification
valor_prestacao
Required
Required
decimal 13v2 Service amount
adicional_frete
Required
Required
decimal 13v2 Additional freight amount
numero_viagem
Optional
Optional
string 1-10 Numeric code of the voyage
direcao
Optional
Optional
string 1 Direction to the destination
N - North
L - East
S - South
O - West
tipo_navegacao
Optional
Optional
string 1 Navigation type
0 - Inland waterways
1 - Coastal shipping (cabotage)
balsas
Optional
Optional
array(string 1-60) 0-3 Barge identification
containers
Optional
Optional
array 0-n Identification of the containers carried

Issuing a CT-e > Water
Container

Send the containers used to carry the cargo in the containers array.

Parameter Standard Simplified Type Size Description
identificacao
Required
Required
string 1-20 Container ID
lacres
Optional
Optional
array
(string 1-20)
0-3 Container seal numbers
documentos
Optional
Optional
array 0-n Documents of the goods carried in the container
Document
Parameter Standard Simplified Type Size Description
chave
Required for an electronic document
Required for an electronic document
string 44 Access key of the document
serie
Required when the access key is not sent
Required when the access key is not sent
string 1-3 Issuing series of the document
numero
Required when the access key is not sent
Required when the access key is not sent
string 1-20 Document number
medida_rateada
Optional
Optional
decimal 2v3 Apportioned unit of measure

Sample fragment for the water mode, not a complete request. Replace the values and IDs with the data of your operation.

{
  "aquaviario": {
    "valor_prestacao": 1000,
    "adicional_frete": 0,
    "identificacao_navio": "AABBBCCC",
    "irin_navio": "0000000000",
    "containers": [
      {
        "identificacao": "AAAAA"
      }
    ]
  }
}

Issuing a CT-e
Rail

The rail mode covers cargo carried by train. Its data goes in the ferroviario object, required when modalidade is 4. When you send the object, tipo_trafego, fluxo, responsavel_faturamento, responsavel_emissao and valor_frete are required. The table below lists the parameters.

Parameter Standard Simplified Type Size Description
tipo_trafego
Required
Required
string 1 Type of traffic
0 - Own
1 - Mutual (more than one railway)
2 - Road-rail
3 - Road
fluxo
Required
Required
string 1-10 Rail flow
An ID number of the contract signed with the customer
responsavel_faturamento
Required
Required
string 1 Railway responsible for billing
1 - Origin railway
2 - Destination railway
responsavel_emissao
Required
Required
string 1 Railway responsible for issuing
1 - Origin railway
2 - Destination railway
valor_frete
Required
Required
decimal 13v2 Freight amount
cte_origem
Optional
Optional
string 44 Access key of the CT-e issued by the origin railway
ferrovias
Optional
Optional
array 0-n Identification of the railways the cargo passes through
Railway
Parameter Standard Simplified Type Size Description
cnpj
Required
Required
string 14 CNPJ (company ID)
00.000.000/0000-00
nome_razao
Required
Required
string 2-60 Name or company name
ie
Optional
Optional
string up to 14 State registration (IE) number
endereco
Required
Required
string 2-255 Street of the railway's address
cidade
Required
Required
string 2-60 City of the railway
uf
Optional
Optional
string 2 State (UF) of the railway's address
numero
Optional
Optional
string 1-60 Street number of the railway's address
complemento
Optional
Optional
string 1-60 Address complement of the railway (suite, unit)
bairro
Optional
Optional
string 2-60 District of the railway's address
cep
Optional
Optional
string 8-9 Postal code (CEP) of the railway's address

Sample fragment for the rail mode, not a complete request. Replace the values, the CNPJ and the registration data with the real data of your operation.

{
  "ferroviario": {
    "tipo_trafego": "1",
    "fluxo": "000000",
    "responsavel_faturamento": "1",
    "responsavel_emissao": "1",
    "valor_frete": 1000,
    "ferrovias": [
      {
        "cnpj": "00.000.000/0000-00",
        "nome_razao": "Ferrovia Passagem",
        "endereco": "Rua Principal",
        "cidade": "Curitiba",
        "uf": "PR"
      }
    ]
  }
}

Issuing a CT-e
Pipeline

The pipeline mode covers products moved through pipelines, such as fuel or gas. Its data goes in the dutoviario object, required when modalidade is 5. When you send the object, the start and end dates are required. The tariff amount is optional. The table below lists the parameters.

Parameter Standard Simplified Type Size Description
data_inicio_prestacao
Required
Required
string 10-20 Start date of the transport service
Y-m-d or Y-m-d H:i:s
data_termino_prestacao
Required
Required
string 10-20 End date of the transport service
Y-m-d or Y-m-d H:i:s
valor_tarifa
Optional
Optional
decimal 9v6 Tariff amount

Sample fragment for the pipeline mode, not a complete request. Replace the dates and the amount with the data of your operation.

{
  "dutoviario": {
    "data_inicio_prestacao": "2023-10-30",
    "data_termino_prestacao": "2023-11-20",
    "valor_tarifa": 100.5121
  }
}

Issuing a CT-e
Multimodal

The multimodal mode covers one transport contract that uses two or more modes, for example truck and ship, under one multimodal transport operator. Its data goes in the multimodal object, required when modalidade is 6. When you send the object, cotm and negociavel are required. seguro is an optional object. The table below lists the parameters.

Parameter Standard Type Size Description
cotm
Required
string 1-20 Certificate number of the multimodal transport operator (COTM)
negociavel
Required
boolean 1 Negotiable indicator: whether the document is negotiable
seguro
Optional
object - - - Insurance information
Insurance
Parameter Standard Type Size Description
cnpj_seguradora
Required
string 14 CNPJ (company ID)
00.000.000/0000-00
nome_razao_seguradora
Required
string 1-30 Name or company name
numero_apolice
Required
string 1-20 Policy number
numero_averbacao
Required
string 1-20 Shipment registration number under the policy (averbação)

Sample fragment for the multimodal mode, not a complete issuing request. Replace the CNPJ and the insurance contract data with valid data of your operation.

{
    "multimodal": {
      "cotm": "0000000000",
      "negociavel": false,
      "seguro": {
          "cnpj_seguradora": "00.000.000/0000-00",
          "nome_razao_seguradora": "Seguradora",
          "numero_apolice": "000000000",
          "numero_averbacao": "00000000"
      }
    }
}

Issuing a CT-e OS

The CT-e OS (Conhecimento de Transporte Eletrônico para Outros Serviços) is the bill for passenger, valuables and excess baggage transport. It is issued in the road mode. It uses the same endpoint as the CT-e, with modelo = cte_os, servico.tipo 6, 7 or 8, and the tomador object always filled in. That object holds the payer (the tomador, in Brazilian law): the individual or company that receives the transport service. Not sure which document you need? See CT-e or CT-e OS?.

To issue a CT-e OS, send a POST request to /2/cte/emissao.

  curl -X POST \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "ambiente": 1,
    "modelo": "cte_os",
    "modalidade": 1,
    ...
  }' \
  https://api.webmania.com.br/2/cte/emissao

Illustrative structure of a CT-e OS, not a request validated for issuing. Replace the IDs, the date, the registration data, the taxes and the transaction details with valid values. Also check the rules of the road mode.

{
    "ambiente": 2,
    "finalidade": "0",
    "natureza_operacao": "Prestação de serviço de transporte - interestadual",
    "modalidade": "1",
    "modelo": "cte_os",
    "data_emissao": "2023-10-27 09:21:22",
    "local_inicio_prestacao": {
        "cidade": "Curitiba",
        "uf": "PR"
    },
    "local_termino_prestacao": {
        "cidade": "São Paulo",
        "uf": "SP"
    },
    "contribuicao_tomador": "9",
    "indicador_tomador": "0",
    "tomador": {
        "nome_razao": "Tomador do Serviço",
        "cpf": "00000000000",
        "telefone": "47999999999",
        "endereco": "Rua Exemplo",
        "numero": "415",
        "bairro": "Bacacheri",
        "cep": "80035040",
        "cidade": "Curitiba",
        "uf": "PR"
    },
    "impostos": {
        "cfop": "0000",
        "classificacao_tributaria": "00"
    },
    "remetente": {
        "nome_razao": "Remetente Carga",
        "cnpj": "00000000000000",
        "nome_fantasia": "Rementente",
        "telefone": "11999999999",
        "endereco": "Rua Exemplo",
        "numero": "321",
        "complemento": "Edifício",
        "bairro": "Jardim",
        "cep": "82400000",
        "cidade": "Curitiba",
        "uf": "PR"
    },
    "destinatario": {
        "nome_razao": "Destinatario Carga",
        "cnpj": "00000000000000",
        "telefone": "11999999999",
        "endereco": "Rua Exemplo",
        "numero": "123",
        "bairro": "Jardim",
        "cidade": "São Paulo",
        "cep": "01153000",
        "uf": "SP"
    },
    "servico": {
        "tipo": 6,
        "descricao": "Transporte de pessoas",
        "valor_total": 100,
        "valor_recebido": 100
    },
    "carga": {
        "valor_total": 100,
        "produto_predominante": "Chocolate",
        "quantidades": [
            {
                "unidade_medida": "1",
                "tipo_medida": "LITROS",
                "quantidade": 2
            }
        ]
    },
    "documentos_fiscais": [
        {
            "tipo": "1",
            "chave": "00000000000000000000000000000000000000000000"
        }
    ],
    "rodoviario": {
        "rntrc": "12345678"
    }
}

Example of an HTTP 200 response, with the fields uuid, chave, serie, cte, status, motivo, modelo, epec, xml, dacte and log, described in Notification fields. log is an object or an array, not a JSON string. Check the status in the response body: HTTP 200 does not mean that SEFAZ authorized the document.

{
  "uuid": "00000000-0000-0000-0000-000000000000", // Unique ID
  "chave": "00000000000000000000000000000000000000000000", // Access key at SEFAZ
  "serie": 1, // CT-e OS series
  "cte": 123, // CT-e OS number
  "status": "aprovado", // aprovado, reprovado, cancelado, denegado, processando or contingencia
  "motivo": "Autorizado o uso do CT-e", // Reason for the status
  "modelo": "cte_os",
  "epec": false, // Whether the document was issued in EPEC
  "xml": "https://api.webmania.com.br/xmlcte/[chave]",
  "dacte": "https://api.webmania.com.br/dacte/[chave]",
  "log": {} // Example object; it can be an empty array
}

The final result is sent by POST to the url_notificacao. See Notifications.

Issuing a CT-e OS
General information

The CT-e OS documents the transport of passengers, valuables or baggage. The subsections below explain how to issue a CT-e OS in road mode.

Fill in the fields according to the purpose of your document. Some parameters have more details: click the parameter name to see them. The table below lists the fields needed to issue a CT-e OS.

Parameter Required Type Size Description
ambiente
Required
integer 1 SEFAZ environment
1 - Production
2 - Sandbox (test environment)
url_notificacao
Optional
string - - - Notification URL for every status update of the CT-e
modelo
Required, model cte_os
string - - - Document model. Send cte_os
natureza_operacao
Required
string 1-60 Description of the nature of the transaction
modalidade
Required
integer 1 Transport mode of the document 1 - Road
2 - Air
3 - Water
4 - Rail

Currently, the API issues the CT-e OS only in mode 1 - Road. The other modes are rejected by the validation.
finalidade
Required, no default value
string 1 Type of CT-e
0 - Normal
1 - Value complement
3 - Replacement
data_emissaoNEW
Optional
string or null - - - Issue date and time of the document. Accepts null.
Recommended format: Y-m-d H:i:s.

When missing or null, the processing date and time is used.

The validation accepts dates up to 168 hours in the past, minus a 10-minute margin for processing and sending. It accepts up to 5 minutes in the future, to allow for clock differences.
contribuicao_tomador
Required
integer 1 Taxpayer type of the payer in the transport service
1 - ICMS taxpayer
2 - Taxpayer exempt from state registration (IE)
9 - Not an ICMS taxpayer
indicador_tomador
Required
integer 1 Indicator validated by the API: 0, 1, 2, 3 or 4. In the CT-e OS, the payer data is always read from the tomador object, whatever this indicator says.
servico
Required
object - - - Details of the service provided
carga
Required
object - - - Details of the cargo being transported
documentos_fiscais
Required
array - - - Identification of the transported documents
local_inicio_prestacao
Required
object - - - Start location of the service
local_termino_prestacao
Required
object - - - End location of the service
percurso
Optional
array 1-25 Codes of the states (UF) the vehicle passes through, in order from origin to destination, without repeating the start and end states. SEFAZ requires it when the start state and the end state do not share a border (rejection 753 – Percurso inválido, "invalid route").
tomador
Required
object - - - Payer of the service
rodoviario
Optional. The TAF or state transport registration (Registro Estadual) the trip requires must come from the request or from the company settings
object - - - Road mode details. For mode 1, the TAF (charter authorization, for interstate trips) or the state transport registration (for trips inside one state) comes from the request or from the company settings. See the fields of this mode.
observacoes_contribuinte
Optional
array - - - Free-form additional notes from the taxpayer
observacoes_fisco
Optional
array - - - Free-form additional notes for the tax authority
detalhes_retirada
Optional
string 1-160 Additional details about the cargo pickup
caracteristica_transporte
Optional
string 1-15 Additional feature of the transport. Examples: REENTREGA (redelivery), DEVOLUÇÃO (return) and REFATURAMENTO (rebilling)
caracteristica_servico
Optional
string 1-30 Additional feature of the service. Examples: ENTREGA EXPRESSA (express delivery), LOGÍSTICA REVERSA (reverse logistics), CONVENCIONAL (standard) and EMERGENCIAL (emergency)
observacoes_gerais
Optional
string 1-2000 Additional information of the document
informacoes_adicionais_fisco
Optional
string or null 0-2000 Additional information for the tax authority

Issuing a CT-e OS
Service

Send the details of the service provided as an object in the servico parameter.

Parameter Required Type Size Description
valor_total
Required
numeric 13v2 Total value of the service
0.00
valor_recebido
Required
numeric 13v2 Amount received for the service
0.00
tipo
Required
integer 1 Type of service provided. 6 - Passenger transport
7 - Valuables transport
8 - Excess baggage
descricao
Required
string 1-30 Description of the service
componentes
Optional
object --- Components of the service value Send an object where each key is the component name and its value is the amount of that component

Illustrative fragment of the service in a CT-e OS, not a complete issuing request. Numbers use a decimal point and no thousands separator.

{
  "servico": {
      "tipo": 6,
      "descricao": "Transporte de pessoas",
      "valor_total": 12000,
      "valor_recebido": 9.500,
      "componentes": {
          "FRETE PESO": 8000
      }
  }
}

Issuing a CT-e OS
Cargo

Send the details of the transported cargo in the carga object, with the transported quantities and, optionally, the seguro (insurance) object. The API validation also requires valor_total (except in mode 5) and produto_predominante, although the CT-e OS XML uses the service description and the sum of the quantities.

Parameter Required Type Size Description
quantidades
Required
array 1-n Quantities of the transported cargo
seguro
Optional
object - - - Insurance and insurer details

Illustrative fragment of the quantities for a CT-e OS. It is not a complete request and does not replace the other cargo fields.

{
  "carga": {
    "quantidades": [
      {
        "quantidade": 20
      }
    ]
  }
}

Issuing a CT-e OS > Cargo
Quantities

Send the quantities of the loaded items in the quantidades array. Each item is an object.

Parameter Standard CT-e OS Simplified Type Size Description
quantidade
Required
Required
Taken from the NF-e when available.
numeric 11v4 Quantity of the cargo item, from 0 to 99999999999.9999. In the CT-e OS, the item quantities are added up to make the total quantity of the service.
unidade_medida
Required
Not used in the CT-e OS
Taken from the NF-e when available.
string 1 Unit of measure of the cargo item.
0 - M3 (cubic meters)
1 - KG
2 - TON
3 - UNIDADE (unit)
4 - LITROS (liters)
5 - MMBTU
tipo_medida
Required
Not used in the CT-e OS
Taken from the NF-e when available.
string 1-20 Type of measure of the cargo item.
Examples: PESO BRUTO (gross weight), PESO DECLARADO (declared weight), LITRAGEM (volume in liters), CAIXAS (boxes), etc.

Issuing a CT-e OS > Cargo
Insurance

Send the insurance and insurer details of the cargo in the seguro object.

Parameter CT-e OS Type Size Description
responsavel
Required when you send carga.seguro
string 1 Party responsible for the insurance
4 - Issuer of the CT-e
5 - Payer of the service
nome_razao_seguradora
Optional
string 1-30 Name or company name of the insurer
numero_apolice
Optional
string 1-20 Insurance policy number

Issuing a CT-e OS
Service locations

Send the start and end locations of the transport service in the local_inicio_prestacao and local_termino_prestacao objects, following the field rules below.

List the states (UF) in between in percurso, in order, without repeating the start and end states. When the start and end states do not share a border, SEFAZ requires the route; without it, the document is rejected with code 753.

Parameter Required Type Size Description
cidade
Required when cod_ibge is not sent or when cod_ibge is 5300108 (DF)
string - - - City name
Send 'EXTERIOR' for transactions abroad.
uf
Required when cod_ibge is not sent
string 2 State code (UF)
Send 'EX' for transactions abroad.
cod_ibge
Required when cidade is not sent
string 7 Official city code (IBGE)
Send 9999999 for transactions abroad.

Illustrative fragment of the service locations and the route for a CT-e OS, not a complete issuing request.

{
  "local_inicio_prestacao": {
    "cidade": "Cascavel",
    "uf": "PR",
    "cod_ibge": "4104808"
  },
  "local_termino_prestacao": {
    "cidade": "Gravataí",
    "uf": "RS",
    "cod_ibge": "4309209"
  },
  "percurso": ["SC"]
}

Issuing a CT-e OS
Payer

The payer of the CT-e OS (the tomador, in Brazilian law) is the individual or company that receives the transport service. Send the payer in the tomador object, following the rules below.

Parameter Required Type Size Description
cnpj
Required for a company
string 14 CNPJ (company ID)
cpf
Required for an individual
string 11 CPF number (individual taxpayer ID)
nome_razao
Required
string 2-60 Name or company name
nome_fantasia
Optional
string 2-60 Trade name of the company
ie
Required for a payer with a CNPJ and contribuicao_tomador=1
string 0-14 State registration number (IE)
email
Optional
string - - - Email address
telefone
Optional
string 6-14 Phone number
endereco
Required
string 2-255 Street of the address
numero
Required
string 1-60 Street number of the address
complemento
Optional
string 1-60 Address complement (suite, floor)
bairro
Required
string 2-60 District (neighborhood) of the address
cep
Required for a Brazilian address
string 8-9 Postal code (CEP) of the address
cidade
Required for a Brazilian payer. It can be filled in from the CEP lookup when available
string 2-255 City name
uf
Required for a Brazilian payer. It can be filled in from the CEP lookup when available
string 2 State code (UF)
codigo_pais
Optional
string 1-4 Country code from the Central Bank (BACEN) list Example: Brazil = 1058

Illustrative fragment of the payer of a CT-e OS, not a complete issuing request. Replace the CPF and the registration data with valid information.

{
  "tomador": {
    "nome_razao": "Tomador do Serviço",
    "cpf": "00000000000",
    "telefone": "47999999999",
    "endereco": "Rua Naftali Reiss",
    "numero": "415",
    "complemento": "tal",
    "bairro": "Bacacheri",
    "cep": "80035040",
    "cidade": "Curitiba",
    "uf": "PR"
  }
}

Issuing a CT-e OS
Tax documents

Send the tax documents in the documentos_fiscais array. Each element of the array is one tax document, as an object.

Parameter Required Type Size Description
chave
Required for a BP-e
string 44 Access key of the BP-e (electronic passenger ticket)
data_emissao
Required when there is no access key
string 10-20 Issue date in the format
Y-m-d
numero
Required when there is no access key
string 1-20 Document number
serie
Optional
string 1-3 Series of the document
subserie
Optional
string 1-3 Sub-series of the document
valor_total
Optional
numeric 13v2 Total value of the document

Illustrative fragment of tax documents, not a complete issuing request. The keys made of zeros are placeholders: replace them with valid 44-character access keys. This fragment does not prove tax authorization.

{
  "documentos_fiscais": [
    {
      "chave": "00000000000000000000000000000000000000000000"
    },
    {
      "numero": "12345",
      "chave": "00000000000000000000000000000000000000000000"
    }
  ]
}

Issuing a CT-e OS
Billing

Send the billing details in the cobranca object.

Parameter Required Type Size Description
fatura
Optional
object --- Billing invoice (fatura)
duplicatas
Optional
array 1-n Billing installments (duplicatas)
Invoice (fatura)
Parameter Required Type Size Description
numero
Optional
string 1-60 Invoice number
valor_original
Optional
numeric 13v2 Original amount of the invoice
valor_desconto
Optional
numeric 13v2 Discount amount of the invoice
valor_liquido
Optional
numeric 13v2 Net amount of the invoice
Installment (duplicata)
Parameter Required Type Size Description
numero
Optional
string 1-60 Installment number
data_vencimento
Optional
string --- Valid due date. Recommended format: Y-m-d
valor
Required in each installment sent
numeric 13v2 Installment amount

Issuing a CT-e OS
Taxes

Send the tax details in the impostos object.

Parameter Required Type Size Description
cfop
Required
string 4-5 CFOP, the transaction code (Código Fiscal de Operações e de Prestações)
classificacao_tributaria
Required
string 2 Tax status code (CST)
00 - Standard ICMS taxation
20 - ICMS with a reduced tax base
40 - ICMS exempt
41 - ICMS not taxed
51 - ICMS deferred
60 - ICMS charged earlier by tax substitution
90 - ICMS, other
SN - Simples Nacional (small business regime)
beneficio_fiscal
Optional
string 1-10 Tax benefit code in the state (UF)
icms
Optional. The automatic rate is applied
object --- ICMS amounts and rates
pis
Optional
numeric 13v2 PIS amount
cofins
Optional
numeric 13v2 COFINS amount
ir
Optional
numeric 13v2 IR amount (income tax)
inss
Optional
numeric 13v2 INSS amount (social security)
csll
Optional
numeric 13v2 CSLL amount (social contribution on net profit)

Issuing a CT-e OS > Taxes
ICMS

Parameter Required Type Size Description
aliquota
Optional
numeric 3v2 ICMS rate
percentual_reducao
Optional
numeric 3v2 Reduction percentage of the tax base
bc_st_retido
Optional
numeric 13v2 Tax base with tax substitution (ICMS-ST withheld)
aliquota_st_retido
Optional
numeric 3v2 Rate with tax substitution (ICMS-ST withheld)
credito_outorgado
Optional
numeric 13v2 Granted tax credit amount (crédito outorgado)
devido_origem
Optional
boolean 1 Indicates that the tax is due in the origin state
partilha
Optional
object - - - Group to send for interstate services to a final consumer that is not an ICMS taxpayer
ICMS Sharing
Parameter Required Type Size Description
base_calculo
Optional. When omitted, the ICMS tax base is used
numeric 13v2 Tax base for the destination state
aliquota_fcp_uf_destino
Required when partilha is sent
numeric 3v2 FCP rate (poverty fund surcharge) in the destination state
aliquota_icms_uf_destino
Required when partilha is sent
numeric 3v2 ICMS rate in the destination state
aliquota_icms_uf_origem
Required when partilha is sent
numeric 3v2 ICMS rate in the origin state
aliquota_icms_interestadual
Required when partilha is sent
numeric 3v2 Interstate ICMS rate
valor_icms_uf_remetente
Required
numeric 3v2 Interstate ICMS rate

Issuing a CT-e OS
Road

Send the road mode details in the rodoviario object. The TAF (charter authorization) is required for an interstate trip, and the state transport registration for a trip inside one state. Send the matching field in the object or keep it in the company settings. The value sent in the object takes priority. The table below lists the parameters you can send.

Parameter Required Type Size Description
tipo_fretamento
Required for passenger transport (servico.tipo = 6).
string 1 Charter type
1 - Occasional
2 - Continuous
data_viagem
Required for an occasional charter (tipo_fretamento = 1).
string --- Valid trip date. Recommended formats: Y-m-d or Y-m-d H:i:s
taf_cte_os
Required for an interstate trip when it is not set in the company settings
string 12 TAF (Termo de Autorização de Fretamento, the charter authorization) for the road CT-e OS
Digits only
registro_estadual_cte_os
Required for a trip inside one state when it is not set in the company settings
string 25 State transport registration number (Registro Estadual) for the road CT-e OS
Digits only
veiculo
Optional
object - - - Transport vehicle

Issuing a CT-e OS > Road
Vehicle

Send the transport vehicle of the CT-e OS in the rodoviario.veiculo object.

Parameter Required Type Size Description
placa
Required when veiculo is sent
string 7 License plate of the vehicle
renavam
Optional
string 9-11 RENAVAM number (national vehicle registry)
uf_licenciamento
Optional
string 2 State where the vehicle is licensed
proprietario
Required when the vehicle does not belong to the company issuing the CT-e.
object - - - Owner of the vehicle
Owner
Parameter Required Type Size Description
nome_razao
Required
string 2-60 Name or company name of the owner
cnpj
Required for a company
string 14 CNPJ (company ID)
00.000.000/0000-00
cpf
Required for an individual
string 11 CPF number (individual taxpayer ID)
000.000.000-00
ie
Required when proprietario is sent
string 1-14 State registration number (IE)
uf
Required when proprietario is sent
string 2 State of the owner's address
taf
Required when proprietario is sent
string 12 Charter authorization (Termo de Autorização de Fretamento)
registro_estadual
Required
string 2-25 State transport registration number (Registro Estadual) of the owner
tipo
Required when proprietario is sent
string 1 Type of owner or holder
0 - TAC Agregado (self-employed driver under contract)
1 - TAC Independente (independent self-employed driver)
2 - Other

Illustrative fragment of the road mode, not a complete issuing request. Replace the trip date and the registrations with real data of the transaction.

{
  "rodoviario": {
    "tipo_fretamento": "1",
    "data_viagem": "2023-12-10",
    "taf_cte_os": "123456789012",
    "registro_estadual_cte_os": "1234567890123456789012345",
    "veiculo": {
      "placa": "ABC0000"
    }
  }
}

Issuing a CT-e OS
Taxpayer notes

Send the taxpayer notes of the CT-e OS in the observacoes_contribuinte array, with up to 10 objects. Each object must have the string fields identificacao and descricao, following the rules below.

Parameter Required Type Size Description
identificacao
Required in each note sent
string 1-20 Field name of the taxpayer note
descricao
Required in each note sent
string 1-160 Text of the taxpayer note for this field

Illustrative fragment of the taxpayer notes in a CT-e OS, not a complete issuing request. The texts and values must reflect the real transaction:

{
  "observacoes_contribuinte": [
    {
      "identificacao": "LEI DA TRANSPARENCIA",
      "descricao": "O valor aproximado de tributos incidentes sobre o preço deste serviço é de R$ 152,00"
    },
    {
      "identificacao": "ContatoEntrega",
      "descricao": "João Pedro da Silva"
    }
  ]
}

Issuing a CT-e OS
Notes for the tax authority

Send the notes for the tax authority in the observacoes_fisco array, with at most 10 objects. Each object must have the text fields identificacao and descricao, both required when the note is sent.

Parameter Standard Type Size Description
identificacao
string 1-20 Field name for the note to the tax authority. Required in each object sent.
descricao
string 1-60 Text of the note to the tax authority for this field. Required in each object sent.

Illustrative fragment of a CT-e OS request. Replace the texts with the data of the transaction and add the other required issuing fields.

{
  "observacoes_fisco": [
    {
      "identificacao": "RegimeEspecial",
      "descricao": "123456"
    }
  ]
}

Tax reform

Preliminary documentation. This section may change until SEFAZ, the state tax authority, fully rolls out the tax reform.

From 2026, the new taxes of the Brazilian tax reform start to roll out gradually. This section shows the timeline. The subsections show how to send each group when you issue a CT-e or a CT-e OS.

What changes with the tax reform?

Complementary Law 214/2025 (Lei Complementar 214/2025) created three new taxes. They will gradually replace the current taxes:

TaxWhat it is
IBSState and city goods and services tax (Imposto sobre Bens e Serviços), a value-added tax shared by states and cities. It replaces ICMS and ISS gradually.
CBSFederal goods and services tax (Contribuição Social sobre Bens e Serviços), the new federal value-added tax. It replaces PIS and COFINS.
ISSelective tax (Imposto Seletivo), on goods harmful to health or the environment, such as tobacco and alcoholic drinks. It starts in 2027.

When does it start?

Environment Available from Required from
Sandbox (test environment) July 7, 2025 To be defined
Production October 20, 2025 January 1, 2026
Tip. In 2025, filling in the new taxes is optional when you issue in production. Use this period to test and adapt your system.

How will the transition work?

The move to the new taxes is gradual, until 2033. Simplified timeline of the rates:

Year IBS CBS Current Taxes
2026 0.1% state 0.90% No changes
2027 0.05% state and 0.05% city 8.80% PIS/COFINS end.
The IPI rate drops to 0%, except for products with incentives in the Manaus Free Trade Zone.
2029-2032 Rates set by the Federal Senate Gradual reduction of ICMS and ISS
2033 Transition complete ICMS and ISS end

Tax reform
IBS/CBS

To send IBS/CBS on a CT-e or CT-e OS, add the ibs_cbs object inside impostos. The API processes this group when you send it in the sandbox or, in production, from January 1, 2026. When processing is active, situacao_tributaria and classificacao_tributaria are required. They must match the document model.

The table below lists the parameters you can send inside the object:

Parameter CT-e Type Size Description
situacao_tributaria
string 3 CST (tax status code) of IBS and CBS. Together with the cClassTrib, it says how IBS and CBS apply.
See the list of CST (tax status) and cClassTrib (tax classification) codes, in Portuguese.
classificacao_tributaria
string 6 cClassTrib (reform tax classification code) of IBS and CBS: standard rate, reduced rate, exemption and so on.
See the list of CST (tax status) and cClassTrib (tax classification) codes, in Portuguese.
situacao_tributaria_regular
string 3 CST (tax status code) of IBS and CBS under the regular regime.
See the list of CST (tax status) and cClassTrib (tax classification) codes, in Portuguese.
Required for transactions that must be taxed under the regular regime.
classificacao_tributaria_regular
string 6 cClassTrib (reform tax classification code) of IBS and CBS under the regular regime.
See the list of CST (tax status) and cClassTrib (tax classification) codes, in Portuguese.
Required for transactions that must be taxed under the regular regime.
ibs_estadual
object - State IBS tax details. Include the conditional fields that the CST requires.
ibs_municipal
object - City IBS tax details. Include the conditional fields that the CST requires.
cbs
object - CBS tax details
credito_presumido
array - Presumed credit details for IBS and CBS

Sample fragment of the IBS/CBS group. Choose the codes that fit the transaction and the document model, and include the other required fields of the issuing request. This fragment is not a complete request.

{
  "impostos": {
    "ibs_cbs": {
      "situacao_tributaria": "000",
      "classificacao_tributaria": "000001",
      "ibs_estadual": {},
      "ibs_municipal": {},
      "cbs": {}
    }
  }
}

Tax reform
IBS/CBS — Simples Nacional NEW

In one sentence: on the CT-e and CT-e OS of companies in the Simples Nacional (small business regime: several taxes in one monthly payment), and of companies in the standard regime (outside Simples Nacional) with a pending request to join the Simples Nacional, the document now shows the company's IBS/CBS regime and the IBS/CBS calculated with the Simples Nacional rates.

What appliesSandboxProduction
New fields, regime rules and Simples Nacional calculationSince October 26, 2026Documents with an issue date from December 14, 2026 (Brasília time)
Zero CBS for companies above the revenue sublimit without the regular regimeDocuments with an issue date from January 1, 2027
No new field is required when you issue. The Simples Nacional rates are optional on any date. Without a rate, the API calculates the Simples IBS/CBS with 0.00.

Do I need to do anything?

If your company is…What to do
Simples Nacional, above the sublimit or notSend impostos.ibs_cbs with the CST and the cClassTrib and, if you want, the Simples Nacional rates. If the company chose the regular IBS/CBS regime, select this option in the company settings.
Standard regime, with a pending request to join the Simples NacionalIn the company settings, select the pending option and choose the intended regime. Then send impostos.ibs_cbs as above.
Standard regime, with no pending requestNothing changes.
MEI (individual micro-entrepreneur)Nothing. The API no longer sends IBS/CBS on the CT-e of an MEI.

How it works

The API reads the company's tax regime and its IBS/CBS regime options from the company settings. It then decides on its own how IBS and CBS go into the document. You do not send the regime when you issue. The regular IBS/CBS regime is the choice of a Simples Nacional company to pay IBS and CBS under the general rules. A pending option is the situation of a standard-regime company that asked to join the Simples Nacional and is waiting for the decision.

If your company is…IBS/CBS under the general rules
(state IBS, city IBS and CBS)
IBS/CBS calculated under the Simples Nacional
Simples Nacional, without the regular regimeNoIBS and CBS
Simples Nacional above the sublimit, without the regular regimeYes. In 2026, CBS follows the usual calculation. From January 1, 2027, the API sets the CBS rate to zero, even if you send cbs.aliquota.CBS only
Simples Nacional, above the sublimit or not, with the regular regimeYesNo
Standard regime with a pending option for the Simples Nacional, without the regular regimeYesIBS and CBS
Standard regime with a pending option for the Simples Nacional, above the sublimit, without the regular regimeYesCBS only
Standard regime with a pending option, with the regular regimeYesNo
Standard regime, with no pending requestYesNo
MEINo IBS/CBS on the document

The general IBS/CBS rules follow the other tax reform sections. The choice of the regular regime takes effect from January 1, 2027. The API sends the regime based on the company settings.

Issuing parameters

The API calculates the Simples IBS/CBS only when the document includes impostos.ibs_cbs. In this case, situacao_tributaria and classificacao_tributaria are required, even if you send only the Simples rates. Without impostos.ibs_cbs, the document has no IBS/CBS.

Parameter CT-e/CT-e OS Type Size Description
impostos.ibs_cbs.aliquota_ibs_sn
string 3v4 IBS rate under the Simples Nacional, in %, for the document.
From 0 to 100, with up to four decimal places. E.g.: "1.2345"
Used only when the company calculates IBS under the Simples (see How it works).
impostos.ibs_cbs.aliquota_cbs_sn
string 3v4 CBS rate under the Simples Nacional, in %, for the document.
From 0 to 100, with up to four decimal places. E.g.: "0.9000"

A rate that is omitted, null or blank counts as 0.00. A zero you send is kept. A rate in the wrong format rejects the issuing request with the message [impostos] O campo aliquota_ibs_sn deve estar entre 0 e 100, com até 4 casas decimais. (the field must be between 0 and 100, with up to 4 decimal places), or the same message for aliquota_cbs_sn.

Federal Government purchases in 2027 and 2028. When impostos.ibs_cbs.compra_governamental.ente is 1 (Federal Government) and the document is issued in 2027 or 2028, in São Paulo time, the API adds aliquota_ibs_sn and aliquota_cbs_sn to get the Simples Nacional CBS rate. Each rate that is omitted, null or blank counts as zero. If the document includes Simples IBS, its rate and its amount are set to zero. If the sum is above 100%, the issuing request is rejected. See Government purchases.

Simples Nacional example

Simples Nacional company without the regular regime:

{
  "impostos": {
    "ibs_cbs": {
      "situacao_tributaria": "000",
      "classificacao_tributaria": "000001",
      "aliquota_ibs_sn": "0.1000",
      "aliquota_cbs_sn": "0.9000"
    }
  }
}

Tax reform
State IBS

For the state IBS tax details, add the ibs_estadual object inside impostos.ibs_cbs.

The table below lists the parameters you can send inside the object:

Parameter CT-e Type Size Description
valor_devolvido
string 13v2 Amount of tax refunded
aliquota_diferimento
number or numeric string - Deferral percentage of the state IBS. Required when the CST requires deferral. The API formats it with 4 decimal places.

Example of the State IBS group:

"ibs_estadual": {
  "valor_devolvido": "10.00" // Amount of tax refunded
}

Tax reform
City IBS

For the city IBS tax details, add the ibs_municipal object inside impostos.ibs_cbs.

The table below lists the parameters you can send inside the object:

Parameter CT-e Type Size Description
valor_devolvido
string 13v2 Amount of tax refunded
0.00
aliquota_diferimento
number or numeric string - Deferral percentage of the city IBS. Required when the CST requires deferral. The API formats it with 4 decimal places.

Example of the City IBS group:

"ibs_municipal": {
  "valor_devolvido": "10.00" // Amount of tax refunded
}

Tax reform
CBS

For the CBS details, add the cbs object inside the ibs_cbs field.

The table below lists the parameters you can send inside the object:

Parameter CT-e Type Size Description
valor_devolvido
string 13v2 Amount of tax refunded
0.00
aliquota_diferimento
number or numeric string - Deferral percentage of the CBS. Required when the CST requires deferral. The API formats it with 4 decimal places.
alc_zfm_cbs
object - Zero rate details for the Manaus Free Trade Zone / Free Trade Areas (ZFM/ALC)

Example of the CBS group:

"cbs": {
  "valor_devolvido": "10.00" // Amount of tax refunded
}

To declare zero-rate transactions in the Manaus Free Trade Zone (ZFM) or in Free Trade Areas (ALC), add the alc_zfm_cbs object inside impostos.ibs_cbs.cbs. The aliquota_efetiva_referencia is required in this group. If you do not send valor_efetivo_referencia, the API calculates it: the tax base actually used for IBS/CBS, multiplied by the reference rate and divided by 100. When you send this object, also send inscricao_suframa at the root of the request. This is the registration with SUFRAMA, the Manaus Free Trade Zone authority. The API does not take it automatically from the issuer's settings.

The table below lists the parameters you can send inside the object:

Zero Rate ZFM/ALC
Parameter CT-e Type Size Description
aliquota_efetiva_referencia
number or numeric string 3v4 Effective reference rate, from 0 to 999.9999. Required when you send alc_zfm_cbs. The API formats it with 4 decimal places. Without valor_efetivo_referencia, the API calculates the reference amount from the effective IBS/CBS base.
valor_efetivo_referencia
number or numeric string 13v2 Taxable reference amount, from 0 to 9999999999999.99. If omitted, the API calculates it. If sent, it replaces the calculated amount. It must equal the effective base multiplied by the reference rate and divided by 100. It is still subject to the validations of the transaction.

The API considers the cities of the ZFM (Manaus, Rio Preto da Eva and Itacoatiara) and of the ALCs (Tabatinga; Guajará-Mirim; Boa Vista/Bonfim; Macapá/Santana; Brasileia/Epitaciolândia/Cruzeiro do Sul). On the CT-e, the start and end of the service and the issuer must be in the ZFM or in the same ALC. A payer (tomador) that is a company must also be in the same area. On the CT-e OS, the check covers the issuer and, when it is a company, the payer. It does not require the start and end cities of the service in this combination.

Sample fragment of impostos.ibs_cbs.cbs with a fictitious reference rate. Replace the percentage with the one that applies to the transaction, send inscricao_suframa at the root, and include the other required fields of the issuing request.

{
  "alc_zfm_cbs": {
    "aliquota_efetiva_referencia": "8.8000"
  }
}

Tax reform
Presumed credit

The presumed credit lets you use tax credits in specific situations. To use it, add the credito_presumido array inside the ibs_cbs field.

The table below lists the parameters you can send inside the array:

Parameter CT-e Type Size Description
classificacao
string 1-2 Presumed credit classification code
See the classification table below
aliquota_ibs
string 2v4 Presumed credit percentage for IBS
aliquota_cbs
string 2v4 Presumed credit percentage for CBS
Presumed Credit Classifications
Code Description Applies to
3 Purchase of materials for recycling IBS and CBS
4 Used movable goods for resale IBS and CBS
5 Automotive regime - Art. 310 CBS
6 Automotive regime - Art. 311 CBS
7 Manaus Free Trade Zone - Art. 444 IBS
10 Manaus Free Trade Zone - Art. 450 CBS
11 Free Trade Area - Art. 462 IBS
13 Free Trade Area (Industry) - Art. 467 CBS

Example of the presumed credit:

"credito_presumido": {
  "classificacao": "5", // Classification code
  "aliquota_ibs": "0.10", // IBS percentage
  "aliquota_cbs": "0.05" // CBS percentage
}

Tax reform
Government purchases

Government purchases. This section implements the gCompraGov group. It applies to transactions with government bodies: the Federal Government, states, cities, the Federal District, public agencies (autarquias) and public consortiums.

To report a government purchase, add the compra_governamental object inside impostos.ibs_cbs. This group requires situacao_tributaria equal to 200 and classificacao_tributaria equal to 200050. The fields marked as required apply when you send the group.

Parameter CT-e Type Size Description
ente
integer 1 Type of government body that hires the service. 1 - Federal Government (União)
2 - State
3 - Federal District
4 - City
5 - Public consortium
6 - IBS Management Committee (Comitê Gestor do IBS)
aliquota_reducao
number or numeric string - Rate reduction percentage applied to the government body. The API formats it with 4 decimal places. For example, 50.0000 means a 50% reduction, and 0.5000 means 0.5%.
tipo_operacao
integer 1 Type of transaction with the government body. 1 - Supply with later payment
2 - Receipt of payment for a supply already made; requires exactly one key in referencias_dfe
3 - Supply with payment already made; requires one or more keys in referencias_dfe
4 - Receipt of payment for a later supply
referencias_dfe
array (string 44) 0-99 Access keys of earlier electronic tax documents (DFe) referenced. Accepts both the numeric format (44 digits) and the alphanumeric format of the tax reform (RTC) [0-9]{6}[A-Z0-9]{12}[0-9]{26}. Required when tipo_operacao is 2 or 3; not allowed when it is 1 or 4.

Sample fragment of a government purchase: ente 2 (State), 50% reduction and tipo_operacao 3 (supply with payment already made). Replace the zero key with a real key of the transaction, and include the other required fields of the issuing request.

{
  "impostos": {
    "ibs_cbs": {
      "situacao_tributaria": "200",
      "classificacao_tributaria": "200050",
      "compra_governamental": {
        "ente": 2,
        "aliquota_reducao": "50.0000",
        "tipo_operacao": 3,
        "referencias_dfe": [
          "00000000000000000000000000000000000000000000"
        ]
      }
    }
  }
}

Tax reform
Linked payments — Split Payment

Split Payment. Split Payment records payment transactions linked to the CT-e when you issue it (group pgtoVinc) and through later events (110300, Payment Link, and 110301, Payment Link Cancellation). The fields below apply to both the CT-e and the CT-e OS.

To report payments that are already linked when you issue the CT-e, send the optional pagamentos_vinculados array with 1 to 99 entries. Each entry is one payment transaction linked to the tax document. The fields below are required when you send the array:

Parameter CT-e Type Size Description
n_pag
integer 1-3 Sequence number of the payment in the CT-e (1 to 990). Must be unique in the array.
id_transacao
string 2-35 Unique ID of the payment transaction, created by the payment service provider (PSP) or acquirer. Must be unique in the array.
tp_meio_pagamento
string 2 Payment method code from the official SEFAZ table (RTC). See the full table below.
cnpj_recebedor
string 14 CNPJ (company ID) of the party that receives the payment, in the alphanumeric RTC format ([A-Z0-9]{12}[0-9]{2}), with valid check digits. The first 12 characters can be letters or digits; the last 2 are check digits.
cnpj_base_psp
string 8 Base CNPJ (root) of the PSP, the payment service provider, in the alphanumeric RTC format ([A-Z0-9]{8}).

Official table of payment methods (RTC):

Code Description
01Cash
02Check
03Credit card
04Debit card
05Store credit (crédito loja)
10Food voucher
11Meal voucher
12Gift voucher
13Fuel voucher
14Trade bill (duplicata mercantil)
15Bank payment slip (boleto)
16Bank deposit
17Instant payment (PIX), dynamic
18Bank transfer / Digital wallet
19Loyalty program / Cashback / Virtual credit
20Instant payment (PIX), static
21In-store credit (crédito em loja)
22Electronic payment not reported — system failure
23Instant payment (PIX) — scheduled
24Employee credit
90No payment
91Drawback transactions or special customs regimes
99Other

Example when you issue the CT-e:

"pagamentos_vinculados": [
  {
    "n_pag": 1,
    "id_transacao": "TX-2026-0001",
    "tp_meio_pagamento": "17", // Dynamic PIX
    "cnpj_recebedor": "12ABC34501DE35",
    "cnpj_base_psp": "12ABC345"
  }
]
Linking after issuing. If the payment happens after the CT-e is issued, record the link with the event 110300, Link a Payment, or cancel it with the event 110301, Cancel a Payment Link.

Functions
Download the XML and PDF

The XML and the PDF of each document are at the URLs returned in the response, in the lookup and in the notification. For security, Webmania restricts access to these files.

The tax document is protected with a password. It opens only after you confirm the CPF/CNPJ (tax ID) of the document recipient, or with one of the access methods below: Access credentials, Token, Issuing IP or Webmania® Panel.

Tax documents in your system. When you make the XML and the PDF available in your system, use access restrictions like the ones Webmania uses. Do not allow public access to tax documents that are not protected with a password.

Ways to access the files:

Authentication Access allowed Password required? Description
Access credentials ✅ No Send the company's access credentials in the request HEADER to access every tax document issued by the company.
Authorization: Bearer YOUR_ACCESS_TOKEN
Token ✅ No Send the encrypted token in the URL to open the tax document for 24 hours without a password. Ideal for sharing a link.
?token=[TOKEN]
The token is not available for tax documents without a recipient.
Issuing IP ✅ No When you issue an invoice, the IP address of the computer or server is permanently registered as authorized. That IP can access every tax document issued by the companies it has access to.
IPs authorized automatically
Webmania® Panel ✅ No When you log in to the Webmania® Panel, you can access every tax document issued by the companies of your account. Access lasts while you are logged in to the Webmania® Panel.
Access while you are logged in
No authentication ❌ Yes When the URL is opened publicly, without authentication, the tax documents are protected with a password. To open them, enter the CPF/CNPJ of the document recipient (numbers only, no punctuation).
PDF = password-protected PDF file
XML = password-protected ZIP file

Access without authentication is not available for tax documents without a recipient.

To download the files to your server, use the Access credentials. To give your customer a link without a password, use the Token.

Functions > Download the XML and PDF
Access credentials

With the company's access credentials in the request header, you can download every tax document issued by the company.

To download a file, send a GET request to the URL of the XML or the PDF, with the credentials in the header. Example with the PDF:

curl -X GET \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
https://api.webmania.com.br/dacte/00000000000000000000000000000000000000000000

The response is the file itself, as application/pdf or text/xml.

Functions > Download the XML and PDF
Token

The token opens the XML and the PDF without a password for 24 hours, so you can share the link with your customer safely.

Note. This feature is not available for tax documents without a recipient. For these documents, use the Access credentials.

To share the file, generate the token encrypted with AES-256-CBC and send it in the token parameter of the file URL:

https://api.webmania.com.br/dacte/00000000000000000000000000000000000000000000?token=[TOKEN]

The step-by-step guide to generate the token, with functions in PHP, Python, Java, C# and Ruby, is on the Webmania GitHub (in Portuguese): https://github.com/webmaniabr/DFeToken.

Functions
Look up a CT-e

The lookup returns the current status of a CT-e or CT-e OS of the authenticated company. It works even while the document is processando or contingencia. Use the notifications to follow your documents day to day. Use the lookup to check one document when you need to.

To look up a CT-e, send a GET request to /2/cte/consulta/{identifier}. Replace {identifier} with the uuid (36 characters) or the chave (access key, 44 characters) of the CT-e.

curl -X GET \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
https://api.webmania.com.br/2/cte/consulta/00000000000000000000000000000000000000000000

The response has the same fields as the notification, described in Notification fields:

  • the document number is in cte, not in numero;
  • modelo identifies the document: cte or cte_os;
  • epec tells whether the EPEC event was issued (false when it was not);
  • xml_cancelamento is present only when the status is cancelado;
  • log is structured (object or array), not a JSON string.

Example of an HTTP 200 response:

{
  "uuid": "00000000-0000-0000-0000-000000000000", // Unique ID
  "chave": "00000000000000000000000000000000000000000000", // Access key at SEFAZ
  "status": "aprovado", // aprovado, reprovado, denegado, cancelado, processando or contingencia
  "motivo": "Autorizado o uso do CT-e", // Reason for the status
  "serie": 1, // CT-e series
  "cte": 123, // CT-e number
  "modelo": "cte", // cte or cte_os
  "epec": false, // Whether the EPEC event was issued
  "xml": "https://api.webmania.com.br/xmlcte/[chave]",
  "dacte": "https://api.webmania.com.br/dacte/[chave]",
  "log": {} // Sample content; check the actual SEFAZ response
}

Functions
Cancel a CT-e

The cancellation registers an event at SEFAZ that voids an authorized CT-e or CT-e OS, for example when the transport service does not take place. Only a document with status aprovado can be canceled.

To cancel a CT-e, send a PUT request to /2/cte/cancelar. Send the uuid or the chave of the CT-e and the justificativa (reason) for the cancellation.

Parameter Required Type Size Description
uuid | chave
Required
string 36 | 44 UUID or access key of the CT-e
justificativa
Required
string 15-255 Reason for the cancellation
curl -X PUT \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
   "chave": "00000000000000000000000000000000000000000000",
   "justificativa": "Cancelado por motivos administrativos."
}' \
https://api.webmania.com.br/2/cte/cancelar

The response has status, motivo, xml, xml_cancelamento and log:

SituationResponseWhat to do
Cancellation approved by SEFAZstatus = canceladoStore the xml_cancelamento. Webmania also sends the cancelado notification.
Cancellation not approvedstatus = reprovadoThe CT-e stays authorized. Read the motivo before you try again.

Example of an HTTP 200 response for an approved cancellation:

{
  "status": "cancelado", // cancelado or reprovado
  "motivo": "Evento registrado e vinculado a CT-e", // Text returned by SEFAZ
  "xml": "https://api.webmania.com.br/xmlcte/[chave]",
  "xml_cancelamento": "https://api.webmania.com.br/xmlcte/[chave]/cancelamento",
  "log": {} // Sample content; check the actual SEFAZ response
}

Functions
CT-e delivery confirmation

The delivery confirmation registers the proof of delivery of the cargo at SEFAZ. It includes the image of the proof of delivery and the details of the person who received the cargo. It applies to an authorized CT-e; the CT-e OS does not have this event.

To confirm the delivery, send a POST request to /2/cte/entrega with the uuid or the chave of the CT-e and the parameters below.

Parameter Required Type Size Description
uuid | chave
Required
string 36 | 44 UUID or access key of the CT-e
comprovante
Required
string - - - Image of the proof of delivery, encoded in base64
nome_recebedor
Required when documento_recebedor is sent; if both are omitted, the recipient is used
string 2-60 Name of the person or company that received the delivery
documento_recebedor
Required when nome_recebedor is sent; if both are omitted, the recipient is used
string 2-20 ID document number of the person or company that received the delivery
notas_fiscais
The NF-e linked to the CT-e are used
array (string 44) 0-2000 Invoices of the goods that were delivered
data_hora
Optional; the current date and time are used
string 19 Date and time of the delivery Y-m-d H:i:s
informacoes
Optional
string 1-2000 Additional information about the delivery
longitude
Required when latitude is sent; if both are omitted, 0.000000 is used
string - - - Longitude of the delivery location, in decimal format
latitude
Required when longitude is sent; if both are omitted, 0.000000 is used
string - - - Latitude of the delivery location, in decimal format
curl -X POST \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
    "chave": "00000000000000000000000000000000000000000000",
    "latitude": "2.123456",
    "longitude": "2.123456",
    "comprovante": "data:image/png;base64,...ElFTkSuQmCC"
}' \
https://api.webmania.com.br/2/cte/entrega

Example of an HTTP 200 response for a registered delivery confirmation:

{
    "status": "aprovado",
    "motivo": "Aprovada a Confirmação de Entrega",
    "xml": "https://api.webmania.com.br/xmlcte/00000000000000000000000000000000000000000000",
    "log": {...}
}

Functions
CT-e delivery confirmation cancellation

This event voids a delivery confirmation that was already registered. You identify the confirmation by the sequence number or the protocol number of the event. The CT-e stays authorized.

To cancel a delivery confirmation, send a PUT request to /2/cte/entrega/cancelar. Send the uuid or the chave of the CT-e and the sequencia or the protocolo of the confirmation.

Parameter Required Type Size Description
uuid | chave
Required
string 36 | 44 UUID or access key of the CT-e
sequencia | protocolo
Required
string - - - Sequence number or protocol number of the delivery confirmation event
curl -X PUT \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
    "chave": "00000000000000000000000000000000000000000000",
    "sequencia": "1"
}' \
https://api.webmania.com.br/2/cte/entrega/cancelar

Example of an HTTP 200 response for a registered delivery confirmation cancellation:

{
    "status": "cancelado",
    "motivo": "Cancelamento de comprovante de entrega aprovado",
    "xml": "https://api.webmania.com.br/xmlcte/00000000000000000000000000000000000000000000",
    "log": {...}
}

Functions
Correction letter

The correction letter (CC-e, Carta de Correção Eletrônica) is the event that fixes some information of an authorized CT-e or CT-e OS without canceling it. Each change gives the XML group, the XML field and the new value.

To issue a correction letter, send a POST request to /2/cte/correcao with the uuid or the chave of the CT-e and the alteracoes (changes).

What can the correction letter not fix?

  • Values such as the tax base, the tax rate, price differences and quantities.
  • Registration data that would change the sender or the recipient.
  • The issue date or the departure date.
  • The series and number of the document.
Does the change not fit in a correction letter? Cancel the CT-e and issue a new document with the correct information.
Parameter Required Type Size Description
uuid | chave
Required
string 36 | 44 UUID or access key of the CT-e
alteracoes
Required
array 1-n Changes that the CC-e will carry.
ambiente
Required when the original document was not issued through Webmania
integer 1 Environment in which the CT-e was issued
1 - Production
2 - Sandbox (test environment)
sequencia
Optional — calculated automatically when omitted
integer 1-2 Sequence number of the event, from 1 to 20. When omitted, the API takes the sequence of the last authorized CC-e for that access key and company and adds 1.
Change
Parameter Required Type Size Description
grupo
Required
string 1-20 XML group to change
Examples: rem, enderReme, dest, enderDest
campo
Required
string 1-20 XML field to change
Examples: xFant, fone, xCpl, email
valor
Required
string 1-500 Corrected value
item
Required when the group is a list
integer 1-2 (value from 1 to 99) When the group of the field is a list, send the index of the list item to change
curl -X POST \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
    "chave": "00000000000000000000000000000000000000000000",
    "alteracoes": [
      {
        "grupo": "rem",
        "campo": "xFant",
        "valor": "Nome fantasia"
      }
    ]
}' \
https://api.webmania.com.br/2/cte/correcao

Example of an HTTP 200 response for a registered correction letter. The xml and the dacce (printable summary of the correction letter) are the files of the CC-e itself:

{
    "uuid": "00000000-0000-0000-0000-000000000000",
    "chave": "00000000000000000000000000000000000000000000",
    "evento": 1,
    "status": "aprovado",
    "motivo": "Evento registrado e vinculado a CT-e",
    "xml": "https://api.webmania.com.br/xmlcce/00000000-0000-0000-0000-000000000000",
    "dacce": "https://api.webmania.com.br/dacce/00000000-0000-0000-0000-000000000000",
    "log": {...}
}

Functions
Link a payment to the CT-e NEW

The event 110300 (Split Payment) registers at SEFAZ that a payment transaction is linked to a CT-e that is already authorized. Use it when the payment happens after the CT-e is issued. If the payment already exists when you issue the CT-e, send it in the pagamentos_vinculados group instead.

To link a payment, send a POST request to /2/cte/evento with the uuid or the chave of the CT-e and the pagamento object.

Parameter Required Type Size Description
uuid | chave
Required
string 36 | 44 UUID or access key of the authorized CT-e.
protocolo
Optional — read automatically from the CT-e when omitted
string 15 Authorization protocol number of the CT-e (15 digits).
sequencia
Optional — calculated automatically
integer 1-3 Sequence number of the event (1 to 999). If omitted, it is calculated from the events accepted before.
pagamento
Required
object — Data of the payment transaction. Same structure as one item of pagamentos_vinculados (fields n_pag, id_transacao, tp_meio_pagamento, cnpj_recebedor, cnpj_base_psp).
curl -X POST \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
   "chave": "00000000000000000000000000000000000000000000",
   "protocolo": "135250000000001",
   "pagamento": {
     "n_pag": 1,
     "id_transacao": "TX-2026-0001",
     "tp_meio_pagamento": "17",
     "cnpj_recebedor": "12ABC34501DE35",
     "cnpj_base_psp": "12ABC345"
   }
}' \
https://api.webmania.com.br/2/cte/evento

Example of an HTTP 200 response for a registered payment link. Store the protocolo_evento: it identifies the link when you cancel it.

{
  "status": "sucesso",
  "evento": "110300",
  "codigo": "135", // cStat 135 = event registered
  "motivo": "Evento registrado e vinculado a CT-e",
  "uuid": "00000000-0000-0000-0000-000000000000",
  "chave": "00000000000000000000000000000000000000000000",
  "protocolo_evento": "135250000000010", // Protocol of this event — used later to cancel it
  "protocolo_cte": "135250000000001",
  "data_evento": "2026-05-12T10:00:00-03:00",
  "n_seq_evento": 1,
  "pagamento": {}, // Object with the normalized payment data; sample content
  "log": {} // SEFAZ response object; sample content
}

Functions
Cancel a payment link NEW

The event 110301 (Split Payment) cancels a payment link event (110300) that is already registered. The CT-e stays authorized: only the payment link is undone.

To cancel a payment link, send a PUT request to /2/cte/evento/cancelar. Send the uuid or the chave of the CT-e and the protocolo_vinculacao or the sequencia_vinculacao of the 110300 event.

Parameter Required Type Size Description
uuid | chave
Required
string 36 | 44 UUID or access key of the CT-e.
protocolo
Optional — read from the CT-e
string 15 Authorization protocol number of the CT-e.
protocolo_vinculacao | sequencia_vinculacao
One of the two is required
string | integer 15 | 1-3 Identifies which 110300 event you are canceling. Send protocolo_vinculacao (protocol of the event) OR sequencia_vinculacao (sequence number of the registered event).
sequencia
Optional — calculated automatically
integer 1-3 Sequence number of this cancellation event (1 to 999).
curl -X PUT \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
   "chave": "00000000000000000000000000000000000000000000",
   "protocolo_vinculacao": "135250000000010"
}' \
https://api.webmania.com.br/2/cte/evento/cancelar

Example of an HTTP 200 response for a registered payment link cancellation:

{
  "status": "sucesso",
  "evento": "110301",
  "codigo": "135",
  "motivo": "Evento registrado e vinculado a CT-e",
  "uuid": "00000000-0000-0000-0000-000000000000",
  "chave": "00000000000000000000000000000000000000000000",
  "protocolo_evento": "135250000000011", // Protocol of this cancellation
  "protocolo_cte": "135250000000001",
  "protocolo_vinculacao": "135250000000010", // Echo of the canceled 110300 event
  "data_evento": "2026-05-12T11:30:00-03:00",
  "n_seq_evento": 1,
  "log": {} // SEFAZ response object; sample content
}

Functions
Look up payment events NEW

This lookup returns the history of the payment events (110300 and 110301) of a CT-e in eventos_pagamento, with the count in total_eventos. The CT-e lookup returns the document data without these events.

To look up the payment events, send a GET request to /2/cte/consulta/evento/{identifier}. Replace {identifier} with the uuid or the chave of the CT-e.

Parameter (URL) Required Type Size Description
{identifier}
Required
string 36 | 44 UUID of the CT-e (36 characters, case-insensitive) or access key (44 characters; both the legacy numeric format and the alphanumeric RTC format [0-9]{6}[A-Z0-9]{12}[0-9]{26} are accepted).
curl -X GET \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
https://api.webmania.com.br/2/cte/consulta/evento/00000000000000000000000000000000000000000000

Example of an HTTP 200 response, partial and for illustration only. pagamento is an object when it was sent in the payment link event, and it can be null in the other events. The protocol, code and reason values depend on the response to each event.

{
  "uuid": "00000000-0000-0000-0000-000000000000",
  "chave": "00000000000000000000000000000000000000000000",
  "total_eventos": 2,
  "eventos_pagamento": [
    {
      "evento": "110300",
      "codigo": "135",
      "motivo": "Evento registrado e vinculado a CT-e",
      "protocolo_evento": "135250000000010",
      "data_evento": "2026-05-12T10:00:00-03:00",
      "n_seq_evento": 1,
      "pagamento": {}
    },
    {
      "evento": "110301",
      "codigo": "135",
      "motivo": "Evento registrado e vinculado a CT-e",
      "protocolo_evento": "135250000000011",
      "protocolo_vinculacao": "135250000000010",
      "data_evento": "2026-05-12T11:30:00-03:00",
      "n_seq_evento": 1
    }
  ]
}

Contingency and processing

Webmania® uses the SEFAZ contingency environment automatically. When the state's SEFAZ (state tax authority) is offline, the CT-e is sent, in the same request, to the SVC (SVC-RS or SVC-SP), the SEFAZ backup authorization servers. Your application does not need to do anything.

If neither SEFAZ nor the SVC responds, or if SEFAZ has not given the result yet, Webmania completes the CT-e on its own:

SituationStatusWhat Webmania does
SEFAZ received the CT-e but has not answered yetprocessandoChecks SEFAZ automatically until it gets the result.
SEFAZ and the SVC are unavailablecontingenciaKeeps the CT-e in a queue and sends it again when the connection comes back. Before sending it again, it checks SEFAZ so the same CT-e is not issued twice.
From request to final result: CT-e When it receives the POST /2/cte/emissao, Webmania checks whether SEFAZ (the state tax authority) is available. If it is down, Webmania tries SVC (SVC-RS or SVC-SP), the SEFAZ contingency environment, in the same request. When the authorizer is available, the CT-e is sent in the same request: the response returns aprovado or reprovado, or processando when SEFAZ has not given the result yet; in that case Webmania checks SEFAZ automatically. When no authorizer is available, the CT-e gets the contingencia status: Webmania checks SEFAZ, looks up the CT-e and resends it only if SEFAZ did not receive it. The final result, aprovado or reprovado, arrives through the url_notificacao and the lookup. POST /2/cte/emissao Is SEFAZ available? Sent to the authorizer SEFAZ or SVC, in the same request Immediate response aprovado reprovado Processing processando Webmania checks SEFAZ automatically Is SVC available? SVC-RS or SVC-SP Contingency contingencia Webmania checks SEFAZ and looks up the CT-e before resending Automatic resend only if SEFAZ did not receive the CT-e Final result in your application aprovado or reprovado, in the url_notificacao and the lookup Yes No Yes No
Webmania® step Check Final result Waiting for the result: not a final status Your application
The processando and contingencia statuses are not notified and do not prove authorization. The url_notificacao receives the final result; until then, follow the CT-e through the lookup, without issuing it again.

The final result, aprovado or reprovado, arrives in the notification and is also available in the lookup. Until then, do not issue the same CT-e again.

Contingency
EPEC

EPEC (Evento Prévio de Emissão em Contingência, a prior contingency issuing event) is not used for new documents. When SEFAZ and the SVC are unavailable, the CT-e goes to the contingency queue described above.

The epec field is still in the response and tells whether the document was issued in EPEC. CT-e issued in EPEC in the past are still reconciled automatically.

Infrastructure

The Webmania® API runs on Amazon AWS, the global leader in cloud computing, in the us-east-1 region (US East), with a point of presence in sa-east-1 (São Paulo). The entry point is anycast and highly available: from anywhere in the world, your request goes to the server closest to you.

Anycast entry of the Webmania API around the world World map with the us-east-1 region, in the eastern United States, and the sa-east-1 point of presence, in São Paulo. Requests from many parts of the world enter through the anycast network and go to the nearest server: North America, Europe and Asia to us-east-1, and South America, Africa and Oceania to sa-east-1. us-east-1 US East sa-east-1 São Paulo
Webmania AWS region Your application Anycast route to the nearest server
Illustration. The dots stand for applications in different regions of the world, not for real server addresses.

Global anycast

The same entry IPs serve the whole world. Your request goes to the server closest to you, with no setup on your side.

Two AWS locations

us-east-1 (US East) and sa-east-1 (São Paulo). Keep your infrastructure close to one of them for a shorter response time.

Static IPs

Fixed IPs for inbound and outbound traffic: allow them in your firewall and check the source of the notifications you receive.

Static inbound IPs Requests from your application to the API.
  • 13.248.145.90
  • 76.223.17.240
Static outbound IPs Notifications sent by Webmania® to your URL.
  • 34.196.69.38
  • 44.219.142.86

Request limits

The Webmania® API limits the number of requests per second to keep every integration stable and fast. Each limit is counted per second, separately for each HTTP method and each endpoint.

GET 15per second

Reading: lookups and lists.

POST No limit

Creating: issuing and other submissions. See the specific limits below.

PUT / DELETE 5per second

Changing and removing resources.

Specific limits

Some endpoints have a lower limit, which applies instead of the method's limit:

Request Limit Reason
Issuing in the sandbox (homologação) 1 request per second Test environment for your integration.

Need a higher request volume? Contact us and we will review it.

When the limit is exceeded

A request over the limit is refused with HTTP 429 (Too Many Requests) before it is processed. Nothing is issued, changed or canceled, and you can safely resend the same request.

Header Example Description
Retry-After 1 Seconds to wait before you resend the request. If the response does not include this header, wait 1 second.

Example of an HTTP 429 response. The API sends the message in Portuguese; it means “Request limit reached. Try again in a few seconds.”:

{
  "error": "Limite de requisições atingido. Tente novamente em alguns segundos."
}
Detect the limit by the HTTP status 429, not by the text of the error field: the message can change from one endpoint to another.

How to handle HTTP 429

  1. Pause sendingStop sending new requests to the same endpoint.
  2. Wait the time shownWait the number of seconds in the Retry-After header, or 1 second if the header is missing.
  3. Resend the same requestThe refused request was not processed. Resend it with the same content.
  4. Wait longer if the 429 repeatsFor each new 429 in a row, double the wait time (1, 2, 4, 8 seconds) and set a maximum number of retries.

Best practices

Use the notification URL

Receive the API results at your notification URL instead of polling in a loop. When a result arrives, update your database and download the PDF and the XML.

Send through a queue

Spread your requests through a queue that respects the per-second limit of each method, instead of sending everything at once.

Send valid credentials

The endpoints require valid access credentials in the request header. Sending them incorrectly is treated as misuse of the API.

Allow your server IP

By default, the firewall blocks servers in regions with a high rate of attacks or a poor reputation. If a GET to https://webmania.com.br/api/ or https://api.webmania.com.br returns 403 Forbidden by mistake, contact us and we will allow your IP.

Changelog

  1. v1.3.1 · December 6, 2026 · Documentation · Changed

    The notes of this version are in the Portuguese changelog.

    Changed sections: observacoes-contribuinte-fisco, reforma-tributaria-credito-presumido

  2. v1.3.0 · December 3, 2026 · Documentation · Added

    CT-e and CT-e OS have a new section, IBS/CBS — Simples Nacional: what changes for each type of company, the tax regime set in the company record, the Simples rates and the dates per environment.

    Changed section: reforma-tributaria-simples-nacional

  3. v1.2.3 · November 17, 2026 · Documentation · Changed

    The contingency section now has a flowchart from the request to the final result, with SVC and the contingency queue. EPEC is no longer used for new documents.

    Changed sections: contingencia, epec

  4. v1.2.2 · November 9, 2026 · Documentation · Added

    The documentation is now LLM-ready: copy the page or each section as Markdown, a section index and llms.txt.

Solutions

Fiscal IssuerFiscal MonitorTax ReconciliationArtificial Intelligence

Industries

Logistics & TransportationTechnology & SaaSManufacturingBanks & FintechsServices & SubscriptionsRetail & CommerceMid-sized CompaniesEnterprise

Brazil tax guide

Start hereComplete guideGlossaryNF‑e (electronic invoice)NFS‑e (service invoice)CT‑e (freight bill)Tax reform

Company

AboutCustomersContactBook a demoPolicies and termsTrust Center

Developers

API documentationNF‑e and NFC‑e APINFS‑e APICT‑e and CT‑e OS APIDC‑e APIMDF‑e APINFCom APICIOT / PEF APITax payment slips APIFiscal Monitor APIB2B Management APISDKs on GitHubDocs for LLMs (llms.txt)

Offices

United States

Webmania Inc8 The Green, STE R, Dover, DE 19901

São Paulo, Brazil

Cubo Itaú innovation hubAlameda Vicente Pinzon, 54 - 10th floor, Vila Olímpia, São Paulo - SP

Curitiba, Brazil

HeadquartersAv. Água Verde, 1413 - 5th floor, Água Verde, Curitiba - PR

HOTMILK innovation hubR. Imac. Conceição, 1430, Prado Velho, Curitiba - PR

Talk to our team

Quick access

Customer panelContact
Webmania® Status SEFAZ Monitor City Hall Monitor
Cubo Itaú Startup 2025
webmania®

Copyright © 2009-2026 Webmania®.Webmania® is a registered trademark used exclusively by WMBR SERVICOS EMPRESARIAIS LTDA
CNPJ 11.290.027/0001-82, headquartered at Av. Água Verde, 1413, 5th floor - Curitiba, PR, Brazil - ZIP 80620-200

Region and language

Brazil

  • PTPortuguês (Brasil)
  • ENEnglish
  • ESEspañol
We use cookies to improve your experience on Webmania®. Learn more in our Privacy Policy and Cookie Policy.