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

...

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


...

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

01. Corpo da requisição de para envio de novo pedidos inteirovários itens no mesmo pedido: Âncorapedido_inteiropedido_inteiro

Bloco de código
titleJSON da requisição do vários itens no pedido
Bloco de código
titleJSON para pedido com inteiro
linenumberstrue
{
   	"integrationHubServiceId": "933aadb482b90dff-c33b6d68-40b84fd1-82858c59-bf1e575d8b385f6623d2d45f",
   	"data": {
      		"id": "9ec389e59c3a6938-75821e43-47684ed4-875ba6b6-ee7c309aa34f16560c43cf68",
      		"type": "TABLE",
      		"displayId": "293",
      		"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": "397359402115",
            				"index": "2115",
            				"name": "MARACUJAA FRANCESA",
            "externalCode":"58",
            				"externalCode": "1",
				"unit": "UN",
            				"quantity": 1.0,
            ,
				"specialInstructions": "Teste",
            "unitPrice":{
               				"unitPrice": {
					"value":61 69.00,
               90,
					"currency": "R$"
            },
            				},
				"optionsPrice":{
                {
					"value": 0.0,
               00,
					"currency": "R$"
            },
            				},
				"totalPrice":{
                {
					"value":61 69.00,
               90,
					"currency": "R$"
            },
            "otherFees":[]
         }
      ],
      "total":{
         "items":61.00,
         "otherFees":0,
         "discount":0.00,
         "orderAmount":61.00,
         "additionalFees":0,
         "deliveryFee":0
      },
      "payments":{
         "prepaid":0.0,
         "pending":0.0,
         "methods":[
            {
               "value":61.00,
               "currency":"BRL",
               "type":"PREPAID",
               "method":"credit",
               "methodInfo":"Visa",
               "changeFor":0.0
            }
         ]
      },
      "delivery":null,
      "extraInfo":"Teste",
      "schedule":null,
      "indoor":null,
      "takeout":null,
      "table":{
         "waiterCode":"9999",
         "tableNumber":"29",
         "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.

...

				}
			},
			{
				"id": "17",
				"index": "17",
				"name": "MARACUJA",
				"externalCode": "58",
				"unit": "UN",
				"quantity": 1,
				"specialInstructions": "Teste",
				"unitPrice": {
					"value": 61.00,
					"currency": "R$"
				},
				"optionsPrice": {
					"value": 0.00,
					"currency": "R$"
				},
				"totalPrice": {
					"value": 61.00,
					"currency": "R$"
				}
			}
		],
		 "otherFees": [],
		 "discounts": [],
		"total": {
			"items": 130.90,
			"otherFees": 0.00,
			"discount": 0.00,
			"orderAmount": 130.90,
			"additionalFees": 0,
			"deliveryFee": 0
		},
		"payments": {
			"prepaid": 0.0,
			"pending": 0.0,
			"methods": [
				{
					"value": 130.90,
					"currency": "BRL",
					"type": "PREPAID",
					"method": "credit",
					"methodInfo": "Visa",
					"changeFor": 0.0
				}
			]
		},
		"delivery": 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:


  • 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-40841e9a6812",
	"data": {
		"id": "b1e26dd8-0a1b-486e-bf62-65e80ddce2f4",
		"type": "TABLE",
		"displayId": 55,
		"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": "54",
				"index": "54",
				"name": "MARACUJA",
				"externalCode": "58",
				"unit": "UN",
				"quantity": 1.0,
				"specialInstructions": "Teste",
				"unitPrice": {
					"value": 61.00,
					"currency": "R$"
				},
				"optionsPrice": {
					"value": 0.0,
					"currency": "R$"
				},
				"totalPrice

...

Bloco de código
titleJSON da requisição do vários itens no pedido
linenumberstrue
{
	"integrationHubServiceId": "ff932717-fab5-4636-a294-a2035f774445",
	"data": {
		"id": "c5f0f7d9-88fa-471d-904d-d8920ac866e7",
		"type": "TABLE",
		"displayId": "4",
		"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": "5",
				"index": "5",
				"name": "MARACUJA",
				"externalCode": "58",
				"unit": "UN",
				"quantity": 1.0,
				"specialInstructions": "Teste",
				"unitPrice": {
					"value": 61.00,
					"currency": "R$"
				},
				"optionsPrice": {
					"value": 0.0,
					"currency": "R$"
				},
				"totalPrice": {
					"value": 61.00,
					"currency": "R$"
				}
			},
			{
				"id": "6",
				"index": "6",
				"name": "BRIGADEIRO TRADICIONAL CX",
				"externalCode": "7",
				"unit": "UN",
				"quantity": 1.0,
				"specialInstructions": "Teste",
				"unitPrice": {
					"value": 61.00,
					"currency": "R$"
				},
			}
		],
		"optionsPriceotherFees": {[],
		"total": {
			"valueitems": 061.0,
					"currencyotherFees": "R$"
				}0,
				"totalPricediscount": {
		0.0,
			"valueorderAmount": 61.000,
					"currencyadditionalFees": "R$"0,
				}"deliveryFee": 0
			}
		],
		"otherFeespayments": [],{
			"totalprepaid": {0.0,
			"itemspending": 610.0,
			"otherFeesmethods": 0,[
			"discount": 0.0,	{
					"orderAmountvalue": 61.0,
					"additionalFeescurrency": 0"BRL",
					"deliveryFeetype": 0"PREPAID",
		},
			"paymentsmethod": {"credit",
					"prepaidmethodInfo": 0.0"Visa",
					"pendingchangeFor": 0.0,
			"methods": [
	}
				{]
		},
			"valuedelivery": 61.0null,
					"currencyextraInfo": "BRLTeste",
		"schedule": null,
			"typeindoor": null,
		"PREPAIDtakeout": null,
		"table": {
			"methodwaiterCode": "credit9999",
					"methodInfotableNumber": "Visa54",
					"changeForchairNumber": 0.0"1"
				},
			]
		},
		"delivery"card": null,
		"extraInfo": "Teste",
		"schedule": null,
		"indoor": null,
		"takeout": null,
		"table": }
}
Bloco de código
titleJSON Resposta
linenumberstrue
{
	"errors": [
		{
			"waiterCodekey": "9999displayId",
			"tableNumbermessage": "4",body.data.displayId must be a string"
		}
	]
}


...

02. JSON enviando faltando um ou mais campos.

Bloco de código
titleJSON Inválido
linenumberstrue
{
	"integrationHubServiceId"chairNumber": "1"
		},299f76ba-3ac3-4cc1-abaf-fac5a2510d8c",
	"data": {
		"cardid": 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.

...

Bloco de código
titleJSON para pedido com item fracionado
linenumberstrue
{
   "integrationHubServiceId":"a13ea12d-1ffc-4f4c-a3e8-a384fe0e9e05",
   "data":{
      "id":"f853a079-d0cb-4612-847f-430460485c02",
      "type":"TABLE",
      "displayId":"29",
      "createdAt":"2024-06-24T17:35:00",
      "orderTiming":"2024-06-24T17:40:24",
      "preparationStartDateTime":"2024-06-24T18:00:00",
      "merchant":{
         "id":"3d0cbd44-a6c4-469c-8ab3-c83700672ee1",
         "name":"BOTECO DO ALBINO"
      },
      "items":[
         {
            "id":"3973594022",
            "index":"22",
            "name":"MARACUJA",
            "externalCode":"58",
            "unit":"UN",
            "quantity":0.5,
            "specialInstructions":"Teste",
            "unitPrice":{
               "value":61.00,
               "currency":"R$"
            },
            "optionsPrice":{
               "value":0.0,
               "currency":"R$"
            },
            "totalPrice":{
               "value":30.50,
               "currency":"R$"
            },
            "otherFees":[]
         }
      ],
      "total":{
         "items":30.50,
         "otherFees":0,
         "discount":0.00,
         "orderAmount":20.50,
         "additionalFees":0,
         "deliveryFee":0
      },
      "payments":{
         "prepaid":0.0,
         "pending":0.0,
         "methods":[
            {
               "value":30.50,
               "currency":"BRL",
               "type":"PREPAID",
               "method":"credit",
               "methodInfo":"Visa",
               "changeFor":0.0
            }
         ]
      },
      "delivery":null,
      "extraInfo":"Teste",
      "schedule":null,
      "indoor":null,
      "takeout":null,
      "table":{
         "waiterCode":"9999",
         "tableNumber":"29",
         "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.

...

"fa3a2d45-3a29-4136-95e7-692d93db8b2b",
		"type": "TABLE",
		"displayId": "55",
		"createdAt": "2024-06-24T17:35:00",
		"orderTiming": "2024-06-24T17:40:24",
		"preparationStartDateTime": "2024-06-24T18:00:00",		
		"items": [
			{
				"id": "54",
				"index": "54",
				"name": "MARACUJA",
				"externalCode": "58",
				"unit": "UN",
				"quantity": 1.0,
				"specialInstructions": "Teste",
				"unitPrice": {
					"value": 61.00,
					"currency": "R$"
				},
				"optionsPrice": {
					"value": 0.0,
					"currency": "R$"
				},
				"totalPrice": {
					"value": 61.00,
					"currency": "R$"
				}
			}
		],
		"otherFees": [],
		"total": {
			"items": 61.0,
			"otherFees": 0,
			"discount": 0.0,
			"orderAmount": 61.0,
			"additionalFees": 0,
			"deliveryFee": 0
		},
		"payments": {
			"prepaid": 0.0,
			"pending": 0.0,
			"methods": [
				{
					"value": 61.0,
					"currency": "BRL",
					"type": "PREPAID",
					"method": "credit",
					"methodInfo": "Visa",
					"changeFor": 0.0
				}
			]
		},
		"delivery": null,
		"extraInfo": "Teste",
		"schedule": null,
		"indoor": null,
		"takeout": null,
		"table": {
			"waiterCode": "9999",
			"tableNumber": "54",
			"chairNumber": "1"
		},
		"card": null
	}
}
Bloco de código
titleJSON Resposta

...

Bloco de código
titleJSON pedidos com desconto
linenumberstrue
{
  "integrationHubServiceId":"4c9952fd-90d6-46f1-afd2-381c21e73cfc",
  "data":{
     "id":"4c9952fd-90d6-46f1-afd2-381c21e73cfc",
     "type":"TABLE",
     "displayId":"9",
     "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":"9",
           "index":"9",
           "name":"MARACUJA",
           "externalCode":"58",
           "unit":"UN",
           "quantity":1.0,
           "specialInstructions":"Teste",
           "unitPrice":{
              "value":61.00,
              "currency":"R$"
           },
           "optionsPrice":{
              "value":0.0,
              "currency":"R$"
           },
           "totalPrice":{
              "value":61.00,
              "currency":"R$"
           }
        }
     ],
     "otherFees":[],
     "discounts":[
        {
           "value":10.0,
           "target":"ITEM",
           "targetId":"9",
           "sponsorshipValues":[
              {
                 "name":"MARKETPLACE",
                 "value":0.0
              }
           ]
        }
     ],
     "total":{
        "items":61.00,
        "otherFees":0,
        "discount":10.0,
        "orderAmount":51.00,
        "additionalFees":0,
        "deliveryFee":0
     },
     "payments":{
        "prepaid":0.0,
        "pending":0.0,
        "methods":[
           {
              "value":51.00,
              "currency":"BRL",
              "type":"PREPAID",
              "method":"credit",
              "methodInfo":"Visa",
              "changeFor":0.0
           }
        ]
     },
     "delivery":null,
     "extraInfo":"Teste",
     "schedule":null,
     "indoor":null,
     "takeout":null,
     "table":{
        "waiterCode":"9999",
        "tableNumber":"9",
        "chairNumber":"1"
     },
     "card":null
  }
}

...

Bloco de código
titleJSON pedidos com item fracionando
linenumberstrue
{
	"integrationHubServiceId": "72ec722e-b643-4076-b1cd-ef388901ba66",
	"data": {
		"id": "57e20fc5-bea5-4372-9bfc-126e1961d99b",
		"type": "TABLE",
		"displayId": "9",
		"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": "10",
				"index": "10",
				"name": "MARACUJA",
				"externalCode": "58",
				"unit": "UN",
				"quantity": 0.5,
				"specialInstructions": "Teste",
				"unitPrice": {
					"value": 61.00,
					"currency": "R$"
				},
				"optionsPrice": {
					"value": 0.0,
					"currency": "R$"
				},
				"totalPrice": {
					"value": 30.50,
					"currency": "R$"
				}
			}
		],
		"otherFees": [],
		"discounts": [
			{
				"value": 10.0,
				"target": "ITEM",
				"targetId": "10",
				"sponsorshipValues": [
					{
						"name": "MARKETPLACE",
						"value": 0.0
					}
				]
			}
		],
		"total": {
			"items": 30.50,
			"otherFees": 0,
			"discount": 10.0,
			"orderAmount": 20.50,
			"additionalFees": 0,
			"deliveryFee": 0
		},
		"payments": {
			"prepaid": 0.0,
			"pending": 0.0,
			"methods": [
				{
					"value": 20.50,
					"currency": "BRL",
					"type": "PREPAID",
					"method": "credit",
					"methodInfo": "Visa",
					"changeFor": 0.0
				}
			]
		},
		"delivery": null,
		"extraInfo": "Teste",
		"schedule": null,
		"indoor": null,
		"takeout": null,
		"table": {
			"waiterCode": "9999",
			"tableNumber": "10",
			"chairNumber": "1"
		},
		"card": null
	}
}
Bloco de código
titleNota: HTTP Status Code = 200 OK
linenumberstrue
Sua solicitação foi aceita mas ainda não processada, aguarde alguns instantes e procure o status.
Informações
titleNota:

Neste exemplo, os dados retornados incluem:

  • success: Indica se a operação foi bem-sucedida.
  • error: Contém informações sobre erros, se houver.
  • integrationHubServiceId: O identificador do serviço de integração.
  • orderKeyType: O tipo da chave do pedido (neste caso, "TABLE").
  • orderKey: A chave do pedido, que pode ser uma lista de identificadores.
  • lastestUpdatedStatus: A data e hora da última atualização do status do pedido.
  • items: Uma lista de itens relacionados ao pedido, onde cada item inclui:
    • id: O identificador do item.
    • status: O status atual do item, incluindo um código e uma descrição.
    • deliveryAgent: Informações sobre o agente de entrega, se aplicável.
    • deliveryDateTime: Data e hora de entrega, se aplicável.
    • cancellationReason: Motivo do cancelamento, se aplicável.
    • tableCardNumber: O número da mesa associada ao pedido.
Informações
titleInformação:

integrationHubServiceId: é um código da integração da loja com o Integration Hub

orderKey: é o código do pedido

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.

Bloco de código
titleJSON Inválido
linenumberstrue
{
    "integrationHubServiceId": "393d9572-2ec9-4cda-9ad3-5b69e02c988d",
	  "orderKeyType": "string",
	   "orderKey": ["string"]
}
Bloco de código
titleJSON Resposta
linenumberstrue
{
	"errors": [
		{
			"key": "orderKeyType",
			"message": "body.orderKeyType must be one of [ORDER_ID, TABLE, CARD]"
		}
	]
}

02. JSON enviando faltando um ou mais campos.

Bloco de código
titleJSON Inválido
linenumberstrue
{
    "integrationHubServiceId": "a5c4e135-aacd-49c1-b051-160a78a83b56"
}
Bloco de código
titleJSON Resposta
linenumberstrue
{
	"errors": [
		{
			"key": "orderKeyType",
			"message": "body.orderKeyType is required"
		},
		{
			"key": "orderKey",
			"message": "body.orderKey is required"
		}
	]
}

03. GUID incorreto 

Bloco de código
titleJSON com o GUID inválido
linenumberstrue
{
    "integrationHubServiceId": "9a1cf326-c962-456f-8c49-c1bb2f340fc6A",
	  "orderKeyType": "TABLE",
	  "orderKey": []
}
Bloco de código
titleJSON Inválido GUID incorreto
linenumberstrue
{
	"errors": [
		{
			"key": "integrationHubServiceId",
			"message": "body.integrationHubServiceId must be a valid GUID"
		}
	]
}

04. Enviando uma requisição sem informar o código da orderKey corretamente

Bloco de código
titleJSON com sem informar o código da orderKey
linenumberstrue
{
    "integrationHubServiceId": "808c143d-d6d4-4b95-8c37-efa3a934f222",
	  "orderKeyType": "TABLE",
	  "orderKey": [""]
}
Bloco de código
titleJSON Response
linenumberstrue
{
	"errors": [
		{
			"key": 0"merchant",
			"message": "body.orderKey[0].data.merchant is not allowed to be emptyrequired"
		}
	]
}
Nota
titleNota: HTTP Status Code = 400 Bad Request
A solicitação é inválida e não pôde ser processada devido a erros na entrada fornecida. Verifique os dados enviados e tente novamente.


...


  • HTTP Status Code 401 - Unauthorized
    Âncora
    status_code_401
    status_code_401
     

...