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.

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, como um com valor integral, adicionais e desconto 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": "ab8aa1e73fea8768-cfe2bbd9-4fdf454b-80999e7b-af7da88274ba40841e9a6812a",
	"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.0
			null
	}
			]
		},
		"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": "ab8aa1e7-cfe2-4fdf-8099-af7da88274ba",
	"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": {
					"valueid": 69.90"c312d2ff-1a8f-40ad-8eed-9ae9a908df6e",
					"currencyname": "R$BOTECO DO ALBINO"
				},
				"optionsitems": [
					{
						"indexid": "32",
						"idindex": "32",
						"name": "COMPOSICAOA AFRANCESA",
						"externalCode": "2011",
						"unit": "UN",
						"quantity": 1,
				"specialInstructions": "Teste",
				"unitPrice": {
							"value": 169.0090,
							"currency": "R$"
						},
						"originalPriceoptionsPrice": {
							"value": 1.00,
							"currency": "RSR$"
						},
						"totalPrice": {
							"value": 169.090,
							"currency": "R$"
						},
						"productionPointoptions": "Adicional Composicao A"[
					}{
				]
			}"index": "3",
			{
				"id": "43",
						"indexname": "4COMPOSICAO A",
						"nameexternalCode": "AERADO201",
						"externalCodeunit": "2UN",
						"unitquantity": "UN",
1,
						"unitPrice": {
							"quantityvalue": 1.00,
							"specialInstructionscurrency": "Teste"R$"
						},
						"unitPriceoriginalPrice": {
							"value": 321.9900,
							"currency": "R$RS"
						},
						"optionsPricetotalPrice": {
							"value": 371.990,
							"currency": "R$"
						},
						"totalPriceproductionPoint": { "Adicional Composicao A"
					}
				]
			},
			"value": 32.99,{
					"currencyid": "R$4",
				}"index": "4",
				"optionsname": ["AERADO",
					{
	"externalCode": "2",
					"indexunit": "5UN",
						"idquantity": "5"1,
						"namespecialInstructions": "AVELATeste",
						"externalCodeunitPrice": "4",{
						"unitvalue": "UN"32.99,
						"quantitycurrency": 1,"R$"
				},
				"unitPriceoptionsPrice": {
							"value": 37.99,
							"currency": "R$"
						},
						"originalPricetotalPrice": {
							"value": 3732.99,
							"currency": "RSR$"
						},
						"totalPriceoptions": [
					{
							"valueindex": 37.99"5",
							"currencyid": "R$"
						}5",
						"productionPointname": "Adicional Avela"
					}
				]AVELA",
			}
		],
		"otherFeesexternalCode": []"4",
						"discountsunit": ["UN",
			{
				"valuequantity": 1,
						"targetunitPrice": "ITEM",{
							"targetIdvalue": "02"37.99,
							"sponsorshipValuescurrency": ["R$"
					{	},
						"nameoriginalPrice": "MARKETPLACE",{
							"value": 1037.0099,
							}"currency": "RS"
				]
			},
		],
				"totaltotalPrice": {
			"items": 102.89,
				"otherFeesvalue": 3837.99,
							"discountcurrency": 10.00,"R$"
			"orderAmount": 131.88			},
						"additionalFeesproductionPoint": 0, "Adicional Avela"
			"deliveryFee": 0
		},
		"payments": {		]
			"prepaid": 0.0}
		],
			"pendingotherFees": 0.0[],
			"methodsdiscounts": [
				{
					"value": 131.88 1,
					"currencytarget": "BRLITEM",
					"typetargetId": "PREPAID02",
					"methodsponsorshipValues": "credit",[
					{
						"methodInfoname": "VisaMARKETPLACE",
						"changeForvalue": 010.000
				}
			]
		},
		"delivery": null,
		"extraInfo": "Teste",
		"schedule": null,
		"indoor": null,
		"takeout": null		]
			}
		],
		"tabletotal": {
			"waiterCodeitems": "131102.88"89,
			"tableNumberotherFees": "8"38.99,
			"chairNumberdiscount": "1"
		}10.00,
		"card": null
	}
}
Bloco de código
titleJSON Resposta
linenumberstrue
{
	"errors": [
		{"orderAmount": 131.88,
			"keyadditionalFees": "displayId"0,
			"message": "body.data.displayId must be a string"deliveryFee": 0
		},
	]
}

02. JSON enviando faltando um ou mais campos.

Bloco de código
titleJSON Inválido
linenumberstrue
{
	"integrationHubServiceId": "ab8aa1e7-cfe2-4fdf-8099-af7da88274ba	"payments": null,
		"delivery": null,
		"extraInfo": "Teste",
		"dataschedule": {null,
		"idindoor": "29261444-5ff8-40b2-bce1-42848247d4a2"null,
		"typetakeout": "TABLE"null,
		"displayIdtable": "8",{
			"createdAtwaiterCode": "2024-06-24T17:35:00131.88",
			"orderTimingtableNumber": "2024-06-24T17:40:248",
			"preparationStartDateTimechairNumber": "2024-06-24T18:00:00"1"
		},
		"itemscard": [null
			}
}
Bloco de código
titleJSON Resposta
linenumberstrue
{
				"iderrors": "2",[
		{
			"indexkey": "2displayId",
				"namemessage": "A FRANCESA",body.data.displayId must be a string"
		}
	]
}


...

02. JSON enviando faltando um ou mais campos.

Bloco de código
titleJSON Inválido
linenumberstrue
{
	"externalCodeintegrationHubServiceId": "13fea8768-bbd9-454b-9e7b-40841e9a6812a",
				"unitdata": "UN",{
				"quantityid": 1"29261444-5ff8-40b2-bce1-42848247d4a2",
				"specialInstructionstype": "TesteTABLE",
				"unitPricedisplayId": {
					"value": 69.90"8",
					"currencycreatedAt": "R$"
				}2024-06-24T17:35:00",
				"optionsPriceorderTiming": {
					"value": 1.00,
					"currency": "R$"
				},
				"totalPrice": "2024-06-24T17:40:24",
		"preparationStartDateTime": "2024-06-24T18:00:00",
		"items": [
			{
					"valueid": 69.90"2",
					"currencyindex": "R$2",
				}"name": "A FRANCESA",
				"optionsexternalCode": ["1",
					{
						"index"unit": "3UN",
						"idquantity": "3"1,
						"namespecialInstructions": "COMPOSICAO ATeste",
						"externalCodeunitPrice": "201",{
						"unitvalue": "UN"69.90,
						"quantitycurrency": 1,"R$"
				},
				"unitPriceoptionsPrice": {
							"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
	}
}

...

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
titleIntegration Hub Code Inválido
linenumberstrue
{
	"integrationHubServiceId": "eb44402af1b874af-582896ab-48dc4535-a5e9aac3-15549de7fad525118fe586cc",
	"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,{
				"specialInstructionsid": "Teste4",
				"unitPriceindex": {"4",
					"valuename": 32.99"AERADO",
					"currencyexternalCode": "R$"
				}2",
				"optionsPriceunit": {"UN",
					"valuequantity": 37.991,
					"currencyspecialInstructions": "R$"
				}Teste",
				"totalPriceunitPrice": {
					"value": 32.99,
					"currency": "R$"
				},
				"optionsoptionsPrice": [
					{
						"indexvalue": "5"37.99,
						"idcurrency": "5"R$"
				},
						"nametotalPrice": "AVELA",{
						"externalCodevalue": "4"32.99,
						"unitcurrency": "UNR$",
				},
				"quantityoptions": 1,[
						"unitPrice": {
							"valueindex": 37.99"5",
							"currencyid": "R$"
						}5",
						"originalPricename": {"AVELA",
							"valueexternalCode": 37.99"4",
							"currencyunit": "RSUN",
						}	"quantity": 1,
						"totalPriceunitPrice": {
							"value": 37.99,
							"currency": "R$"
						},
						"productionPointoriginalPrice": "Adicional Avela"{
					}
				]"value": 37.99,
			}
		],
		"otherFeescurrency": [],
		"discounts": ["RS"
			{
				"value": 1},
						"targettotalPrice": "ITEM",{
				"targetId": "02",
				"sponsorshipValuesvalue": [37.99,
					{
						"namecurrency": "MARKETPLACE"R$"
						},
						"valueproductionPoint": 10.00 "Adicional Avela"
					}
				]
			}
		],
		"totalotherFees": {[],
			"itemsdiscounts": 102.89,[
			"otherFees": 38.99,{
				"discountvalue": 10.001,
				"orderAmounttarget": 131.88"ITEM",
				"additionalFeestargetId": 0"02",
				"deliveryFeesponsorshipValues": 0[
		},
			{
						"paymentsname": {
"MARKETPLACE",
						"prepaidvalue": 010.0,00
			"pending": 0.0,		}
			"methods": [	]
			}
		{],
		"total": {
			"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
	}
}
Bloco de código
titleJSON Response
linenumberstrue
{
	"errors": [
		{
			"key": "integrationHubServiceId",
			"message": "Provider Merchant for integrationHubServiceId \"eb44402af1b874af-582896ab-48dc4535-a5e9aac3-15549de7fad525118fe586cc\" not found or disabled"
		}
	]
}
		}
	]
}
Nota
titleNota: HTTP Status Code = 404 - Not Found

IntegrationHubId incorreto ou inválido

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 vários itens  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 varios itens com valor integral e adicionais  acesse a documentação clicando aqui.

Nota
titleNota: HTTP Status Code = 404 - Not Found

IntegrationHubId incorreto ou inválido

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


...




Templatedocumentos