---
updatedAt: 2026-08-21T13:25:29.000Z
agentTools:
  projectIndex: https://docs.melhorenvio.com.br/llms.txt
---

# Inserir Logística Reversa no carrinho

Logística Reversa

<div style={{ textAlign: "justify" }}>
  <br />

  > 📘 Considerações importantes:
  >
  > No momento, o fluxo de Logística Reversa não está inteiramente disponível no ambiente Sandbox; embora seja possível inserir a etiqueta no carrinho, obter um `id` e confirmar a compra, não é possível solicitar a geração da etiqueta e do código de devolução. No entanto, o serviço está operando normalmente no ambiente de produção.

  A Logística Reversa utiliza os serviços PAC e SEDEX dos Correios (respectivamente `service:1` ou `service:2`). Para processar uma devolução, o fluxo depende da origem da etiqueta original.

  **1. Envio original feito pelo Melhor Envio**

  Se a etiqueta original foi gerada conosco, já temos a maioria dos dados. Você precisará fornecer apenas:

  * O `id` do envio original, a ser informado no campo `order_id`;
  * Os dados de contato do novo remetente (a pessoa que está devolvendo);
  * A confirmação do valor segurado, dimensões e peso.
  * *Informe a chave da DCe no campo destinado, ou deixe em branco para que a API comunique a DCe à SEFAZ.*

  Exemplo de requisição para devolução de envio cujo frete foi intermediado pelo Melhor Envio:

  ```json
  {
      "service": 1,
      "new_sender_mail": "remetente@melhorenvio.com",
      "new_sender_phone": "99 99999-9999",
      "insurance_value": 2.90,
      "order_id": "9c79c7bb-e365-4d92-8553-255d60bc28d0",
      "package": {
          "weight": 1.2,
          "height": 2,
          "width": 5,
          "length": 12
      },
      "options": {
          "own_hand": false,
          "receipt": false,
          "dce": {
            "key": "35260819...243000197990...001234561...829137"
          }
      }
  }
  ```

  **2. Envio original NÃO feito pelo Melhor Envio**

  Se a etiqueta original foi gerada por terceiros, precisaremos de todas as informações para o novo envio, incluindo:

  * Dados completos do novo remetente (quem devolve).
  * Dados completos do destinatário (quem recebe a devolução).
  * Dados completos da carga (valor segurado, dimensões e peso).
  * (Opcional) - Dados completos dos produtos como `name`, `quantity` e `unitary_value`.
  * *Informe a chave da DCe no campo destinado, ou deixe em branco para que a API comunique a DCe à SEFAZ.*

  Exemplo de requisição para devolução de envios intermediado por terceiros:

  ```json
  {
      "service": 1,
      "new_sender_mail": "remetente@melhorenvio.com",
      "new_sender_phone": "99 99999-9999",
      "insurance_value": 60.75,
      "from": {
          "name": "Antonio Augusto",
          "document": "86845718008",
          "company_document": "99799989000102",
          "address": "Av. República do Líbano",
          "number": "846",
          "district": "Tres Vendas",
          "city": "Pelotas",
          "state_abbr": "RS",
          "postal_code": "96055710"
      },
      "to": {
          "name": "João Neves",
          "phone": "15997459876",
          "email": "destinatario@melhorenvio.com",
          "document": "26805059054",
          "company_document": "62278475000100",
          "state_register": "123456",
          "economic_activity_code": "123456",
          "address": "Rua dos buritis",
          "complement": "segundo andar",
          "number": "128",
          "district": "Jabaquara",
          "city": "São paulo",
          "state_abbr": "SP",
          "postal_code": "4321000",
          "note": "alguma observação"
      },
      "products": [
          {
              "name": "Produto A",
              "quantity": 1,
              "unitary_value": 60.75
          }
      ],
      "package": {
          "weight": 1.2,
          "height": 2,
          "width": 5,
          "length": 12
      },
      "options": {
          "own_hand": false,
          "receipt": false,
          "dce": {
            "key": "35260819...243000197990...001234561...829137"
      }
  }
  ```

  <br />
</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/cart/reverse": {
      "post": {
        "summary": "Inserir Logística Reversa no carrinho",
        "description": "Logística Reversa",
        "operationId": "inserir-logistica-reversa-no-carrinho",
        "parameters": [
          {
            "name": "Accept",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "application/json"
            }
          },
          {
            "name": "Content-Type",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "default": "application/json"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "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": [
                  "service",
                  "new_sender_mail",
                  "new_sender_phone",
                  "insurance_value",
                  "from",
                  "to",
                  "package"
                ],
                "properties": {
                  "service": {
                    "type": "integer",
                    "description": "Id referente do serviço da transportadora",
                    "format": "int32"
                  },
                  "new_sender_mail": {
                    "type": "string",
                    "description": "e-mail do remetente que estará realizando a devolução"
                  },
                  "new_sender_phone": {
                    "type": "string",
                    "description": "celular do remetente que estará realizando a devolução"
                  },
                  "insurance_value": {
                    "type": "number",
                    "description": "Valor declarado",
                    "default": 0,
                    "format": "double"
                  },
                  "agency": {
                    "type": "integer",
                    "description": "Id da agência/unidade onde será postado o envio (consultar regras das transportadoras)",
                    "format": "int32"
                  },
                  "from": {
                    "type": "object",
                    "description": "Informações do remetente do envio",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "Nome"
                      },
                      "phone": {
                        "type": "string",
                        "description": "Telefone"
                      },
                      "email": {
                        "type": "string",
                        "description": "E-mail"
                      },
                      "document": {
                        "type": "string",
                        "description": "CPF"
                      },
                      "company_document": {
                        "type": "string",
                        "description": "CNPJ"
                      },
                      "state_register": {
                        "type": "string",
                        "description": "Inscrição Estadual"
                      },
                      "address": {
                        "type": "string",
                        "description": "Logradouro"
                      },
                      "complement": {
                        "type": "string",
                        "description": "Complemento"
                      },
                      "number": {
                        "type": "string",
                        "description": "Número"
                      },
                      "district": {
                        "type": "string",
                        "description": "Bairro"
                      },
                      "city": {
                        "type": "string",
                        "description": "Cidade"
                      },
                      "country_id": {
                        "type": "string",
                        "description": "País"
                      },
                      "postal_code": {
                        "type": "string",
                        "description": "Cep"
                      },
                      "state_abbr": {
                        "type": "string",
                        "description": "Estado"
                      },
                      "note": {
                        "type": "string",
                        "description": "Observação"
                      }
                    },
                    "required": [
                      "state_abbr",
                      "postal_code",
                      "country_id",
                      "city",
                      "district",
                      "number",
                      "address",
                      "company_document",
                      "document",
                      "email",
                      "name"
                    ]
                  },
                  "to": {
                    "type": "object",
                    "description": "Informações do destinatário do envio",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "Nome"
                      },
                      "phone": {
                        "type": "string",
                        "description": "Telefone"
                      },
                      "email": {
                        "type": "string",
                        "description": "E-mail"
                      },
                      "document": {
                        "type": "string",
                        "description": "CPF"
                      },
                      "company_document": {
                        "type": "string",
                        "description": "CNPJ"
                      },
                      "state_register": {
                        "type": "string",
                        "description": "Inscrição Estadual"
                      },
                      "address": {
                        "type": "string",
                        "description": "Logradouro"
                      },
                      "complement": {
                        "type": "string",
                        "description": "Complemento"
                      },
                      "number": {
                        "type": "string",
                        "description": "Número"
                      },
                      "district": {
                        "type": "string",
                        "description": "Bairro"
                      },
                      "city": {
                        "type": "string",
                        "description": "Cidade"
                      },
                      "country_id": {
                        "type": "string",
                        "description": "País"
                      },
                      "postal_code": {
                        "type": "string",
                        "description": "Cep"
                      },
                      "state_abbr": {
                        "type": "string",
                        "description": "Estado"
                      },
                      "note": {
                        "type": "string",
                        "description": "Observação"
                      }
                    },
                    "required": [
                      "name",
                      "document",
                      "company_document",
                      "address",
                      "number",
                      "district",
                      "city",
                      "country_id",
                      "postal_code",
                      "state_abbr"
                    ]
                  },
                  "products": {
                    "type": "array",
                    "description": "Informações dos produtos que serão enviados (utilizado na declaração de conteúdo). Obrigatório caso seja uma devolução de um envio não intermediado originalmente pelo Melhor Envio",
                    "items": {
                      "properties": {
                        "name": {
                          "type": "string",
                          "description": "Nome"
                        },
                        "quantity": {
                          "type": "string",
                          "description": "Quantidade"
                        },
                        "unitary_value": {
                          "type": "string",
                          "description": "Valor unitário"
                        },
                        "weight": {
                          "type": "number",
                          "description": "Peso",
                          "format": "float"
                        }
                      },
                      "required": [
                        "name",
                        "weight",
                        "quantity",
                        "unitary_value"
                      ],
                      "type": "object"
                    }
                  },
                  "package": {
                    "type": "object",
                    "description": "Descrição dos volumes contidos no envio",
                    "required": [
                      "height",
                      "width",
                      "length",
                      "weight"
                    ],
                    "properties": {
                      "height": {
                        "type": "integer",
                        "description": "Altura",
                        "format": "int32"
                      },
                      "width": {
                        "type": "integer",
                        "description": "Largura",
                        "format": "int32"
                      },
                      "length": {
                        "type": "integer",
                        "description": "Comprimento",
                        "format": "int32"
                      },
                      "weight": {
                        "type": "number",
                        "description": "Peso",
                        "format": "float"
                      }
                    }
                  },
                  "options": {
                    "type": "array",
                    "description": "Informações complementares do envio",
                    "items": {
                      "properties": {
                        "own_hand": {
                          "type": "boolean",
                          "description": "Serviço de mãos próprias",
                          "default": false
                        },
                        "receipt": {
                          "type": "boolean",
                          "description": "Aviso de recebimento",
                          "default": false
                        },
                        "platform": {
                          "type": "string"
                        },
                        "tags": {
                          "type": "array",
                          "items": {
                            "properties": {
                              "tag": {
                                "type": "string",
                                "description": "Identificação do pedido na plataforma"
                              },
                              "Url": {
                                "type": "string",
                                "description": "Url da plataforma"
                              }
                            },
                            "type": "object"
                          }
                        },
                        "dce": {
                          "type": "object",
                          "properties": {
                            "key": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "type": "object"
                    }
                  }
                }
              },
              "examples": {
                "Logística Reversa envio original ME": {
                  "value": {
                    "service": 1,
                    "new_sender_mail": "remetente@melhorenvio.com",
                    "new_sender_phone": "99 99999-9999",
                    "insurance_value": 2.9,
                    "order_id": "9c79c7bb-e365-4d92-8553-255d60bc28d0",
                    "package": {
                      "weight": 1.2,
                      "height": 2,
                      "width": 5,
                      "length": 12
                    },
                    "options": {
                      "own_hand": false,
                      "receipt": false
                    }
                  }
                },
                "Logística Reversa envio original terceiros": {
                  "value": {
                    "service": 1,
                    "new_sender_mail": "remetente@melhorenvio.com",
                    "new_sender_phone": "99 99999-9999",
                    "insurance_value": 60.75,
                    "from": {
                      "name": "Antonio Augusto",
                      "document": "86845718008",
                      "company_document": "99799989000102",
                      "address": "Av. República do Líbano",
                      "number": "846",
                      "district": "Tres Vendas",
                      "city": "Pelotas",
                      "state_abbr": "RS",
                      "postal_code": "96055710"
                    },
                    "to": {
                      "name": "João Neves",
                      "phone": "15997459876",
                      "email": "destinatario@melhorenvio.com",
                      "document": "26805059054",
                      "company_document": "62278475000100",
                      "state_register": "123456",
                      "economic_activity_code": "123456",
                      "address": "Rua dos buritis",
                      "complement": "segundo andar",
                      "number": "128",
                      "district": "Jabaquara",
                      "city": "São paulo",
                      "state_abbr": "SP",
                      "postal_code": "4321000",
                      "note": "alguma observação"
                    },
                    "products": [
                      {
                        "name": "Produto A",
                        "quantity": 1,
                        "unitary_value": 60.75,
                        "weight": 1
                      }
                    ],
                    "package": {
                      "weight": 1.2,
                      "height": 2,
                      "width": 5,
                      "length": 12
                    },
                    "options": {
                      "own_hand": false,
                      "receipt": false
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "201",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"id\": \"10b87ac0-e99d-4aa4-b8b0-b147a84e16bf\",\n  \"protocol\": \"ORD-20220397305\",\n  \"service_id\": 3,\n  \"agency_id\": 48,\n  \"contract\": null,\n  \"service_code\": null,\n  \"quote\": 25.35,\n  \"price\": 25.35,\n  \"coupon\": null,\n  \"discount\": 5.71,\n  \"delivery_min\": 5,\n  \"delivery_max\": 6,\n  \"status\": \"pending\",\n  \"reminder\": null,\n  \"insurance_value\": 50,\n  \"weight\": null,\n  \"width\": null,\n  \"height\": null,\n  \"length\": null,\n  \"diameter\": null,\n  \"format\": \"box\",\n  \"billed_weight\": 3.5,\n  \"receipt\": false,\n  \"own_hand\": false,\n  \"collect\": false,\n  \"collect_scheduled_at\": null,\n  \"reverse\": false,\n  \"non_commercial\": true,\n  \"authorization_code\": null,\n  \"tracking\": null,\n  \"self_tracking\": null,\n  \"delivery_receipt\": null,\n  \"additional_info\": null,\n  \"cte_key\": null,\n  \"paid_at\": null,\n  \"generated_at\": null,\n  \"posted_at\": null,\n  \"delivered_at\": null,\n  \"canceled_at\": null,\n  \"suspended_at\": null,\n  \"expired_at\": null,\n  \"created_at\": \"2022-03-29 12:50:19\",\n  \"updated_at\": \"2022-03-29 12:50:19\",\n  \"parse_pi_at\": null,\n  \"products\": [\n    {\n      \"name\": \"Papel adesivo para etiquetas 1\",\n      \"quantity\": 3,\n      \"unitary_value\": 100,\n      \"weight\": null\n    },\n    {\n      \"name\": \"Papel adesivo para etiquetas 2\",\n      \"quantity\": 1,\n      \"unitary_value\": 700,\n      \"weight\": null\n    }\n  ],\n  \"volumes\": [\n    {\n      \"id\": 101594,\n      \"height\": \"10.00\",\n      \"width\": \"15.00\",\n      \"length\": \"20.00\",\n      \"diameter\": \"0.00\",\n      \"weight\": \"3.50\",\n      \"format\": \"box\",\n      \"created_at\": \"2022-03-29 12:50:19\",\n      \"updated_at\": \"2022-03-29 12:50:19\"\n    }\n  ]\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "10b87ac0-e99d-4aa4-b8b0-b147a84e16bf"
                    },
                    "protocol": {
                      "type": "string",
                      "example": "ORD-20220397305"
                    },
                    "service_id": {
                      "type": "integer",
                      "example": 3,
                      "default": 0
                    },
                    "agency_id": {
                      "type": "integer",
                      "example": 48,
                      "default": 0
                    },
                    "contract": {},
                    "service_code": {},
                    "quote": {
                      "type": "number",
                      "example": 25.35,
                      "default": 0
                    },
                    "price": {
                      "type": "number",
                      "example": 25.35,
                      "default": 0
                    },
                    "coupon": {},
                    "discount": {
                      "type": "number",
                      "example": 5.71,
                      "default": 0
                    },
                    "delivery_min": {
                      "type": "integer",
                      "example": 5,
                      "default": 0
                    },
                    "delivery_max": {
                      "type": "integer",
                      "example": 6,
                      "default": 0
                    },
                    "status": {
                      "type": "string",
                      "example": "pending"
                    },
                    "reminder": {},
                    "insurance_value": {
                      "type": "integer",
                      "example": 50,
                      "default": 0
                    },
                    "weight": {},
                    "width": {},
                    "height": {},
                    "length": {},
                    "diameter": {},
                    "format": {
                      "type": "string",
                      "example": "box"
                    },
                    "billed_weight": {
                      "type": "number",
                      "example": 3.5,
                      "default": 0
                    },
                    "receipt": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "own_hand": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "collect": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "collect_scheduled_at": {},
                    "reverse": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "non_commercial": {
                      "type": "boolean",
                      "example": true,
                      "default": true
                    },
                    "authorization_code": {},
                    "tracking": {},
                    "self_tracking": {},
                    "delivery_receipt": {},
                    "additional_info": {},
                    "cte_key": {},
                    "paid_at": {},
                    "generated_at": {},
                    "posted_at": {},
                    "delivered_at": {},
                    "canceled_at": {},
                    "suspended_at": {},
                    "expired_at": {},
                    "created_at": {
                      "type": "string",
                      "example": "2022-03-29 12:50:19"
                    },
                    "updated_at": {
                      "type": "string",
                      "example": "2022-03-29 12:50:19"
                    },
                    "parse_pi_at": {},
                    "products": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "example": "Papel adesivo para etiquetas 1"
                          },
                          "quantity": {
                            "type": "integer",
                            "example": 3,
                            "default": 0
                          },
                          "unitary_value": {
                            "type": "integer",
                            "example": 100,
                            "default": 0
                          },
                          "weight": {}
                        }
                      }
                    },
                    "volumes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "example": 101594,
                            "default": 0
                          },
                          "height": {
                            "type": "string",
                            "example": "10.00"
                          },
                          "width": {
                            "type": "string",
                            "example": "15.00"
                          },
                          "length": {
                            "type": "string",
                            "example": "20.00"
                          },
                          "diameter": {
                            "type": "string",
                            "example": "0.00"
                          },
                          "weight": {
                            "type": "string",
                            "example": "3.50"
                          },
                          "format": {
                            "type": "string",
                            "example": "box"
                          },
                          "created_at": {
                            "type": "string",
                            "example": "2022-03-29 12:50:19"
                          },
                          "updated_at": {
                            "type": "string",
                            "example": "2022-03-29 12:50:19"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "422",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"error\": {\n    \"volumes\": [\n      [\n        \"Peso do pacote 1 não informado\",\n        \"Altura do pacote 1 não informada\",\n        \"Largura do pacote 1 não informada\",\n        \"Comprimento do pacote 1 não informado\"\n      ]\n    ]\n  }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "volumes": {
                          "type": "array",
                          "items": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "example": "Peso do pacote 1 não informado"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```