200 Status OK response API

Hi,
We’ve been trying to connect our Kiosk with Lightspeed Restaurant. In the staging environment, we’ve been able to set up the connection successfully using the product ID’s for a non-establishment profile. The first client that will be using this API has an establishment profile with multiple stores in it.
We’ve connected the profile with the credentials of the first store. Thereafter we added the correct Company ID, Customer ID and Payment Type ID. This payment type ID was specifically created for our Kiosk. Since this is an establishment, we used the PLU codes to connect the products.
Attached you can find the code for sending orders. All we get is a 200 status ok response. After that, the order cannot be found in the Lightspeed reports.
Any suggestions on what we can do to fix this?
Many thanks
25 comments
Hi @MitchellWarmerdam,
Thank you for contacting us.
Can you show me the requestURL? When you're getting a 200 OK code, you've also got a response, can you show me the response when sending the order?
Hi Lucien,
Please find a screenshot attached with the response and URL.
Hi @MitchellWarmerdam,
Can you tell me on which server this account is on? You can check that in the company endpoint https://developers.lightspeedhq.com/resto-api/endpoints/corecompany/#get-all-companies
Hi @LucienVersendaal
Lightspeed server is euw1
Hi @MitchellWarmerdam,
It seems that the productPLU:OS35 doesn't exist for this company.
Hi Lucien,
That's weird, it does show PLU code OS35 when I review the menu. Please find a screenshot attached. As you can see, a separate category was created for Onesix Kiosk.
Do we need to change something in this account to activate these PLU codes?
Hi @MitchellWarmerdam,
Okay I see the product does exist.
I checked the server logs, and they are telling me that the product can't be found.
I guess that I see what is going wrong here, when I look at your payload I see you're using "productPLU" instead of "productPlu", can you make this change and try again.
Hi Lucien,
Thanks for your support. We changed the payload to "productPlu". Afterwards we tried sending orders as follows:
Neither seem to work. Can you see in the server logs what the latest error response is?
Many thanks,
Mitchell
Hi @MitchellWarmerdam,
Can you send me the payload?
Please find it attached
Hi @MitchellWarmerdam,
I've checked the payload but I don't see anything wrong here, also I can find this receipt in the resto manager:
The response you got after creating the order 5328920 is the orderID which you can retrieve by doing
GET/rest/onlineordering/customer/5143468/order/5328920
Hi @LucienVersendaal
The connection seems to be working. Thanks for your help!
We have one more question. We'd like to run a script that sends all the historic data to the Lightspeed report. However, when we do that, the date is automatically set to today. So it looks like all orders have been finished today. Is there a way we can send the original order date (deliveryDate)?
Thanks in advance!
Hi @MitchellWarmerdam,
What you can do is send orders with the deliveryDate in the past(max 7 days). The creationDate will the date when you're creating the order, so this will not be in the past.
I hope this helps.
Hi @LucienVersendaal
Thanks for your answer, is there a way we can send the orders with a date longer than 7 days?
Hi @MitchellWarmerdam,
Unfortunately not.
Hi @LucienVersendaal
Thanks for your answer!
I have one more question. The connection is working fine for most locations. However, for one client we keep having orders that are not showing up in Lightspeed. Can you see what causes this? We've checked the PLU codes and everything seems correct. It's for Company ID: 36962. Below you can see some orders that are missing in Lightspeed.
Thanks in advance!
Hi @MitchellWarmerdam,
Can you check if you're using the correct token for that companyID?
Use https://jwt.io/ and put in the access_token and check the CID matches the companyID.
Hi @LucienVersendaal
The token seems correct because some orders do appear in Lightspeed and some don't. Can you see, based on my previous screenshots, why those orders are not appearing?
Hi Mitchell,
Is this company also on euw1?
Hi Ali,
Yes, this is the case. We managed to send some orders but we're still facing some difficulties. Please find 2 problems below
Thanks in advance!
Hello,
Thank you.
Lightspeed HQ
Hey!
Let's first focus on the "wrong total" issue. The admin's email is [email protected] Please find the payload below.
Can you see why this is order is not a total of €19.60?
Hello,
Products of type combos and choices are not supported for online orders (the burger menu in this example). To sell these types online, they need to be recreated as Products + Modifiers.
Lightspeed HQ
Hi Yorick,
Thanks, we will forward this to our client.
Then we have one more challenge that we're facing with the connection. Please find a screenshot of the order within Lightspeed below.
Here you can view the order within our dashboard.
Here you can view the payload.
Can you explain why the total price is €17,20 within Lightspeed instead of €17,70?
Thanks in advance
Hi Mitchell,
Was the account modifiers updated since this example? Some of this ID and PLU seem different from what I see in the account right now.
When you send the PLU in the payload, it takes preference over the ID if there is a match. When there is duplicate PLU in the backend, we pick the first one.
If you check all available modifiers on the account, you will find some duplicates (all groups seem duplicated) with 4 lychee modifiers, 2 of them with a $0 price. I would recommend to clean up the modifiers and update it on your side, or sending only the ID to avoid this kind of unexpected result.
Lightspeed HQ