I'm developing a order management app to create fulfilment orders at a 3th party logistics provider.
So far I am able to:
Query the orders.
I created a Fulfilment Service.
I can request locations and inventory levels.
The main question now is how I can relate line_items from the order to inventory levels.
When I query an order, I get data like:
sku, product_id, variant_id
To retrieves a list of inventory levels, I need to have inventory_item_ids.
Or when I query inventory levels, I receive an inventory_item_id and location_id, but how do I know which products are related to these inventory and location id's?
"Each product variant has one inventory item, and that inventory item belongs only to that product variant."
How can I find this 1:1 inventory item id?
You can't get the relationship directly from the inventoryLevel. You have to request the inventoryItem. the inventoryItem is the data structure encapsulating the inventoryLevel. You can at the same time request the variant of an inventoryItem and then get the variant id.
I hope that help
After a bit of digging, it looks like the only way with REST API is to get the inventory_item_id via the Product Variant request
I hope it will help you (this time)