LightSpeed eCom API and webhook

robyrajurobyraju Member Posts: 4

Hi,

I'm trying to integrate LightSpeed eCom with GetResponse App and do automations. I have implemented site tracking using GetResponse JS code. But i couldn't track or synchronize the products, orders or customers in the store. As i have talked with the GetResponse support, i came to know that GetResponse don't have ecommerce integration with LightSpeed. So, i have decided to try the LightSpeed webhooks to fetch details of products, orders or customers and send to GetResponse.

I have checked the webhooks in LightSpeed API article (https://developers.lightspeedhq.com/ecom/tutorials/webhooks/) and i just want to know answers for some questions below:

1. Is webhook or API more suitable for this case?

2. Do we need any API key or secret key for creating and using webhooks?

3. How can we get the group ID (X-Group-Id) of the webhook we want to use?

4. If we set up a webhook that will call a URL when a new product is added in the store or a new order has been paced, do the response have the details of the product added or the new order?

5. Do validation is necessary for a webhook? How to set 'X-Signature' value?

Please let me know.

Thanks in advance

Answers

  • LeahLeah Moderator, Lightspeed Staff Posts: 109 moderator

    hi @robyraju let me try to answer your questions:

    1. Is webhook or API more suitable for this case?

    If you're trying to fetch newly created and/or updated products, customers and orders, webhooks are suitable for this. If you need to fetch pre-existing records, you will need to use the API to get these.

    2. Do we need any API key or secret key for creating and using webhooks?

    Yes, you need an API key and secret in order to access the eCom API, including creating and updating webhooks.

    3. How can we get the group ID (X-Group-Id) of the webhook we want to use?

    The webhook groups and actions are outlined here: https://developers.lightspeedhq.com/ecom/tutorials/webhooks/

    The X-Group-Id is associated with webhooks sent to apps and do not apply for single shop connections like the one you would be working with.

    4. If we set up a webhook that will call a URL when a new product is added in the store or a new order has been paced, do the response have the details of the product added or the new order?

    Yes, the webhook responses will contain the objects from the group/event they are associated with.

    5. Do validation is necessary for a webhook? How to set 'X-Signature' value?

    X-Signature is another header that is used exclusively for app webhooks and does not apply in this case

    API Support
    Lightspeed HQ
  • robyrajurobyraju Member Posts: 4

    Hi @Leah,

    Thanks for the reply.


    To confirm, which of these do i need in my case:


    X-Shop-Id

    X-Format

    X-Language

    X-Group-Id

    X-RateLimit-Limit

    X-RateLimit-Remaining

    X-RateLimit-Reset

    X-Cluster-Id

  • robyrajurobyraju Member Posts: 4

    Hi,

    I have one more question.

    I want to get only popular products from the eCom store. If i use the "/products.json" resource, which parameter i need to pass with that to sort the result based on popularity?

  • LeahLeah Moderator, Lightspeed Staff Posts: 109 moderator

    @robyraju those headers represent the headers that are sent with the webhook to the URL of your choosing. They will all be included in the webhook request. You can set up your webhooks on your shop and use a URL generated by the webhook tester at: https://webhook.site/ for the 'address' field. This URL will then allow you to see the full webhook request that eCom sends.

    As for the popular products, there is no API field for products that would allow you to sort based on popularity. The ability to sort on popularity is limited to the theme variables. See the documentation here: https://ecom-support.lightspeedhq.com/hc/en-us/articles/115000277594-3-b-Rain-variables#template-pageindexrain

    API Support
    Lightspeed HQ
Sign In or Register to comment.