CONTEÚDO
01. VISÃO GERAL
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 no pedido.
...
Essa documentação tem como finalidade demonstrar o formato do JSON para envio de requisições de pedidos, como valor integração e adicionais.
...
02. EXEMPLO DE UTILIZAÇÃO
2.1 - Request Itens com Valor Integral e Adicionais:
Estrutura do corpo da requisição para criação de novos pedidos com itens de valor integral e adiconais
Bloco de código |
---|
title | JSON para pedido com inteiro |
---|
linenumbers | true |
---|
|
{
"integrationHubServiceId": "3fea8768-bbd9-454b-9e7b-40841e9a6812",
"data": {
"id": "f4114e16-c2e4-4dc3-86f3-98a52bfd5d7d",
"type": "TABLE",
"displayId": "58 |
...
Estrutura do corpo da requisição para criação de novos pedidos com itens de valor integral e adiconais
Bloco de código |
---|
title | JSON para pedido com inteiro |
---|
linenumbers | true |
---|
|
{
"integrationHubServiceId": "5ffec6b8-1c55-4a7d-985f-12d13685b553",
"data": {
"id": "f4114e16-c2e4-4dc3-86f3-98a52bfd5d7d",
"type": "TABLE",
"displayId": "58",
"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": "61",
"index": "60",
"name": "A FRANCESA",
"externalCode": "1",
"unit": "UN",
"quantity": 1,
"specialInstructions": "Teste",
"unitPrice": {
"value": 69.90,
"currency": "R$"
},
"optionsPrice": {
"value": 0.0,
"currency": "R$"
},
"totalPrice": {
"value": 69.90,
"currency": "R$"
},
"options": [
{
"index": "61",
"id": "61",
"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": [],
"total": {
"items": 70.90,
"otherFees": 0,
"discount": 0.0,
"orderAmount": 70.90,
"additionalFees": 0,
"deliveryFee": 0
},
"payments": {
"prepaid": 0.0,
"pending": 0.0,
"methods": [
{
"value": 70.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": "57",
"chairNumber": "1"
},
"card": null
}
} |
Nota |
---|
title | Nota: HTTP Status Code = 200 OK |
---|
|
Sua solicitação foi aceita mas ainda não processada, aguarde alguns instantes e procure o status. |
code
...
03. ERROS
...
title | Corpo da requisição no JSON |
---|
linenumbers | true |
---|
...
integrationHubServiceId: string,
data:
id: string,
type: DELIVERY,
displayId: string,
sourceAppId: string,
salesChannel: string,
createdAt: string,
lastEvent: CREATED,
orderTiming: INSTANT,
preparationStartDateTime: string,
merchant:
id: string,
name: string
items:
id: string,
index: string,
name: string,
externalCode: string,
unit: UN,
ean: string,
quantity: 0,
specialInstructions: string,
unitPrice:
value: 0,
currency: string
originalPrice:
value: 0,
currency: string
optionsPrice:
value: 0,
currency: string
totalPrice:
value: 0,
currency: string
options:
index: string,
id: string,
name: string,
externalCode: string,
unit: UN,
ean: string,
quantity: 0,
unitPrice:
value: 0,
currency: string
originalPrice:
value: 0,
currency: string
totalPrice:
value: 0,
currency: string
productionPoint: string
otherFees:
total:
items: 0,
otherFees: 0,
discount: 0,
orderAmount: 0,
additionalFees: 0,
deliveryFee: 0
payments:
prepaid: 0,
pending: 0,
methods:
value: 0,
currency: string,
type: OFFLINE,
method: CREDIT,
brand: VISA,
methodInfo: string,
changeFor: 0
delivery: null,
extraInfo: Teste,
schedule: null,
takeout: null,
indoor: null,
table:
waiterCode: 0,
tableNumber: 0,
chairNumber: 0
card: null
...
A seguir, alguns dos erros comuns que podem ser apresentados ao lidar com requisições HTTP e suas respectivas respostas:
...
A seguir, alguns dos erros comuns que podem ser apresentados ao lidar com requisições HTTP e suas respectivas respostas:
- HTTP Status Code - 400 - Bad Request
Âncora |
---|
| status_code_400 |
---|
| status_code_400 |
---|
|
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.
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 |
---|
title | JSON Inválido |
---|
linenumbers | true |
---|
|
{
"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 |
---|
title | JSON Resposta |
---|
linenumbers | true |
---|
|
{
"errors": [
{
"key": "displayId",
"message": "body.data.displayId must be a string"
}
]
} |
...
3.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 |
---|
title | JSON Inválido |
---|
linenumbers | true |
---|
|
{
"integrationHubServiceId": "3fea8768-bbd9-454b-9e7b-40841e9a6812",
"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 |
---|
title | JSON Resposta |
---|
linenumbers | true |
---|
|
{
"errors": [
{
"key": "merchant",
"message": "body.data.merchant is required"
}
]
} |
Nota |
---|
title | Nota: HTTP Status Code = 400 Bad Request |
---|
|
A solicitação é inválida e não pôde ser processada devido a erros na entrada fornecida. Verifique os dados enviados e tente novamente. |
...
- HTTP Status Code 401 - Unauthorized
Âncora |
---|
| status_code_401 |
---|
| status_code_401 |
---|
|
O código de status HTTP 401, conhecido como "Unauthorized" (Não Autorizado), indica que a requisição não foi aplicada porque carece de credenciais de autenticação válidas para o recurso alvo. Diferente do código 403 (Forbidden), que significa que o servidor entendeu a requisição, mas se recusa a autorizá-la, o 401 é usado especificamente quando a autenticação é necessária e falhou ou ainda não foi fornecida.
Nota |
---|
title | Nota: HTTP Status Code = 401 Unauthorized |
---|
|
A solicitação não pôde ser processada porque o usuário não possui as permissões necessárias. Verifique suas credenciais e tente novamente. |
...
- HTTP Status Code 403 - Forbidden
Âncora |
---|
| status_code_403 |
---|
| status_code_403 |
---|
|
O código de status HTTP 403, conhecido como "Forbidden" (Proibido), indica que o servidor não entendeu a requisição do cliente por está tentando acessar uma URL
incorreta
Bloco de código |
---|
title | URL enviada incorreda |
---|
|
https://api-barramento.meuelevestage.com/order/newOrderS |
Bloco de código |
---|
title | JSON Response para URL incorreta |
---|
linenumbers | true |
---|
|
{
"message": "Missing Authentication Token"
} |
Nota |
---|
title | Nota: HTTP Status Code = 403 - Forbidden |
---|
|
O cliente não enviou uma requisição para a URL incorreta. |
...
- HTTP Status Code 404 - Not Found
Âncora |
---|
| status_code_404 |
---|
| status_code_404 |
---|
|
O código de status HTTP 404, conhecido como "Not Found" (Não Encontrado), indica que o servidor não encontrou o recurso solicitado. Isso pode ocorrer quando o integrationHubId
está incorreto ou inválido.
Bloco de código |
---|
title | Integration Hub Code Inválido |
---|
linenumbers | true |
---|
|
{
"integrationHubServiceId": "f1b874af-96ab-4535-aac3-25118fe586cc",
"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
}
} |
Bloco de código |
---|
title | JSON Response |
---|
linenumbers | true |
---|
|
{
"errors": [
{
"key": "integrationHubServiceId",
"message": "Provider Merchant for integrationHubServiceId \"f1b874af-96ab-4535-aac3-25118fe586cc\" not found or disabled"
}
]
} |
Nota |
---|
title | Nota: HTTP Status Code = 404 - Not Found |
---|
|
IntegrationHubId incorreto ou inválido |
Dica |
---|
|
Para obter detalhes técnicos sobre o envio de requisições ao endpoint newOrder , incluindo a estrutura do corpo da requisição para itens com valor integral acesse a documentação clicando aqui. |
Dica |
---|
|
Para obter detalhes técnicos sobre o envio de requisições ao endpoint newOrder , incluindo a estrutura do corpo da requisição para itens com valor integral, adicionais e descontos acesse a documentação clicando aqui. |
...
04. LINKS
...