Can you make multiple changes in 1 PUT request?

in Development
Hi,
Can you make multiple changes in 1x PUT request? i.e:
{ "ItemShops": { "ItemShop": [{ "itemShopID": "15392", "qoh": 1 }]}, "Prices": {"ItemPrice": [{ "amount": 49.95 }]}}
How should that be formed?
Thanks,
9 comments
Have you read through the API documentation? For a single item, you can issue a PUT request to update multiple properties. Described here --> https://developers.lightspeedhq.com/retail/endpoints/Item/#put-update-an-item.
Aye, I read the docs and saw that it says that you can update multiple properties in one PUT request. Thanks for the link.
My issue is more related to the form that my PUT request should take as the API issues an error when trying to update the price at the same time as the qoh.
I thought that reaching out to the community may help.
Gotcha. Here is an example request JSON body that would update a product note, the product's on-hand availability, and the product's pricing. I'd have to reference the correct item in my query's URL (e.g. - https://api.merchantos.com/API/Account/{accountId}/Item/{itemId}.json), as well as ensure that this item is defined in shop 1 as itemShopID 164, and ensure that useType and useTypeID's are correct.
{
"Note": {
"note": "This is a newly-updated note."
},
"ItemShops": {
"ItemShop": {
"itemShopID": 164,
"shopID": 1,
"qoh": 1
}
},
"Prices": {
"ItemPrice": [
{
"amount": "400",
"useTypeID": "1",
"useType": "Default"
},
{
"amount": "275",
"useTypeID": "2",
"useType": "MSRP"
},
{
"amount": "320",
"useTypeID": "3",
"useType": "Online"
}
]
}
}
Hi,
I'm trying with:
Which I think should work, but the API returns:
Unknown price level, is it indicating that it does not like the "." in the price?
Perform a GET request on this same item and you should see what the API is looking for when it comes to prices. There are different "use types" when it comes to prices.
Here is what the price levels look like in the front end UI. Even if you only have a single price level per item you'd presumably need to specify it when changing prices via the API.
...so did referencing a valid price level in your PUT call solve your issue?
Hi @gregarican, this one is on my todo list to resolve. I'll let you know when I get back to it! ;)
@gregarican Yes it was the 'useType' & 'useTypeID' that were missing. Thanks.