This topic and discussion board has been closed.
To stay updated on announcements related to the API please review this post about the new Developer changelog.
Hey Devs,
To allow apps to sync inventory changes faster, we have just released a new inventoryBulkAdjustQuantityAtLocation GraphQL mutation.
This mutation has a cost of 10, and allows to adjust the inventory of up to 100 inventory items at a specific location. With the GraphQL bucket refill of 50 this allows adjusting inventory of up to 500 inventory items per second.
mutation {
inventoryBulkAdjustQuantityAtLocation(
locationId: "gid://shopify/Location/1",
inventoryItemAdjustments: [
{inventoryItemId: "gid://shopify/InventoryItem/1", availableDelta: 1},
{inventoryItemId: "gid://shopify/InventoryItem/2", availableDelta: 10}
]) {
inventoryLevels {
available
}
}
}
Here's an example using Insomnia on my store:
With a sync bandwidth of 1.8M adjustments per hour, this should remove the need for Fulfillment Services to be the inventory manager; i.e. using the hourly fetch_stock sync. We recommend this mutation as the prefered way for Fulfillment Services to sync inventory changes with Shopify.
If you need help with GraphQL, you can join us in the #graphql channel of the Shopify Partners Slack! Also check out our Getting Started Guide and Blog post on using GraphQL with Locations. Our newest guides (fulfillment, inventory) also include GraphQL examples.
Happy Coding!
Ryan | Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
But this still requires us to call the stock level within Shopify first.... slow. We need you to allow us to SET the stock and ignore any adjusting like in the REST interface.
Dave
Hi Dave,
There are no plans to include a set endpoint for the new inventory APIs. You can keep track of any inventorylevel changes using webhooks and perform an adjust to the intended level. Inventory sets were too racy when multiple actors are adjusting inventory and often resulted in incorrect inventory counts.
Ryan
Ryan | Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
How do i get in on the Partner Slack Channel?
If you need help with GraphQL, you can join us in the #graphql channel of the Shopify Partners Slack! Also check out our Getting Started Guide and Blog post on using GraphQL with Locations. Our newest guides (fulfillment, inventory) also include GraphQL examples.
I'm going to chip in and say it would be great if we had a 'set'.
I certainly understand the race conditions, but I would imagine that a lot of your customers don't have stores where race conditions are a massive concern; assuming the inventory update are performed at slow times.
https://help.shopify.com/en/partners/getting-started/walkthrough#step-3-join-the-community
Link to join slack is on this page.
Ryan | Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
Thanks Ryan
I wanted to chime in and again stress how great the ability to set would be here. I certainly understand race conditions can come up, but we have an enterprise level ERP system that is the master of iventory data across all our systems, and we periodiaclly run full syncs to keep things up to date.
Without the set, we have to query the current shopify number, and then go and set it. "inventoryBulkAdjustQuantityAtLocation" is great and is only about 10% of the overall sync time, but we are spending 90% of the sync time just querying the current shopify number so we can calculate a delta (this is actually leads to _more_ race condtions).
It would be an INCREDIBLE help to have the ability to set the inventory number, and we could get our full ERP sync down to less than half a minute.
As a business owner, have you ever wondered when your customer's first impression of yo...
By Skye Jun 6, 2023We're excited to announce improvements to the threaded messaging experience in our communi...
By TyW May 31, 2023Thank you to everyone who participated in our AMA with Klaviyo. It was great to see so man...
By Jacqui May 30, 2023