If you have two applications each making an API call to the same shop, to the same endpoint, and to same item, then Lightspeed Retail would logically reflect the requests. As long as no API thresholds have been exceeded then there are no surprises. Lightspeed Retail would only reflect what's been pushed into it via the API.
Out of curiosity, why would you have two applications in this scenario?
I was just writing about how this had to be something really stupid I was missing ... and then, sure enough, I realized I was calling json_encode() twice on the same data.
The post() method that I'm passing all this into -- and using successfully with other thing like Items and Customers -- encodes the array into json, so I didn't need to be doing it when I passed the data.
Duh. Thanks, all, for helping me talk that through!
Thanks Adrian, I was keeping the example simple for the purpose of explanation.
My production solution is to left pad my search query for the systemsku field with zeros to 12 digits and that gave me the results I was expecting.
Still an unexpected behavior that should should be put on the defect shelf unless its mentioned in the API docs somewhere.
Thanks @Adrian Samuel . Your answer solved my problem!.
Hi @mapetek ,
Thank you for contacting us.
"Orders from Retail aren't pushed to over to eCom, they can't be viewed on the customer profile within eCom."
The moment that an eCom order is paid, that is the moment that this order will be pushed to Retail. So you need the Retail API to fetch the order history of a customer.
With this request you can get all sales of the customer with ID 1.
To connect with the retail API you'll need to follow this steps: https://developers.lightspeedhq.com/retail/authentication/authentication-overview/
I hope this will help.
Thanks @Adrian Samuel!
I need the code to show the separate line item labor prices, just not the $0 on the Work Order line. I'll play around with your code to see if I can modify it to do that or contact a development partner.
Thank you, that works perfect. Just a small correction:
The headers are spelled this way:
[X-Event] => products/deleted
Yes, you can obtain the item(s) associated to the Sale and the quantity sold by loading the relations SaleLines.
Hi @ahall I removed your file for security reasons but upon looking it over I was able to find the issue. The client is only authorized on your company test account, and that is the account you are getting the access token for. You are then trying to make a request to the customer account, but you do not have an access token/refresh token for that account. Here's a link to our documentation explaining how to request/be granted access to your customer's account: https://developers.lightspeedhq.com/retail/authentication/access-token/
Hi @BFentress ,
Our API gives a result of max 100 items per call, so you need to build a pagination. You can do that by doing this:
/Item?load_relations=all&offset=0 //offset=0 page1 //offset=1 page2
For more information: https://developers.lightspeedhq.com/retail/introduction/introduction/#pagination