CT-e
Issue CT-e
Accepts a CT-e (model 57, road modal) for asynchronous authorization with SEFAZ.
/openapi/v2/empresas/{empresaId}/cteRequires the token, timestamp and sign signature headers, see Authentication.
Acceptance returns HTTP 200 with no body. Resubmitting the same id: an identical message fingerprint reuses the original task (idempotent), a different fingerprint returns 10017030, and a previous terminal failure reopens the task with the new message. Results are obtained through the query or the webhook. Enum strings are case-insensitive.
Parameters
Path parameters
empresaIdstringrequiredCompany (carrier) identifier returned at registration.
Example:1934811222334455
Request body
idstringrequiredIntegrator document id, used as the
cteIdpath variable in every later call.Example:CTE-ORD-1ambienteEmissaostringrequiredMust match the current environment of the company (
10017010).Values:ProducaoHomologacaonaturezastringrequiredNature of the service (natOp), up to 60 characters.
Example:PRESTACAO DE SERVICO DE TRANSPORTEcfopstringrequired4-digit CFOP.
Example:5353tipostringrequiredCT-e type.
ComplementarrequiresctesComplementados;SubstitutorequirescteSubstituido(10017015).Values:NormalComplementarSubstitutotipoServicostringrequiredService type. Subcontracting / redispatch / intermediate redispatch require
documentosAnteriores.Values:NormalSubcontratacaoRedespachoRedespachoIntermediarioVinculadoMultimodalmodalstringrequiredOnly
Rodoviarioin phase one; other modals are rejected (10017018).tomadorstringrequiredService taker.
Values:RemetenteExpedidorRecebedorDestinatarioOutrosindicadorIeTomadorstringrequiredIE indicator of the taker.
Contribuinterequires a numeric IE on the taker (10017013).retiraMercadoriabooleanoptionalWhether the receiver picks the goods up.
detalheRetirastringoptionalPick-up details, up to 160 characters.
municipioEnvioobjectoptionalIssuing municipality; defaults to the registered municipality of the company.
origemobjectrequiredOrigin municipality.
destinoobjectrequiredDestination municipality.
remetenteobjectat least one of `remetente` or `destinatario`Sender. The party referenced by
tomadoris mandatory (10017012).destinatarioobjectat least one of `remetente` or `destinatario`Receiver (destinatário).
expedidorobjectoptionalDispatcher (optional).
recebedorobjectoptionalConsignee (recebedor, optional).
tomadorOutrosobjectrequired for `tomador=Outros`Service taker when it is none of the four parties above.
cargaobjectrequiredTransported cargo.
documentosobjectrequired for normal documentsTransported documents; exactly one of the
nfe/nf/outrosgroups may be sent (10017014). Complementary documents do not requiredocumentos.documentosAnterioresarrayrequired for subcontracting / redispatch / intermediate redispatchPrevious transport documents, one entry per previous carrier; forbidden for the other service types (
10017014).rodoviarioobjectrequiredRoad modal information.
valorPrestacaoobjectrequiredService amounts.
impostosobjectrequiredTax parameters; the full rules are in the Tax parameters section below.
cobrancaobjectoptionalInvoice and installments (optional).
cteSubstituidoobjectrequired for `tipo=Substituto`Replaced CT-e.
ctesComplementadosarrayrequired for `tipo=Complementar`Keys of the complemented CT-e (44-digit strings), 1 to 10.
caracteristicasAdicionaisobjectoptionalAdditional characteristics (optional).
fluxoobjectoptionalTransport flow / route (optional).
entregaobjectoptionalDelivery window (optional).
observacoesstringoptionalFree text, up to 2000 characters.
observacoesContribuintearrayoptionalTaxpayer remarks, up to 10.
observacoesFiscoarrayoptionalRemarks to the tax authority, up to 10.
autorizadosXmlarrayoptionalCPF / CNPJ authorized to download the XML (strings), up to 10.
Responses
Accepted. No body; authorization happens asynchronously.
No response body
Errors
| Code | HTTP | |
|---|---|---|
| 10003000 | 404 |
|
| 10017004 | 400 | Company cannot issue (not approved / certificate not ready). Wait for approval or link the certificate. |
| 10017005 | 400 | Concurrent duplicate request. Retry later. |
| 10017006 | 400 | Too many pending tasks for the CNPJ. Retry later. |
| 10017007 | 400 | Number series unresolved (none configured, or several enabled without a choice). Configure a model 57 series. |
| 10017010 | 400 |
|
| 10017011 | 400 | Municipality IBGE code not found. Check |
| 10017012 | 400 | Party missing. Add the party referenced by |
| 10017013 | 400 | Taker inconsistent with the IE indicator. Adjust |
| 10017014 | 400 | Invalid document references (missing, bad check digit, mixed groups, previous documents inconsistent with the service type). |
| 10017015 | 400 | Document type inconsistent with references. Send |
| 10017016 | 400 | Components do not sum to the total, or |
| 10017017 | 400 | Invalid RNTRC. |
| 10017018 | 400 | Unsupported modal. |
| 10017019 | 400 | Invalid enum or format; |
| 10017020 | 400 | Tax parameter missing. |
| 10017021 | 400 | Tax parameter not allowed (for example |
| 10017022 | 400 | CST inconsistent with the company regime (Simples only |
| 10017023 | 400 |
|
| 10017024 | 400 | Rate table row missing and no explicit rate given. |
| 10017025 | 400 | Unsupported CST. |
| 10017030 | 400 | Same |
| 10017031 | 400 | Production: an active / authorized document already exists for the |
| 10001001 | 400 | Request field validation failed (one entry per field); fix per |
Tax parameters (`impostos`)
| Field | Description |
|---|---|
icms.situacaoTributaria (required) | 00 / 20 / 40 / 41 / 51 / 60 / 90 / 90-OutraUF / SN; must match the company regime: Simples (CRT 1/4) only SN, regular regime never SN (10017022) |
icms.baseCalculo / aliquota / valor | Explicit values win; otherwise the base defaults to the service total, the rate comes from the intrastate rate table or the statutory interstate rate (7% or 12%), and the amount is computed. An intrastate service with no table row and no explicit rate returns 10017024 |
icms.percentualReducaoBase | Required for CST 20; forbidden for CST 00 |
icms.valorDesonerado / codigoBeneficio | Optional for CST 20 / 40 / 41 / 51 / 60 / 90, defaulting to 0.00 / SEM CBENEF |
icms.valorCredito | Optional for CST 60 / 90 |
icms.stRetido | Required for CST 60: { "baseCalculo", "aliquota", "valor" } |
icms.outraUf | Optional for 90-OutraUF: { "baseCalculo", "aliquota", "valor", "percentualReducaoBase" }, falling back to icms.* |
icmsUfFim | Required for interstate services when indicadorIeTomador=NaoContribuinte (10017023); forbidden for intrastate. baseCalculo / percentualFcp / aliquotaInterna / aliquotaInterestadual / valorFcp / valorUfFim / valorUfIni are all optional and default to the internal rate and FCP table of the destination state |
percentualCargaTributaria | Approximate tax burden percentage, used for vTotTrib |
informacoesFisco | Additional information for the tax authority (up to 2000) |
ibsCbs | Not available in phase one; rejected when present (10017021) |
SEFAZ rejection
SEFAZ rejections during issuance are not HTTP errors: they surface as query status Negada and the cte.rejected webhook, with motivoStatus / cteMotivoStatus in the form cStat - xMotivo. A terminal task failure (Falha) sends no callback; use the query.
