Any way to have separate API for each shop on a multistore setup?

bonitabonita Posts: 1Member
We have 5 shops. We use API to pull orders into a warehouse manage system. However since the API is all connected, it get orders from all 5 shops. Our goal is to be able to separate all sales from each shops from the API level and be able to use reorder reports. Any suggestion on how these can be accomplished? Maybe if we use different username (that is locked to one shop only) to get the API, it will generate different token keys?

Thank you very much for the help.

Answers

  • Adrian SamuelAdrian Samuel Posts: 368Moderator, Lightspeed Staff moderator
    edited November 2018
    Hey @bonita! We don't have a separate API thread per shop, as you can imagine, having a separate thread per shop would be a lot of overhead and would translate into a lot of development time.

    A simple workaround this would be to sort and group your data.

    I've written a live example in Node.js for you to explore. Simply enter in your accountID and your Access_Token in the fields at the top and then you'll be able to try the script with your live data. You'll see the final response groups the data from the Order endpoint by shopID.

    https://repl.it/@Adrian_Samuel/LS-Order-API-grouped-by-ShopID

    You can also add a query parameter to the request to specify the shopID

    Here's an example:

    https://api.lightspeedapp.com/API/Account/{{accountID}}/Order.json?shopID={{shopID}}


    I hope this helps!
    Post edited by Adrian Samuel on
Sign In or Register to comment.