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.

CONTEÚDO

...

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


...

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

01. Retornar todos os status dos consumos:

Âncora
todos_status
todos_status

...

Bloco de código
titleJSON Para retornar o status de um consumo específico
linenumberstrue
{
  "integrationHubServiceId": "66ca34be-a568-4444-a78d-098a68686e58",
  "orderKeyType": "TABLECARD",
  "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 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
			}
		}
	]
}


...

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:

...

Bloco de código
titleJSON Inválido
linenumberstrue
{
    "integrationHubServiceId": "66ca34be-a568-4444-a78d-098a68686e58",
	  "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]"
		}
	]
}

...

API Order Mesa - New Order
API Order Mesa - Status
API Order Cartão - Consumption
API Order Cartão - Payment
API Order Mesa - Get Cancelled Items
API Order Mesa - Cancelled Items

...