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

Este endpoint é utilizado Esta documentação tem como finalidade demonstrar o formato JSON para envio de requisições de requisição para novos pedidos com vários itens na API Order mesa via barramentMesa, 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": "82b90dff3fea8768-6d68bbd9-4fd1454b-8c599e7b-5f6623d2d45f40841e9a6812",
	"data": {
		"id": "9c3a693829261444-1e435ff8-4ed440b2-a6b6bce1-16560c43cf6842848247d4a2",
		"type": "TABLE",
		"displayId": "38",
		"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": "152",
				"index": "152",
				"name": "A FRANCESA",
				"externalCode": "1",
				"unit": "UN",
				"quantity": 1,
				"specialInstructions": "Teste",
				"unitPrice": {
					"value": 69.90,
					"currency": "R$"
				},
				"optionsPrice": {
					"value": 01.00,
					"currency": "R$"
				},
				"totalPrice": {
					"value": 69.90,
					"currency": "R$"
				}
			},
			{
				"id": "174",
				"index": "174",
				"name": "MARACUJAAERADO",
				"externalCode": "582",
				"unit": "UN",
				"quantity": 1,
				"specialInstructions": "Teste",
				"unitPrice": {
					"value": 6132.0099,
					"currency": "R$"
				},
				"optionsPrice": {
					"value": 037.0099,
					"currency": "R$"
				},
				"totalPrice": {
					"value": 6132.0099,
					"currency": "R$"
				}
			}
		],
		 "otherFees": [],
		 "discounts": [],
		"total": {
			"items": 130102.9089,
			"otherFees": 038.0099,
			"discount": 0.00,
			"orderAmount": 130141.9088,
			"additionalFees": 0,
			"deliveryFee": 0
		},
		"payments": {null,
			"prepaiddelivery": 0.0null,
			"pendingextraInfo": 0.0"Teste",
			"methodsschedule": [null,
				{
					"value"indoor": 130.90null,
					"currency""takeout": "BRL"null,
					"typetable": "PREPAID",{
					"methodwaiterCode": "credit141.88",
					"methodInfotableNumber": "Visa8",
					"changeForchairNumber": 0.0
		"1"
		}
			]
		},
		"deliverycard": null,
		"extraInfo": "Teste",
		"schedule": null,
		"indoor": null,
		"takeout": null,
		"table": {
			"waiterCode": "9999",
			"tableNumber": "300",
			"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": [
			{
		

...

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-40841e9a6812",
	"data": {
		"id": "b1e26dd8-0a1b-486e-bf62-65e80ddce2f42",
				"typeindex": "TABLE2",
				"displayIdname": 55"A FRANCESA",
				"createdAtexternalCode": "2024-06-24T17:35:001",
				"orderTimingunit": "2024-06-24T17:40:24",
"UN",
				"quantity": 1,
				"preparationStartDateTimespecialInstructions": "2024-06-24T18:00:00Teste",
				"merchantunitPrice": {
					"idvalue": "c312d2ff-1a8f-40ad-8eed-9ae9a908df6e"69.90,
					"namecurrency": "BOTECO DO ALBINOR$"
				},
				"itemsoptionsPrice": [{
			{
				"idvalue": "54"1.00,
					"indexcurrency": "54"R$"
				},
				"nametotalPrice": "MARACUJA",{
					"externalCodevalue": "58"69.90,
					"unitcurrency": "UNR$",
				}
			"quantity": 1.0,},
			{
				"specialInstructionsid": "Teste4",
				"unitPriceindex": {"4",
					"valuename": 61.00"AERADO",
					"currencyexternalCode": "R$"
				}2",
				"optionsPriceunit": {"UN",
					"valuequantity": 0.01,
					"currencyspecialInstructions": "R$"
				}Teste",
				"totalPriceunitPrice": {
					"value": 6132.0099,
					"currency": "R$"
				},
			}
		],
		"otherFees": [],	"optionsPrice": {
		"total": {
			"itemsvalue": 6137.099,
					"otherFeescurrency": 0,"R$"
			"discount": 0.0	},
				"orderAmounttotalPrice": 61.0,{
					"additionalFeesvalue": 032.99,
					"deliveryFeecurrency": 0"R$"
				},
		"payments": {
		}
		],
		"prepaidotherFees": 0.0[],
			"pendingdiscounts": 0.0[],
			"methodstotal": [
				{
					"valueitems": 61102.089,
					"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": "9999141.88",
			"tableNumber": "548",
			"chairNumber": "1"
		},
		"card": null
	}
}

...

Bloco de código
titleJSON Inválido
linenumberstrue
{
	"integrationHubServiceId": "299f76ba3fea8768-3ac3bbd9-4cc1454b-abaf9e7b-fac5a2510d8c40841e9a6812",
	"data": {
		"id": "fa3a2d4529261444-3a295ff8-413640b2-95e7bce1-692d93db8b2b42848247d4a2",
		"type": "TABLE",
		"displayId": "558",
		"createdAt": "2024-06-24T17:35:00",
		"orderTiming": "2024-06-24T17:40:24",
		"preparationStartDateTime": "2024-06-24T18:00:00",		
		"items": [
			{
				"id": "542",
				"index": "542",
				"name": "MARACUJAA FRANCESA",
				"externalCode": "581",
				"unit": "UN",
				"quantity": 1.0,
				"specialInstructions": "Teste",
				"unitPrice": {
					"value": 6169.0090,
					"currency": "R$"
				},
				"optionsPrice": {
					"value": 01.000,
					"currency": "R$"
				},
				"totalPrice": {
					"value": 6169.0090,
					"currency": "R$"
				}
			},
			],{
				"otherFeesid": []"4",
				"totalindex": {"4",
				"itemsname": 61.0"AERADO",
				"otherFeesexternalCode": 0"2",
				"discountunit": 0.0"UN",
				"orderAmountquantity": 61.01,
				"additionalFeesspecialInstructions": 0"Teste",
				"deliveryFeeunitPrice": 0{
		},
			"paymentsvalue": {32.99,
					"prepaidcurrency": 0.0,
"R$"
				"pending": 0.0},
				"methodsoptionsPrice": [
				{
					"value": 6137.099,
					"currency": "BRL"R$"
				},
					"typetotalPrice": "PREPAID",{
					"methodvalue": "credit"32.99,
					"methodInfocurrency": "VisaR$",
					"changeFor": 0.0
}					}
			]}
		}],
		"deliveryotherFees": null[],
		"extraInfodiscounts": "Teste"[],
		"scheduletotal": null,{
			"indooritems": null102.89,
			"takeoutotherFees": null38.99,
			"tablediscount": {0.00,
			"waiterCodeorderAmount": "9999"141.88,
			"tableNumberadditionalFees": "54"0,
			"chairNumberdeliveryFee": "1"0
		},
		"cardpayments": null,
	}
}
Bloco de código
titleJSON Resposta
linenumberstrue
{
	"errorsdelivery": [null,
		{
	"extraInfo": "Teste",
		"schedule": null,
		"keyindoor": null,
		"merchanttakeout": null,
		"table": {
			"messagewaiterCode": "body.data.merchant is required"141.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 Âncorastatus_code_403status_code_403

O código de status HTTP 403401, conhecido como "ForbiddenUnauthorized" (ProibidoNão Autorizado), 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/getStatuS
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.

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
    HTTP Status Code 404 - Not Found
    Âncora
    status_code_404status_code_404

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álidoentendeu a requisição do cliente por está tentando acessar uma URL incorreta.

Bloco de código
titleIntegration Hub Code InválidoURL enviada incorreda
https://api-barramento.meuelevestage.com/order/newOrderS
Bloco de código
titleJSON Response para URL incorreta
linenumberstrue
{
    "integrationHubServiceId	"message": "f1b874af-96ab-4535-aac3-25118fe586cc",
	  "orderKeyType": "TABLE",
	  "orderKey": ["5"]
}
Bloco de código
titleJSON Response
linenumberstrue
{
	"errors": [
		{
			"key": "integrationHubServiceId",
			"message": "Provider Merchant for integrationHubServiceId \"f1b874af-96ab-4535-aac3-25118fe586cc\" not found or disabled"
		}
	]
}
Nota
titleNota: HTTP Status Code = 404 - Not Found

IntegrationHubId incorreto ou inválido

...

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": {
		"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,
		"delivery": null,
		"extraInfo": "Teste",
		"schedule": null,
		"indoor": null,
		"takeout": null,
		"table": {
			"waiterCode": "141.88",
			"tableNumber": "8",
			"chairNumber": "1"
		},
		"card": null
	}
}
Bloco de código
titleJSON Response
linenumberstrue
{
	"errors": [
		{
			"key": "integrationHubServiceId",
			"message": "Provider Merchant for integrationHubServiceId \"709aa0b2-2b89-4d06-9f12-c3b8c275d9fa\" 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 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

...

O código de status HTTP 412, conhecido como "Precondition Failed" (Pré-condição Falhou), indica que o servidor não atendeu a uma das pré-condições que o cliente colocou no cabeçalho da requisição. 

Bloco de código
titleJSON
linenumberstrue
{
    "integrationHubServiceId": "8f7949c3-cdd6-4db0-8746-369e651026b4",
	  "orderKeyType": "TABLE",
	  "orderKey": []
}
Bloco de código
titleHTTP Status Code 412 = Precpndition Failed
linenumberstrue
{
	"message": "NOT_FOUND",
	"code": 412
}
Nota
titleNota: HTTP Status Code = 412 Precondition Failed

Alguma regra necessária para a execução da solicitação não foi atendida. É necessário analisar o conteúdo da resposta retornada para identificar os motivos.

...

O código de status HTTP 429, conhecido como "Too Many Requests" (Muitas Requisições), indica que o cliente excedeu o limite de requisições permitido para um determinado período de tempo. Esse limite é definido pelo servidor e pode variar de acordo com a política de limitação de taxa implementada.

Bloco de código
titleJSON da requisição
linenumberstrue
{
    "integrationHubServiceId": "7d7d205b-83ba-47c5-91ba-e4f32a2bbd9e",
	  "orderKeyType": "TABLE",
		"orderKey": ["5"]
}
Bloco de código
titleResposta da última execução
linenumberstrue
{
	"success": true,
	"error": null,
	"integrationHubServiceId": "7d7d205b-83ba-47c5-91ba-e4f32a2bbd9e",
	"orderKeyType": "TABLE",
	"orderKey": [
		"5"
	],
	"lastestUpdatedStatus": "2024-07-02 18:54:28",
	"items": [
		{
			"id": "de9fd388-c223-4325-a64d-08889250f839",
			"status": {
				"code": 504,
				"description": "OPEN_TABLE"
			},
			"deliveryAgent": null,
			"deliveryDateTime": null,
			"cancellationReason": null,
			"tableCardNumber": "5"
		}
	]
}
Nota
titleNota: HTTP Status Code = 429 - Too Many Requests

Alguma regra para atender ao seu pedido não foi cumprida; analise o corpo da resposta para descobrir as razões.

...




Templatedocumentos