Error with updating quantity via API

meatcomputermeatcomputer Member Posts: 24

I haven't updated my code for many months so I'm assuming something changed on in the API.

I keep getting the error "{"httpCode":"400","httpMessage":"Bad Request","message":"Item not Update. The ItemShop record with shopID 0 cannot have its qoh field changed.","errorClass":"Exception"}'

I am sending a put request to:` 

"https://api.lightspeedapp.com/API/Account/**accountid**/Item/**itemid**.json"


With the payload:

       quantity_info = { "ItemShops": {

           "ItemShop": [{

               "itemShopID":number,

               "qoh": 1

               }]


But I keep on getting the same error. Any ideas?

1 comment

  • gregaricangregarican Member Posts: 870 

    shopID 0 is a read-only calculated entity, that represents the aggregate sum of all shops. So let's say you have shopID 1 with 3 on-hand, and shopID 2 with 2 on-hand. Then that would mean shopID 0 would show 5 on-hand as the total.

    Check your case-sensitivity and check you aren't trying to update a value in the read-only shopID 0. Details here --> https://community.lightspeedhq.com/en/discussion/comment/13653.

Sign In or Register to comment.