updating the quantity of an Item

meatcomputermeatcomputer Posts: 12Member

Hello,

I was looking through the API and I feel like I'm quite close to finding the right endpoint but it doesn't seem to be on the documentation.

I understand that every item has an related ItemShop(s) which has a "qoh" column which I could use to update the quantity of an item.

I found this page (https://developers.lightspeedhq.com/retail/introduction/relations/#writing-to-relations) about writing to relations but it only shows writing to the "Sales" relation.

Can I write to the ItemShops relation if so how?

All the best.

Tags:

2 comments

  • Adrian SamuelAdrian Samuel Posts: 306Moderator, Lightspeed Staff moderator

    Hey @meatcomputer , you basically need to make a request to the item endpoint, specify in the path the itemID and then write to the shop of the quantity you're updating. Remember itemShop 0 is the aggregated information from all the shops and so is therefore not writeable.


    A typical request would look like this:


    // Request https://api.lightspeedapp.com/API/Account/{{accountID}}/Item/{{itemID}}.json
    
    {
        "ItemShops": {
            "ItemShop": [{
                "itemShopID": itemShopIDNumber,
                 "qoh": 2  //quantity on hand. Whatever number you set will be the quantity. It will not add to the existing number
            }]
    
        }
    }
    
    


  • meatcomputermeatcomputer Posts: 12Member

    Thanks that really cleared that up for me

Sign In or Register to comment.