Shopify位置:这个更新对应用程序意味着什么Developers

shopify locations developers

At this year’sUnite, Shopify introduced a fundamental new concept, and the workflows surrounding it:Locations, To enable Shopify Developers to update current apps or create new apps around this concept, we’ve made important updates to various APIs, and introduced new Inventory APIs.


To evolve with the many sales and fulfillment needs of merchants, Shopify has put a lot of effort into adding location awareness to many core areas, including inventory, fulfillment, transfers, refunds, and more. With these changes to our platform, Shopify’s ‘back office’ capabilities are getting a much needed upgrade to better support our merchants’ growing needs, and the API updates will allow developers to build new and innovative solutions.

In this blog post, we’ll walk you through what this update means for Shopify Developers, and the necessary changes you need to make to your apps to better support your merchants with multiple locations.

You might also like:How the New GraphQL Admin API Can Help You Manage Inventory and Locations.

How APIs around locations have evolved

shopify locations developer api avilability

Over the past 10 years, Shopify has grown with our merchants and developers in ways we couldn’t have predicted.

In the beginning, Shopify was designed for merchants with very simple inventory needs. Many of our merchants started their businesses fulfilling inventory from one place, such as a basement or garage. Because of this, the solutions available were also very simple.

In 2013, Shopify introduced Locations in the form of ourPoint of Saleproduct. At that time, locations were only connected to orders. This helped keep track of the specific retail location where an order was placed.

在2018年,我们更新位置的概念。的easiest way to think about a “location” is any place where a merchant does business. It can have an address, it can store inventory, it can ship items, or it can make sales.

With this concept of Locations, instead of seeing a single number that represents all of a merchant’s inventory for a specific product, Shopify merchants will be able to manage their inventory per location, for the first time ever.

You might also like:Introducing Shopify Developer Tools for macOS.

Reaching new merchants and enhancing your app with Locations

shopify locations developer admin

Locations provide a dedicated home for fulfillment apps, custom fulfillment services, dropshipping apps, print-on-demand apps, and third-party logistic apps. They also represent all the physical places from which orders are being fulfilled.

In this space, apps can help merchants manage items at one or more locations, and provide better visibility and control overinventory management. Apps can specify where items are being stocked, fulfilled, or returned.

的first step to creating new solutions that fit into Locations is to trial the beta.

Not yet a Shopify Partner and want to test out our newest tools and updates?Sign up for a Shopify Partner account nowto access a free development store.

Exploring Locations on your development stores

It’s important to note thatLocations is currently in beta, and can only be accessed through development stores. The only requirement to access Locations is yourShopify Partner account.

How to enable Locations on your development stores

  1. Create a newdevelopment store
  2. Toggle theEnable Locations betacheckbox when creating your development store
  3. From the Shopify Admin, go toSettings>Locations
  4. In theLocationssection, clickEnable Locations

You’re all set! You can now begin beta testing Locations on your development store. For more information on how to use these features, see our betaLocations documentation.

In addition, once you enable Locations on your development store, theaccount ownerof the development store will receive an email fromTestFlightwithin 24-48 hours with set up instructions for testing POS with new location features.

Enhancing your locations-related apps, and preventing breaking during API migration

With the introduction of Locations, we’re making changes to three existing APIs:

We are also introducing two new Inventory APIs:

If you're currently using one of the existing APIs, you've likely already received migration instructions (a few times!) through email or theAPI Announcement forums. If you're too swamped to do a scan of your inbox, we've also included migration details below.

Important:的se updates should be prioritized—as of August 1, 2018,apps will no longer be able to use the Product and Variant API to adjust inventory.Additionally, fulfillments and refunds with restocks will require alocation_idat creation.

Product and Variant APIs

Wherever a merchant’s items are stocked—in a warehouse, at a retail store, at a dropshipper, or a fulfillment center—we want to know about it. To make this possible, we’ve introduced two new concepts to our platform:Inventory ItemandInventory Level.

Behind the scenes, each variant is now always linked to a single InventoryItem. Each InventoryItem must be stored in at least one location at any given time. Inventory stored in each location is represented by the new InventoryLevel resource.

shopify locations developer api relationships
Inventory API resource relationships.

In the past, each variant had a single quantity that was visible in Shopify, and apps would update this quantity directly on the variant. Going forward, that same quantity will be a representation of all available inventory across all locations.

However, the Product and Variant APIs should continue to be used for merchandising concerns, such as:

  • How will items be priced?
  • What product images should customers see?
  • What sales channels is this item sold on?
  • What description should customers see?

的newInventory APIs(which uses the InventoryItem and InventoryLevel resources above) should be used when dealing with the back-office concerns of physical goods, such as:

  • Where are the items stored?
  • How many of a particular SKU are in the warehouse vs the retail store?
  • How much does an item weigh?

Access Inventory migration guide

Fulfillment API

的Fulfillment API allows your app to tell Shopify when items have been picked and packed, but it now has been updated to includewherethat fulfillment took place as well. Each fulfillment in Shopify must now reference alocation_id, representing the location in which the goods were processed.

Apps should create multiple independent fulfillments when:

  • 项目处理and shippedfrom different locations
  • 项目处理at different times
  • Items are delivered to the customerwith different shipping providers

Here is an example of a fulfillment request specifyinglocation_id.

Access Fulfillment migration guide

Refund API

的Refund API allows apps to do the following:

  • Process refund payments
  • Restock items to inventory
  • Notify customers about the changes made to their orders when Refunds are processed

Prior to supporting Locations, restocking was an all-or-nothing operation––that is, all items on a given refund were restocked, or none were. We have updated the Refunds API to allow more flexibility.

Here is an example return. As you can see, you can specify precisely which location to restock each item to.

Access Refund API

Help us build the multi-location future of commerce

This update will provide additional value to merchants and app Partners of all sizes, granting all merchants the ability to track inventory across multiple locations, and apps to help them do so efficiently. No more duplicate products, and no more spreadsheets.

What do you think of Locations?Share your thoughts in the comments below!

Topics:

Grow your business with the Shopify Partner Program

Learn more