Ir para o conteúdo

Consultar pedidos

Recuperar pedidos por ID

Este endpoint permite que o vendedor (seller) recupere um pedido utilizando o id como referência.

Escopo requerido

Valor Descrição
open:order-order:read Permite a leitura de pedidos e dados relacionados.

Parâmetros da URL

Campo Tipo Descrição Obrigatório
id string(UUID) ID do pedido na plataforma. Sim

Chamada:

curl -X 'GET' \
  'https://services.magalu.com/seller/v1/orders/{id}' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <Access Token>' \
  -H 'Content-Type: application/json' \

Resposta:

{
  "id": "c8be6d3d-77e6-4cd9-8d6e-dd556b3e46ee",
  "status": "new|approved|cancelled|finished",
  "created_at": "2024-07-04T19:30:28.993Z",
  "approved_at": "2024-07-04T19:30:28.993Z",
  "purchased_at": "2024-07-04T19:30:28.993Z",
  "updated_at": "2024-07-04T19:30:28.993Z",
  "code": "123456789101112",
  "channel": {
    "id": "e83ed3c7-7bae-47c4-9dcd-d12f6329fe1a",
    "marketplace": {
      "document": "18901029000100"
    },
    "extras": {
      "alias": "magalu"
    }
  },
  "customer": {
    "birth_date": "2024-07-04",
    "customer_type": "cnpj|cpf",
    "document_number": "12312312311",
    "email": "user@mail.com",
    "name": "Fulano de Tal",
    "phones": [
      {
        "area_code": "11",
        "country_code": "55",
        "number": "991232233",
        "type": "mobile|residential|comercial"
      }
    ]
  },
  "payments": [
    {
      "gateway": {
        "document": "58159109000156"
      },
      "description": "Pix|Boleto Bancário|Cartão de Crédito",
      "extras": {
        "qr_code": "xpto"
      },
      "installments": 1,
      "method": "pix|bank_slip|credit_card",
      "currency": "BRL",
      "normalizer": 100,
      "amount": 10000
    }
  ],
  "amounts": {
    "currency": "BRL",
    "normalizer": 100,
    "total": 10000,
    "discount": {
      "currency": "BRL",
      "normalizer": 100,
      "total": 5000,
      "shared": 2500
    },
    "freight": {
      "currency": "BRL",
      "normalizer": 100,
      "total": 10000,
      "shared": 0
    },
    "taxes": [
      {
        "currency": "BRL",
        "normalizer": 100,
        "type": "icms|prc|...",
        "description": "ICMS",
        "total": 100
      }
    ],
        "comission": {
        "currency": "BRL",
        "normalizer": 100,
        "type": "value", //(value, percentage, etc.)
        "total": 25220
        }
  },
  "deliveries": [
    {
      "code": "123456789101112-1",
      "id": "6c764444-436d-4659-8cec-304414b05259",
      "seller": {
        "id": "GENPUB.e83ed3c7-7bae-47c4-9dcd-d12f6329fe1a",
        "name": "Loja do Edu"
      },
      "status": "new|approved|invoiced|shipped|delivered|cancelled|frozen",
      "amounts": {
        "currency": "BRL",
        "normalizer": 100,
        "total": 10000,
        "discount": [{
          "currency": "BRL",
          "normalizer": 100,
          "type": "sale",
          "description": "Liquidação Fantástica",
          "total": 5000,
          "shared": 2500
        }],
        "freight": [{
          "currency": "BRL",
          "normalizer": 100,
          "total": 10000,
          "shared": 0
        }],
        "taxes": [
          {
            "currency": "BRL",
            "normalizer": 100,
            "type": "icms|prc|...",
            "description": "ICMS",
            "total": 100
          }
        ],
            "comission": {
            "currency": "BRL",
            "normalizer": 100,
            "type": "value", //(value, percentage, etc.)
            "total": 14400,
          }
      },
      "items": [
        {
          "sequencial": "1",
          "amounts": {
            "currency": "BRL",
            "normalizer": 100,
            "total": 10000,
            "discount": {
              "currency": "BRL",
              "normalizer": 100,
              "total": 5000,
              "shared": 2500
            },
            "freight": {
              "currency": "BRL",
              "normalizer": 100,
              "total": 10000,
              "shared": 0
            },
            "comission": {
              "normalizer": 100,
              "type": "percentage",//fixo percentual
              "value": 1850           
              }
          },
          "info": {
            "sku": "livro_01",
            "id": "00839163-486f-4557-8173-c454d22edd64",
            "name": "Livro XYZ",
            "description": "...",
            "images": [
              {
                "url": "https://imagem.do.livro/foto.jpg"
              }
            ],
            "attributes": [
              {
                "name": "color",
                "value": "black"
              }
            ],
            "extras": {
              "categories": "UD"
            },
            "dimensions": {
              "height": {
                "value": 120,
                "unit": "cm"
              },
              "width": {
                "value": 100,
                "unit": "cm"
              },
              "length": {
                "value": 110,
                "unit": "cm"
              },
              "weight": {
                "value": 170,
                "unit": "g"
              }
            }
          },
          "unit_price": {
            "currency": "BRL",
            "normalizer": 100,
            "value": 1999
          },
          "measure_unit": "PC|KG|G",
          "quantity": 2
        }
      ],
      "shipping": {
        "posting_date": "2021-07-22T13:06:28.000Z",
        "recipient": {
          "customer_type": "cnpj|cpf",
          "document_number": "12312312311",
          "email": "user@mail.com",
          "name": "Fu***as",
          "phones": [
            {
              "area_code": "11",
              "country_code": "55",
              "number": "991232233",
              "type": "mobile|comercial|residential"
            }
          ],
          "address": {
            "zipcode": "86380000",
            "street": "1 DE MAIO",
            "number": "79",
            "district": "VILA INDUSTRIAL",
            "city": "ANDIRA",
            "state": "PR",
            "country": "BR",
            "complement": "apto 1023",
            "reference": ""
          }
        },
        "pickup_details": {
          "store": {
            "name": "loja magalu 001 franca",
            "document": "1928491824"
          }
        },
        "drop_details": {
          "store": {
            "name": "loja magalu 001 franca",
            "document": "1928491824"
          },
          "address": {
            "zipcode": "86380000",
            "street": "1 DE MAIO",
            "number": "79",
            "district": "VILA INDUSTRIAL",
            "city": "ANDIRA",
            "state": "PR",
            "country": "BR",
            "complement": "apto 1023",
            "reference": ""
          }
        },
        "handling_time": {
          "value": 15,
          "precision": "days",
          "workday": true,
          "limit_date": "2021-07-22T13:06:28.000Z"
        },
        "deadline": {
          "value": 15,
          "precision": "days",
          "workday": true,
          "limit_date": "2021-07-22T13:06:28.000Z"
        },
        "provider": {
          "id": "integra",
          "name": "integra",
          "description": "Entrega pelo parceiro",
          "extras": {
            "chave": "valor"
          }
        }
      }
    }
  ]
}

Códigos de retorno

Código Descrição
200 OK
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
500 Internal Server Error

Recuperar pedidos por filtros

Este endpoint permite recuperar uma coleção de pedidos utilizando filtros como referência.

Escopo requerido

Valor Descrição
open:order-order:read Permite a leitura de pedidos e dados relacionados.

Filtros

Campo Tipo Descrição Obrigatório
status String Status do pedido, pode ser os seguintes valores: Não
- new: novo
- approved: pagamento aprovado
- cancelled: cancelamento total, todas entregas canceladas
- finished: pedido finalizado, podendo haver entregas com cancelamento parcial.
code String Código do pedido Não
channel__id String Identificador do canal Não
updated_at__ge String (datetime ISO 8601) Filtra pedidos a partir da data informada (ex.: "2023-06-27T12:15:37.729Z") Não
updated_at__le String (datetime ISO 8601) Filtra pedidos até a data informada (ex.: "2023-06-27T12:15:37.729Z") Não

Paginação e Ordenação

Campo Tipo Descrição Obrigatório
_limit Inteiro Determina a quantidade de registros a serem retornados. Valor padrão 50. Não
_offset Inteiro Posição de registro de referência, a partir dele serão retornados os próximos N registros. Valor padrão 0. Não
_sort String Ordenação, sendo permitido os seguintes valores: Não
- created_at:asc
- created_at:desc
- updated_at:asc
- updated_at:desc

Chamada:

curl -X 'GET' \
  'https://services.magalu.com/seller/v1/orders' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <Access Token>' \
  -H 'Content-Type: application/json' \

Resposta:

{
  "meta": {
    "page": {
      "limit": 20,
      "offset": 150,
      "count": 10,
      "max_limit": 100
    },
    "links": {
      "previous": "?_offset=130&_limit=20",
      "next": "?_offset=170&_limit=20",
      "self": "?_offset=150&_limit=20"
    }
  },
  "results": [
    {
      "id": "c8be6d3d-77e6-4cd9-8d6e-dd556b3e46ee",
      "status": "new|approved|cancelled|finished",
      "created_at": "2024-07-04T19:30:28.993Z",
      "approved_at": "2024-07-04T19:30:28.993Z",
      "purchased_at": "2024-07-04T19:30:28.993Z",
      "updated_at": "2024-07-04T19:30:28.993Z",
      "code": "123456789101112",
      "channel": {
        "id": "e83ed3c7-7bae-47c4-9dcd-d12f6329fe1a",
        "marketplace": {
          "document": "18901029000100"
        },
        "extras": {
          "alias": "magalu"
        }
      },
      "customer": {
        "birth_date": "2024-07-04",
        "customer_type": "cnpj|cpf",
        "document_number": "12312312311",
        "email": "user@mail.com",
        "name": "Fulano de Tal",
        "phones": [
          {
            "area_code": "11",
            "country_code": "55",
            "number": "991232233",
            "type": "mobile|residential|comercial"
          }
        ]
      },
      "payments": [
        {
          "gateway": {
            "document": "58159109000156"
          },
          "description": "Pix|Boleto Bancário|Cartão de Crédito",
          "extras": {
            "qr_code": "xpto"
          },
          "installments": 1,
          "method": "pix|bank_slip|credit_card",
          "currency": "BRL",
          "normalizer": 100,
          "amount": 10000
        }
      ],
      "amounts": {
        "currency": "BRL",
        "normalizer": 100,
        "total": 10000,
        "discount": {
          "currency": "BRL",
          "normalizer": 100,
          "total": 5000,
          "shared": 2500
        },
        "freight": {
          "currency": "BRL",
          "normalizer": 100,
          "total": 10000,
          "shared": 0
        },
        "taxes": [
          {
            "currency": "BRL",
            "normalizer": 100,
            "type": "icms|prc|...",
            "description": "ICMS",
            "total": 100
          }
        ],
        "comission": {
            "currency": "BRL",
            "normalizer": 100,
            "type": "value", //(value, percentage, etc.)
            "total": 25220
            }
      },
      "deliveries": [
        {
          "code": "123456789101112-1",
          "id": "6c764444-436d-4659-8cec-304414b05259",
          "seller": {
            "id": "GENPUB.e83ed3c7-7bae-47c4-9dcd-d12f6329fe1a",
            "name": "Loja do Edu"
          },
          "status": "new|approved|invoiced|shipped|delivered|cancelled|frozen",
          "amounts": {
            "currency": "BRL",
            "normalizer": 100,
            "total": 10000,
            "discount": [{
              "currency": "BRL",
              "normalizer": 100,
              "type": "sale", // definir tipos
              "description": "Liquidação Fantástica",
              "total": 5000,
              "shared": 2500
            }],
            "freight": [{
              "currency": "BRL",
              "normalizer": 100,
              "total": 10000,
              "shared": 0
            }],
            "taxes": [
              {
                "currency": "BRL",
                "normalizer": 100,
                "type": "icms|prc|...",
                "description": "ICMS",
                "total": 100
              }
            ],
            "comission": {
                "currency": "BRL",
                "normalizer": 100,
                "type": "value", //(value, percentage, etc.)
                "total": 14400,
                }
          },
          "items": [
            {
              "sequencial": "1",
              "amounts": {
                "currency": "BRL",
                "normalizer": 100,
                "total": 10000,
                "discount": {
                  "currency": "BRL",
                  "normalizer": 100,
                  "total": 5000,
                  "shared": 2500
                },
                "freight": {
                  "currency": "BRL",
                  "normalizer": 100,
                  "total": 10000,
                  "shared": 0
                },
                "comission": {
                  "normalizer": 100,
                  "type": "percentage",//fixo percentual
                  "value": 1850           
                  }
              },
              "info": {
                "sku": "livro_01",
                "id": "00839163-486f-4557-8173-c454d22edd64",
                "name": "Livro XYZ",
                "description": "...",
                "images": [
                  {
                    "url": "https://imagem.do.livro/foto.jpg"
                  }
                ],
                "attributes": [
                  {
                    "name": "color",
                    "value": "black"
                  }
                ],
                "extras": {
                  "categories": "UD"
                },
                "dimensions": {
                  "height": {
                    "value": 120,
                    "unit": "cm"
                  },
                  "width": {
                    "value": 100,
                    "unit": "cm"
                  },
                  "length": {
                    "value": 110,
                    "unit": "cm"
                  },
                  "weight": {
                    "value": 170,
                    "unit": "g"
                  }
                }
              },
              "unit_price": {
                "currency": "BRL",
                "normalizer": 100,
                "value": 1999
              },
              "measure_unit": "PC|KG|G",
              "quantity": 1
            }
          ],
          "shipping": {
            "posting_date": "2021-07-22T13:06:28.000Z",
            "recipient": {
              "customer_type": "cnpj|cpf",
              "document_number": "12312312311",
              "email": "user@mail.com",
              "name": "Fu***as",
              "phones": [
                {
                  "area_code": "11",
                  "country_code": "55",
                  "number": "991232233",
                  "type": "mobile|comercial|residential"
                }
              ],
              "address": {
                "zipcode": "86380000",
                "street": "1 DE MAIO",
                "number": "79",
                "district": "VILA INDUSTRIAL",
                "city": "ANDIRA",
                "state": "PR",
                "country": "BR",
                "complement": "apto 1023",
                "reference": ""
              }
            },
            "pickup_details": {
              "store": {
                "name": "loja magalu 001 franca",
                "document": "1928491824"
              }
            },
            "drop_details": {
              "store": {
                "name": "loja magalu 001 franca",
                "document": "1928491824"
              },
              "address": {
                "zipcode": "86380000",
                "street": "1 DE MAIO",
                "number": "79",
                "district": "VILA INDUSTRIAL",
                "city": "ANDIRA",
                "state": "PR",
                "country": "BR",
                "complement": "apto 1023",
                "reference": ""
              }
            },
            "handling_time": {
              "value": 15,
              "precision": "days",
              "workday": true,
              "limit_date": "2021-07-22T13:06:28.000Z"
            },
            "deadline": {
              "value": 15,
              "precision": "days",
              "workday": true,
              "limit_date": "2021-07-22T13:06:28.000Z"
            },
            "provider": {
              "id": "integra",
              "name": "integra",
              "description": "Entrega pelo parceiro",
              "extras": {
                "chave": "valor"
              }
            }
          }
        }
      ]
    }
  ]
}

Códigos de retorno

Código Descrição
200 OK
400 Bad Request
401 Unauthorized
500 Internal Server Error