Lookup customer by email?

agrohsagrohs Member Posts: 6
Is there any way in the API to do a search for customer records via their email address?

1 comment

  • Adrian SamuelAdrian Samuel Moderator, Lightspeed Staff Posts: 627 moderator
    edited October 2018
    Hey @agrohs!

    You need to add the "Contact" relation to the query and it will enable you to get the Emails Object returned which has the relevant data.
    You'll also need to implement a special search query on that relation. 

    An example of this would be:
    <a rel="nofollow" href="https://api.lightspeedapp.com/API/Account/%7B%7BAccountId%7D%7D/Customer.json?load_relations=[">https://api.lightspeedapp.com/API/Account/{{AccountId}}/</a>Customer?load_relations=["Contact"]&amp;Contact.email=~,[email protected]
    

    You can read more about the different relations in our documentation here :
    Customer endpoint
    https://developers.lightspeedhq.com/retail/endpoints/Customer/

    Searching tutorial
    https://developers.lightspeedhq.com/retail/tutorials/searching/
    :)
    Post edited by Adrian Samuel on

    Adrian Samuel

    Software Developer - Strategic Solutions

    Lightspeed HQ

Sign In or Register to comment.