I’m using Shopify’s official API client (@shopify/shopify-api) for node.
My system has its own inventory management system and I want it to behave as a master control thus I want to set an available amount at the inventory level via API. For that, I’m using inventory_levels/set endpoint on that client with post request and my JSON body looks like the following.
{
inventory_item_id: 45197411975402,
location_id: 70109757674,
available: 177
}
Now when I’m trying to send a request to Shopify, I’m receiving the following error.
HttpResponseError: Received an error response (400 Bad Request) from Shopify:
{
"inventory_item_id": "Required parameter missing or invalid"
}
If you report this error, please include this id: a31e7178-6bb4-4f62-8466-171f8c837f5e
at HttpResponseError.ShopifyError [as constructor] (/xx/xx/xx/xx/node_modules/@shopify/shopify-api/dist/error.js:13:28)
at new HttpResponseError (/xx/xx/xx/xx/node_modules/@shopify/shopify-api/dist/error.js:95:28)
at RestClient.
I did try a few suggested solutions for similar issues (giving content type to application/json, verifying ids, etc) and it seems that none of those worked
Update - I've tested the same with Postman and I can very well confirm that it works fine in Postman. But if I change **Content-Type** header to something else than **application/json** then I receive the same error.
Now I really really believe that Node client's [post](https://github.com/Shopify/shopify-api-node/blob/HEAD/docs/usage/rest.md#post-and-put) method should be doing this automatically for sure but for some reason if it doesn't do that, I can see a property named **extraHeaders**. I've used it something like below since there is literally not a single example on how to utilize that property. The error is still the same so can anyone point out what I'm doing wrong?
```javascript
extraHeaders: {
'Content-Type': 'application/json',
}