CONTEÚDO
| Âncora | ||||
|---|---|---|---|---|
|
Este endpoint permite o envio de requisições para a criação de novos pedidos na API Order , especificamente para pedidos realizados em mesa, utilizando a barramento de serviços. A estrutura JSON apresentada ilustra um exemplo de payload para o endpoint newOrder, destinado ao registro de pedidos com itens de valor integral incluindo adicionais e desconto em um item.
...
Esta documentação tem como finalidade demonstrar o formato do JSON para envio de requisição de pedidos com valor integração na API Order Mesa, no endpoint newOrder para itens com valor integral, adicionais e desconto.
...
...
| Âncora | ||||
|---|---|---|---|---|
|
2.1 - Itens com Valor Integral Adicionais e Descontos:
01. Corpo da requisição de envio de novo pedidos inteiro:
| Bloco de código | ||||
|---|---|---|---|---|
| ||||
{
"integrationHubServiceId": "818484b63fea8768-bad8bbd9-43e4454b-a44d9e7b-9a6b0280ffb240841e9a6812",
"data": {
"id": "00e50465de703e24-560a3c8f-4354441a-90caaacd-0a4dd144bbef17ac766206a9",
"type": "TABLE",
"displayId": "52",
"createdAt": "2024-06-24T17:35:00",
"orderTiming": "2024-06-24T17:40:24",
"preparationStartDateTime": "2024-06-24T18:00:00",
"merchant": {
"id": "c312d2ff-1a8f-40ad-8eed-9ae9a908df6e",
"name": "BOTECO DO ALBINO"
},
"items": [
{
"id": "34",
"index": "34",
"name": "A FRANCESA",
"externalCode": "1",
"unit": "UN",
"quantity": 1,
"specialInstructions": "Teste",
"unitPrice": {
"value": 69.90,
"currency": "R$"
},
"optionsPrice": {
"value": 1.00,
"currency": "R$"
},
"totalPrice": {
"value": 69.90,
"currency": "R$"
},
"options": [
{
"index": "45",
"id": "45",
"name": "COMPOSICAO A",
"externalCode": "201",
"unit": "UN",
"quantity": 1,
"unitPrice": {
"value": 1.00,
"currency": "R$"
},
"originalPrice": {
"value": 1.00,
"currency": "R$"
},
"totalPrice": {
"value": 1.00,
"currency": "R$"
},
"productionPoint": "Teste"
}
]
}
],
"otherFees": [],
"discounts": [
{
"value": 10.00,
"target": "ITEM",
"targetId": "4",
"sponsorshipValues": [
{
"name": "MARKETPLACE",
"value": 0
}
]
}
],
"total": {
"items": 7060.90,
"otherFees": 0.00,
"discount": 010.00,
"orderAmount": 7060.90,
"additionalFees": 0,
"deliveryFee": 0
},
"payments": {
"prepaid": 0.0,
"pending": 0.0,
"methods": [
{
"value": 7060.90,
"currency": "BRL",
"type": "PREPAID",
"method": "credit",
"methodInfo": "Visa",
"changeFor": 0.0
}
]
},
"delivery": null,
"extraInfo": "Teste",
"schedule": null,
"indoor": null,
"takeout": null,
"table": {
"waiterCode": "9999",
"tableNumber": "52",
"chairNumber": "1"
},
"card": null
}
} |
| Nota | ||
|---|---|---|
| ||
Sua solicitação foi aceita mas ainda não processada, aguarde alguns instantes e procure o status. |
...
...
...
| Âncora | ||||
|---|---|---|---|---|
|
A seguir, alguns dos erros comuns que podem ser apresentados ao lidar com requisições HTTP e suas respectivas respostas:
...
O código de status HTTP 400, conhecido como "Bad Request" (Requisição Inválida), indica que o servidor não pôde processar a requisição do cliente devido a uma sintaxe inválida, estrutura malformada ou dados inválidos presentes na requisição.
01. Formando inválido do JSON esperado.
a uma sintaxe inválida, estrutura malformada ou dados inválidos presentes na requisição.
3.1. Formato inválido do JSON esperado:
A requisição foi enviada com um JSON malformado ou inválido, o que impede o sistema de interpretá-la corretamente. Isso ocorre quando a estrutura JSON contém erros de sintaxe, como chaves ou colchetes incorretos.
| Bloco de código | ||||
|---|---|---|---|---|
| ||||
{
"integrationHubServiceId": "3fea8768-bbd9-454b-9e7b-40841e9a6812",
"data": {
"id": "b1e26dd8-0a1b-486e-bf62-65e80ddce2f4",
"type": "TABLE",
"displayId": 55,
"createdAt": "2024-06-24T17:35:00",
"orderTiming": "2024-06-24T17:40:24",
"preparationStartDateTime": "2024-06-24T18:00:00",
"merchant": {
"id": "c312d2ff-1a8f-40ad-8eed-9ae9a908df6e",
"name": "BOTECO DO ALBINO"
},
"items": [
{
"id": "54",
"index": "54",
"name": "MARACUJA",
"externalCode": "58",
"unit": "UN",
"quantity": 1.0,
"specialInstructions": "Teste",
"unitPrice": {
"value": 61.00,
"currency": "R$"
},
"optionsPrice": {
"value": 0.0,
"currency": "R$"
},
"totalPrice": {
"value": 61.00,
"currency": "R$"
}
}
],
"otherFees": [],
"total": {
"items": 61.0,
"otherFees": 0,
"discount": 0.0,
"orderAmount": 61.0,
"additionalFees": 0,
"deliveryFee": 0
},
"payments": {
"prepaid": 0.0,
"pending": 0.0,
"methods": [
{
"value": 61.0,
"currency": "BRL",
"type": "PREPAID",
"method": "credit",
"methodInfo": "Visa",
"changeFor": 0.0
}
]
},
"delivery": null,
"extraInfo": "Teste",
"schedule": null,
"indoor": null,
"takeout": null,
"table": {
"waiterCode": "9999",
"tableNumber": "54",
"chairNumber": "1"
},
"card": null
}
} |
| Bloco de código | ||||
|---|---|---|---|---|
| ||||
{
"errors": [
{
"key": "displayId",
"message": "body.data.displayId must be a string"
}
]
} |
...
023. JSON enviando 2 - JSON enviado com a ausência de um ou mais campos obrigatórios:
Se a requisição estiver faltando um ou mais campos obrigatórios, o servidor responderá com um erro 400. Cada campo requerido deve estar presente para que a operação seja processada corretamente.
| Bloco de código | ||||
|---|---|---|---|---|
| ||||
{
"integrationHubServiceId": "299f76ba3fea8768-3ac3bbd9-4cc1454b-abaf9e7b-fac5a2510d8c40841e9a6812",
"data": {
"id": "fa3a2d45-3a29-4136-95e7-692d93db8b2b",
"type": "TABLE",
"displayId": "55",
"createdAt": "2024-06-24T17:35:00",
"orderTiming": "2024-06-24T17:40:24",
"preparationStartDateTime": "2024-06-24T18:00:00",
"items": [
{
"id": "54",
"index": "54",
"name": "MARACUJA",
"externalCode": "58",
"unit": "UN",
"quantity": 1.0,
"specialInstructions": "Teste",
"unitPrice": {
"value": 61.00,
"currency": "R$"
},
"optionsPrice": {
"value": 0.0,
"currency": "R$"
},
"totalPrice": {
"value": 61.00,
"currency": "R$"
}
}
],
"otherFees": [],
"total": {
"items": 61.0,
"otherFees": 0,
"discount": 0.0,
"orderAmount": 61.0,
"additionalFees": 0,
"deliveryFee": 0
},
"payments": {
"prepaid": 0.0,
"pending": 0.0,
"methods": [
{
"value": 61.0,
"currency": "BRL",
"type": "PREPAID",
"method": "credit",
"methodInfo": "Visa",
"changeFor": 0.0
}
]
},
"delivery": null,
"extraInfo": "Teste",
"schedule": null,
"indoor": null,
"takeout": null,
"table": {
"waiterCode": "9999",
"tableNumber": "54",
"chairNumber": "1"
},
"card": null
}
} |
...
| Bloco de código | ||||
|---|---|---|---|---|
| ||||
{
"integrationHubServiceId": "3fea8768f1b874af-bbd996ab-454b4535-9e7baac3-40841e9a681225118fe586c",
"data": {
"id": "f1bddb3f-63c4-4b2f-be53-e4527275ad9d",
"type": "TABLE",
"displayId": "55",
"createdAt": "2024-06-24T17:35:00",
"orderTiming": "2024-06-24T17:40:24",
"preparationStartDateTime": "2024-06-24T18:00:00",
"merchant": {
"id": "c312d2ff-1a8f-40ad-8eed-9ae9a908df6e",
"name": "BOTECO DO ALBINO"
},
"items": [
{
"id": "54",
"index": "54",
"name": "MARACUJA",
"externalCode": "58",
"unit": "UN",
"quantity": 1.0,
"specialInstructions": "Teste",
"unitPrice": {
"value": 61.00,
"currency": "R$"
},
"optionsPrice": {
"value": 0.0,
"currency": "R$"
},
"totalPrice": {
"value": 61.00,
"currency": "R$"
}
}
],
"otherFees": [],
"total": {
"items": 61.0,
"otherFees": 0,
"discount": 0.0,
"orderAmount": 61.0,
"additionalFees": 0,
"deliveryFee": 0
},
"payments": {
"prepaid": 0.0,
"pending": 0.0,
"methods": [
{
"value": 61.0,
"currency": "BRL",
"type": "PREPAID",
"method": "credit",
"methodInfo": "Visa",
"changeFor": 0.0
}
]
},
"delivery": null,
"extraInfo": "Teste",
"schedule": null,
"indoor": null,
"takeout": null,
"table": {
"waiterCode": "9999",
"tableNumber": "54",
"chairNumber": "1"
},
"card": null
}
} |
...
| Dica | ||
|---|---|---|
| ||
Para obter detalhes técnicos sobre o envio de requisições ao endpoint |
| Dica | ||
|---|---|---|
| ||
Para obter detalhes técnicos sobre o envio de requisições ao endpoint |
...
...
| Âncora | ||||
|---|---|---|---|---|
|
| New Order Mesa - Itens Fracionando |
|---|
| New Order Mesa - Vários Itens com Valor Integral |
| Templatedocumentos |
|---|