Melhor Envio tools
The 12 Melhor Envio operations your product runs on your customer's account through Connect. All of them use the same endpoint, POST /api/tools/{tool}/execute.
- Calculate shippingPOSTQuotes the shipping of products between two CEPs and returns one entry per service, with id, carrier, price, delivery time, the packages and an error when the service does not serve the route. custom_price and custom_delivery_time include the fees and discounts of the account. Only the services enabled for the integration in the Melhor Envio panel are quoted.
- Create cart itemPOSTAdds a shipping label to the cart of the account and returns it. Its id is the id of the label in the other tools. Nothing is paid until Purchase labels. Correios, J&T and Loggi take one volume per call: for more packages, add one item per package.
- List cart itemsGETLists the labels in the cart that were not paid yet, with id, service, price, sender, recipient and volumes. Labels stay in the cart for 20 days. 10 per page: pass page for the next ones, up to last_page.
- Delete cart itemDELETERemoves a label that was not paid yet from the cart.
- Purchase labelsPOSTPays labels in the cart with the balance of the Melhor Envio wallet and returns the purchase, with the total and the labels, now released. The wallet needs enough balance: check it with Get balance. Paid labels still need Generate labels.
- Generate labelsPOSTGenerates paid labels, which is required before Print labels, and returns the result for each id. A generated label must be posted within 20 days, or 7 days with Correios.
- Print labelsPOSTReturns a link to print generated labels. A private link opens only for someone signed in to the Melhor Envio account; a public link opens for anyone who has it.
- List labelsGETLists the labels of the account with id, protocol, status, service, price, tracking code and the dates of payment, generation, posting and delivery. 10 per page: pass page for the next ones, up to last_page.
- Get labelGETReturns one label with status, service, price, sender, recipient, volumes, tracking code and the dates of payment, generation, posting and delivery.
- Search labelsGETFinds labels by one exact value: the id, the protocol, the tracking code, the authorization code, or the CPF or CNPJ of the sender or the recipient.
- Cancel labelPOSTCancels a label. A generated label can be canceled only before it is posted and before the carrier is notified of a pickup; the refund of a generated label comes 12 hours after the approval.
- Get balanceGETReturns the balance of the Melhor Envio wallet in BRL, with the amount reserved and the debts. Purchase labels spends this balance.
See Connect applied to your product.
Try it for 15 days with no card, or walk our team through your use case.
