Calcular frete (Correios)
get_shipping_ratesCalculate Brazilian Correios shipping rates (SEDEX, PAC, ...) for a cart, from the authenticated store's origin CEP and enabled services. Returns each enabled service with price (BRL) and delivery estimate, plus free shipping when eligible. Every call returns a supportCode: pass it to diagnose_quote_issue to investigate that quote later instead of quoting again. Calls are subject to the store's plan limits; when setup or the plan is missing, reason and actionUrl say what the merchant must finish.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | Cart line items. | |
| requestId | No | Idempotency/correlation id. Auto-generated when omitted. | |
| instanceId | No | Merchant/store id. Ignored on authenticated servers (the merchant comes from the API key); used only on local/unauthenticated servers. | |
| destinationCep | Yes | Destination Brazilian postal code (CEP). 8 digits; dashes/spaces are ignored. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rates | Yes | ||
| reason | No | Why no rates were returned, when the list is empty. | |
| actionUrl | No | When set (e.g. reason=subscription_required), send the merchant here to finish setup. | |
| supportCode | No | ||
| excludedServices | No | Services the store has enabled but that didn't come back in `rates` for this cart (e.g. the package exceeds that service's size/weight limit). Share this with the merchant/customer instead of silently omitting the service. |