"Item not Update. The ItemShop record with shopID 0 cannot have its qoh field changed." Error

DigwoodDigwood Member Posts: 4

Despite many efforts, I cannot seem to stop getting this error. I've combed the forums and understand how the multiple shop entries work. However, even after specifying in the payload shopId: 1, it still insists on attempting to update shopId: 0.

Delivering the same, exact payload through Postman - everything works fine.

Here's a list of curlopts set in the code (PHP 7.4):

CURLOPT_URL              => 'https://api.lightspeedapp.com/API/Account/<ACCT ID>/Item/<Item ID>.json?load_relations=["ItemShops"]',
CURLOPT_CUSTOMREQUEST    => "PUT",
CURLOPT_RETURNTRANSFER   => true,
CURLOPT_ENCODING         => "",
CURLOPT_MAXREDIRS        => 10,
CURLOPT_TIMEOUT          => 30
CURLOPT_HTTPHEADER       => [
    "Content-Type: application/json",
    "Authorization: Bearer " . <AUTH TOKEN>
]

And here's the json'ed payload:

{"ItemShops":{"ItemShop":[{"shopId":1,"itemShopId":134,"qoh":69}]}}

Everything I could find on the error showed the user trying to update shopId: 0, so I'm not quite sure where I'm going wrong.

Can anyone advise? Thanks!

1 comment

  • DigwoodDigwood Member Posts: 4

    Immediately found the solution after posting, but this forum wouldn't let me see or edit this post until now, for some reason.

    Anyway, for those (like me) who have become temporarily blind to the obvious:

    Capitalization matters. shopIdandshopIDare not the same, and not interchangeable. Don't forget about Case-Sensitivity! :D

Sign In or Register to comment.