Syncing data to clerk...

jurajjuraj Member Posts: 1
Hey, I am trying to connect one lightspeed webshop to a third party(clerk.io). To sync it, I need to submit a json file containing all products, sales, and categories in a specific format.

I found the 'products' endpoint and started to construct the desired output. However, I was not able to find the price attribute. The price attribute is contained at the variants/catalog endpoints, but 'catalog' doesn't work with the field filter ("?fields=id,title...") and 'variants' endpoint doesn't contain other product related attributes, such as title, description etc. 

Also, when looking at "categories" in the 'products' endpoint, it is a reference to another API call. I should submit the categories as an int string (234, 12, 235, 623).

Please, how can I generate a json containing the products WITH the following fields: ID, title, description, PRICE, image, url, CATEGORIES?

Once I get the products ready, I also need to construct the categories json output with id, name, url and subcategories. The final step is the sales, with id, products, time and email. 

Does anyone have a clue on how to approach this problem?


1 comment

  • JaivyDaamJaivyDaam Lightspeed Staff Posts: 29 Lightspeed
    Hi @juraj

    Thank you for your message.

    As this is a REST API, we have different recourses for different aspects of our platform. As these are relational by ID, I would like to advise you to create a database with all of the information inside different tables and relate them using ID's. Every productID has different resources with different ID's attached to them where you can interlink them.

    Only then you'll be able to create a SQL query to gather all of the relation information and generate the desired JSON output.

    I hope to have informed you sufficient, if you have any questions do not hesitate to contact us.
Sign In or Register to comment.