Páginas filhas
  • New Order Cartão - Itens com Valor Integral Adicionais e Descontos

Versões comparadas

Chave

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

...

Bloco de código
titleJSON para pedido com inteiro
linenumberstrue
{
	"integrationHubServiceId": "3fea8768-bbd9-454b-9e7b-40841e9a6812",
	"data": {
		"id": "de703e24-3c8f-441a-aacd-17ac766206a9",
		"type": "TABLE",
		"displayId": "2",
		"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": "4",
				"index": "4",
				"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$"
				},
				 "options": [
          {
            "index": "5",
            "id": "5",
            "name": "COMPOSICAO A",
            "externalCode": "201",
            "unit": "UN",
            "quantity": 1,
            "unitPrice": {
              "value": 1.00,
              "currency": "R$"
            },
            "originalPrice": {
              "value": 1.00,
              "currency": "R$"
            },
            "totalPrice": {
              "value": 1.00,
              "currency": "R$"
            },
            "productionPoint": "Teste"
          }
        ]
			}
		],
		"otherFees": [],
		 "discounts": [
      {
        "value": 10.00,
        "target": "ITEM",
        "targetId": "4",
        "sponsorshipValues": [
          {
            "name": "MARKETPLACE",
            "value": 0
          }
        ]
      }
    ],
		"total": {
			"items": 60.90,
			"otherFees": 0.00,
			"discount": 10.00,
			"orderAmount": 60.90,
			"additionalFees": 0,
			"deliveryFee": 0
		},
		"payments": {null,
			"prepaiddelivery": 0.0null,
			"pendingextraInfo": 0.0"Teste",
			"methodsschedule": [null,
				{"indoor": null,
					"valuetakeout": 60.90null,
		"table": {
			"currencywaiterCode": "BRL9999",
					"typetableNumber": "PREPAID2",
					"methodchairNumber": "credit1",
					"methodInfo": "Visa"},
					"changeForcard": 0.0null
				}
			]
		},
		"delivery": null,
		"extraInfo": "Teste",
		"schedule": null,
		"indoor": null,
		"takeout": null,
		"table": {
			"waiterCode": "9999",
			"tableNumber": "2",
			"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.

...

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-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

...

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": {
					"value": 61.00,
					"currency": "R$"
				}
			}
		],
		"otherFees": [],
		"total": {
			"itemsid": 61.0"c312d2ff-1a8f-40ad-8eed-9ae9a908df6e",
			"otherFeesname": 0"BOTECO DO ALBINO"
		},
			"discountitems": 0.0,
[
			{
				"orderAmountid": 61.0"54",
				"additionalFeesindex": 0"54",
				"deliveryFeename": 0"MARACUJA",
		},
		"paymentsexternalCode": {"58",
				"prepaidunit": 0.0"UN",
				"pendingquantity": 01.0,
				"methodsspecialInstructions": ["Teste",
				"unitPrice": {
					"value": 61.000,
					"currency": "BRLR$",
					"type": "PREPAID"		},
					"methodoptionsPrice": "credit",{
					"methodInfovalue": "Visa"0.0,
					"changeForcurrency": 0.0"R$"
				},
				]"totalPrice": {
		},
			"deliveryvalue": null61.00,
					"extraInfocurrency": "Teste",
		"schedule": null,
		"indoor": nullR$"
				}
			}
		],
		"takeoutotherFees": null[],
		"tabletotal": {
			"waiterCodeitems": "9999"61.0,
			"tableNumberotherFees": "54"0,
			"chairNumberdiscount": "1"
		},
		"card": null
	}
}
Bloco de código
titleJSON Resposta
linenumberstrue
{
	"errors": [
		{
			"key": "displayId"0.0,
			"orderAmount": 61.0,
			"additionalFees": 0,
			"messagedeliveryFee": "body.data.displayId must be a string"0
		},
	]
}

02. JSON enviando faltando um ou mais campos.

Bloco de código
titleJSON Inválido
linenumberstrue
{
	"integrationHubServiceIdpayments": "3fea8768-bbd9-454b-9e7b-40841e9a6812"null,
		"datadelivery": {null,
		"idextraInfo": "fa3a2d45-3a29-4136-95e7-692d93db8b2bTeste",
		"typeschedule": null,
		"TABLEindoor": null,
		"displayIdtakeout": null,
		"55table",: {
			"createdAtwaiterCode": "2024-06-24T17:35:009999",
			"orderTimingtableNumber": "2024-06-24T17:40:2454",
			"preparationStartDateTimechairNumber": "2024-06-24T18:00:00",		
		"items1"
		},
		"card": null
	}
}
Bloco de código
titleJSON Resposta
linenumberstrue
{
	"errors": [
			{{
			"key": "displayId",
				"idmessage": "54",body.data.displayId must be a string"
		}
	]
}


...

02. JSON enviando faltando um ou mais campos.

Bloco de código
titleJSON Inválido
linenumberstrue
{
	"indexintegrationHubServiceId": "543fea8768-bbd9-454b-9e7b-40841e9a6812",
				"namedata": "MARACUJA",{
				"externalCodeid": "58fa3a2d45-3a29-4136-95e7-692d93db8b2b",
				"unittype": "UNTABLE",
				"quantitydisplayId": 1.0"55",
				"specialInstructionscreatedAt": "Teste2024-06-24T17:35:00",
				"unitPriceorderTiming": {
					"value": 61.00"2024-06-24T17:40:24",
					"currencypreparationStartDateTime": "R$"
				},
		2024-06-24T18:00:00",		
		"optionsPriceitems": [
			{
					"valueid": 0.0"54",
					"currencyindex": "R$"
				}54",
				"totalPricename": {
					"value": 61.00"MARACUJA",
					"currencyexternalCode": "R$58",
				}
"unit": "UN",
				}"quantity": 1.0,
		],
		"otherFeesspecialInstructions": []"Teste",
				"totalunitPrice": {
					"itemsvalue": 61.000,
					"otherFeescurrency": 0,"R$"
			"discount": 0.0	},
				"orderAmountoptionsPrice": 61.0,{
					"additionalFeesvalue": 0.0,
					"deliveryFeecurrency": 0"R$"
				},
				"paymentstotalPrice": {
					"prepaidvalue": 061.000,
					"pendingcurrency": 0.0"R$"
				}
			}
		],
		"otherFees": [],
		"methodstotal": [
				{
					"valueitems": 61.0,
					"currencyotherFees": "BRL"0,
					"typediscount": "PREPAID"0.0,
					"methodorderAmount": "credit"61.0,
					"methodInfoadditionalFees": "Visa"0,
					"changeFordeliveryFee": 0.0
				},
			]
		}"payments": null,
		"delivery": null,
		"extraInfo": "Teste",
		"schedule": null,
		"indoor": null,
		"takeout": null,
		"table": {
			"waiterCode": "9999",
			"tableNumber": "54",
			"chairNumber": "1"
		},
		"card": null
	}
}

...

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
titleURL enviada incorreda
https://api-barramento.meuelevestage.com/order/newOrderS

...

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, descontos e taxa  acesse a documentação clicando aqui.

...




Templatedocumentos