TF Fiscal
Documentation

CT-e

Issue CT-e

Accepts a CT-e (model 57, road modal) for asynchronous authorization with SEFAZ.

POST/openapi/v2/empresas/{empresaId}/cte

Requires 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

  • empresaIdstringrequired

    Company (carrier) identifier returned at registration.

    Example: 1934811222334455

Request body

  • idstringrequired

    Integrator document id, used as the cteId path variable in every later call.

    Example: CTE-ORD-1
  • ambienteEmissaostringrequired

    Must match the current environment of the company (10017010).

    Values:ProducaoHomologacao
  • naturezastringrequired

    Nature of the service (natOp), up to 60 characters.

    Example: PRESTACAO DE SERVICO DE TRANSPORTE
  • cfopstringrequired

    4-digit CFOP.

    Example: 5353
  • tipostringrequired

    CT-e type. Complementar requires ctesComplementados; Substituto requires cteSubstituido (10017015).

    Values:NormalComplementarSubstituto
  • tipoServicostringrequired

    Service type. Subcontracting / redispatch / intermediate redispatch require documentosAnteriores.

    Values:NormalSubcontratacaoRedespachoRedespachoIntermediarioVinculadoMultimodal
  • modalstringrequired

    Only Rodoviario in phase one; other modals are rejected (10017018).

  • tomadorstringrequired

    Service taker.

    Values:RemetenteExpedidorRecebedorDestinatarioOutros
  • indicadorIeTomadorstringrequired

    IE indicator of the taker. Contribuinte requires a numeric IE on the taker (10017013).

  • retiraMercadoriabooleanoptional

    Whether the receiver picks the goods up.

  • detalheRetirastringoptional

    Pick-up details, up to 160 characters.

  • municipioEnvioobjectoptional

    Issuing municipality; defaults to the registered municipality of the company.

  • origemobjectrequired

    Origin municipality.

  • destinoobjectrequired

    Destination municipality.

  • remetenteobjectat least one of `remetente` or `destinatario`

    Sender. The party referenced by tomador is mandatory (10017012).

  • destinatarioobjectat least one of `remetente` or `destinatario`

    Receiver (destinatário).

  • expedidorobjectoptional

    Dispatcher (optional).

  • recebedorobjectoptional

    Consignee (recebedor, optional).

  • tomadorOutrosobjectrequired for `tomador=Outros`

    Service taker when it is none of the four parties above.

  • cargaobjectrequired

    Transported cargo.

  • documentosobjectrequired for normal documents

    Transported documents; exactly one of the nfe / nf / outros groups may be sent (10017014). Complementary documents do not require documentos.

  • documentosAnterioresarrayrequired for subcontracting / redispatch / intermediate redispatch

    Previous transport documents, one entry per previous carrier; forbidden for the other service types (10017014).

  • rodoviarioobjectrequired

    Road modal information.

  • valorPrestacaoobjectrequired

    Service amounts.

  • impostosobjectrequired

    Tax parameters; the full rules are in the Tax parameters section below.

  • cobrancaobjectoptional

    Invoice 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.

  • caracteristicasAdicionaisobjectoptional

    Additional characteristics (optional).

  • fluxoobjectoptional

    Transport flow / route (optional).

  • entregaobjectoptional

    Delivery window (optional).

  • observacoesstringoptional

    Free text, up to 2000 characters.

  • observacoesContribuintearrayoptional

    Taxpayer remarks, up to 10.

  • observacoesFiscoarrayoptional

    Remarks to the tax authority, up to 10.

  • autorizadosXmlarrayoptional

    CPF / CNPJ authorized to download the XML (strings), up to 10.

Responses

200

Accepted. No body; authorization happens asynchronously.

No response body

Errors

CodeHTTP
10003000404

empresaId not found.

10017004400

Company cannot issue (not approved / certificate not ready). Wait for approval or link the certificate.

10017005400

Concurrent duplicate request. Retry later.

10017006400

Too many pending tasks for the CNPJ. Retry later.

10017007400

Number series unresolved (none configured, or several enabled without a choice). Configure a model 57 series.

10017010400

ambienteEmissao differs from the environment of the company. Submit for the company environment.

10017011400

Municipality IBGE code not found. Check codigoIbge.

10017012400

Party missing. Add the party referenced by tomador.

10017013400

Taker inconsistent with the IE indicator. Adjust indicadorIeTomador or the IE of the taker.

10017014400

Invalid document references (missing, bad check digit, mixed groups, previous documents inconsistent with the service type).

10017015400

Document type inconsistent with references. Send ctesComplementados / cteSubstituido per tipo.

10017016400

Components do not sum to the total, or aReceber > total. Fix the amounts.

10017017400

Invalid RNTRC.

10017018400

Unsupported modal.

10017019400

Invalid enum or format; mensagem names the field.

10017020400

Tax parameter missing.

10017021400

Tax parameter not allowed (for example ibsCbs, or percentualReducaoBase with CST 00).

10017022400

CST inconsistent with the company regime (Simples only SN; regular regime never SN).

10017023400

icmsUfFim required for an interstate service with a non-taxpayer taker.

10017024400

Rate table row missing and no explicit rate given.

10017025400

Unsupported CST.

10017030400

Same id with a different message. Use a new id or resend the original message.

10017031400

Production: an active / authorized document already exists for the id. Query the original.

10001001400

Request field validation failed (one entry per field); fix per mensagem.

Tax parameters (`impostos`)

FieldDescription
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 / valorExplicit 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.percentualReducaoBaseRequired for CST 20; forbidden for CST 00
icms.valorDesonerado / codigoBeneficioOptional for CST 20 / 40 / 41 / 51 / 60 / 90, defaulting to 0.00 / SEM CBENEF
icms.valorCreditoOptional for CST 60 / 90
icms.stRetidoRequired for CST 60: { "baseCalculo", "aliquota", "valor" }
icms.outraUfOptional for 90-OutraUF: { "baseCalculo", "aliquota", "valor", "percentualReducaoBase" }, falling back to icms.*
icmsUfFimRequired 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
percentualCargaTributariaApproximate tax burden percentage, used for vTotTrib
informacoesFiscoAdditional information for the tax authority (up to 2000)
ibsCbsNot 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.