CONTEÚDO - NÃO MEXE API


01. VISÃO GERAL

Esta documentação tem como finalidade demonstrar o formato JSON para envio de requisições de pedidos com vários itens, sendo um item com valor integral e outro fracionando, como valor fracionado, adicionais e desconto na API Order Mesa, utilizando o endpoint newOrder.



02. ENDPOINT


MétodoURL
POSThttps://api-barramento.meuelevestage.com/order/newOrder



03. EXEMPLO DE UTILIZAÇÃO

01. Corpo da requisição para envio de vários itens no mesmo pedido:

{
	"integrationHubServiceId": "3fea8768-bbd9-454b-9e7b-40841e9a6812",
	"data": {
		"id": "29261444-5ff8-40b2-bce1-42848247d4a2",
		"type": "TABLE",
		"displayId": "8",
		"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": "2",
				"index": "2",
				"name": "A FRANCESA",
				"externalCode": "1",
				"unit": "UN",
				"quantity": 0.5,
				"specialInstructions": "Teste",
				"unitPrice": {
					"value": 69.90,
					"currency": "R$"
				},
				"optionsPrice": {
					"value": 1.00,
					"currency": "R$"
				},
				"totalPrice": {
					"value": 34.95,
					"currency": "R$"
				},
				"options": [
					{
						"index": "3",
						"id": "3",
						"name": "COMPOSICAO A",
						"externalCode": "201",
						"unit": "UN",
						"quantity": 1,
						"unitPrice": {
							"value": 1.00,
							"currency": "R$"
						},
						"originalPrice": {
							"value": 1.00,
							"currency": "RS"
						},
						"totalPrice": {
							"value": 1.0,
							"currency": "R$"
						},
						"productionPoint": "Adicional Composicao A"
					}
				]
			},
			{
				"id": "4",
				"index": "4",
				"name": "AERADO",
				"externalCode": "2",
				"unit": "UN",
				"quantity": 1,
				"specialInstructions": "Teste",
				"unitPrice": {
					"value": 32.99,
					"currency": "R$"
				},
				"optionsPrice": {
					"value": 37.99,
					"currency": "R$"
				},
				"totalPrice": {
					"value": 32.99,
					"currency": "R$"
				},
				"options": [
					{
						"index": "5",
						"id": "5",
						"name": "AVELA",
						"externalCode": "4",
						"unit": "UN",
						"quantity": 1,
						"unitPrice": {
							"value": 37.99,
							"currency": "R$"
						},
						"originalPrice": {
							"value": 37.99,
							"currency": "RS"
						},
						"totalPrice": {
							"value": 37.99,
							"currency": "R$"
						},
						"productionPoint": "Adicional Avela"
					}
				]
			}
		],
		"otherFees": [],
		"discounts": [
			{
				"value": 1,
				"target": "ITEM",
				"targetId": "02",
				"sponsorshipValues": [
					{
						"name": "MARKETPLACE",
						"value": 10.00
					}
				]
			}
		],
		"total": {
			"items": 67.94,
			"otherFees": 38.99,
			"discount": 10.00,
			"orderAmount": 96.93,
			"additionalFees": 0,
			"deliveryFee": 0
		},
		"payments": null
		"delivery": null,
		"extraInfo": "Teste",
		"schedule": null,
		"indoor": null,
		"takeout": null,
		"table": {
			"waiterCode": "96.93",
			"tableNumber": "8",
			"chairNumber": "1"
		},
		"card": null
	}
}

Sua solicitação foi aceita mas ainda não processada, aguarde alguns instantes e procure o status.



04. ERROS

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.

{
	"integrationHubServiceId": "3fea8768-bbd9-454b-9e7b-40841e9a6812",
	"data": {
		"id": "29261444-5ff8-40b2-bce1-42848247d4a2",
		"type": "TABLE",
		"displayId": 8,
		"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": "2",
				"index": "2",
				"name": "A FRANCESA",
				"externalCode": "1",
				"unit": "UN",
				"quantity": 0.5,
				"specialInstructions": "Teste",
				"unitPrice": {
					"value": 69.90,
					"currency": "R$"
				},
				"optionsPrice": {
					"value": 1.00,
					"currency": "R$"
				},
				"totalPrice": {
					"value": 34.95,
					"currency": "R$"
				},
				"options": [
					{
						"index": "3",
						"id": "3",
						"name": "COMPOSICAO A",
						"externalCode": "201",
						"unit": "UN",
						"quantity": 1,
						"unitPrice": {
							"value": 1.00,
							"currency": "R$"
						},
						"originalPrice": {
							"value": 1.00,
							"currency": "RS"
						},
						"totalPrice": {
							"value": 1.0,
							"currency": "R$"
						},
						"productionPoint": "Adicional Composicao A"
					}
				]
			},
			{
				"id": "4",
				"index": "4",
				"name": "AERADO",
				"externalCode": "2",
				"unit": "UN",
				"quantity": 1,
				"specialInstructions": "Teste",
				"unitPrice": {
					"value": 32.99,
					"currency": "R$"
				},
				"optionsPrice": {
					"value": 37.99,
					"currency": "R$"
				},
				"totalPrice": {
					"value": 32.99,
					"currency": "R$"
				},
				"options": [
					{
						"index": "5",
						"id": "5",
						"name": "AVELA",
						"externalCode": "4",
						"unit": "UN",
						"quantity": 1,
						"unitPrice": {
							"value": 37.99,
							"currency": "R$"
						},
						"originalPrice": {
							"value": 37.99,
							"currency": "RS"
						},
						"totalPrice": {
							"value": 37.99,
							"currency": "R$"
						},
						"productionPoint": "Adicional Avela"
					}
				]
			}
		],
		"otherFees": [],
		"discounts": [
			{
				"value": 1,
				"target": "ITEM",
				"targetId": "02",
				"sponsorshipValues": [
					{
						"name": "MARKETPLACE",
						"value": 10.00
					}
				]
			}
		],
		"total": {
			"items": 67.94,
			"otherFees": 38.99,
			"discount": 10.00,
			"orderAmount": 96.93,
			"additionalFees": 0,
			"deliveryFee": 0
		},
		"payments": null,
		"delivery": null,
		"extraInfo": "Teste",
		"schedule": null,
		"indoor": null,
		"takeout": null,
		"table": {
			"waiterCode": "96.93",
			"tableNumber": "8",
			"chairNumber": "1"
		},
		"card": null
	}
}
{
	"errors": [
		{
			"key": "displayId",
			"message": "body.data.displayId must be a string"
		}
	]
}



02. JSON enviando faltando um ou mais campos.

{
	"integrationHubServiceId": "3fea8768-bbd9-454b-9e7b-40841e9a6812",
	"data": {
		"id": "29261444-5ff8-40b2-bce1-42848247d4a2",
		"type": "TABLE",
		"displayId": "8",
		"createdAt": "2024-06-24T17:35:00",
		"orderTiming": "2024-06-24T17:40:24",
		"preparationStartDateTime": "2024-06-24T18:00:00",,
		"items": [
			{
				"id": "2",
				"index": "2",
				"name": "A FRANCESA",
				"externalCode": "1",
				"unit": "UN",
				"quantity": 0.5,
				"specialInstructions": "Teste",
				"unitPrice": {
					"value": 69.90,
					"currency": "R$"
				},
				"optionsPrice": {
					"value": 1.00,
					"currency": "R$"
				},
				"totalPrice": {
					"value": 34.95,
					"currency": "R$"
				},
				"options": [
					{
						"index": "3",
						"id": "3",
						"name": "COMPOSICAO A",
						"externalCode": "201",
						"unit": "UN",
						"quantity": 1,
						"unitPrice": {
							"value": 1.00,
							"currency": "R$"
						},
						"originalPrice": {
							"value": 1.00,
							"currency": "RS"
						},
						"totalPrice": {
							"value": 1.0,
							"currency": "R$"
						},
						"productionPoint": "Adicional Composicao A"
					}
				]
			},
			{
				"id": "4",
				"index": "4",
				"name": "AERADO",
				"externalCode": "2",
				"unit": "UN",
				"quantity": 1,
				"specialInstructions": "Teste",
				"unitPrice": {
					"value": 32.99,
					"currency": "R$"
				},
				"optionsPrice": {
					"value": 37.99,
					"currency": "R$"
				},
				"totalPrice": {
					"value": 32.99,
					"currency": "R$"
				},
				"options": [
					{
						"index": "5",
						"id": "5",
						"name": "AVELA",
						"externalCode": "4",
						"unit": "UN",
						"quantity": 1,
						"unitPrice": {
							"value": 37.99,
							"currency": "R$"
						},
						"originalPrice": {
							"value": 37.99,
							"currency": "RS"
						},
						"totalPrice": {
							"value": 37.99,
							"currency": "R$"
						},
						"productionPoint": "Adicional Avela"
					}
				]
			}
		],
		"otherFees": [],
		"discounts": [
			{
				"value": 1,
				"target": "ITEM",
				"targetId": "02",
				"sponsorshipValues": [
					{
						"name": "MARKETPLACE",
						"value": 10.00
					}
				]
			}
		],
		"total": {
			"items": 67.94,
			"otherFees": 38.99,
			"discount": 10.00,
			"orderAmount": 96.93,
			"additionalFees": 0,
			"deliveryFee": 0
		},
		"payments": null,
		"delivery": null,
		"extraInfo": "Teste",
		"schedule": null,
		"indoor": null,
		"takeout": null,
		"table": {
			"waiterCode": "96.93",
			"tableNumber": "8",
			"chairNumber": "1"
		},
		"card": null
	}
}
{
	"errors": [
		{
			"key": "merchant",
			"message": "body.data.merchant is required"
		}
	]
}




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.


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.




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


https://api-barramento.meuelevestage.com/order/newOrderS
{
	"message": "Missing Authentication Token"
}

O cliente não enviou uma requisição para a URL  incorreta.




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.

{
	"integrationHubServiceId": "f1b874af-96ab-4535-aac3-25118fe586cc",
	"data": {
		"id": "29261444-5ff8-40b2-bce1-42848247d4a2",
		"type": "TABLE",
		"displayId": "8",
		"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": "2",
				"index": "2",
				"name": "A FRANCESA",
				"externalCode": "1",
				"unit": "UN",
				"quantity": 0.5,
				"specialInstructions": "Teste",
				"unitPrice": {
					"value": 69.90,
					"currency": "R$"
				},
				"optionsPrice": {
					"value": 1.00,
					"currency": "R$"
				},
				"totalPrice": {
					"value": 34.95,
					"currency": "R$"
				},
				"options": [
					{
						"index": "3",
						"id": "3",
						"name": "COMPOSICAO A",
						"externalCode": "201",
						"unit": "UN",
						"quantity": 1,
						"unitPrice": {
							"value": 1.00,
							"currency": "R$"
						},
						"originalPrice": {
							"value": 1.00,
							"currency": "RS"
						},
						"totalPrice": {
							"value": 1.0,
							"currency": "R$"
						},
						"productionPoint": "Adicional Composicao A"
					}
				]
			},
			{
				"id": "4",
				"index": "4",
				"name": "AERADO",
				"externalCode": "2",
				"unit": "UN",
				"quantity": 1,
				"specialInstructions": "Teste",
				"unitPrice": {
					"value": 32.99,
					"currency": "R$"
				},
				"optionsPrice": {
					"value": 37.99,
					"currency": "R$"
				},
				"totalPrice": {
					"value": 32.99,
					"currency": "R$"
				},
				"options": [
					{
						"index": "5",
						"id": "5",
						"name": "AVELA",
						"externalCode": "4",
						"unit": "UN",
						"quantity": 1,
						"unitPrice": {
							"value": 37.99,
							"currency": "R$"
						},
						"originalPrice": {
							"value": 37.99,
							"currency": "RS"
						},
						"totalPrice": {
							"value": 37.99,
							"currency": "R$"
						},
						"productionPoint": "Adicional Avela"
					}
				]
			}
		],
		"otherFees": [],
		"discounts": [
			{
				"value": 1,
				"target": "ITEM",
				"targetId": "02",
				"sponsorshipValues": [
					{
						"name": "MARKETPLACE",
						"value": 10.00
					}
				]
			}
		],
		"total": {
			"items": 67.94,
			"otherFees": 38.99,
			"discount": 10.00,
			"orderAmount": 96.93,
			"additionalFees": 0,
			"deliveryFee": 0
		},
		"payments": null,
		"delivery": null,
		"extraInfo": "Teste",
		"schedule": null,
		"indoor": null,
		"takeout": null,
		"table": {
			"waiterCode": "96.93",
			"tableNumber": "8",
			"chairNumber": "1"
		},
		"card": null
	}
}
{
	"errors": [
		{
			"key": "integrationHubServiceId",
			"message": "Provider Merchant for integrationHubServiceId \"f1b874af-96ab-4535-aac3-25118fe586cc\" not found or disabled"
		}
	]
}

IntegrationHubId incorreto ou inválido

Para obter detalhes técnicos sobre o envio de requisições ao endpoint newOrder, incluindo a estrutura do corpo da requisição para varios itens acesse a documentação clicando aqui.

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  acesse a documentação clicando aqui.

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 desconto  acesse a documentação clicando aqui.

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 um de valor integral e outro com valor fracionando, adicionais e desconto  acesse a documentação clicando aqui.



05. LINKS


New Order Mesa - Itens Fracionando
New Order Mesa - Vários Itens