CONTEÚDO - NÃO MEXE API
Âncora | ||||
---|---|---|---|---|
|
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 fracionado outro com valor integral, adicionais e desconto na API Order MesaCartão Consumo, utilizando o endpoint newOrder.
...
...
Âncora | ||||
---|---|---|---|---|
|
2.1 - Request Vários Itens com Valor Fracionado Adicionais e Desconto:
01. Corpo da requisição para envio de vários itens no mesmo pedido:
Bloco de código | ||||
---|---|---|---|---|
| ||||
{ "integrationHubServiceId": "3fea8768-bbd9-454b-9e7b-40841e9a6812", "data": { "id": "29261444-5ff8-40b2-bce1-42848247d4a2", "type": "TABLECARD", "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": 0.5, "specialInstructions": "Teste", "unitPrice": { "value": 69.90, "currency": "R$" }, "optionsPrice": { "value": 1.00, "currency": "R$" }, "totalPrice": { "value": 34.95, "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": 67.94, "otherFees": 38.99, "discount": 10.00, "orderAmount": 96.93, "additionalFees": 0, "deliveryFee": 0 }, "payments": {null, "prepaiddelivery": 0.0null, "pendingextraInfo": 0.0"Teste", "methodsschedule": [ { "value": 96,93, "currency": "BRL", "type": "PREPAID", "method": "credit", "methodInfo": "Visa", "changeFor": 0.0 } ] }, "delivery": null, "extraInfo": "Teste", "schedulenull, "indoor": null, "indoortakeout": null, "takeouttable": null, "tablecard": { "waiterCode": "96.93"9999, "tableNumbercardNumber": "8"29, "chairNumberdeliveryTableNumber": "1"29 }, "card": null } } |
Nota | ||
---|---|---|
| ||
Sua solicitação foi aceita mas ainda não processada, aguarde alguns instantes e procure o status. |
...
...
Âncora | ||||
---|---|---|---|---|
|
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
3.1 - Formato inválido do JSON esperado:
A requisição foi enviada com um JSON malformado ou inválido, o que impede o sistema de interpretá-la corretamente. Isso ocorre quando a estrutura JSON contém erros de sintaxe, como chaves ou colchetes incorretos.
Bloco de código | ||||
---|---|---|---|---|
| ||||
{ "integrationHubServiceId": "3fea8768-bbd9-454b-9e7b-40841e9a6812", "data": { "id": "29261444-5ff8-40b2-bce1-42848247d4a2", "type": "TABLECARD", "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": 0.5, "specialInstructions": "Teste", "unitPrice": { "value": 69.90, "currency": "R$" }, "optionsPrice": { "value": 1.00, "currency": "R$" }, "totalPrice": { "value": 34.95, "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": "5R$", }, "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}, "target": "ITEM", "targetIdtotalPrice": "02", { "sponsorshipValues": [ {"value": 37.99, "namecurrency": "MARKETPLACE"R$" }, "valueproductionPoint": 10.00 "Adicional Avela" } ] } ], "totalotherFees": {[], "itemsdiscounts": 67.94,[ "otherFees": 38.99,{ "discountvalue": 10.001, "orderAmounttarget": 96.93"ITEM", "additionalFeestargetId": 0"02", "deliveryFeesponsorshipValues": 0[ }, "payments": { "prepaidname": 0.0"MARKETPLACE", "pendingvalue": 010.0,00 "methods": [ } {] } ], "valuetotal": 96,93,{ "items": 67.94, "currencyotherFees": "BRL"38.99, "typediscount": "PREPAID"10.00, "methodorderAmount": "credit"96.93, "methodInfoadditionalFees": "Visa"0, "changeFordeliveryFee": 0.0 }, ] }"payments": null, "delivery": null, "extraInfo": "Teste", "schedule": null, "indoor": null, "takeout": null, "table": null, "card": { "waiterCode": "96.93"9999, "tableNumbercardNumber": "8"29, "chairNumberdeliveryTableNumber": "1"29 }, "card": null } } |
Bloco de código | ||||
---|---|---|---|---|
| ||||
{ "errors": [ { "key": "displayId", "message": "body.data.displayId must be a string" } ] } |
...
...
3.2 - JSON enviado com a ausência de um ou mais campos obrigatórios:
Se a requisição estiver faltando um ou mais campos obrigatórios, o servidor responderá com um erro 400. Cada campo requerido deve estar presente para que a operação seja processada corretamente
Bloco de código | ||||
---|---|---|---|---|
| ||||
{ "integrationHubServiceId": "3fea8768-bbd9-454b-9e7b-40841e9a6812", "data": { "id": "29261444-5ff8-40b2-bce1-42848247d4a2", "type": "TABLECARD", "displayId": "8", "createdAt": "2024-06-24T17:35:00", "orderTiming": "2024-06-24T17:40:24", "preparationStartDateTime": "2024-06-24T18:00:00",, "items": [ { "id": "2", "index": "2", "name": "A FRANCESA", "externalCode": "1", "unit": "UN", "quantity": 0.5, "specialInstructions": "Teste", "unitPrice": { "value": 69.90, "currency": "R$" }, "optionsPrice": { "value": 1.00, "currency": "R$" }, "totalPrice": { "value": 34.95, "currency": "R$" }, "options": [ { "index": "3", "id": "3", "name": "COMPOSICAO A", "externalCode": "201", "unit": "UN", "quantity": 1, "unitPrice": { "value": 1.00, "currencyunit": "R$UN", }"quantity": 1, "originalPriceunitPrice": { "value": 1.00, "currency": "RSR$" }, "totalPriceoriginalPrice": { "value": 1.000, "currency": "R$RS" }, "productionPointtotalPrice": "Adicional Composicao A" }{ ] }, { "id"value": "4"1.0, "index": "4", "namecurrency": "AERADOR$", "externalCode": "2" }, "unitproductionPoint": "UN",Adicional Composicao A" } "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": "5R$", }, "nametotalPrice": "AVELA",{ "externalCodevalue": "4"32.99, "unitcurrency": "UNR$", "quantity": 1}, "unitPriceoptions": {[ "value": 37.99,{ "currencyindex": "R$5", }"id": "5", "originalPricename": {"AVELA", "valueexternalCode": 37.99"4", "currencyunit": "RSUN", }"quantity": 1, "totalPriceunitPrice": { "value": 37.99, "currency": "R$" }, "productionPoint": "Adicional Avela" } ] } ], "otherFees": [], "discountsoriginalPrice": [{ { "value": 137.99, "targetcurrency": "ITEMRS", "targetId": "02" }, "sponsorshipValuestotalPrice": [{ { "value": 37.99, "namecurrency": "MARKETPLACE"R$" }, "valueproductionPoint": 10.00"Adicional Avela" } ] } ], "totalotherFees": {[], "itemsdiscounts": 67.94, [ { "otherFeesvalue": 38.991, "discounttarget": 10.00"ITEM", "orderAmounttargetId": 96.93"02", "additionalFeessponsorshipValues": 0,[ "deliveryFee": 0 { }, "paymentsname": {"MARKETPLACE", "prepaidvalue": 0.0, "pending": 0.010.00 } ] } ], "methodstotal": [ { "valueitems": 96,9367.94, "currencyotherFees": "BRL"38.99, "typediscount": "PREPAID"10.00, "methodorderAmount": "credit"96.93, "methodInfoadditionalFees": "Visa"0, "changeFordeliveryFee": 0.0 }, ] }"payments": null, "delivery": null, "extraInfo": "Teste", "schedule": null, "indoor": null, "takeout": null, "table": {null, "waiterCodecard": "96.93",{ "tableNumberwaiterCode": "8"9999, "chairNumbercardNumber": "1"29, }, "carddeliveryTableNumber": null29 } } } |
Bloco de código | ||||
---|---|---|---|---|
| ||||
{ "errors": [ { "key": "merchant", "message": "body.data.merchant is required" } ] } |
...
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 | ||
---|---|---|
| ||
https://api-barramento.meuelevestage.com/order/newOrderS |
...
Bloco de código | ||||
---|---|---|---|---|
| ||||
{ "integrationHubServiceId": "f1b874af-96ab-4535-aac3-25118fe586cc", "data": { "id": "29261444-5ff8-40b2-bce1-42848247d4a2", "type": "TABLECARD", "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": 0.5, "specialInstructions": "Teste", "unitPrice": { "value": 69.90, "currency": "R$" }, "optionsPrice": { "value": 1.00, "currency": "R$" }, "totalPrice": { "value": 34.95, "currency": "R$" }, "options": [ { "index": "3", "id": "3", "name": "COMPOSICAO A", "externalCode": "201", "unit": "UN", "quantity": 1, "unitPrice": { "value": 1.00, "currencyunit": "R$UN", }"quantity": 1, "originalPriceunitPrice": { "value": 1.00, "currency": "RSR$" }, "totalPriceoriginalPrice": { "value": 1.000, "currency": "R$RS" }, "productionPointtotalPrice": "Adicional Composicao A" }{ ] }, { "id"value": "4"1.0, "index": "4", "namecurrency": "AERADOR$", "externalCode": "2" }, "unitproductionPoint": "UN",Adicional Composicao A" } "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": "5R$", }, "nametotalPrice": "AVELA",{ "externalCodevalue": "4"32.99, "unitcurrency": "UNR$", "quantity": 1}, "unitPriceoptions": {[ "value": 37.99,{ "currencyindex": "R$5", }"id": "5", "originalPricename": {"AVELA", "valueexternalCode": 37.99"4", "currencyunit": "RSUN", }"quantity": 1, "totalPriceunitPrice": { "value": 37.99, "currency": "R$" }, "productionPoint": "Adicional Avela" } ] } ], "otherFees": [], "discountsoriginalPrice": [{ { "value": 137.99, "targetcurrency": "ITEMRS", "targetId": "02" }, "sponsorshipValuestotalPrice": [{ { "value": 37.99, "namecurrency": "MARKETPLACE"R$" }, "valueproductionPoint": 10.00"Adicional Avela" } ] } ], "totalotherFees": {[], "itemsdiscounts": 67.94, [ { "otherFeesvalue": 38.991, "discounttarget": 10.00"ITEM", "orderAmounttargetId": 96.93"02", "additionalFeessponsorshipValues": 0,[ "deliveryFee": 0 { }, "paymentsname": {"MARKETPLACE", "prepaidvalue": 0.0,10.00 } "pending": 0.0, ] "methods": [} ], "total": { "valueitems": 96,9367.94, "currencyotherFees": "BRL"38.99, "typediscount": "PREPAID"10.00, "methodorderAmount": "credit"96.93, "methodInfoadditionalFees": "Visa"0, "changeFordeliveryFee": 0.0 }, ] }"payments": null, "delivery": null, "extraInfo": "Teste", "schedule": null, "indoor": null, "takeout": null, "table": null, "card": { "waiterCode": "96.93"9999, "tableNumbercardNumber": "8"29, "chairNumberdeliveryTableNumber": "1"29 }, "card": null } } |
Bloco de código | ||||
---|---|---|---|---|
| ||||
{ "errors": [ { "key": "integrationHubServiceId", "message": "Provider Merchant for integrationHubServiceId \"f1b874af-96ab-4535-aac3-25118fe586cc\" not found or disabled" } ] } |
...
Dica | ||
---|---|---|
| ||
Para obter detalhes técnicos sobre o envio de requisições ao endpoint |
Dica | ||
---|---|---|
| ||
Para obter detalhes técnicos sobre o envio de requisições ao endpoint |
Dica | ||
---|---|---|
| ||
Para obter detalhes técnicos sobre o envio de requisições ao endpoint |
Dica | ||
---|---|---|
| ||
Para obter detalhes técnicos sobre o envio de requisições ao endpoint |
...
...
Âncora | ||||
---|---|---|---|---|
|
New Order |
---|
Cartão - Item com Valor Integral |
---|
New Order |
Cartão - |
---|
Itens Fracionando |
---|
Templatedocumentos |
---|