Páginas filhas
  • New Order Mesa - Vários Itens com Valor Integral, Adicionais e Desconto

Versões comparadas

Chave

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

...

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

...

Bloco de código
titleJSON da requisição do vários itens no pedido
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$"
				},
				"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": 102.89,
			"otherFees": 38.99,
			"discount": 10.00,
			"orderAmount": 131.88,
			"additionalFees": 0,
			"deliveryFee": 0
		},
		"payments": {null,
			"prepaiddelivery": 0.0null,
			"pendingextraInfo": 0.0"Teste",
			"methodsschedule": [null,
				{"indoor": null,
					"valuetakeout": 131.88null,
					"currencytable": "BRL",{
					"typewaiterCode": "PREPAID8",
					"methodtableNumber": "credit8",
					"methodInfochairNumber": "Visa1",
		},
			"changeForcard": 0.0null
				}
			]
		},
		"delivery": null,
		"extraInfo": "Teste",
		"schedule": null,
		"indoor": null,
		"takeout": null,
		"table": {
			"waiterCode": "131.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

...

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": "29261444c312d2ff-5ff81a8f-40b240ad-bce18eed-42848247d4a29ae9a908df6e",
			"typename": "TABLE"BOTECO DO ALBINO"
		},
		"displayIditems": 8,[
			{
				"createdAtid": "2024-06-24T17:35:002",
				"orderTimingindex": "2024-06-24T17:40:242",
				"preparationStartDateTimename": "2024-06-24T18:00:00A FRANCESA",
				"merchantexternalCode": {"1",
				"idunit": "c312d2ff-1a8f-40ad-8eed-9ae9a908df6eUN",
				"namequantity": "BOTECO DO ALBINO"1,
		},
		"itemsspecialInstructions": ["Teste",
				"unitPrice": {
					"idvalue": "2"69.90,
					"indexcurrency": "2"R$"
				},
				"nameoptionsPrice": "A FRANCESA",{
					"externalCodevalue": "1".00,
					"unitcurrency": "UNR$",
				"quantity": 1},
				"specialInstructionstotalPrice": "Teste",
				"unitPrice": {
					"value": 69.90,
					"currency": "R$"
				},
				"optionsPriceoptions": [
					{
						"valueindex": 1.00"3",
						"currencyid": "R$3",
				},
				"totalPricename": { "COMPOSICAO A",
						"valueexternalCode": 69.90"201",
						"currencyunit": "R$UN",
				},
				"optionsquantity": [1,
					{
						"index	"unitPrice": "3",{
						"id": "3",
						"namevalue": "COMPOSICAO A"1.00,
						"externalCode": "201",
						"unitcurrency": "UNR$",
						"quantity": 1},
						"unitPriceoriginalPrice": {
							"value": 1.00,
							"currency": "R$RS"
						},
						"originalPricetotalPrice": {
							"value": 1.000,
							"currency": "RSR$"
						},
						"totalPriceproductionPoint": { "Adicional Composicao A"
							"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": 102.89,
			"otherFees": 38.99,
			"discount": 10.00,
			"orderAmount": 131.88,
			"additionalFees": 0,
			"deliveryFee": 0
		},
		"payments": {null,
			"prepaiddelivery": 0.0null,
			"pendingextraInfo": 0.0"Teste",
			"methodsschedule": [null,
		"indoor": null,
		{"takeout": null,
		"table": {
			"valuewaiterCode": "131.88",
					"currencytableNumber": "BRL8",
					"typechairNumber": "PREPAID1",
		},
			"methodcard": "credit",null
	}
}
Bloco de código
titleJSON Resposta
linenumberstrue
{
	"errors": [
		{
			"methodInfokey": "VisadisplayId",
					"changeFormessage": 0.0"body.data.displayId must be a string"
				}
			]
}


...

02. JSON enviando faltando um ou mais campos.

Bloco de código
titleJSON Inválido
linenumberstrue
{
	"integrationHubServiceId": "3fea8768-bbd9-454b-9e7b-40841e9a6812a",
	"data": {		},
		"delivery": null,
		"extraInfoid": "Teste29261444-5ff8-40b2-bce1-42848247d4a2",
		"scheduletype": null"TABLE",
		"indoordisplayId": null"8",
		"takeoutcreatedAt": null"2024-06-24T17:35:00",
		"tableorderTiming": {"2024-06-24T17:40:24",
			"waiterCodepreparationStartDateTime": "131.882024-06-24T18:00:00",
		"items": [
			{
				"tableNumberid": "82",
				"chairNumberindex": "12",
		},
		"cardname": null
	}
}
Bloco de código
titleJSON Resposta
linenumberstrue
{
	"errors": [
		{"A FRANCESA",
				"externalCode": "1",
				"unit": "UN",
				"quantity": 1,
				"keyspecialInstructions": "displayIdTeste",
				"messageunitPrice": "body.data.displayId must be a string{
					"value": 69.90,
					"currency": "R$"
				},
	]
}

02. JSON enviando faltando um ou mais campos.

Bloco de código
titleJSON Inválido
linenumberstrue
{
	"integrationHubServiceId": "3fea8768-bbd9-454b-9e7b-40841e9a6812a",
	"data			"optionsPrice": {
					"idvalue": "29261444-5ff8-40b2-bce1-42848247d4a2"1.00,
					"typecurrency": "TABLE"R$"
				},
				"displayIdtotalPrice": "8",{
					"createdAtvalue": "2024-06-24T17:35:00"69.90,
					"orderTimingcurrency": "2024-06-24T17:40:24",
		"preparationStartDateTime": "2024-06-24T18:00:00"R$"
				},
				"itemsoptions": [
					{
						"idindex": "23",
						"indexid": "23",
						"name": "COMPOSICAO A FRANCESA",
						"externalCode": "1201",
						"unit": "UN",
						"quantity": 1,
						"specialInstructionsunitPrice": "Teste",{
				"unitPrice": {
					"value": 691.9000,
							"currency": "R$"
						},
						"optionsPriceoriginalPrice": {
							"value": 1.00,
							"currency": "R$RS"
						},
						"totalPrice": {
							"value": 691.900,
							"currency": "R$"
						},
						"optionsproductionPoint": ["Adicional Composicao A"
					{}
				]
		"index": "3"	},
			{
				"id": "34",
						"nameindex": "COMPOSICAO A4",
						"externalCodename": "201AERADO",
				"externalCode": "2",
				"unit": "UN",
						"quantity": 1,
				"specialInstructions": "Teste",
				"unitPrice": {
							"value": 132.0099,
							"currency": "R$"
						},
						"originalPriceoptionsPrice": {
							"value": 137.0099,
							"currency": "RSR$"
						},
						"totalPrice": {
							"value": 132.099,
							"currency": "R$"
						},
						"productionPointoptions": "Adicional Composicao A"[
					}{
				]
			},
			{
"index": "5",
						"id": "45",
				"index": "4",
				"name": "AERADOAVELA",
						"externalCode": "24",
						"unit": "UN",
						"quantity": 1,
				"specialInstructions": "Teste",
				"unitPrice": {
							"value": 3237.99,
							"currency": "R$"
						},
						"optionsPriceoriginalPrice": {
							"value": 37.99,
							"currency": "R$RS"
						},
						"totalPrice": {
							"value": 3237.99,
							"currency": "R$"
						},
						"optionsproductionPoint": "Adicional [Avela"
					{}
				]
		"index	}
		],
		"otherFees": "5"[],
						"iddiscounts": "5",[
			{
				"namevalue": "AVELA"1,
						"externalCodetarget": "4ITEM",
						"unittargetId": "UN02",
						"quantitysponsorshipValues": 1,[
						"unitPrice": {
							"valuename": 37.99"MARKETPLACE",
							"currencyvalue": "R$"10.00
						},
				]
		"originalPrice"	}
		],
		"total": {
			"items": 102.89,
				"valueotherFees": 3738.99,
							"currencydiscount": "RS"
						}10.00,
						"totalPriceorderAmount": {
				131.88,
			"valueadditionalFees": 37.990,
							"currencydeliveryFee": "R$"
				0
		},
						"productionPointpayments": "Adicional Avela"null,
					}"delivery": null,
				]"extraInfo": "Teste",
			}"schedule": null,
		]"indoor": null,
		"otherFeestakeout": []null,
		"discountstable": [
			{
				"valuewaiterCode": 1"131.88",
				"targettableNumber": "ITEM8",
				"targetIdchairNumber": "021",
		},
		"sponsorshipValuescard": [null
					{
						"name": "MARKETPLACE",
						"value": 10.00
					}
				]
			}
		],
		"total": {
			"items": 102.89}
}
Bloco de código
titleJSON Resposta
linenumberstrue
{
	"errors": [
		{
			"key": "merchant",
			"otherFeesmessage": 38.99,"body.data.merchant is required"
			"discount": 10.00,
			"orderAmount": 131.88,
			"additionalFees": 0,
			"deliveryFee": 0
		},
		"payments": {
			"prepaid": 0.0,
			"pending": 0.0,
			"methods": [
				{
					"value": 131.88,
					"currency": "BRL",
					"type": "PREPAID",
					"method": "credit",
					"methodInfo": "Visa",
					"changeFor": 0.0
				}
			]
		},
		"delivery": null,
		"extraInfo": "Teste",
		"schedule": null,
		"indoor": null,
		"takeout": null,
		"table": {
			"waiterCode": "131.88",
			"tableNumber": "8",
			"chairNumber": "1"
		},
		"card": null
	}
}
Bloco de código
titleJSON Resposta
linenumberstrue
{
	"errors": [
		{
			"key": "merchant",
			"message": "body.data.merchant is required"
		}
	]
}

...

}
	]
}


...


  • 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
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 - 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
titleURL enviada incorreda
https://api-barramento.meuelevestage.com/order/newOrderS
Bloco de código
titleJSON Response para URL incorreta
linenumberstrue
{
	"message": "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": "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": 1,
				"specialInstructions": "Teste",
				"unitPrice": {
					"value": 69.90,
					"currency": "R$"
				},
				"optionsPrice

...

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.

...

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
Bloco de código
titleJSON Response para URL incorreta
linenumberstrue
{
	"message": "Missing Authentication Token"
}
Nota
titleNota: HTTP Status Code = 403 - Forbidden

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.

Bloco de código
titleIntegration Hub Code Inválido
linenumberstrue
{
	"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": 1,
				"specialInstructions": "Teste",
				"unitPrice": {
					"value": 69.90,
					"currency": "R$"
				},
				"optionsPrice": {
					"value": 1.00,
					"currency": "R$"
				},
				"totalPrice": {
					"value": 69.90,
					"currency": "R$"
				},
				"options": [
					{
						"index": "3",
						"id": "3",
						"name": "COMPOSICAO A",
						"externalCode": "201",
						"unit": "UN",
						"quantity": 1,
						"unitPrice": {
							"value": 1.00,
							"currency": "R$"
						},
						"originalPricetotalPrice": {
							"value": 169.0090,
							"currency": "RSR$"
						},
						"totalPriceoptions": [
					{
							"valueindex": 1.0"3",
							"currencyid": "R$"
						}3",
						"productionPointname": "AdicionalCOMPOSICAO Composicao A",
						}"externalCode": "201",
				]
			}"unit": "UN",
			{
				"idquantity": "4"1,
						"indexunitPrice": "4",{
							"namevalue": "AERADO"1.00,
							"externalCodecurrency": "2"R$"
						},
						"unitoriginalPrice": "UN",
{
							"quantityvalue": 1.00,
							"specialInstructionscurrency": "Teste"RS"
						},
						"unitPricetotalPrice": {
							"value": 321.990,
							"currency": "R$"
						},
						"optionsPriceproductionPoint": {"Adicional Composicao A"
					}
				]
			"value": 37.99},
			{
				"currencyid": "R$4",
				}"index": "4",
				"totalPricename": {"AERADO",
					"valueexternalCode": 32.99"2",
					"currencyunit": "R$UN",
				}"quantity": 1,
				"optionsspecialInstructions": ["Teste",
					"unitPrice": {
						"indexvalue": "5"32.99,
						"idcurrency": "5R$",
				},
				"nameoptionsPrice": "AVELA",{
						"externalCodevalue": "4"37.99,
						"unitcurrency": "UNR$",
						"quantity": 1},
						"unitPricetotalPrice": {
							"value": 3732.99,
							"currency": "R$"
						},
						"originalPriceoptions": [
					{
							"valueindex": 37.99"5",
							"currencyid": "RS"
						}5",
						"totalPricename": {"AVELA",
							"valueexternalCode": 37.99"4",
							"currencyunit": "R$UN",
						}"quantity": 1,
						"productionPointunitPrice": "Adicional Avela"{
					}
				]"value": 37.99,
			}
		],
		"otherFeescurrency": []"R$"
						},
						"discountsoriginalPrice": [{
			{
				"value": 137.99,
							"targetcurrency": "ITEMRS",
					"targetId": "02"	},
						"sponsorshipValuestotalPrice": [{
					{
		"value": 37.99,
							"namecurrency": "MARKETPLACE"R$"
						},
						"valueproductionPoint": 10.00"Adicional Avela"
					}
				]
			}
		],
			"otherFees": [],
		"totaldiscounts": [
			{
				"itemsvalue": 102.891,
				"otherFeestarget": 38.99"ITEM",
				"discounttargetId": 10.00"02",
				"orderAmountsponsorshipValues": 131.88,[
					{
						"additionalFeesname": 0"MARKETPLACE",
						"deliveryFeevalue": 0
10.00
					},
		"payments": {
			"prepaid": 0.0,
			"pending": 0.0]
			}
		],
			"methodstotal": [
				{
					"valueitems": 131102.8889,
					"currencyotherFees": "BRL"38.99,
					"typediscount": "PREPAID"10.00,
					"methodorderAmount": "credit"131.88,
					"methodInfoadditionalFees": "Visa"0,
					"changeFordeliveryFee": 0.0
				},
			]
		}"payments": null,
		"delivery": null,
		"extraInfo": "Teste",
		"schedule": null,
		"indoor": null,
		"takeout": null,
		"table": {
			"waiterCode": "131.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 itens com um de valor integral e outro com valor fracionando, adicionais e desconto  acesse a documentação clicando aqui.


...

...