Páginas filhas
  • API Order Cartão - Get Consumption

Versões comparadas

Chave

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

...

Bloco de código
titleResposta do JSON da requisição
linenumberstrue
{
   	"success": true,
   	"error": null,
   	"integrationHubServiceId": "ea2aecdb66ca34be-7a37a568-449f4444-99e1a78d-aa1346b09524098a68686e58",
   	"orderKeyType": "CARD",
   	"orderKey":[
      "06",
      "10",
      "19"
    [],
   	"consumption": [
      {
         		{
			"orderId": "7cf20761ad976378-adc78823-4a7948d3-98c39cd1-2259dd2b285662d68cf3be77",
         			"type": "CARD",
         			"createdAt": "2024-0209-0809 1012:1233:0552",
         			"customerName": "TOTVS",
         			"items": [
            {
               "id":"251",
               "index":"331811",
               "name":"TESTE MYTAPP",
               "externalCode":"251",
               "unit":"UNIT",
               "ean":"",
               "quantity":1,
               "specialInstructions":"",
               "unitPrice":{
                  "value":99.9,
                  "currency":"R$"
               },
               "optionsPrice":{
                  "value":0,
                  "currency":"R$"
               },
               "totalPrice":{
                  "value":99.9,
                  "currency":"R$"
               },
               "options":null,
               "productionPoint":[
                  {
                     "name":"NENHUM"
                  }
               ]
            }
         ],
         "otherFees":[
            {
               "name":"Taxa de Serviço",
               "type":"SERVICE_FEE",
               "receivedBy":"MERCHANT",
               "receiverDocument":"",
               "price":{
                  "value":9.99,
                  "currency":"R$"
               },
               "observation":""
            }
         ],
         "discounts":null,
         "total":{
            "items":99.9,
            "otherFees":9.99,
            "discount":0,
            "orderAmount":109.89
         },
         "delivery":null,
         "takeout":null,
         "indoor":null,
         "table":null,
         "card":{
		 	"waiterCode": 123,
	        "cardNumber": 4242424242424242,
      		"deliveryTableNumber": 0
      },
      {
         "orderId":"244e2bc1-b7ef-4260-bbf5-49251bdc5f0f",
         "type":"TABLE",
         "createdAt":"2024-02-08 10:45:02",
         "customerName":"TOTVS",
         "items":[
            {
               "id":"1",
               "index":"331820",
               "name":"A FRANCESA",
               "externalCode":"1",
               "unit":"UNIT",
               "ean":"",
               "quantity":1,
               "specialInstructions":"",
               "unitPrice":{
                  "value":69.9,
                  "currency":"R$"
               },
               "optionsPrice":{
                  "value":0,
                  "currency":"R$"
               },
               "totalPrice":{
                  "value":69.9,
                  "currency":"R$"
               },
               "options":null,
               "productionPoint":[
                  {
                     "name":"COZINHA"
                  }
               ]
            },
            {
               "id":"4",
               "index":"331821",
               "name":"AVELA",
               "externalCode":"4",
               "unit":"UNIT",
               "ean":"",
               "quantity":1,
               "specialInstructions":"",
               "unitPrice":{
                  "value":37.99,
                  "currency":"R$"
               },
               "optionsPrice":{
                  "value":0,
                  "currency":"R$"
               },
               "totalPrice":{
                  "value":37.99,
                  "currency":"R$"
               },
               "options":null,
               "productionPoint":[
                  {
                     "name":"COZINHA"
                  }
               ]
            }
         ],
         "otherFees":[
            {
               "name":"Taxa de Serviço",
               "type":"SERVICE_FEE",
               "receivedBy":"MERCHANT",
               "receiverDocument":"",
               "price":{
                  "value":10.78,
                  "currency":"R$"
               },
               "observation":""
            }
         ],
         "discounts":null,
         "total":{
            "items":107.89,
            "otherFees":10.78,
            "discount":0,
            "orderAmount":118.67
         },
         "delivery":null,
         "takeout":null,
         "indoor":null,
         "table":{
            "waiterCode":1,
            "tableNumber":10,
            "chairNumber":0
         },
         "card":null
      },
      {
         "orderId":"b6017f3d-e680-4840-b69f-d2b573d4f8c0",
         "type":"TABLE",
         "createdAt":"2024-02-25 14:01:50",
         "customerName":"TOTVS",
         "items":[
            {
               "id":"5",
               "index":"331838",
               "name":"BRIGADEIRO COM BABA DE MOCA",
               "externalCode":"5",
               "unit":"UNIT",
               "ean":"",
               "quantity":2,
               "specialInstructions":"",
               "unitPrice":{
                  "value":29.99,
                  "currency":"R$"
               },
               "optionsPrice":{
                  "value":0,
                  "currency":"R$"
               },
               "totalPrice":{
                  "value":30.2,
                  "currency":"R$"
               },
               "options":null,
               "productionPoint":[
                  {
                     "name":"COZINHA"
                  }
               ]
            },
            {
               "id":"6",
               "index":"331839",
               "name":"BRIGADEIRO 2",
               "externalCode":"6",
               "unit":"UNIT",
               "ean":"",
               "quantity":2,
               "specialInstructions":"",
               "unitPrice":{
                  "value":63,
                  "currency":"R$"
               },
               "optionsPrice":{
                  "value":0,
                  "currency":"R$"
               },
               "totalPrice":{
                  "value":63.42,
                  "currency":"R$"
               },
               "options":null,
               "productionPoint":[
                  {
                     "name":"COZINHA"
                  }
               ]
            },
            {
               "id":"5",
               "index":"331841",
               "name":"BRIGADEIRO COM BABA DE MOCA",
               "externalCode":"5",
               "unit":"UNIT",
               "ean":"",
               "quantity":1,
               "specialInstructions":"",
               "unitPrice":{
                  "value":29.99,
                  "currency":"R$"
               },
               "optionsPrice":{
                  "value":0,
                  "currency":"R$"
               },
               "totalPrice":{
                  "value":15.11,
                  "currency":"R$"
               },
               "options":null,
               "productionPoint":[
                  {
                     "name":"COZINHA"
                  }
               ]
            },
            {
               "id":"6",
               "index":"331842",
               "name":"BRIGADEIRO 2",
               "externalCode":"6",
               "unit":"UNIT",
               "ean":"",
               "quantity":1,
               "specialInstructions":"",
               "unitPrice":{
                  "value":63,
                  "currency":"R$"
               },
               "optionsPrice":{
                  "value":0,
                  "currency":"R$"
               },
               "totalPrice":{
                  "value":31.7,
                  "currency":"R$"
               },
               "options":null,
               "productionPoint":[
                  {
                     "name":"COZINHA"
                  }
               ]
            }
         ],
         "otherFees":[
            {
               "name":"Taxa de Serviço",
               "type":"SERVICE_FEE",
               "receivedBy":"MERCHANT",
               "receiverDocument":"",
               "price":{
                  "value":14.04,
                  "currency":"R$"
               },
               "observation":""
            }
         ],
         "discounts":null,
         "total":{
            "items":140.43,
            "otherFees":14.04,
            "discount":0,
            "orderAmount":154.47
         },
         "delivery":null,
         "takeout":null,
         "indoor":null,
         "table":{
            "waiterCode":9999,
            "tableNumber":19,
            "chairNumber":0
         },
         "card":null
      }
   ]
}

...

				{
					"id": "181",
					"index": "181",
					"name": "A FRANCESA",
					"externalCode": "1",
					"unit": "UNIT",
					"ean": "",
					"quantity": 1,
					"specialInstructions": "TESTE",
					"unitPrice": {
						"value": 69.9,
						"currency": "R$"
					},
					"optionsPrice": {
						"value": 0,
						"currency": "R$"
					},
					"totalPrice": {
						"value": 69.9,
						"currency": "R$"
					},
					"options": null,
					"productionPoint": [
						{
							"name": "COZINHA"
						}
					]
				},
				{
					"id": "1",
					"index": "1",
					"name": "MARACUJA",
					"externalCode": "58",
					"unit": "UNIT",
					"ean": "",
					"quantity": 1,
					"specialInstructions": "TESTE",
					"unitPrice": {
						"value": 61,
						"currency": "R$"
					},
					"optionsPrice": {
						"value": 0,
						"currency": "R$"
					},
					"totalPrice": {
						"value": 61,
						"currency": "R$"
					},
					"options": null,
					"productionPoint": [
						{
							"name": "NENHUM"
						}
					]
				}
			],
			"otherFees": [
				{
					"name": "Taxa de Serviço",
					"type": "SERVICE_FEE",
					"receivedBy": "MERCHANT",
					"receiverDocument": "",
					"price": {
						"value": 13.09,
						"currency": "R$"
					},
					"observation": ""
				}
			],
			"discounts": null,
			"total": {
				"items": 130.9,
				"otherFees": 13.09,
				"discount": 0,
				"orderAmount": 143.99
			},
			"delivery": null,
			"takeout": null,
			"indoor": null,
			"table": null,
			"card": {
				"waiterCode": 9999,
				"cardNumber": 1,
				"deliveryTableNumber": 326
			}
		},
		{
			"orderId": "2160c838-97d0-432f-a43a-dce087150d49",
			"type": "CARD",
			"createdAt": "2024-09-09 14:57:36",
			"customerName": "TOTVS",
			"items": [
				{
					"id": "200",
					"index": "20",
					"name": "A FRANCESA",
					"externalCode": "1",
					"unit": "UNIT",
					"ean": "",
					"quantity": 1,
					"specialInstructions": "TESTE",
					"unitPrice": {
						"value": 69.9,
						"currency": "R$"
					},
					"optionsPrice": {
						"value": 0,
						"currency": "R$"
					},
					"totalPrice": {
						"value": 69.9,
						"currency": "R$"
					},
					"options": null,
					"productionPoint": [
						{
							"name": "COZINHA"
						}
					]
				}
			],
			"otherFees": [
				{
					"name": "Taxa de Serviço",
					"type": "SERVICE_FEE",
					"receivedBy": "MERCHANT",
					"receiverDocument": "",
					"price": {
						"value": 6.99,
						"currency": "R$"
					},
					"observation": ""
				}
			],
			"discounts": null,
			"total": {
				"items": 69.9,
				"otherFees": 6.99,
				"discount": 0,
				"orderAmount": 76.89
			},
			"delivery": null,
			"takeout": null,
			"indoor": null,
			"table": null,
			"card": {
				"waiterCode": 9999,
				"cardNumber": 340,
				"deliveryTableNumber": 340
			}
		},
		{
			"orderId": "5b8d7e5c-f87e-40ac-91b7-726da529fc88",
			"type": "CARD",
			"createdAt": "2024-09-09 14:39:39",
			"customerName": "TOTVS",
			"items": [
				{
					"id": "1",
					"index": "332003",
					"name": "A FRANCESA",
					"externalCode": "1",
					"unit": "UNIT",
					"ean": "",
					"quantity": 1,
					"specialInstructions": "",
					"unitPrice": {
						"value": 69.9,
						"currency": "R$"
					},
					"optionsPrice": {
						"value": 0,
						"currency": "R$"
					},
					"totalPrice": {
						"value": 69.9,
						"currency": "R$"
					},
					"options": null,
					"productionPoint": [
						{
							"name": "COZINHA"
						}
					]
				}
			],
			"otherFees": [
				{
					"name": "Taxa de Serviço",
					"type": "SERVICE_FEE",
					"receivedBy": "MERCHANT",
					"receiverDocument": "",
					"price": {
						"value": 6.99,
						"currency": "R$"
					},
					"observation": ""
				}
			],
			"discounts": null,
			"total": {
				"items": 69.9,
				"otherFees": 6.99,
				"discount": 0,
				"orderAmount": 76.89
			},
			"delivery": null,
			"takeout": null,
			"indoor": null,
			"table": null,
			"card": {
				"waiterCode": 9999,
				"cardNumber": 4040,
				"deliveryTableNumber": 0
			}
		}
	]
}


...

02. Obter detalhes de um consumo específico:

Âncora
detalhes_pedido_especifico
detalhes_pedido_especifico

Bloco de código
titleJSON Para retornar o status de um consumo específico
linenumberstrue
{
  "integrationHubServiceId": "66ca34be-a568-4444-a78d-098a68686e58",
  "orderKeyType": "TABLE",
  "orderKey": ["40"]
}
Nota
titleNota: HTTP Status Code = 202 Accepted

A solicitação foi aceita, mas ainda não foi processada. É necessário aguardar alguns momentos e, em seguida, entrar em contato no mesmo endereço para obter o status do consumo solicitado.


...


Bloco de código
titleJSON de resposta do retorno de um consumo específico HTTP Status Code = 208
linenumberstrue
{
	"errors": [
		{
			"key": "orderKeyType_orderKey",
			"message": "Order consumption request already exists: TABLE_40"
		}
	]
}  
 
Nota
titleNota: HTTP Status Code = 208 Already Reported

A solicitação já foi enviada. É necessário aguardar alguns momentos e, em seguida, entrar em contato no mesmo endereço para obter o status do consumo solicitado.


...


Bloco de código
titleJSON de resposta do retorno de um consumo
linenumberstrue
{
	"success": true,
	"error": null,
	"integrationHubServiceId": "66ca34be-a568-4444-a78d-098a68686e58",
	"orderKeyType": "CARD",
	"orderKey": [
		"340"
	],
	"consumption": [
		{
			"orderId": "2160c838-97d0-432f-a43a-dce087150d49",
			"type": "CARD",
			"createdAt": "2024-09-09 14:57:36",
			"customerName": "TOTVS",
			"items": [
				{
					"id": "200",
					"index": "20",
					"name": "A FRANCESA",
					"externalCode": "1",
					"unit": "UNIT",
					"ean": "",
					"quantity": 1,
					"specialInstructions": "TESTE",
					"unitPrice": {
						"value": 69.9,
						"currency": "R$"
					},
					"optionsPrice": {
						"value": 0,
						"currency": "R$"
					},
					"totalPrice": {
						"value": 69.9,
						"currency": "R$"
					},
					"options": null,
					"productionPoint": [
						{
							"name": "COZINHA"
						}
					]
				}
			],
			"otherFees": [
				{
					"name": "Taxa de Serviço",
					"type": "SERVICE_FEE",
					"receivedBy": "MERCHANT",
					"receiverDocument": "",
					"price": {
						"value": 6.99,
						"currency": "R$"
					},
					"observation": ""
				}
			],
			"discounts": null,
			"total": {
				"items": 69.9,
				"otherFees": 6.99,
				"discount": 0,
				"orderAmount": 76.89
			},
			"delivery": null,
			"takeout": null,
			"indoor": null,
			"table": null,
			"card": {
				"waiterCode": 9999,
				"cardNumber": 340,
				"deliveryTableNumber": 340
			}
		}
	]
}
Nota
titleNota: HTTP Status Code = 226 IM Used

A solicitação foi processada com sucesso e o resultado foi retornado conforme esperado.


...

04. Retornar o status de múltiplos pedidos:

Bloco de código
titleJSON Para retornar múltiplos consumos
linenumberstrue
{
  "integrationHubServiceId": "66ca34be-a568-4444-a78d-098a68686e58",
  "orderKeyType": "TABLE",
  "orderKey": ["340", "350"]
}


...


Bloco de código
titleJSON de retorno de múltiplos consumos
linenumberstrue
{
	"success": true,
	"error": null,
	"integrationHubServiceId": "66ca34be-a568-4444-a78d-098a68686e58",
	"orderKeyType": "CARD",
	"orderKey": [
		"340",
		"350"
	],
	"consumption": [
		{
			"orderId": "2160c838-97d0-432f-a43a-dce087150d49",
			"type": "CARD",
			"createdAt": "2024-09-09 14:57:36",
			"customerName": "TOTVS",
			"items": [
				{
					"id": "200",
					"index": "20",
					"name": "A FRANCESA",
					"externalCode": "1",
					"unit": "UNIT",
					"ean": "",
					"quantity": 1,
					"specialInstructions": "TESTE",
					"unitPrice": {
						"value": 69.9,
						"currency": "R$"
					},
					"optionsPrice": {
						"value": 0,
						"currency": "R$"
					},
					"totalPrice": {
						"value": 69.9,
						"currency": "R$"
					},
					"options": null,
					"productionPoint": [
						{
							"name": "COZINHA"
						}
					]
				}
			],
			"otherFees": [
				{
					"name": "Taxa de Serviço",
					"type": "SERVICE_FEE",
					"receivedBy": "MERCHANT",
					"receiverDocument": "",
					"price": {
						"value": 6.99,
						"currency": "R$"
					},
					"observation": ""
				}
			],
			"discounts": null,
			"total": {
				"items": 69.9,
				"otherFees": 6.99,
				"discount": 0,
				"orderAmount": 76.89
			},
			"delivery": null,
			"takeout": null,
			"indoor": null,
			"table": null,
			"card": {
				"waiterCode": 9999,
				"cardNumber": 340,
				"deliveryTableNumber": 340
			}
		},
		{
			"orderId": "1fbcd589-1bbd-472c-a28d-6b1164282964",
			"type": "CARD",
			"createdAt": "2024-09-09 15:27:18",
			"customerName": "TOTVS",
			"items": [
				{
					"id": "201",
					"index": "201",
					"name": "A FRANCESA",
					"externalCode": "1",
					"unit": "UNIT",
					"ean": "",
					"quantity": 1,
					"specialInstructions": "TESTE",
					"unitPrice": {
						"value": 69.9,
						"currency": "R$"
					},
					"optionsPrice": {
						"value": 0,
						"currency": "R$"
					},
					"totalPrice": {
						"value": 69.9,
						"currency": "R$"
					},
					"options": null,
					"productionPoint": [
						{
							"name": "COZINHA"
						}
					]
				}
			],
			"otherFees": [
				{
					"name": "Taxa de Serviço",
					"type": "SERVICE_FEE",
					"receivedBy": "MERCHANT",
					"receiverDocument": "",
					"price": {
						"value": 6.99,
						"currency": "R$"
					},
					"observation": ""
				}
			],
			"discounts": null,
			"total": {
				"items": 69.9,
				"otherFees": 6.99,
				"discount": 0,
				"orderAmount": 76.89
			},
			"delivery": null,
			"takeout": null,
			"indoor": null,
			"table": null,
			"card": {
				"waiterCode": 9999,
				"cardNumber": 350,
				"deliveryTableNumber": 340
			}
		}
	]
}

...

Bloco de código
titleJSON Para retornar o status de um consumo específico
linenumberstrue
{
  "integrationHubServiceId": "7056c970-cb11-400f-9d4f-9f30253f3b0b",
  "orderKeyType": "TABLE",
  "orderKey": ["40"]
}
Nota
titleNota: HTTP Status Code = 202 Accepted

A solicitação foi aceita, mas ainda não foi processada. É necessário aguardar alguns momentos e, em seguida, entrar em contato no mesmo endereço para obter o status do consumo solicitado.

Bloco de código
titleJSON de resposta do retorno de um consumo específico HTTP Status Code = 208
linenumberstrue
{
	"errors": [
		{
			"key": "orderKeyType_orderKey",
			"message": "Order consumption request already exists: TABLE_40"
		}
	]
}  
 
Nota
titleNota: HTTP Status Code = 208 Already Reported

A solicitação já foi enviada. É necessário aguardar alguns momentos e, em seguida, entrar em contato no mesmo endereço para obter o status do consumo solicitado.

Bloco de código
titleJSON de resposta do retorno de um consumo
linenumberstrue
{
	"success": true,
	"error": null,
	"integrationHubServiceId": "7056c970-cb11-400f-9d4f-9f30253f3b0b",
	"orderKeyType": "TABLE",
	"orderKey": [
		"40"
	],
	"consumption": [
		{
			"orderId": "d8ef12c3-ce5f-4bfa-b1d2-ebde107a2f02",
			"type": "TABLE",
			"createdAt": "2024-06-28 17:27:20",
			"customerName": "TOTVS",
			"items": [
				{
					"id": "39735945",
					"index": "4",
					"name": "MARACUJA",
					"externalCode": "58",
					"unit": "UNIT",
					"ean": "",
					"quantity": 1,
					"specialInstructions": "TESTE",
					"unitPrice": {
						"value": 61,
						"currency": "R$"
					},
					"optionsPrice": {
						"value": 0,
						"currency": "R$"
					},
					"totalPrice": {
						"value": 61,
						"currency": "R$"
					},
					"options": null,
					"productionPoint": [
						{
							"name": "NENHUM"
						}
					]
				}
			],
			"otherFees": [
				{
					"name": "Taxa de Serviço",
					"type": "SERVICE_FEE",
					"receivedBy": "MERCHANT",
					"receiverDocument": "",
					"price": {
						"value": 6.1,
						"currency": "R$"
					},
					"observation": ""
				}
			],
			"discounts": [],
			"total": {
				"items": 61,
				"otherFees": 6.1,
				"discount": 0,
				"orderAmount": 67.1
			},
			"delivery": null,
			"takeout": null,
			"indoor": null,
			"table": {
				"waiterCode": 9999,
				"tableNumber": 40,
				"chairNumber": 0
			},
			"card": null
		}
	]
}
Nota
titleNota: HTTP Status Code = 226 IM Used

A solicitação foi processada com sucesso e o resultado foi retornado conforme esperado.

04. Retornar o status de múltiplos pedidos:

Bloco de código
titleJSON Para retornar múltiplos consumos
linenumberstrue
{
  "integrationHubServiceId": "ab70a3ce-915b-42ee-9d7f-049d36e26eca",
  "orderKeyType": "TABLE",
  "orderKey": ["20", "40"]
}
Bloco de código
titleJSON de retorno de múltiplos consumos
linenumberstrue
{
	"success": true,
	"error": null,
	"integrationHubServiceId": "ab70a3ce-915b-42ee-9d7f-049d36e26eca",
	"orderKeyType": "TABLE",
	"orderKey": [
		"20",
		"40"
	],
	"consumption": [
		{
			"orderId": "2299a4af-2363-4aa8-803b-b95f7d8e8a7b",
			"type": "TABLE",
			"createdAt": "2024-06-28 17:27:20",
			"customerName": "TOTVS",
			"items": [
				{
					"id": "39735945",
					"index": "4",
					"name": "MARACUJA",
					"externalCode": "58",
					"unit": "UNIT",
					"ean": "",
					"quantity": 1,
					"specialInstructions": "TESTE",
					"unitPrice": {
						"value": 61,
						"currency": "R$"
					},
					"optionsPrice": {
						"value": 0,
						"currency": "R$"
					},
					"totalPrice": {
						"value": 61,
						"currency": "R$"
					},
					"options": null,
					"productionPoint": [
						{
							"name": "NENHUM"
						}
					]
				}
			],
			"otherFees": [
				{
					"name": "Taxa de Serviço",
					"type": "SERVICE_FEE",
					"receivedBy": "MERCHANT",
					"receiverDocument": "",
					"price": {
						"value": 6.1,
						"currency": "R$"
					},
					"observation": ""
				}
			],
			"discounts": [],
			"total": {
				"items": 61,
				"otherFees": 6.1,
				"discount": 0,
				"orderAmount": 67.1
			},
			"delivery": null,
			"takeout": null,
			"indoor": null,
			"table": {
				"waiterCode": 9999,
				"tableNumber": 20,
				"chairNumber": 0
			},
			"card": null
		}
	]
}
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.
  • consumption: Uma lista de consumos associados ao pedido, onde cada consumo inclui:
    • orderId: O identificador do pedido.
    • type: O tipo de consumo (neste caso, "TABLE").
    • createdAt: Data e hora de criação do pedido.
    • customerName: Nome do cliente.
    • items: Uma lista de itens consumidos, onde cada item inclui:
      • id: O identificador do item.
      • index: O índice do item.
      • name: O nome do item.
      • externalCode: O código externo do item.
      • unit: A unidade do item.
      • ean: O código EAN do item (pode estar vazio).
      • quantity: A quantidade do item.
      • specialInstructions: Instruções especiais para o item.
      • unitPrice: O preço unitário do item.
      • optionsPrice: O preço das opções do item.
      • totalPrice: O preço total do item.
      • options: As opções do item (pode ser null).
      • productionPoint: Pontos de produção associados ao item.
    • otherFees: Outras taxas associadas ao pedido.
    • discounts: Descontos aplicados ao pedido.
    • total: Totais do pedido, incluindo valores de itens, outras taxas e descontos.
    • delivery: Informações sobre entrega (pode ser null).
    • takeout: Informações sobre retirada (pode ser null).
    • indoor: Informações sobre consumo no local (pode ser null).
    • table: Informações sobre a mesa, incluindo o código do garçom e o número da mesa.
    • card: Informações sobre o cartão (pode ser null).
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:

...

Bloco de código
titleJSON Inválido
linenumberstrue
{
    "integrationHubServiceId": "a9cad63966ca34be-5775a568-4f8a4444-917ba78d-2ae0f2d284d8098a68686e58",
	  "orderKeyType": "string",
	   "orderKey": ["string"]
}

...

Bloco de código
titleJSON Inválido
linenumberstrue
{
    "integrationHubServiceId": "a5c4e13566ca34be-aacda568-49c14444-b051a78d-160a78a83b56098a68686e58"
}
Bloco de código
titleJSON Resposta
linenumberstrue
{
	"errors": [
		{
			"key": "orderKeyType",
			"message": "body.orderKeyType is required"
		},
		{
			"key": "orderKey",
			"message": "body.orderKey is required"
		}
	]
}

...

Bloco de código
titleJSON com o GUID inválido
linenumberstrue
{
    "integrationHubServiceId": "9a1cf32666ca34be-c962a568-456f4444-8c49a78d-c1bb2f340fc6A098a68686eAA",
	  "orderKeyType": "TABLE",
	  "orderKey": []
}

...

Bloco de código
titleJSON com sem informar o código da orderKey
linenumberstrue
{
    "integrationHubServiceId": "808c143d66ca34be-d6d4a568-4b954444-8c37a78d-efa3a934f222098a68686e58",
	  "orderKeyType": "TABLE",
	  "orderKey": [""]
}

...

O código de status HTTP 403, conhecido como "Forbidden" (Proibido), indica que o servidor entendeu a requisição do cliente, mas está se recusando a cumpri-la. Isso geralmente ocorre quando o cliente não possui permissões adequadas para acessar o recurso solicitado, mesmo que as credenciais de autenticação tenham sido fornecidas corretamenteenviou a URL incorreta para a requisição.


Bloco de código
titleURL enviada incorreda
https://api-barramento.meuelevestage.com/order/getConsumptionsgetConsumptionS
Bloco de código
titleJSON Response para URL incorreta
linenumberstrue
{
	"message": "Missing Authentication Token"
}

...

  • 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 URL fornecido  integrationHubId  está incorreto , o recurso foi removido permanentemente ou não está disponível no momento da requisiçãoou inválido.


Bloco de código
titleIntegration Hub Code Inválido
linenumberstrue
{
    "integrationHubServiceId": "f1b874af-96ab-4535-aac3-25118fe586cc",
	  "orderKeyType": "TABLE",
		"orderKey": ["5350"]
}
Bloco de código
titleJSON Response
linenumberstrue
{
	"errors": [
		{
			"key": "integrationHubServiceId",
			"message": "Provider Merchant for integrationHubServiceId \"f1b874af-96ab-4535-aac3-25118fe586cc\" not found or disabled"
		}
	]
}

...

  • HTTP Status Code 412 - Precondition Failed
    Âncora
    status_code_412
    status_code_412
    VERIFICAR COM O KENNEDY 

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 da requisição
linenumberstrue
{
    "integrationHubServiceId": "7d7d205b66ca34be-83baa568-47c54444-91baa78d-e4f32a2bbd9e098a68686e58",
	  "orderKeyType": "TABLE",
		"orderKey": ["20340", "40350"]
}
Bloco de código
titleResposta da última execução
linenumberstrue
{
	"success": true,
	"error": null,
	"integrationHubServiceId": "7d7d205b-83ba-47c5-91ba-e4f32a2bbd9e",
	"orderKeyType": "TABLE",
	"orderKey": [
		"20",
		"40"
	],
	"consumption": [
		{
			"orderId": "f5fee4b4-c13f-482d-8e98-0dd840629e02",
			"type": "TABLE",
			"createdAt": "2024-06-28 17:27:20",
			"customerName": "TOTVS",
			"items": [
				{
					"id": "39735945",
					"index": "4",
					"name": "MARACUJA",
					"externalCode": "58",
					"unit": "UNIT",
					"ean": "",
					"quantity": 1,
					"specialInstructions": "TESTE",
					"unitPrice": {
						"value": 61,
						"currency": "R$"
					},
					"optionsPrice": {
						"value": 0,
						"currency": "R$"
					},
					"totalPrice": {
						"value": 61,
						"currency": "R$"
					},
					"options": null,
					"productionPoint": [
						{
							"name": "NENHUM"
						}
					]
				}
			],
			"otherFees": [
				{
					"name": "Taxa de Serviço",
					"type": "SERVICE_FEE",
					"receivedBy": "MERCHANT",
					"receiverDocument": "",
					"price": {
						"value": 6.1,
						"currency": "R$"
					},
					"observation": ""
				}
			],
			"discounts": [],
			"total": {
				"items": 61,
				"otherFees": 6.1,
				"discount": 0,
				"orderAmount": 67.1
			},
			"delivery": null,
			"takeout": null,
			"indoor": null,
			"table": {
				"waiterCode": 9999,
				"tableNumber": 20,
				"chairNumber": 0
			},
			"card": null
		}
	]
}

...