Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

CONTEÚDO - NÃO MEXE API


01. VISÃO GERAL
Âncora
ver_geral
ver_geral

Esta documentação tem como finalidade demonstrar o formato JSON para envio de requisições de pedidos com vários itens na API Order Mesa, utilizando o endpoint newOrder.


...

02. ENDPOINT
Âncora
endpoint
endpoint


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


...

03. EXEMPLO DE UTILIZAÇÃO
Âncora
varios_itens
varios_itens

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

Bloco de código
titleJSON da requisição do vários itens no pedido
linenumberstrue
{
	"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": 1,
				"specialInstructions": "Teste",
				"unitPrice": {
					"value": 69.90,
					"currency": "R$"
				},
				"optionsPrice": {
					"value": 1.00,
					"currency": "R$"
				},
				"totalPrice": {
					"value": 69.90,
					"currency": "R$"
				}
			},
			{
				"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$"
				}
			}
		],
		"otherFees": [],
		"discounts": [],
		"total": {
			"items": 102.89,
			"otherFees": 38.99,
			"discount": 0.00,
			"orderAmount": 141.88,
			"additionalFees": 0,
			"deliveryFee": 0
		},
		"payments": {null,
			"prepaiddelivery": 0.0null,
			"pendingextraInfo": 0.0"Teste",
			"methodsschedule": [null,
				{"indoor": null,
					"valuetakeout":  141.88null,
		"table": {
			"currencywaiterCode": "BRL141.88",
					"typetableNumber": "PREPAID8",
					"methodchairNumber": "credit1",
					"methodInfo": "Visa"},
					"changeForcard": 0.0null
				}
			]
		},
		"delivery": null,
		"extraInfo": "Teste",
		"schedule": null,
		"indoor": null,
		"takeout": null,
		"table": {
			"waiterCode": "141.88",
			"tableNumber": "8",
			"chairNumber": "1"
		},
		"card": null
	}
}
Nota
titleNota: HTTP Status Code = 200 OK

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:

...

}
Nota
titleNota: HTTP Status Code = 200 OK

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


...

04. ERROS
Âncora
erros
erros

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.

01. Formando inválido do JSON esperado.

Bloco de código
titleJSON Inválido
linenumberstrue
{
	"integrationHubServiceId": "3fea8768-bbd9-454b-9e7b-40841e9a6812a",
	"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

...

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.

Bloco de código
titleJSON Inválido
linenumberstrue
{
	"integrationHubServiceId": "3fea8768-bbd9-454b-9e7b-40841e9a6812a",
	"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": 1,
				"specialInstructions": "Teste",
				"unitPrice": {
					"value": 69.90,
					"currency": "R$"
				},
				"optionsPrice": {
					"value": 1.00,
					"currency": "R$"
				},
				"totalPrice": {
					"value": 69.90,
					"currency": "R$"
				}
			},
			{
				"id": "4",
				"index": "4",
				"name": "AERADO",
				"externalCode": "2",
				"unit": "UN",
				"quantity": 1,
				"specialInstructions": "Teste",
				"unitPriceindex": {
					"value": 32.99"2",
					"currencyname": "R$A FRANCESA",
				}"externalCode": "1",
				"optionsPriceunit": {"UN",
					"valuequantity": 37.991,
					"currencyspecialInstructions": "R$"
				}Teste",
				"totalPriceunitPrice": {
					"value": 3269.9990,
					"currency": "R$"
				},
				}
"optionsPrice": {
			],
		"otherFeesvalue": []1.00,
					"discountscurrency": []"R$"
				},
				"totaltotalPrice": {
					"itemsvalue": 10269.8990,
					"otherFeescurrency": 38.99,"R$"
				}
			"discount": 0.00},
			"orderAmount": 141.88,
{
				"additionalFeesid": 0"4",
				"deliveryFeeindex": 0"4",
		},
		"paymentsname": {"AERADO",
				"prepaidexternalCode": 0.0"2",
				"pendingunit": 0.0"UN",
				"methodsquantity": [1,
				{
	"specialInstructions": "Teste",
				"valueunitPrice":  141.88,{
					"currencyvalue": "BRL"32.99,
					"typecurrency": "PREPAID"R$"
				},
					"methodoptionsPrice": "credit",{
					"methodInfovalue": "Visa"37.99,
					"changeForcurrency": 0.0"R$"
				},
				]"totalPrice": {
		},
			"deliveryvalue": null32.99,
					"extraInfocurrency": "Teste",
		"schedule": nullR$"
				}
			}
		],
		"indoorotherFees": null[],
		"takeoutdiscounts": null[],
		"tabletotal": {
			"waiterCodeitems": "141102.88"89,
			"tableNumberotherFees": "8"38.99,
			"chairNumberdiscount": "1"
		},
		"card": null
	}
}
Bloco de código
titleJSON Resposta
linenumberstrue
{
	"errors": [
		{
			"key": "displayId"0.00,
			"orderAmount": 141.88,
			"additionalFees": 0,
			"messagedeliveryFee": "body.data.displayId must be a string"0
		},
	]
}

02. JSON enviando faltando um ou mais campos.

Bloco de código
titleJSON Inválido
linenumberstrue
{
	"integrationHubServiceIdpayments": "3fea8768-bbd9-454b-9e7b-40841e9a6812"null,
		"datadelivery": {null,
		"idextraInfo": "29261444-5ff8-40b2-bce1-42848247d4a2Teste",
		"typeschedule": "TABLE"null,
		"displayIdindoor": "8"null,
		"createdAttakeout": "2024-06-24T17:35:00"null,
		"orderTimingtable": "2024-06-24T17:40:24",{
			"preparationStartDateTimewaiterCode": "2024-06-24T18:00:00141.88",
			"itemstableNumber": [
			{"8",
				"idchairNumber": "21",
		},
		"indexcard": "2",
	null
	}
}
Bloco de código
titleJSON Resposta
linenumberstrue
{
	"errors": [
		{
			"namekey": "A FRANCESAdisplayId",
				"externalCodemessage": "1",body.data.displayId must be a string"
		}
	]
}


...


02. JSON enviando faltando um ou mais campos.

Bloco de código
titleJSON Inválido
linenumberstrue
{
	"unitintegrationHubServiceId": "UN3fea8768-bbd9-454b-9e7b-40841e9a6812",
			
	"quantitydata": 1,{
				"specialInstructionsid": "Teste29261444-5ff8-40b2-bce1-42848247d4a2",
				"unitPricetype": {
					"value": 69.90"TABLE",
					"currencydisplayId": "R$"
				}8",
				"optionsPricecreatedAt": {
					"value": 1.00"2024-06-24T17:35:00",
					"currencyorderTiming": "R$"
				},
		2024-06-24T17:40:24",
		"totalPricepreparationStartDateTime": {
					"value": 69.90,
					"currency": "R$"
				}
			},"2024-06-24T18:00:00",
		"items": [
			{
				"id": "42",
				"index": "42",
				"name": "AERADOA FRANCESA",
				"externalCode": "21",
				"unit": "UN",
				"quantity": 1,
				"specialInstructions": "Teste",
				"unitPrice": {
					"value": 3269.9990,
					"currency": "R$"
				},
				"optionsPrice": {
					"value": 371.9900,
					"currency": "R$"
				},
				"totalPrice": {
					"value": 3269.9990,
					"currency": "R$"
				}
				},
			}{
		],
		"otherFeesid": []"4",
		"discounts": [],
		"totalindex": {
			"items4": 102.89,
				"otherFeesname": 38.99"AERADO",
				"discountexternalCode": 0.00"2",
				"orderAmountunit": 141.88"UN",
				"additionalFeesquantity": 01,
				"deliveryFeespecialInstructions": 0"Teste",
		},
		"paymentsunitPrice": {
					"prepaidvalue": 032.099,
					"pendingcurrency": 0.0"R$"
				},
				"methodsoptionsPrice": [
				{
					"value":  14137.8899,
					"currency": "BRLR$",
					"type": "PREPAID"},
					"methodtotalPrice": "credit",{
					"methodInfovalue": "Visa"32.99,
					"changeForcurrency": 0.0"R$"
				}
			]
		},
		"delivery": null,
		"extraInfo": "Teste",	}
		"schedule": null],
		"indoorotherFees": null[],
		"takeoutdiscounts": null[],
		"tabletotal": {
			"waiterCodeitems": "141102.88"89,
			"tableNumberotherFees": "8"38.99,
			"chairNumberdiscount": "1"0.00,
		}	"orderAmount": 141.88,
			"cardadditionalFees": null
	}
}
Bloco de código
titleJSON Resposta
linenumberstrue
{
	"errors0,
			"deliveryFee": [0
		{},
			"keypayments": null,
		"merchantdelivery": null,
			"messageextraInfo": "body.data.merchant is required"Teste",
		}
	]
}

...

"schedule": null,
		"indoor": null,
		"takeout": null,
		"table": {
			"waiterCode": "141.88",
			"tableNumber": "8",
			"chairNumber": "1"
		},
		"card": null
	}
}
Bloco de código
titleJSON Resposta
linenumberstrue
{
	"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.

Nota
titleNota: 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 - ForbiddenHTTP Status Code 401 - Unauthorized
    Âncora
    status_code_
    403
    401
    status_code_
    403
    401
     

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
titleURL enviada incorreda
https://api-barramento.meuelevestage.com/order/newOrderS

...

titleJSON Response para URL incorreta
linenumberstrue

...

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
titleNota: HTTP Status Code = 403 - Forbidden401 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 novamenteO cliente não enviou uma requisição para a URL  incorreta.


...


  • HTTP Status Code 404 403 - Not FoundForbidden
    Âncora
    status_code_404403
    status_code_404403

O código de status HTTP 404403, conhecido como "Not FoundForbidden" (Não EncontradoProibido), indica que o servidor não encontrou o recurso solicitado. Isso pode ocorrer quando o integrationHubId  está incorreto ou inválido.entendeu a requisição do cliente por está tentando acessar uma URL incorreta.

Bloco de código
titleURL enviada incorreda
https://api-barramento.meuelevestage.com/order/newOrderS
Bloco de código
titleIntegration Hub Code InválidoJSON Response para URL incorreta
linenumberstrue
{
	"integrationHubServiceIdmessage": "Missing Authentication Token"
}
Nota
titleNota: 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
titleIntegration Hub Code Inválido
linenumberstrue
{
	"integrationHubServiceId": "709aa0b2-2b89-4d06-9f12-c3b8c275d9fa",
	"data": {
709aa0b2-2b89-4d06-9f12-c3b8c275d9fa",
	"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": "c312d2ff29261444-1a8f5ff8-40ad40b2-8eedbce1-9ae9a908df6e42848247d4a2",
			"nametype": "BOTECO DO ALBINOTABLE",
		}"displayId": "8",
		"itemscreatedAt": [
			{
				"id"2024-06-24T17:35:00",
		"orderTiming": "22024-06-24T17:40:24",
				"indexpreparationStartDateTime": "22024-06-24T18:00:00",
				"namemerchant": "A FRANCESA",
	{
			"externalCodeid": "1c312d2ff-1a8f-40ad-8eed-9ae9a908df6e",
				"unitname": "UNBOTECO DO ALBINO",
		},
		"quantityitems": 1,[
				"specialInstructions": "Teste",{
				"unitPriceid": {"2",
					"valueindex": 69.90"2",
					"currencyname": "R$A FRANCESA",
				}"externalCode": "1",
				"optionsPriceunit": {"UN",
					"valuequantity": 1.00,
					"currencyspecialInstructions": "R$"
				}Teste",
				"totalPriceunitPrice": {
					"value": 69.90,
					"currency": "R$"
				},
			},
				"optionsPrice": {
					"idvalue": "4"1.00,
					"indexcurrency": "4"R$"
				},
				"nametotalPrice": "AERADO",{
					"externalCodevalue": "2"69.90,
					"unitcurrency": "UNR$",
				"quantity": 1}
			},
			{
				"specialInstructionsid": "Teste4",
				"unitPriceindex": {
					"value": 32.99"4",
					"currencyname": "R$AERADO",
				}"externalCode": "2",
				"optionsPriceunit": {"UN",
					"valuequantity": 37.991,
					"currencyspecialInstructions": "R$"
				}Teste",
				"totalPriceunitPrice": {
					"value": 32.99,
					"currency": "R$"
				}
			}
		],
		"otherFees": [],
		"discounts": [],
		"totaloptionsPrice": {
					"itemsvalue": 10237.8999,
					"otherFeescurrency": 38.99"R$"
				},
				"discounttotalPrice": 0.00,{
					"orderAmountvalue": 14132.8899,
					"additionalFeescurrency": 0,"R$"
				"deliveryFee": 0
}
			},
		"payments": {
	],
		"prepaidotherFees": 0.0[],
			"pendingdiscounts": 0.0[],
			"methodstotal": [
				{
					"valueitems":  141102.8889,
					"currencyotherFees": "BRL"38.99,
					"typediscount": "PREPAID"0.00,
					"methodorderAmount": "credit"141.88,
					"methodInfoadditionalFees": "Visa"0,
					"changeFordeliveryFee": 0.0
				},
			]
		}"payments": null,
		"delivery": null,
		"extraInfo": "Teste",
		"schedule": null,
		"indoor": null,
		"takeout": null,
		"table": {
			"waiterCode": "141.88",
			"tableNumber": "8",
			"chairNumber": "1"
		},
		"card": null
	}
}

...

Dica
titleSaiba mais!

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 com valor integral e adcional  acesse a documentação clicando aqui.

Dica
titleSaiba mais!

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.

Dica
titleSaiba mais!

Para obter detalhes técnicos sobre o envio de requisições ao endpoint newOrder, incluindo a estrutura do corpo da requisição para itens um com valor integral outro fracionado, adicionais e descontos  acesse a documentação clicando aqui.

...




Templatedocumentos