Order created using API are not displayed in the Lightspeed admin.
Hello,
I am using the Lightspeed APIs (in production) in order to create customers and orders.
When I create customers using the APIs, I can see the customer created in the admin.
However when I create an order using the APIs, the order seems to be well created but I cannot retrieve the order created in the admin.
Here is a simplified flow explaining my problem :
1. Create an order
API used :
POST - https://euc1.posios.com/PosServer/rest/onlineordering/customer/685567/establishmentorder
Data sent (with one product) :
{ "companyId": 32625, "deliveryDate": "2019-12-05T16:10:21.957Z", "status": "ACCEPTED", "description": "Online order", "orderItems": [ { "amount": 2, "totalPrice": 5, "unitPrice": 5, "productPlu": "D3", "totalPriceWithoutVat": 5, "unitPriceWithoutVat": 5 } ], "type": "takeaway", "note": "note", "orderPayment": { "paymentTypeId": 8187, "paymentTypeTypeId": 4, "amount": 1 }, "customerId": 685567 }
The answer of the API return me an order ID
293388
2. Get the created order
API used :
GET - https://euc1.posios.com/PosServer/rest/onlineordering/order/293388
Data retrieved :
{ "id": 293388, "deliveryDate": "2019-12-05T16:10:22.000Z", "creationDate": "2019-12-05T16:10:22.000Z", "type": "takeaway", "receiptId": 0, "status": "ACCEPTED", "orderItems": [ { "id": 842308, "productId": 1250429, "productPlu": "D3", "amount": 2, "unitPrice": 5, "totalPrice": 5, "unitPriceWithoutVat": 5, "totalPriceWithoutVat": 5, "modifiers": [], "subitems": [] } ], "orderPayments": [ { "id": 293508, "paymentTypeId": 8187, "paymentTypeTypeId": 4, "amount": 1 } ], "orderTaxInfo": [], "note": "note", "numberOfCustomers": 0, "tableId": 0, "customerId": 685567, "orderPayment": { "id": 293508, "paymentTypeId": 8187, "paymentTypeTypeId": 4, "amount": 1 } }
So the order seems to be well created BUT when I go in the Lightspeed admin, there is no way to retrieve the created order and nothing is printed in kitchen connected to Lightspeed.
When I was using the staging access, I was able to see the order in the admin when doing the exact same process.
Is there something that I am missing ?
Thank you in advance for your help.
1 comment
Hello @Nicolas Bernier,
They paymentTypeId and paymentTypeTypeId used doesn't exist. That's why the order was rejected by the LiteServer,
You can get a list of the valid Payment Type with the request below.
https://developers.lightspeedhq.com/resto-api/endpoints/onlineordering/#get-available-payment-types