Determining customer contact information for contact tracing purposes

Hello,
We are building Contact Tracing AI, a software system that helps organizations leverage their existing technology infrastructure (e.g. Video Management, Point-of-sales, and Access Control) to identify customers and employees who may have been exposed to known COVID-19 cases, automatically and at scale.
We would like to integrate with Lightspeed Retail and/or Lightspeed Restaurant POS in order to associate contact information with customers in videos. Reading through the documentation I found https://developers.lightspeedhq.com/retail/endpoints/Customer/, which seems to indicate that this is possible. However, I have couple of questions:
1) How does customer contact information make its way into the system? Is it automatically made available by Lightspeed whenever a customer makes a transaction, or is there some additional process that is required?
2) Presumably we have to be approved and/or authenticated in some way, and there is some degree of access control so that we do not have access to all customer information all at once. How exactly can a third party application developer gain access to customer contact information?
Any additional feedback or guidance would be appreciated.
Answers
As long as a Lightspeed support rep approves your application then the actual client grants you access to their account. Via typical OAuth scopes. In your case it would just be the employee:customers scope. See https://developers.lightspeedhq.com/retail/authentication/scopes/ and https://developers.lightspeedhq.com/retail/authentication/access-token/ for details.
Once that takes place then you can use your access token to grab a refresh token and you can make API calls. See https://developers.lightspeedhq.com/retail/authentication/refresh-token/ for how that works.
It's pretty much just a standard REST API set of endpoints. Unfortunately (although Retail is a cloud-based solution) there are no webhooks. So you can't just listen for a trigger of a new customer being added. You have to poll the Customer endpoint with a REST API request with a timestamp query parameter. That will provide you the newly-added customer records.
Here's an example REST API query for new customers created on 2019-01-19 anytime during the timespan. I just add the Authorization Token in my request header and off I go. 😀
https://api.merchantos.com/API/Account/{AccountId}/Customer.json?createTime=><,2019-01-19T00:00:01-5:00,2019-01-19T23:59:59-5:00
Thank you for the prompt response!
As long as a Lightspeed support rep approves your application then the actual client grants you access to their account.
We have submitted an application at https://www.lightspeedhq.com/partners/partner-application/. Is this what you are referring to, or is there some other application we need to submit?
Here's an example REST API query for new customers created on 2019-01-19 anytime during the timespan. I just add the Authorization Token in my request header and off I go. 😀
What does it mean for a customer to be created? Does this mean they made a payment at a Lightspeed POS? Once a customer has been created, is there a record for every time they make a payment?
Thanks again!
I believe that's the correct link for applying. Not sure how long it will take to get a response as to the status of your application.
My example was just that, pulling any new customer records initially creating during that timespan. You can employ similar API requests for querying sales during a specific timespan. In addition to the base sales record, you'd employ load_relations to pull related datasets, such as the customer record, the payment record, etc. So you would need access scopes for those other areas in addition to just employee:customers.
The REST API request would look something like this:
https://api.merchantos.com/API/Account/{AccountId}/Sale.json?archived=false&voided=false&completed=true&load_relations=["SalePayments","SalePayments.PaymentType","SalePayments.SaleAccounts","SalePayments.CCCharge","Customer","Customer.Contact"]&offset=0&limit=100&timeStamp=><,2019-01-01T00:00:01-5:00,2019-01-31T23:59:59-5:00