MobiariDocs

Correios (own contract)

Quotes, labels, tracking and reverse logistics on your own Correios contract.

With your Correios contract connected, Mobiari quotes PAC, SEDEX and the contract's other services at checkout and in the admin, at the contract's prices. When you ship, it creates the pre-posting (pré-postagem) with the order's NF-e (or with a content declaration), prints the label and follows the tracking on its own. On a return, it asks Correios for a reverse logistics authorization and sends the customer the code and the deadline.

Everything is billed on your contract, not from a prepaid balance. If you also reach Correios through Melhor Envio, both can stay on: their options show together in the quote.

Before you start

  • A contract with Correios and access to the CWS portal (cws.correios.com.br) with your idCorreios.
  • The contract number, the DR (Diretoria Regional, the regional office, a number such as 72) and the posting card (cartão de postagem) number.
  • The company details and the origin address filled in under Shipping and freight: they are the sender of the labels and where returns go.

1. Create the access keys in CWS

At Correios, each access key carries one kind of authorization (idCorreios, contract or posting card) and only the APIs granted to it. That is why you usually have more than one:

  • a key with Preço, Prazo, Rastro and, if you like, CEP and Webhook, to quote and track;
  • a posting card key with Pré-postagem, to make labels and return authorizations.

In the CWS portal, create the keys under Gestão de acesso a API's → Chaves de acesso. Each one starts with cws-ch. Write down the expiry date the portal shows: keys last about six months at most, and Correios does not say when a key expires through its API.

2. Connect it in Mobiari

  1. In the admin, open Settings → Payments and freight and, under Frete (Shipping), click Correios (contrato próprio).
  2. In Serviços cotados (quoted services), keep 03298, 03220 (PAC and SEDEX on contract) or add other services of your contract, separated by commas. In Serviços de logística reversa (reverse services), keep 03301, 03247 (PAC and SEDEX reverse) unless your contract uses other codes.
  3. Click Save.
  4. Under Correios access keys, click Add a key for each key: pick the Kind of authorization, paste the Access key, type the Valid until date and fill in the Contract, the DR and the Card. Click Check and save.

Mobiari checks each key with Correios using queries that change nothing (a CEP, a deadline, a price) and shows the APIs it reaches: Price, Deadline, Pre-posting, Tracking, Webhook and CEP. A key Correios refuses is not saved. From then on, each call goes with the valid key that has the right API. The key is stored encrypted and never comes back to the screen: only its last four characters show. Check runs the verification again whenever you want.

Prices come from the contract

A quote sends each key's contract number and DR. If they are not the key's, Correios refuses the quote, and the key shows the warning "O contrato ou a DR não conferem com a chave" (the contract or DR do not match the key).

Key expiry

Each key shows how many days are left before it expires. Team members who manage integrations get a notice in the bell and by e-mail 30 days before, 7 days before and on the day the key expires. The Correios (contrato próprio) card in Payments and freight also shows A key expires soon, A key expires this week or A key expired.

To renew, create a new key in CWS and add it in Mobiari, or change the date in Valid until and click Save date. An expired key is no longer used: without another key with the same API, Correios quotes and labels stop.

Quotes

At checkout and in the Freight step of a shipment, each service of Serviços cotados shows with the contract's price and the deadline in business days. Weight and sizes come from the boxes worked out for the order; a box smaller than 16 × 11 × 2 cm is quoted at that minimum size. Correios carry up to 30 kg per object, 100 cm a side and 200 cm adding the three sides: past that, Correios do not show in the quote. With several boxes, the price is the sum of the boxes.

Labels

  1. In the shipment, choose a Correios option in the Freight step.
  2. In the Book step, check the recipient and click Make label. With the order's production NF-e, the note's key goes on the pre-posting. Without one, the label goes with a content declaration of the shipment's items: confirm the declaration fits this sale.
  3. In the Dispatch step, Print label opens the label PDF. Stick it on the package and take it to an agency.

Each label carries one box: a shipment with several boxes must be split first. Nothing is paid at that moment: the cost goes on the contract's invoice.

Tracking

Once the label is made, Mobiari checks Correios tracking on its own every few minutes: the shipment moves to In transit when the object is posted and to Delivered when Correios record the delivery. Refresh tracking checks right away. If the pre-posting expires without being posted, or is cancelled, the shipment becomes Cancelled.

Returns through Correios

On a requested or approved return, Mobiari asks Correios for a reverse logistics authorization on your contract. The customer takes the package to any agency with the code, by the deadline, and pays nothing.

  1. Open the return. If it is still requested, click Approve and then Approve with a Correios authorization. If it is already approved, use Get a Correios authorization under How to send it back.
  2. Pick the Service (PAC or SEDEX reverse) and the Days to post it (1 to 90).
  3. The package uses the weight and sizes of the returned products. If they do not fit in one box, fill in the package's weight and sizes.
  4. Click Approve and get authorization (or Get authorization).

The customer gets the code, Correios as the carrier and the deadline in the approval e-mail and on the order page. Correios ask for the customer's CPF or CNPJ and e-mail: without them, no authorization is made. Until the package is posted, Cancel the Correios authorization cancels the code at Correios.

Common questions

The key was refused. Check that you copied the whole key, that it is still valid in the CWS portal and that it is a production key: the Correios test environment (homologação) does not take production keys, and Mobiari only uses production.

Correios do not show in the quote. Check that a valid key has Price and Deadline, that the contract and DR are filled in and that the origin address has a CEP. Boxes past the limits also take Correios out of the quote.

"Nenhuma chave tem a API Pré-postagem liberada" (no key has the Pré-postagem API). The posting card key needs the Pré-postagem API in the CWS portal.

On this page