Consult Orders¶
Retrieve Orders by ID¶
This endpoint allows the seller
to retrieve an order using the id
as a reference.
Required Scope
Value | Description |
---|---|
open:order-order-seller:read |
Allows reading orders and related data. |
URL Parameters
Field | Type | Description | Required |
---|---|---|---|
id |
string(UUID) | ID of the order on the platform. | Sim |
Headers
Field | Type | Description | Required |
---|---|---|---|
X-Channel-Id |
String | ID of the sales channel you want to operate (e.g. "9fe0d853-732b-4e4a-a0b0-cff988ed043d") | Yes |
Filters
Field | Type | Description | Required |
---|---|---|---|
updated_at__ge |
String (datetime ISO 8601) | Filters orders modified from the specified date informed (e.g., "2023-06-27T12:15:37.729Z") | No |
Request:
curl -X 'GET' \
'https://api.magalu.com/seller/v1/orders/{id}' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <Access Token>' \
-H 'Content-Type: application/json' \
-H 'X-Channel-Id: <Channel Id>'
Response:
{
"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",
"status":"new|approved|cancelled|finished",
"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",
"name":"Fulano de Tal",
"document_number":"12312312311",
"email":"user@mail.com",
"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
},
"tax":{
"currency":"BRL",
"normalizer":100,
"total":100
},
"comission":{
"currency":"BRL",
"normalizer":100,
"type":"value", //(value, percentage, etc.)
"total":25220
}
},
"foreign_amounts":{ // This object with its values will only exist if the request is international
"currency":"BRL",
"normalizer":100,
"total":30100,
"discount":{
"currency":"BRL",
"normalizer":100,
"total":772
},
"freight":{
"currency":"BRL",
"normalizer":100,
"amount":1000,
"interest":200,
"discount":100
},
"tax":{
"currency":"BRL",
"normalizer":100,
"total":2545
},
"exchange_rate":{
"currency":"USD",
"value":590
}
},
"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,
"total":5000,
"shared":2500
},
"freight":{
"currency":"BRL",
"normalizer":100,
"total":10000,
"shared":0
},
"tax":{
"currency":"BRL",
"normalizer":100,
"total":100
}
},
"foreign_amounts":{ // This object with its values will only exist if the request is international
"currency":"BRL",
"normalizer":100,
"total":30100,
"discount":{
"currency":"BRL",
"normalizer":100,
"total":772
},
"freight":{
"currency":"BRL",
"normalizer":100,
"amount":1000,
"interest":200,
"discount":200
},
"tax":{
"currency":"BRL",
"normalizer":100,
"total":1290
},
"comission":{
"currency":"BRL",
"normalizer":100,
"total":2545
},
"exchange_rate":{
"currency":"USD",
"value":595
}
},
"items":[
{
"sequencial":"1",
"amounts":{
"currency":"BRL",
"normalizer":100,
"total":10000,
"discounts":[
{
"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
}
]
},
"foreign_amounts":{ // This object with its values will only exist if the request is international
"currency":"BRL",
"normalizer":100,
"total":985,
"discount":{
"currency":"BRL",
"normalizer":100,
"total":572
},
"comission":{
"currency":"BRL",
"normalizer":100,
"total":572
},
"taxes":[
{
"currency":"BRL",
"normalizer":100,
"total":195,
"type":"importacao",
"description":"importacao"
}
],
"exchange_rate":{
"currency":"USD",
"value":595
}
},
"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":"g",
"quantity":2
}
],
"shipping":{
"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"
}
}
}
]
}
Response Codes
Code | Description |
---|---|
200 | OK |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
500 | Internal Server Error |
Retrieve Orders by Filters¶
This endpoint allows retrieving a collection of orders using filters as a reference.
Required Scope
Value | Description |
---|---|
open:order-order-seller:read |
Allows reading orders and related data. |
Headers
Field | Type | Description | Required |
---|---|---|---|
X-Channel-Id |
String | ID of the sales channel you want to operate (e.g. "9fe0d853-732b-4e4a-a0b0-cff988ed043d") | Yes |
Filters
Field | Type | Description | Required |
---|---|---|---|
status |
String | Order status, can be the following values: | No |
- new : new |
|||
- approved : payment approved |
|||
- cancelled : total cancellation, all deliveries canceled |
|||
- finished : order completed, may have partially canceled deliveries. |
|||
code |
String | Order code | No |
purchased_at__gte |
String (datetime ISO 8601) | Filters orders starting from the specified date (e.g., "2023-06-27T12:15:37.729Z") | No |
purchased_at__lte |
String (datetime ISO 8601) | Filters orders up to the specified date (e.g., "2023-06-27T12:15:37.729Z") | No |
Pagination and Sorting
Field | Type | Description | Required |
---|---|---|---|
_limit |
Integer | Determines the number of records to be returned. Default value is 50. | No |
_offset |
Integer | Record position reference, from which the next N records will be returned. Default value is 0. | No |
_sort |
String | Sorting, allowing the following values: | No |
- purchased_at:asc |
|||
- purchased_at:desc |
|||
* When not set, the purchased_at:asc will be used |
Request:
curl -X 'GET' \
'https://api.magalu.com/seller/v1/orders' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <Access Token>' \
-H 'Content-Type: application/json' \
-H 'X-Channel-Id: <Channel Id>'
Response:
{
"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
},
"tax":{
"currency":"BRL",
"normalizer":100,
"total":100
},
"comission":{
"currency":"BRL",
"normalizer":100,
"type":"value",
"total":25220
}
},
"foreign_amounts":{ // This object with its values will only exist if the request is international
"currency":"BRL",
"normalizer":100,
"total":30100,
"discount":{
"currency":"BRL",
"normalizer":100,
"total":772
},
"freight":{
"currency":"BRL",
"normalizer":100,
"amount":1000,
"interest":200,
"discount":100
},
"tax":{
"currency":"BRL",
"normalizer":100,
"total":2545
},
"exchange_rate":{
"currency":"USD",
"value":590
}
},
"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,
"total":5000,
"shared":2500
},
"freight":{
"currency":"BRL",
"normalizer":100,
"total":10000,
"shared":0
},
"tax":{
"currency":"BRL",
"normalizer":100,
"total":100
}
},
"foreign_amounts":{ // This object with its values will only exist if the request is international
"currency":"BRL",
"normalizer":100,
"total":30100,
"discount":{
"currency":"BRL",
"normalizer":100,
"total":772
},
"freight":{
"currency":"BRL",
"normalizer":100,
"amount":1000,
"interest":200,
"discount":200
},
"tax":{
"currency":"BRL",
"normalizer":100,
"total":1290
},
"comission":{
"currency":"BRL",
"normalizer":100,
"total":2545
},
"exchange_rate":{
"currency":"USD",
"value":595
}
},
"items":[
{
"sequencial":"1",
"amounts":{
"currency":"BRL",
"normalizer":100,
"total":10000,
"discounts":[
{
"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
}
]
},
"foreign_amounts":{ // This object with its values will only exist if the request is international
"currency":"BRL",
"normalizer":100,
"total":985,
"discount":{
"currency":"BRL",
"normalizer":100,
"total":572
},
"comission":{
"currency":"BRL",
"normalizer":100,
"total":572
},
"taxes":[
{
"currency":"BRL",
"normalizer":100,
"total":195,
"type":"importacao",
"description":"importacao"
}
],
"exchange_rate":{
"currency":"USD",
"value":595
}
},
"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":"g",
"quantity":1
}
],
"shipping":{
"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"
}
}
}
}
]
}
]
}
Response Codes
Code | Description |
---|---|
200 | OK |
400 | Bad Request |
401 | Unauthorized |
500 | Internal Server Error |