API Deprecation at Shopify: 2021-01 Edition

api-deprecation-update-2021-01

Welcome to the last 2020 edition of API deprecation at Shopify, where we dive into the upcoming breaking changes coming into effect for all supported versions. Hot on the heels of Black Friday/Cyber Monday 2020, we’ll look back at the breaking changes that shipped in our April 2020 version, which becomes the oldest supported Shopify API version on January 1st, 2021. Let’s dive in.

A quick refresher on versioning

Before we dive into the changes headed your way, let’s revisit howAPI versioning at Shopifyworks.

  • We release a version every quarter.These releases typically happen on or around January 1st, April 1st, July 2nd, and October 1st. Versions are named in a year-month format (e.g. 2021-01), ensuring that it will always be easy to identify the time the version became stable, as well as compare the timelines of multiple versions.
  • Apps make requests to a specific version of the API by specifying it in the request URL.While the Shopify APIs continuously evolve, apps can be built on a stable version to ensure that the API contract remains constant. Keep in mind that this means that any features released after your targeted version won’t be accessible until you update your request URL.
  • We release features to merchants continuously.To ship features without affecting the latest stable APIs, we use release candidates. The release candidate is simply the next API version, and can be targeted for requests using the same year-month format. In the release candidate, you’ll find the latest set of features that have just been released. However, since it’s continuously evolving, you should avoid using the release candidate for your app’s general everyday consumption of the API. To have both the benefit of stability and access to the latest features, we recommend keeping your app’s everyday requests on a stable version, and only moving specific calls that deal with newly released features to the release candidate.
  • Apps that do not request a specific version are served the oldest supported version. This allowed existing apps to continue functioning when we shipped versioning, without having to update to the new URLs. This concept also applies to apps explicitly calling versions that are no longer supported. While every app will benefit from this mechanism preventing all of their requests from erroring out after a version switch, we recommend targeting recent releases intentionally.
  • Versions are supported for one year.Removing support for versions allows us to stay agile and make the changes needed to best serve our merchants and the Shopify platform for the long term. While versions are supported for one year, this means that apps actually only have nine months to adopt these new changes and take advantage of new features before the old behavior is no longer available.

With this refresher at the top of our mind, let’s review the key information you’ll need to be ready for January 1st, 2021.

You might also like:How to Build a Shopify App in One Week.

What’s happening on January 1st

On January 1st, 2021, the following changes will come into effect on our APIs:

  • The 2021-01 version will become stable and ready for general usage.
  • The 2020-01 version will become unsupported.
  • Requests that have been deprecated by changes in2020-04will cause your app to be flagged. To minimize merchant impact, Shopify will de-list flagged apps from the Shopify App Store and block new installs. Additionally, we may notify merchants that your apps are no longer supported.

Shortly afterward, at our discretion:

  • Requests with no API version specified will be served the2020-04 version.
  • Requests for the 2019-10 version will no longer receive that version. Instead, these requests will fall forward to2020-04.
  • Webhooks set to 2019-10 will fall forward in the same manner.

Most importantly, the 2020-04 API version, which will become the default version, includes breaking API changes.如果你的应用是将发出请求break in 2020-04, you need to take action and migrate those requests before January 1st, 2021. Failure to do so will result in failed requests and a broken app.

Upcoming breaking changes

Below are the breaking changes introduced in 2020-04, which will become Shopify’s oldest supported version on January 1st.

1. Price reductions mutations removed

In 2020-01, we released two mutations built around bulk modifying price reductions,productBulkAddPriceReductionsandproductBulkRemovePriceReductions.

Upon review, we felt these weren’t quite ready for broad usage, so we decided to remove them from the schema.

The takeaway:TheproductBulkAddPriceReductionsandproductBulkRemovePriceReductionsmutations have been removed.

2. New error codes for media objects

We’ve added additional error codes for media objects, enabling more specific troubleshooting. We list these types of changes as breaking, as the addition of a value to anenum意味着你的应用may start seeing new values it previously wasn’t expecting.

The takeaway:When working with media objects, update any error parsing to handle the new values.

3. New error codes for customers on the Storefront API

This is the same as above. We’ve added additional error codes for customers on theStorefront API.

The takeaway:When working with customers, update any error parsing to handle the new values.

You might also like:Getting Started with GraphQL.

Get ready for January 1st, 2020

The following resources can help you stay on top of changes to the Shopify platform:

  • API health report: A per-app health report in thePartner Dashboardthat showcases the exact API changes that will affect you.
  • Email: Ensure your developer contact email is up-to-date so we can notify you about pending changes.
  • Deprecation headers: In your app, theX-Shopify-API-Deprecated-Reasonheader is added to requests that are deprecated and will be unsupported within nine months.
  • Developer changelog: Stay up to date with the recent changes to Shopify’s APIs and other developer products
  • Deprecated API calls endpoint: Since private apps don’t have access to an API health report, webuilt a new endpointto request this data.

This coming January, ensure your apps are ready for the new year with these new enhancements to error handling by migrating to 2020-04 or later.

Check out the2021-01 release notesfor the full set of new features, yourPartner Dashboardto see which changes may affect you, or subscribe to our monthly What’s New for Shopify Developers and Partners newsletter below.

Template Icon
Topics:

Grow your business with the Shopify Partner Program

Learn more