Covers all questions related to inventory management, order fulfillment, and shipping.
Hello,
Am trying to perform an Admin API POST using CURL to set inventory level via a Custom App, per https://shopify.dev/docs/api/admin-rest/2023-04/resources/inventorylevel#post-inventory-levels-set instruction.
The item_inventory_id and location_id have been verified correctly, since I'm able to perform "GET" methods for inventory_level, but for POST am getting 400 Bad Request Error. I'm at a loss as to why.
I've reviewed past Shopify Developer postings regarding similar errors, but they haven't helped. As far I'm aware CURL doesn't send any cookies.
I think I also have the appropriate Custom App permissions to write to inventory_levels:
read_fulfillments, write_inventory, read_inventory, write_merchant_managed_fulfillment_orders, read_merchant_managed_fulfillment_orders, write_order_edits, read_order_edits, write_orders, read_orders, write_payment_customizations, read_payment_customizations, write_payment_terms, read_payment_terms, write_price_rules, read_price_rules, write_product_feeds, read_product_feeds, write_product_listings, read_product_listings, write_products, read_products, write_reports, read_reports, write_returns, read_returns, write_third_party_fulfillment_orders, read_third_party_fulfillment_orders, write_fulfillment_constraint_rules, read_fulfillment_constraint_rules
Any help would be greatly appreciated, and thanks in advance.
Regards,
Immanuel
I'm a newbie on this forum.
But just wondering if it would help if I post the X-Request-ID: d2fa99f8-7ee1-49cf-9dea-7dce8807fee6 here, I've seen some posts where someone had been helped after being asked for the X-Request-ID. Perhaps a representative from Shopify might be able to provide more insight to the error rather than simply returning "Bad Request" by looking up said X-Request-ID.
Regards,
Immanuel
Hello @immpek, Have you found any solution for this issue? I face the same problem while updating the inventory level via REST APIs. If you have any solution I really would like to get that solution.
Looking forward to getting a reply from you.
Thank you,
Hardik Zinzuvadiya
Hello @anaconx,
I wasn't able to get it to work using CURL, but I did get it to work using POSTMAN instead. So, unfortunately, I still don't know what exactly was wrong with the CURL command.
Furthermore, I ended up using a combination of REST API and GraphQL calls for my solution.
Hope that helps.
Regards,
Immanuel
It seems like you're encountering a 400 Bad Request error when performing the Admin API POST with CURL. Have you double-checked your parameters?
Hi Immanuel, However, there are a few things you can double-check to ensure that the request is formatted correctly Make sure you're using the correct API version.
Hello @AmberLaflamme,
Yes, I checked the parameters, I literally copied & pasted the curl command per Shopify's dev doc example: https://shopify.dev/docs/api/admin-rest/2023-04/resources/inventorylevel#post-inventory-levels-set
Since I was able to get it to work using POSTMAN, I didn't pursue the CURL issue any further.
-Immanuel