Assign Inventory to Location with API

Solved
Highlighted
Tourist
12 3 7

Hi everyone, very simple question, hoping there is an answer and not that this hasn't been implemented yet.

How do I assign an inventory item to a specific location using the API?

I have the location all set up, and when I go to hit the inventory_levels/adjust.json endpoint with the correct params (location_id, inventory_item_id, available_adjustment) I get a 404 error: Not found.

When I go to create inventory in this warehouse for this product manually via the Shopify admin, I get this message: 

"Inventory can’t be edited because no variants are stocked at <your location>."

Ok, makes sense.  I need to associate the variant/inventory_item/whatever with the specific location since new products are automatically associated with the default location.  But there isn't an obvious way to do that with the API?  When I search: "Shopify assign inventory to location with API" on Google I usually get to this page: https://help.shopify.com/en/manual/locations/assigning-inventory-to-locations.  This page is exactly what I need...minus the API part (most important part hehe).  I find it a  bit ominous that I can't immediately find some documentation about this, hoping it's implemented and just not well documented.

Thank you, let me know if you need more information.

0 Likes
Highlighted
Tourist
12 3 7

This is an accepted solution.

In a classic move, I've found the answer to my question moments after posting it.

https://shopify.dev/docs/admin-api/rest/reference/inventory/inventorylevel?api[version]=2020-04

A ways down the page there is an example section for: Connect an inventory item to a location.

Sorry for cluttering up the board, maybe this will help someone in the future.

1 Like