Getting API error

Hi guys,

I am using the 'online ordering for a customer' endpoint to attempt to create some very basic orders - HOWEVER, when I send in my payload I am receiving this error:

{"description":"JSON parse error: Cannot deserialize instance of `com.xudox.pos.server.rest.shared.model.OrderDTO` out of START_ARRAY token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `com.xudox.pos.server.rest.shared.model.OrderDTO` out of START_ARRAY token\n at [Source: (PushbackInputStream); line: 1, column: 1]"}


Here is the entire raw request I am sending:


POST http://euw3.posios.com/PosServer/rest/onlineordering/customer/2277779/establishmentorder HTTP/1.1

Host: euw3.posios.com

Accept: application/json

X-Auth-Token: eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJlc3RhYmxpc2htZW50Iiwic2VydmVyIjoiZXV3My5wb3Npb3MuY29tIiwic3ViIjoiNzcxMjkiLCJpc3MiOiIzNjQxMiIsInRhcmdldFVzZXJJZCI6Njg5NDAsImV4cCI6MTYxODUyMzg5NCwiZGlkIjoiYXBpIiwiY2lkIjozNTA1Mn0.f6izhuG20q7tv6bvZy05MFJny_T30NVj4zllKHsASvc

Cookie: __cfduid=d68f5c0e26d720d9641f7b06b4bd107661618516694

Content-Type: application/json; charset=utf-8

Content-Length: 953


[{"companyId":35052,"creationDate":"2021-05-17T00:00:00","deliveryDate":"2021-05-17T00:00:00","description":"Create by integration on 15/04/2021 20:58:27","note":"60684051f1325408df1bc447","customerId":2277779,"orderItems":[{"productPlu":"MF1","amount":3,"totalPrice":36.75,"totalPriceWithoutVat":0.0,"unitPrice":0.0,"unitPriceWithoutVat":0.0,"modifiers":null,"subitems":null},{"productPlu":"MF3","amount":3,"totalPrice":26.25,"totalPriceWithoutVat":0.0,"unitPrice":0.0,"unitPriceWithoutVat":0.0,"modifiers":null,"subitems":null},{"productPlu":"W&C18","amount":3,"totalPrice":31.5,"totalPriceWithoutVat":0.0,"unitPrice":0.0,"unitPriceWithoutVat":0.0,"modifiers":null,"subitems":null},{"productPlu":"379162","amount":3,"totalPrice":10.5,"totalPriceWithoutVat":0.0,"unitPrice":0.0,"unitPriceWithoutVat":0.0,"modifiers":null,"subitems":null}],"orderPayment":{"amount":105.0,"paymentTypeId":4,"paymentTypeTypeId":0},"type":"restaurant","status":"ACCEPTED"}]


Also the 'paymentTypeId' and paymentTypeTypeId - I am aware I can get the latter here: https://developers.lightspeedhq.com/resto-api/tutorials/payment-type-types/ but what about the former?


Best


Nadav

2 comments

Sign In or Register to comment.