All things Shopify and commerce
Hi there,
I'm fundamentally new to Shopify and working on an integration project using Azure Logic App. One of the requirements is to set the available inventory quantity in Shopify using this API endpoint (myShopify.com/admin/api/2023-04/inventory_levels/set.json). I test the API endpoint using Postman and it perfectly works.
The problem that I'm getting is in the Logic App, when I sent the request for the below input,
{ "uri": "https://myShopify.com/admin/api/2023-01/inventory_levels/set.json", "method": "POST", "headers": { "Accept": "*/*", "Content-Type": "application/json", "X-Shopify-Access-Token": "xxxxxxxxxxxxxxxxx" }, "body": { "available": 89, "inventory_item_id": 40978570519510, "location_id": 70811973482 } }
"body": { "errors": { "inventory_item_id": "expected Float to be a id" } }
I don't really understand the problem. I did googled it but could not find any similar issues encountered in Shopify.
Has anyone encountered this before? any help is greatly appreciated.
Regards,
Junius
Hello,
I think the problem is that you need to specific the whole ID as opposed to just the number. Try this:
{
"uri": "https://myShopify.com/admin/api/2023-01/inventory_levels/set.json",
"method": "POST",
"headers": {
"Accept": "*/*",
"Content-Type": "application/json",
"X-Shopify-Access-Token": "xxxxxxxxxxxxxxxxx"
},
"body": {
"available": 89,
"inventory_item_id": "gid://shopify/InventoryItem/40978570519510",
"location_id": "gid://shopify/Location/70811973482"
}
}
User | RANK |
---|---|
40 | |
37 | |
24 | |
23 | |
15 |
Transform this holiday season into a shopping spree. Plus, learn how to effortlessly open ...
By Jasonh Dec 8, 2023Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023