d
Topic
Ryan O Shopify Employee
Posts:
88
Last edited 9 days ago

[Deprecation] Important changes to ProductVariant, Refund and Fulfillment APIs

Hey Devs,

Shopify is preparing to release multi-location inventory features to all merchants this summer. All apps that create fulfillments or manage inventory will need to be updated by July 1st, 2018, to remain functional on shops that track inventory across multiple locations.

Key dates

July 1st, 2018

  • Apps will no longer be able to create fulfillments without specifying a location
  • Apps will no longer be able to set inventory on the Product/Variant APIs

Migrating to support multi-location fulfillments

Shopify fulfillments are currently “location unaware”, meaning that when an app creates a fulfillment and fulfills an order, Shopify decrements the inventory with no concept of which location that inventory should be decremented from. In order to support merchants with inventory allocated across multiple locations, apps will need to include a location_id when creating fulfillments.

For details on how to migrate your apps to support multi-location, see our Multi-Location Fulfillment Migration Guide.

Migrating to support multi-location inventory

Currently inventory is set and adjusted on the product variant and is not tracked by any particular location. In anticipation of multi-location inventory, Shopify has released a new Inventory API, which includes two new endpoints: Inventory Item and Inventory Level. The Inventory API will allows apps to effectively manage inventory quantities across multiple locations.

For details on how to migrate your apps to support multi-location inventory, see our Multi-Location Inventory Migration Guide.

We’ll keep you up to date as we continue to make improvements to our platform’s multi-location fulfillment and inventory management capabilities, so you can continue to build the best apps to help extend these new features.

If you have any questions about this change, please read our detailed FAQ or contact deprecations@shopify.com.

 

Thanks,

Shopify Apps Team

i
Replies
tomn68 Member
Posts:
1
about 1 month ago
g
1
upvotes

Is this a revised schedule? I thought the last email from February where it stated May 7 as option to enabled multi-location inventory and then Jan 1 2019 where it goes read only.

Just so I'm clear, if we use the product variant to track inventory levels but do not use them to track muli-location inventory levels, does this new July 1st date effect us in this use case?

 

Tom

Posts:
4
about 1 month ago

Hi Ryan,

It would be a lot better if you guys could allow us to enable multi location on our development stores before releasing this nice addition to the grand public. 

We are authoring an inventory management platform with a nice integration with Shopify. This is a very important change we need to get right from the start and we don't have much time left. 

Another question which came up from our engineering team is: how are existing merchands who don't have multi-location enabled going to be affected? Will the deprecated inventory APIs be disabled for this merchands cohort as well? 

 

Thanks in advance.

Tahar from Stock&Buy

Ryan O Shopify Employee
Posts:
88
about 1 month ago

Hi Tahar, 

Stay tuned for details on enabling multi-location features on development shops.  I don't have any public details to share except that it will be available to all partner developers before it launches to merchants.

 

For all,

If you have specific implementation questions for the migration please contact deprecations@shopify.com.

Posts:
4
about 1 month ago

Thanks Ryan. Appreciate the super fast response. 

By the way, we did send an email to deprecations@shopify.com but received no response :)

Posts:
1
about 1 month ago

Hi Ryan,

   Thanks for all the awesome detail. 

    I have a quick question about the affect of inventory on the orders api.  There is a flag on the create order api call called inventory_behavior.  Do the changes made that will affect the inventory levels on the Product API have an affect on this?  I know they are totally different API endpoints but I wasn't sure if the underlying behavior would cause any changes on Order api as well.

Thanks!

Posts:
3
about 1 month ago

Hello, after reading the post i realized that for the FulfillmentApi the only change that's need is to provide a location_id.

The question is: where do i find the location_id? I mean no location has been specified right now for products and variants, so how can they be associated to a Location? Is this something that happens by default for all the inventory?

Thanks!

Ryan O Shopify Employee
Posts:
88
about 1 month ago

Hi Ralph,

There is no change to the orders API.  If you specified inventory_behaviordecrement_obeying_policy Shopify will handle all of the inventory decrementing using the new APIs.

 

Hi Fabio,

You can get the location_id from https://help.shopify.com/api/reference/location#index to see them all or from https://help.shopify.com/api/reference/inventorylevel to see locations for a specific item.

 

Ryan

Posts:
2
Last edited about 1 month ago
g
2
upvotes

Hello Ryan O,

Two issues with this:

1. This change violates the golden API rule.. once publised, behaviour should not change or break. Why not allow us to continue setting variant -> inventory_quantity and under the hood just update the appropriate inventory item/level for the default Location?

2. This change will incur extra API calls.

 

Upon further review...

(a) https://help.shopify.com/api/tutorials/inventory-migration-guide#affected-apis
Affected API | Changing behaviour 

Setting inventory_quantity will adjust a product variant's inventory at its location that has the lowest ID. The inventory at that location will be adjusted so that the sum of inventory across all locations matches the value set by inventory_quantity. Use the Inventory Level endpoint instead.

(b) https://help.shopify.com/api/tutorials/inventory-migration-guide#deprecation-schedule
Deprecation Schedule

July 1, 2018
Apps will no longer be able to set inventory_quantity or inventory_quantity_adjustment on the product variant.

(a) and (b) seem to contradict each other or does "Setting inventory_quantity.." refer to current behaviour?

 

Thanks,
Paul

Posts:
9
Last edited about 1 month ago
g
2
upvotes

So with a new shop where you have to add lets say 100 product calls to the api, you now have to add that x times for each variant due to the inventory level getting its own endpoint ? Isn't it possible to just send the inventory items with the variants within the same call for when you add a new product with variants ?

Metafields is a myth...
Hari Member
Posts:
3
23 days ago
g
1
upvotes

Hi,

I use a private app (not Third party apps) to make API calls to my store endpoint to update inventory quantity and fulfillment details for the order. fulfillment_service is set to "manual" for all the products/variants. I fulfill the products manually and use my custom application to update Shopify with the required details.

Question:

1. Is location_id still mandatory in the fulfillment API even when private apps are making the call to create the fulfillment records ?

2. When the product is set to fulfillment_service = manual, can i update the inventory levels using Inventory API without specifying the location_id.

bardia Member
Posts:
3
Last edited 18 days ago

Hi Ryan,

Could you please update the post's links to the two Migration tutorials? They point to 404.

Thanks,

Bardia

Robert Tolton Member
Posts:
3
Last edited 10 days ago

@Hari - I too would like to know this, I have a private app performing fulfillments currently. It's slightly concerning that neither the fulfillment migration tutorial nor the API docs for locations are currently available? Is locations something you opt-in to?

Ryan O Shopify Employee
Posts:
88
9 days ago

Hey All,

Fulfillment Migration Guide, Locations, if these don't work for you, try resetting your cache.  The  URLs were only down for about 30 minutes for the migration to the new developers site.

Question:

1. Is location_id still mandatory in the fulfillment API even when private apps are making the call to create the fulfillment records ?

2. When the product is set to fulfillment_service = manual, can i update the inventory levels using Inventory API without specifying the location_id.

You must always include a location ID, doesn't matter about private apps.

Posts:
48
Last edited 9 days ago

I noticed the same thing as Paul and mentioned it here. Important to get an answer. 

Ryan O Shopify Employee
Posts:
88
9 days ago

Responded to your other thread as well:

 

You have to include a location ID even if the shop only has a single location.  The changed behaviour on Product and Product Variant went into place when that document was pubished in late 2017, and will only continue to take place in a grace period for grandfathered apps after the release of multiple locations.  This is in order to mitigate the affect on merchant's inventory if the apps do not migrate in time.  I will update the migration guide to be more clear about this.

Posts:
4
Last edited 9 days ago

Hi Ryan,

We are still unclear about how the new API will work. Here are a few issues / questions we are currently having a very hard time with:

  1. Is multi location equivalent to multiple locations? What I mean is, we have a test store with three locations but the has_multilocation flag is still set to false. Is there a place in the admin area where we can turn this on? Can one define multiple POS locations with the has_multilocation flag set to false? 
  2. Related to point 1 above, do you have an ETA as to when we can we set the multi location flag?   

I would be helpful if you can answer these questions in a timely manner, we have one engineer staying idle waiting for these points to be clarified :)

Thank you in advance.

Tahar.

Ryan O Shopify Employee
Posts:
88
9 days ago

You can test the multi-location feature by creating a new development store from your partner account and checking the box here:

Once your store is created you can go to settings > locations and enable the features.

For 1.  Even with the flag off, you may have more than one location.  This could be from POS locations, or automatically created from a fulfillment service

Posts:
4
8 days ago

Thanks a lot Ryan. That definitely helps. In case of a store with multiple POS locations and the has_multi_location flag set to false, how will Shopify behave? Would inventory and orders be handled same as if the multi-location flag was set?  

Again thanks for all the clarifications.

Posts:
48
7 days ago

Hi Ryan O. Here is another question. When creating a product via the API or creating a new variant via the API do we, in essence have to create variants with zero inventory and then after the call completes we set inventory levels for the necessary location(s)? So the new flow of product creation would be:

  1. Setup JSON for a full product including properties, images, variants, metafields, etc...
  2. POST to /admin/products.json
  3. Inspect response JSON to get inventory item ID's
  4. For each variant's inventory_item_id, submit a POST to inventory_levels/set.json to set its available inventory

This right? Make sense? No way to create a product with inventory levels in one call anymore?

Andrii Member
Posts:
2
2 days ago

Hi Ryan,

Can you help me, I have a method that set inventory_quantity. The question is: what should I do now? Do you have some tutorial what to do in this case? For now I haven't any locations for my application.

Thanks, Andrii.

Ryan O Shopify Employee
Posts:
88
Last edited 2 days ago

Andrii, check out the inventory migration guide in the original post.  You will need to convert to the new inventory APIs.

Andrii Member
Posts:
2
Last edited 2 days ago

Ryan, I read it, but I can't understand how to do it. Should I manually create location level record for each variant?

Also this link is not correct maybe (https://help.shopify.com/api/reference/location)?

Ryan O Shopify Employee
Posts:
88
2 days ago

I'm not sure I understand your question Andrii, and this forum isn't the best platform for 1:1 support.  Could you email deprecations@shopify.com and add some more details to your request.  Thanks!

Posts:
48
2 days ago

Hi all, this change is tough on developers. I would actually suggest talking this out here would be great! 

Ryan O Shopify Employee
Posts:
88
2 days ago
g
1
upvotes

So the new flow of product creation would be:

  1. Setup JSON for a full product including properties, images, variants, metafields, etc...
  2. POST to /admin/products.json
  3. Inspect response JSON to get inventory item ID's
  4. For each variant's inventory_item_id, submit a POST to inventory_levels/set.json to set its available inventory

This right? Make sense? No way to create a product with inventory levels in one call anymore?

This is correct.

Hi all, this change is tough on developers. I would actually suggest talking this out here would be great! 

The email is handled by a whole team, and can help with specific shops, request-ids, and other private data.  General questions are fine here though.

Ryan O Shopify Employee
Posts:
88
Last edited 2 days ago

Thanks a lot Ryan. That definitely helps. In case of a store with multiple POS locations and the has_multi_location flag set to false, how will Shopify behave? Would inventory and orders be handled same as if the multi-location flag was set?  

Again thanks for all the clarifications.

When the merchant opts in to multiple locations (aka enabling the flag), this allows the merchant to create new locations, and automatically connects all of their existing inventory to the shipping origin location.  All other behavior is already implemented and functioning currently.

Ryan O Shopify Employee
Posts:
88
2 days ago

Paul,

1. This change violates the golden API rule.. once publised, behaviour should not change or break. Why not allow us to continue setting variant -> inventory_quantity and under the hood just update the appropriate inventory item/level for the default Location?

2. This change will incur extra API calls.

1. This is why we gave as long of a lead time as possible, we recognize that this is a large change for developers and will continue to work with you to get it done.

2.  If your apps are having issues being rate limited due to the new multi-location features, please reach out to deprecations@shopify.com and we can discuss your individual use-cases.

Upon further review... (a) and (b) seem to contradict each other or does "Setting inventory_quantity.." refer to current behaviour?

The wording has since been updated to clarify: "The following behaviors are temporary and exist only to help you migrate to the Inventory API. Updating inventory using the Product and ProductVariant APIs is deprecated, and should no longer be relied upon to update inventory."

 

Poul,

So with a new shop where you have to add lets say 100 product calls to the api, you now have to add that x times for each variant due to the inventory level getting its own endpoint ? Isn't it possible to just send the inventory items with the variants within the same call for when you add a new product with variants ?

In order to set the inventory level on a new inventory item, yes you will need to make another call.  You cannot set the inventory level in the same call as creating the variant.