---
updatedAt: 2026-06-18T14:03:31.000Z
agentTools:
  projectIndex: https://docs.melhorenvio.com.br/llms.txt
---

# Cálculo de Fretes

Envios

<div style={{ textAlign: "justify" }}>
  Caso necessite, disponibilizamos a seguir alguns fluxogramas que poderão lhe auxiliar a visualizar este processo conforme a sua plataforma, assim como servir de base para que você adapte da melhor maneira ao seu próprio fluxo:

  * [Fluxograma para E-commerce, ERP ou Hub](https://melhorenvio.s3.sa-east-1.amazonaws.com/partners/manual/Diagrama+de+integra%C3%A7%C3%A3o+-+Fluxograma+de+cota%C3%A7%C3%A3o+\(E-commerce\).pdf)
  * [Fluxograma para Marketplace](https://melhorenvio.s3.sa-east-1.amazonaws.com/partners/manual/Diagrama+de+integra%C3%A7%C3%A3o+-+Fluxograma+de+cota%C3%A7%C3%A3o+\(Marketplace\).pdf)

  # Cotação por Produtos

  Os dados devem ser enviados com suas informações unitárias:

  * Dimensões (altura, largura, comprimento) em centímetros (cm);
  * Peso em quilogramas (kg);
  * Valor do produto em `insurance_value` (em double - apenas duas casas decimais);
  * Quantidade (em unidades).

  ## Exemplo de Requisição (Produto)

  ```json
  {
    "from": {
        "postal_code": "96020360"
    },
    "to": {
        "postal_code": "01018020"
    },
    "products": [
        {
            "id": "Produto A",
            "width": 11, //cm
            "height": 17, //cm
            "length": 11, //cm
            "weight": 1, //kg
            "insurance_value": 10.1, //BRL
            "quantity": 1 //unidade de produto
        },
        {
            "id": "Produto B",
            "width": 10,
            "height": 10,
            "length": 12,
            "weight": 0.2,
            "insurance_value": 10.1,
            "quantity": 5
        }
    ],
    "options": {
        "receipt": false,
        "own_hand": false
    },
    "services": "1,2,18"
  }
  ```

  ### Detalhes dos Parâmetros

  > 📘 Valor segurado total
  >
  > O valor segurado total (`insurance_value`) é calculado pela nossa API multiplicando o `insurance_value` unitário pela `quantity` de cada item.

  ***

  ***

  # Cotação por Pacotes

  Os dados devem ser enviados com suas informações unitárias:

  * Dimensões (altura, largura, comprimento) em centímetros (cm);
  * Peso em quilogramas (kg);
  * Valor do produto em `insurance` (em double - apenas duas casas decimais).

  ## Exemplo de Requisição (Pacotes)

  ```json
  {
    "from": {
        "postal_code": "96020360"
    },
    "to": {
        "postal_code": "01018020"
    },
    "volumes": [
        {
            "width": 11,
            "height": 17,
            "length": 11,
            "weight": 0.3,
            "insurance": 10.1
        },
        {
            "width": 20,
            "height": 25,
            "length": 25,
            "weight": 1.5,
            "insurance": 1000
        }
    ],
    "options": {
        "receipt": false,
        "own_hand": false
    },
    "services": "1,2,18"
  }
  ```

  ### Detalhes dos Parâmetros

  > 📘 Valor segurado
  >
  > * O valor segurado (`insurance`) é calculado pela nossa API multiplicando o `insurance` unitário pela `quantity` de cada item.
  > * Serviços Adicionais (`options`):
  > * `options.receipt` (Aviso de Recebimento): Adiciona custo extra com Correios e JadLog.
  > * `options.own_hand` (Mãos Próprias): Adiciona custo extra apenas com Correios.

  ***

  ***

  # Parâmetros de Resposta

  Para sua integração, utilize o `custom_price` e o `custom   _delivery_time` informados no retorno da nossa API. Eles refletem os valores com as customizações (taxas ou descontos) configuradas na conta Melhor Envio do usuário integrado, em vez dos valores originais (`price` e `delivery_time`).

  > ⚠️ Restrição (Azul Cargo)
  >
  > Embora seja possível cotar fretes com a Azul Cargo, a compra de etiquetas comerciais (NFe) dessa transportadora não está disponível via API, devendo ela ser utilizada apenas para envios não-comerciais (DEC).
</div>

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "api-melhor-envio-sandbox",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://sandbox.melhorenvio.com.br/",
      "description": "Ambiente de Sandbox (Testes)"
    },
    {
      "url": "https://melhorenvio.com.br/",
      "description": "Ambiente de Produção (Real)"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/api/v2/me/shipment/calculate": {
      "post": {
        "summary": "Cálculo de Fretes",
        "description": "Envios",
        "operationId": "calculo-de-fretes-por-produtos",
        "parameters": [
          {
            "name": "Accept",
            "in": "header",
            "description": "application/json",
            "required": true,
            "schema": {
              "type": "string",
              "default": "application/json"
            }
          },
          {
            "name": "Content-Type",
            "in": "header",
            "description": "application/json",
            "required": true,
            "schema": {
              "type": "string",
              "default": "application/json"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "description": "Token",
            "required": true,
            "schema": {
              "type": "string",
              "default": "Bearer token"
            }
          },
          {
            "name": "User-Agent",
            "in": "header",
            "description": "É obrigatório que seja adicionado o cabeçalho HTTP User-Agent com o nome da sua aplicação junto a um email de contato/suporte.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "Aplicação (email para contato técnico)"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "from",
                  "to",
                  "products"
                ],
                "properties": {
                  "from": {
                    "type": "object",
                    "description": "Local de partida",
                    "required": [
                      "postal_code"
                    ],
                    "properties": {
                      "postal_code": {
                        "type": "string",
                        "description": "Cep Local de Partida"
                      }
                    }
                  },
                  "to": {
                    "type": "object",
                    "description": "Local de Recebimento",
                    "required": [
                      "postal_code"
                    ],
                    "properties": {
                      "postal_code": {
                        "type": "string",
                        "description": "Cep local de Recebimento"
                      }
                    }
                  },
                  "products": {
                    "type": "array",
                    "description": "Listagem dos produtos contidos no pacote.",
                    "items": {
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Identificador do Produto"
                        },
                        "width": {
                          "type": "integer",
                          "description": "Largura",
                          "format": "int32"
                        },
                        "height": {
                          "type": "integer",
                          "description": "Altura",
                          "format": "int32"
                        },
                        "length": {
                          "type": "integer",
                          "description": "Comprimento",
                          "format": "int32"
                        },
                        "weight": {
                          "type": "number",
                          "description": "Peso",
                          "format": "float"
                        },
                        "insurance_value": {
                          "type": "number",
                          "description": "Valor do produto que será utilizado para o cálculo do seguro do frete",
                          "format": "float"
                        },
                        "quantity": {
                          "type": "integer",
                          "description": "Número de itens",
                          "format": "int32"
                        }
                      },
                      "required": [
                        "id",
                        "width",
                        "height",
                        "length",
                        "weight",
                        "insurance_value",
                        "quantity"
                      ],
                      "type": "object"
                    }
                  },
                  "volumes": {
                    "type": "array",
                    "description": "Atributos do objeto",
                    "items": {
                      "properties": {
                        "width": {
                          "type": "integer",
                          "description": "Largura",
                          "format": "int32"
                        },
                        "heigth": {
                          "type": "integer",
                          "description": "Altura",
                          "format": "int32"
                        },
                        "lenght": {
                          "type": "integer",
                          "description": "Comprimento",
                          "format": "int32"
                        },
                        "weight": {
                          "type": "number",
                          "description": "Peso",
                          "format": "float"
                        },
                        "insurance": {
                          "type": "number",
                          "description": "Valor do produto que será utilizado para o cálculo do seguro do frete",
                          "format": "float"
                        }
                      },
                      "required": [
                        "width",
                        "heigth",
                        "lenght",
                        "weight",
                        "insurance"
                      ],
                      "type": "object"
                    }
                  },
                  "options": {
                    "type": "object",
                    "description": "Opções de Serviços de Entrega",
                    "properties": {
                      "receipt": {
                        "type": "boolean",
                        "description": "Aviso de Recebimento"
                      },
                      "own_hand": {
                        "type": "boolean",
                        "description": "Mão Própria"
                      }
                    }
                  }
                }
              },
              "examples": {
                "calculo de frete produto": {
                  "value": {
                    "from": {
                      "postal_code": "96020360"
                    },
                    "to": {
                      "postal_code": "01018020"
                    },
                    "products": [
                      {
                        "id": "x",
                        "width": 11,
                        "height": 17,
                        "length": 11,
                        "weight": 0.3,
                        "insurance_value": 10.1,
                        "quantity": 1
                      },
                      {
                        "id": "y",
                        "width": 16,
                        "height": 25,
                        "length": 11,
                        "weight": 0.3,
                        "insurance_value": 55.05,
                        "quantity": 2
                      },
                      {
                        "id": "z",
                        "width": 22,
                        "height": 30,
                        "length": 11,
                        "weight": 1,
                        "insurance_value": 30,
                        "quantity": 1
                      }
                    ]
                  }
                },
                "calculo de frete pacote": {
                  "value": {
                    "from": {
                      "postal_code": "01002001"
                    },
                    "to": {
                      "postal_code": "90570020"
                    },
                    "package": {
                      "height": 4,
                      "width": 12,
                      "length": 17,
                      "weight": 0.3
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "[\n  {\n    \"id\": 1,\n    \"name\": \"PAC\",\n    \"price\": \"37.79\",\n    \"custom_price\": \"37.79\",\n    \"discount\": \"2.09\",\n    \"currency\": \"R$\",\n    \"delivery_time\": 9,\n    \"delivery_range\": {\n      \"min\": 8,\n      \"max\": 9\n    },\n    \"custom_delivery_time\": 9,\n    \"custom_delivery_range\": {\n      \"min\": 8,\n      \"max\": 9\n    },\n    \"packages\": [\n      {\n        \"price\": \"37.79\",\n        \"discount\": \"2.09\",\n        \"format\": \"box\",\n        \"dimensions\": {\n          \"height\": 2,\n          \"width\": 11,\n          \"length\": 16\n        },\n        \"weight\": \"0.10\",\n        \"insurance_value\": \"50.00\",\n        \"products\": [\n          {\n            \"id\": \"pequeno\",\n            \"quantity\": 1\n          }\n        ]\n      }\n    ],\n    \"additional_services\": {\n      \"receipt\": true,\n      \"own_hand\": true,\n      \"collect\": false\n    },\n    \"company\": {\n      \"id\": 1,\n      \"name\": \"Correios\",\n      \"picture\": \"https://sandbox.melhorenvio.com.br/images/shipping-companies/correios.png\"\n    }\n  },\n  {\n    \"id\": 2,\n    \"name\": \"SEDEX\",\n    \"price\": \"46.23\",\n    \"custom_price\": \"46.23\",\n    \"discount\": \"3.95\",\n    \"currency\": \"R$\",\n    \"delivery_time\": 4,\n    \"delivery_range\": {\n      \"min\": 3,\n      \"max\": 4\n    },\n    \"custom_delivery_time\": 4,\n    \"custom_delivery_range\": {\n      \"min\": 3,\n      \"max\": 4\n    },\n    \"packages\": [\n      {\n        \"price\": \"46.23\",\n        \"discount\": \"3.95\",\n        \"format\": \"box\",\n        \"dimensions\": {\n          \"height\": 2,\n          \"width\": 11,\n          \"length\": 16\n        },\n        \"weight\": \"0.10\",\n        \"insurance_value\": \"50.00\",\n        \"products\": [\n          {\n            \"id\": \"pequeno\",\n            \"quantity\": 1\n          }\n        ]\n      }\n    ],\n    \"additional_services\": {\n      \"receipt\": true,\n      \"own_hand\": true,\n      \"collect\": false\n    },\n    \"company\": {\n      \"id\": 1,\n      \"name\": \"Correios\",\n      \"picture\": \"https://sandbox.melhorenvio.com.br/images/shipping-companies/correios.png\"\n    }\n  },\n  {\n    \"id\": 3,\n    \"name\": \".Package\",\n    \"price\": \"18.60\",\n    \"custom_price\": \"18.60\",\n    \"discount\": \"4.16\",\n    \"currency\": \"R$\",\n    \"delivery_time\": 6,\n    \"delivery_range\": {\n      \"min\": 5,\n      \"max\": 6\n    },\n    \"custom_delivery_time\": 6,\n    \"custom_delivery_range\": {\n      \"min\": 5,\n      \"max\": 6\n    },\n    \"packages\": [\n      {\n        \"format\": \"box\",\n        \"dimensions\": {\n          \"height\": 1,\n          \"width\": 1,\n          \"length\": 1\n        },\n        \"weight\": \"0.10\",\n        \"insurance_value\": \"50.00\",\n        \"products\": [\n          {\n            \"id\": \"pequeno\",\n            \"quantity\": 1\n          }\n        ]\n      }\n    ],\n    \"additional_services\": {\n      \"receipt\": true,\n      \"own_hand\": false,\n      \"collect\": false\n    },\n    \"company\": {\n      \"id\": 2,\n      \"name\": \"Jadlog\",\n      \"picture\": \"https://sandbox.melhorenvio.com.br/images/shipping-companies/jadlog.png\"\n    }\n  },\n  {\n    \"id\": 4,\n    \"name\": \".Com\",\n    \"price\": \"16.44\",\n    \"custom_price\": \"16.44\",\n    \"discount\": \"0.00\",\n    \"currency\": \"R$\",\n    \"delivery_time\": 5,\n    \"delivery_range\": {\n      \"min\": 4,\n      \"max\": 5\n    },\n    \"custom_delivery_time\": 5,\n    \"custom_delivery_range\": {\n      \"min\": 4,\n      \"max\": 5\n    },\n    \"packages\": [\n      {\n        \"format\": \"box\",\n        \"dimensions\": {\n          \"height\": 1,\n          \"width\": 1,\n          \"length\": 1\n        },\n        \"weight\": \"0.10\",\n        \"insurance_value\": \"50.00\",\n        \"products\": [\n          {\n            \"id\": \"pequeno\",\n            \"quantity\": 1\n          }\n        ]\n      }\n    ],\n    \"additional_services\": {\n      \"receipt\": true,\n      \"own_hand\": false,\n      \"collect\": false\n    },\n    \"company\": {\n      \"id\": 2,\n      \"name\": \"Jadlog\",\n      \"picture\": \"https://sandbox.melhorenvio.com.br/images/shipping-companies/jadlog.png\"\n    }\n  },\n  {\n    \"id\": 17,\n    \"name\": \"Mini Envios\",\n    \"price\": \"23.44\",\n    \"custom_price\": \"23.44\",\n    \"discount\": \"0.00\",\n    \"currency\": \"R$\",\n    \"delivery_time\": 11,\n    \"delivery_range\": {\n      \"min\": 10,\n      \"max\": 11\n    },\n    \"custom_delivery_time\": 11,\n    \"custom_delivery_range\": {\n      \"min\": 10,\n      \"max\": 11\n    },\n    \"packages\": [\n      {\n        \"price\": \"23.44\",\n        \"discount\": \"0.00\",\n        \"format\": \"box\",\n        \"dimensions\": {\n          \"height\": 1,\n          \"width\": 11,\n          \"length\": 16\n        },\n        \"weight\": \"0.10\",\n        \"insurance_value\": \"50.00\",\n        \"products\": [\n          {\n            \"id\": \"pequeno\",\n            \"quantity\": 1\n          }\n        ]\n      }\n    ],\n    \"additional_services\": {\n      \"receipt\": true,\n      \"own_hand\": false,\n      \"collect\": false\n    },\n    \"company\": {\n      \"id\": 1,\n      \"name\": \"Correios\",\n      \"picture\": \"https://sandbox.melhorenvio.com.br/images/shipping-companies/correios.png\"\n    }\n  }\n]"
                  }
                },
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "integer",
                        "example": 1,
                        "default": 0
                      },
                      "name": {
                        "type": "string",
                        "example": "PAC"
                      },
                      "price": {
                        "type": "string",
                        "example": "37.79"
                      },
                      "custom_price": {
                        "type": "string",
                        "example": "37.79"
                      },
                      "discount": {
                        "type": "string",
                        "example": "2.09"
                      },
                      "currency": {
                        "type": "string",
                        "example": "R$"
                      },
                      "delivery_time": {
                        "type": "integer",
                        "example": 9,
                        "default": 0
                      },
                      "delivery_range": {
                        "type": "object",
                        "properties": {
                          "min": {
                            "type": "integer",
                            "example": 8,
                            "default": 0
                          },
                          "max": {
                            "type": "integer",
                            "example": 9,
                            "default": 0
                          }
                        }
                      },
                      "custom_delivery_time": {
                        "type": "integer",
                        "example": 9,
                        "default": 0
                      },
                      "custom_delivery_range": {
                        "type": "object",
                        "properties": {
                          "min": {
                            "type": "integer",
                            "example": 8,
                            "default": 0
                          },
                          "max": {
                            "type": "integer",
                            "example": 9,
                            "default": 0
                          }
                        }
                      },
                      "packages": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "price": {
                              "type": "string",
                              "example": "37.79"
                            },
                            "discount": {
                              "type": "string",
                              "example": "2.09"
                            },
                            "format": {
                              "type": "string",
                              "example": "box"
                            },
                            "dimensions": {
                              "type": "object",
                              "properties": {
                                "height": {
                                  "type": "integer",
                                  "example": 2,
                                  "default": 0
                                },
                                "width": {
                                  "type": "integer",
                                  "example": 11,
                                  "default": 0
                                },
                                "length": {
                                  "type": "integer",
                                  "example": 16,
                                  "default": 0
                                }
                              }
                            },
                            "weight": {
                              "type": "string",
                              "example": "0.10"
                            },
                            "insurance_value": {
                              "type": "string",
                              "example": "50.00"
                            },
                            "products": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "example": "pequeno"
                                  },
                                  "quantity": {
                                    "type": "integer",
                                    "example": 1,
                                    "default": 0
                                  }
                                }
                              }
                            }
                          }
                        }
                      },
                      "additional_services": {
                        "type": "object",
                        "properties": {
                          "receipt": {
                            "type": "boolean",
                            "example": true,
                            "default": true
                          },
                          "own_hand": {
                            "type": "boolean",
                            "example": true,
                            "default": true
                          },
                          "collect": {
                            "type": "boolean",
                            "example": false,
                            "default": true
                          }
                        }
                      },
                      "company": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "example": 1,
                            "default": 0
                          },
                          "name": {
                            "type": "string",
                            "example": "Correios"
                          },
                          "picture": {
                            "type": "string",
                            "example": "https://sandbox.melhorenvio.com.br/images/shipping-companies/correios.png"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "422",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"message\": \"The given data was invalid.\",\n  \"errors\": {\n    \"from.postal_code\": [\n      \"O campo from.postal code é obrigatório.\"\n    ],\n    \"to.postal_code\": [\n      \"O campo to.postal code é obrigatório.\"\n    ]\n  }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "The given data was invalid."
                    },
                    "errors": {
                      "type": "object",
                      "properties": {
                        "from.postal_code": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "example": "O campo from.postal code é obrigatório."
                          }
                        },
                        "to.postal_code": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "example": "O campo to.postal code é obrigatório."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```