We use cookies and similar technologies, including Google Analytics and the Meta Pixel, to improve your experience, measure site traffic and understand signup campaigns. By clicking "Accept", you agree to this use.

Learn more about our privacy practices
Português

CT-e: road freight

Issue the road CT-e (model 57, layout 4.00) of a carrier through /v1/cte: synchronous authorization at the SVRS, DACTE and XML, cancellation and correction letter, in test mode (homologação).

The CT-e (Conhecimento de Transporte Eletrônico) is the fiscal document of the freight service. Arquivix Notas issues the normal road CT-e (tpCTe 0, modal 01) of the carrier company registered in the account, with the A1 certificate of that company. Every UF that issues CT-e through the SVRS is authorized by it, synchronously (CTeRecepcaoSincV4): the answer comes in the same call to the SEFAZ.

Routes

MethodRouteWhat it does
GET/v1/cte/readiness?companyId=Is the carrier credentialed for CT-e in this environment? (ready, not_credentialed, registration_disabled, registration_not_found, no_certificate, unknown)
POST/v1/cteIssue. 202 with { id, status }; Idempotency-Key is required.
GET/v1/cteList, newest first (companyId, status, cursor, limit).
GET/v1/cte/:idThe CT-e: status, key, protocol, cStat/xMotivo and the content sent.
PUT/v1/cte/:idSend a rejected CT-e again with the same number (new key, new body).
POST/v1/cte/:id/discardGive up a rejected CT-e (its credit comes back).
POST/v1/cte/:id/syncAsk the SVRS by the key now (after a timeout).
POST/v1/cte/:id/cancelCancellation (event 110111), { justification } with 15 to 255 characters. A CT-e with a correction letter cannot be cancelled: 409 CTE_CANCEL_AFTER_CORRECTION (the SVRS answers rejection 523).
POST/v1/cte/:id/correctionCorrection letter (event 110110), { corrections: [{ group, field, value, item? }] }, up to 20 per CT-e.
GET/v1/cte/:id/eventsThe events and their answer from the SVRS.
GET/v1/cte/:id/events/:eventId/xmlThe procEventoCTe of a registered event.
GET/v1/cte/:id/xmlThe cteProc (or the signed XML of a rejected CT-e).
GET/v1/cte/:id/pdfThe DACTE (A4, QR Code).

Issuing

The body has the carrier (companyId), CFOP and nature of the operation, the start and end cities (IBGE code), the sender and the recipient, who pays (taker.role: sender, recipient, shipper, receiver, or other with its own party), the value of the service (vTPrest, its components and vRec), the ICMS, the cargo, the keys of the NF-e carried and the RNTRC of the carrier. Money goes as decimal text ("150.00").

POST /v1/cte

{
  "companyId": "5f0c...",
  "cfop": "5353",
  "natOp": "PRESTACAO DE SERVICO DE TRANSPORTE",
  "start": { "cityCode": "2304400", "city": "Fortaleza", "state": "CE" },
  "end": { "cityCode": "2303709", "city": "Caucaia", "state": "CE" },
  "sender": {
    "taxId": "07526557000100", "stateRegistration": "061234567", "name": "Companny do Brasil",
    "address": { "street": "Av. Bezerra de Menezes", "number": "100", "district": "Centro", "zip": "60325001", "cityCode": "2304400", "city": "Fortaleza", "state": "CE" }
  },
  "recipient": {
    "taxId": "12345678909", "stateRegistration": null, "name": "Maria da Silva",
    "address": { "street": "Rua A", "number": "10", "district": "Centro", "zip": null, "cityCode": "2303709", "city": "Caucaia", "state": "CE" }
  },
  "taker": { "role": "sender" },
  "values": { "total": "150.00", "receivable": "150.00", "components": [{ "name": "FRETE VALOR", "amount": "150.00" }] },
  "icms": { "cst": "sn" },
  "cargo": { "value": "5000.00", "product": "PECAS PARA MOTOS", "measures": [{ "unit": "01", "type": "PESO BRUTO", "quantity": "130.0000" }] },
  "nfeKeys": ["23261107526557000100550010000012341000012345"],
  "rntrc": "12345678",
  "externalId": "frete-0001"
}

202 Accepted

{
  "data": { "id": "8d2e...", "status": "queued" }
}

GET /v1/cte/:id (authorized)

{
  "data": {
    "type": "cte", "id": "8d2e...", "environment": "test", "status": "authorized", "model": 57,
    "series": 1, "number": 1, "accessKey": "23261158147583000168570010000000011...",
    "protocol": "323260000000001", "cStat": "100", "xMotivo": "Autorizado o uso do CT-e",
    "authorizedAt": "2026-11-29T12:00:00.000Z", "error": null, "content": { "...": "..." }
  }
}
  • The number is reserved once per CT-e (series of the company, model 57) and the signed XML is stored before it goes to the SVRS.
  • No answer from the SVRS: the CT-e goes to reconciliation_required and Arquivix Notas asks by the key (up to 5 times) before manual_review. Never issue it again while it is there.
  • The CT-e 4.00 has no inutilization: a rejected CT-e is sent again with the same number (PUT) or discarded.
  • The credit is the same as the NF-e: reserved when it is accepted (live only), confirmed on authorization, given back on rejection, denial or discard.
  • Permissions are those of the NF-e: nfe.documents.view, nfe.documents.issue and nfe.documents.manage (cancel, correct, discard, sync).

States

StatusMeaning
queued · processingWaiting for or at the SVRS.
authorizedAuthorized (cStat 100): DACTE and XML available.
rejectedRefused by the SVRS (cStat and xMotivo say why). Fix and PUT, or discard.
deniedDenied (cStat 110 and others): final, the number is used.
retry_pending · reconciliation_required · manual_reviewThe SVRS did not answer: Arquivix Notas tries again or checks by the key.
cancelling · cancelledCancellation sent / registered. A refused cancellation goes back to authorized.
discardedGiven up after a rejection.

Errors and webhooks

  • 422 CTE_VALIDATION_FAILED with details field by field (CTE_JUSTIFICATION_LENGTH, CTE_CORRECTION_INVALID, CTE_CORRECTION_LIMIT); 404 CTE_NOT_FOUND; 409 CTE_INVALID_STATE for an action that does not fit the state; 409 DOCUMENTS_NOT_READY for a file before the authorization.
  • Before sending, the XML is checked against the official schema (PL_CTe_400): a failure is rejected with CTE_SCHEMA_INVALID and never reaches the SVRS. A refusal by the SVRS keeps its cStat and xMotivo (225, 539...).
  • Webhooks: cte.document.authorized, cte.document.rejected, cte.document.denied, cte.document.reconciliation_required, cte.document.manual_review, cte.document.cancelled, cte.document.cancellation_rejected, cte.document.corrected.

Through the MCP

The agent has the same operations: cte_readiness, cte_issue, cte_list, cte_get, cte_sync, cte_resubmit, cte_cancel, cte_correct and cte_discard. Issuing, resubmitting, cancelling, correcting and discarding only show a preview until confirm: true, after the person agrees.

In the dashboard

Freight (CT-e) in the menu lists the CT-e and issues the road CT-e of a Simples Nacional carrier: sender, recipient, who pays (sender or recipient), value of the service, cargo and the NF-e keys. The CT-e page downloads the DACTE and the XML, cancels with a justification (not after a correction letter: the SVRS refuses it with 523) and sends the correction letter (group, field and new value of the layout). A rejected CT-e is sent again with the same number, as it is, once the cause is fixed on the Arquivix Notas side, or discarded. Each registered event downloads its procEventoCTe. Editing a rejected CT-e and the other parties stay in the API for now.