---
title: "Inserir fretes no carrinho"
method: POST
path: "/api/v2/me/cart"
---

# Inserir fretes no carrinho

`POST /api/v2/me/cart`

## Request

- Base URL: `https://sandbox.melhorenvio.com.br`
- URL: `https://sandbox.melhorenvio.com.br/api/v2/me/cart`
- Auth: none required
- TypeScript: <https://skmtc.dev/melhorenvio/apis/api-melhor-envio-sandbox/docs/api/v2/me/cart/post.ts> (a function with typed inputs; its response is checked against the schema)

Carrinho de Compras

## Headers

- `Accept` string, required
- `Content-Type` string, required
- `Authorization` string, required
- `User-Agent` string, required

## Request body

- object
  - `service` integer, required: Id referente do serviço da transportadora
  - `agency` integer: Id da agência/unidade onde será postado o envio (consultar regras das transportadoras)
  - `from` object, required: Informações do remetente do envio
    - `name` string, required: Nome
    - `phone` string: Telefone
    - `email` string: E-mail
    - `document` string, required: CPF
    - `company_document` string, required: CNPJ
    - `state_register` string: Inscrição Estadual
    - `address` string, required: Logradouro
    - `complement` string: Complemento
    - `number` string, required: Número
    - `district` string, required: Bairro
    - `city` string, required: Cidade
    - `country_id` string, required: País
    - `postal_code` string, required: Cep
    - `state_abbr` string, required: Estado
    - `note` string: Observação
  - `to` object, required: Informações do destinatário do envio
    - `name` string, required: Nome
    - `phone` string: Telefone
    - `email` string: E-mail
    - `document` string, required: CPF
    - `company_document` string, required: CNPJ
    - `state_register` string: Inscrição Estadual
    - `address` string, required: Logradouro
    - `complement` string: Complemento
    - `number` string, required: Número
    - `district` string, required: Bairro
    - `city` string, required: Cidade
    - `country_id` string, required: País
    - `postal_code` string, required: Cep
    - `state_abbr` string, required: Estado
    - `note` string: Observação
  - `products` object[], required: Informações dos produtos que serão enviados (utilizado na declaração de conteúdo)
    - `name` string, required: Nome
    - `quantity` string, required: Quantidade
    - `unitary_value` string, required: Valor Unitário
  - `volumes` object[], required: Descrição dos volumes contidos no envio
    - `height` integer, required: Altura
    - `width` integer, required: Largura
    - `length` integer, required: Comprimento
    - `weight` number, float, required: Peso
  - `options` object: Informações complementares do envio
    - `insurance_value` number, double, required: Valor Segurado
    - `receipt` boolean, required: Flag para setar o serviço adicional de Aviso de Recebimento,
    - `own_hand` boolean, required: Flag para setar o serviço adicional de Mãos Próprias
    - `reverse` boolean, required: Flag para identificar o envio como Envio reverso
    - `non_commercial` boolean, required: Flag para identificar o envio como um Envio não comercial
    - `invoice` object
      - `key` string, required: Chave da Nota Fiscal
    - `dce` object
      - `key` string: Chave da DCe
    - `plataform` string
    - `tags` object[]
      - `tag` string: Identificação do pedido na plataforma
      - `Url` string: Url da plataforma

## Response `201`

201

- object
  - `id` string
  - `protocol` string
  - `service_id` integer
  - `agency_id` integer
  - `contract` unknown
  - `service_code` unknown
  - `quote` number
  - `price` number
  - `coupon` unknown
  - `discount` number
  - `delivery_min` integer
  - `delivery_max` integer
  - `status` string
  - `reminder` unknown
  - `insurance_value` integer
  - `weight` unknown
  - `width` unknown
  - `height` unknown
  - `length` unknown
  - `diameter` unknown
  - `format` string
  - `billed_weight` number
  - `receipt` boolean
  - `own_hand` boolean
  - `collect` boolean
  - `collect_scheduled_at` unknown
  - `reverse` boolean
  - `non_commercial` boolean
  - `authorization_code` unknown
  - `tracking` unknown
  - `self_tracking` unknown
  - `delivery_receipt` unknown
  - `additional_info` unknown
  - `cte_key` unknown
  - `paid_at` unknown
  - `generated_at` unknown
  - `posted_at` unknown
  - `delivered_at` unknown
  - `canceled_at` unknown
  - `suspended_at` unknown
  - `expired_at` unknown
  - `created_at` string
  - `updated_at` string
  - `parse_pi_at` unknown
  - `products` object[]
    - `name` string
    - `quantity` integer
    - `unitary_value` integer
    - `weight` unknown
  - `volumes` object[]
    - `id` integer
    - `height` string
    - `width` string
    - `length` string
    - `diameter` string
    - `weight` string
    - `format` string
    - `created_at` string
    - `updated_at` string

## Other responses

- `422`: Unprocessable Entity

---

[API](https://skmtc.dev/melhorenvio/apis/api-melhor-envio-sandbox.md) - [All operations](https://skmtc.dev/melhorenvio/apis/api-melhor-envio-sandbox/llms.txt) - [OpenAPI document](https://skmtc.dev/melhorenvio/apis/api-melhor-envio-sandbox/revisions/ffbe3939fc36?raw)
