Shopify API versioning
API versioning allows Shopify to continuously evolve the platform while offering third-party developers a predictable path for feature upgrades and deprecations.
To ensure you always know about upcoming API changes, follow theChangelogand always keep your contact information up to date in the Partner Dashboard.
Versioned vs. unversioned APIs
Anchor link to section titled "Versioned vs. unversioned APIs"Versioned APIs | Unversioned APIs |
---|---|
Release schedule
Anchor link to section titled "Release schedule"Shopify releases a new API version every 3 months at the beginning of the quarter. Version names are date-based to be meaningful and semantically unambiguous (for example,2023-01
). Below is an example release schedule for 2023:
Stable version | Release date | Date stable version is supported until |
---|---|---|
2023-01 | January 1, 2023 | January 1, 2024 |
2023-04 | April 1, 2023 | April 1, 2024 |
2023-07 | July 1, 2023 | July 1, 2024 |
2023-10 | October 1, 2023 | October 1, 2024 |
Stable versions are released at 5pm UTC.
Each stable version is supported for a minimum of 12 months. This means that there are at least 9 months of overlap between two consecutive stable versions. When a new stable version is introduced and contains changes that affect your app, you have 9 months to test and migrate your app to the new version before support for the previous version is removed.
We strongly recommend updating your apps to make requests to the latest stable API version every quarter. However, if your app uses a stable version that is no longer supported, then Shopify falls forward and responds to your request with the same behaviour as the oldest supported stable version. For example, when Shopify removes2023-07
, API requests to version2023-07
will be served version2023-10
, because that will be the oldest supported stable version.
If your request doesn't include a version, then the API also defaults to the oldest supported stable version. However, we do not recommend relying on this behaviour for adopting deprecated changes. As you update your app, you should specify the API version with every request. By making your app version aware, you anchor your code to a specific set of features that are guaranteed to behave in the same way for the supported timeframe.
Example version support schedule
Making requests to an API version
Anchor link to section titled "Making requests to an API version"Shopify API versions are explicitly declared in the URLs that your app makes requests to.:
- REST Admin API URL:
/admin/api/{api_version}/{endpoint}.json
- GraphQL Admin API URL:
/admin/api/{api_version}/graphql.json
- Storefront API URL:
/api/{api_version}/graphql.json
- Payments Apps API URL:
/payments_apps/api/{api_version}/graphql.json
For example, the following URLs make requests to version2023-10
:
- Rest Admin API URL:
/admin/api/2023-10/products.json
- GraphQL Admin API URL:
/admin/api/2023-10/graphql.json
- Storefront API URL:
/api/2023-10/graphql.json
- Payments Apps API URL:
/payments_apps/api/2023-10/graphql.json
在那里are several supported versions of the APIs available, and you specify the version that you want to use by substituting the version name in the URL. There are three types of API versions: stable, release candidate, and unstable.
Shopify's API responses contain the headerX-Shopify-API-Version
, which returns the API version that was used to execute the request. When you keep your app updated, this matches the API version that's specified in your request. If the returned version is different, then your app is out of date and is using the default API version.
Release candidates
Anchor link to section titled "Release candidates"Release candidates let you see what changes are scheduled for release in the next stable version so that you can begin updating your app as early as possible. API release candidates are made available on the same date that we release our stable versions. For example, when version2023-01
is released on January 1, 2023, the release candidate for version2023-04
will also become available.
Both backwards-incompatible and backwards-compatible changes can be added to the release candidate so that they’re available to you ahead of the stable release. For this reason, we recommend that you don’t use release candidates in production.
Unstable API versions
Anchor link to section titled "Unstable API versions"在那里is always an unstable version of the APIs available. The unstable versions contain features and changes that are still in progress, and we make backwards-incompatible and backwards-compatible changes to them regularly. Generally, changes appear in the unstable version before a stable release, but there is no guarantee that changes in the unstable version will eventually be released. A feature might be added to an unstable version but then be removed later.
You can use the unstable API versions to test new changes and features early, but you should not use them in production.
For example, you can use the following API URLs to make requests to the unstable API:
- REST Admin API request:
https://{shop}.myshopify.com/admin/api/unstable/products.json
- GraphQL Admin API request:
https://{shop}.myshopify.com/admin/api/unstable/graphql.json
- Storefront API request:
https://{shop}.myshopify.com/api/unstable/graphql.json
- Payments Apps API request:
https://{shop}.myshopify.com/payments_apps/api/unstable/graphql.json
Deprecation practices
Anchor link to section titled "Deprecation practices"Part of a Shopify API can be deprecated if it becomes unnecessary, unsafe, or outdated. It's marked as deprecated when it's removed in a newer version of the API. The deprecation is then retroactively applied to previous stable versions of the API. When a deprecation is introduced, any further details and any relevant migration information is announced in thedeveloper changelog.
因为每个版本是支持最少a year, there are always at least 9 months of overlap between versions for you to update your app to support deprecations.
Removing parts of a Shopify API
Anchor link to section titled "Removing parts of a Shopify API"任何字段或类型(GraphQL)和属性或再保险sources (REST) that have been deprecated in a release will be removed in a subsequent release. For example, a field that's deprecated in2023-07
might be removed in2023-10
.
Apps using deprecated resources
Anchor link to section titled "Apps using deprecated resources"If a public app or sales channel continues to use unsupported resources after the upgrade deadline, it will be delisted from the Shopify App Store. Also, users who install an unsupported public app, unsupported custom app, or unsupported sales channel will see a warning during the installation process.
If your app continues to use unsupported API resources, users will be blocked from installing the app for a minimum of 7 days.
In the Shopify admin, users will see warning messages indicating that the app is unsupported. These warnings are shown to users only if the app makes calls to unsupported resources after the upgrade deadline. Warnings are removed 7 days after the last use of unsupported resources is detected. Warnings can't be manually removed by you or by the user.
GraphQL API deprecation practices
Anchor link to section titled "GraphQL API deprecation practices"When Shopify deprecates a field in a GraphQL API, the change is communicated in one or more of the following ways:
- TheAPI health reportlists which resources require changes.
- A deprecation warning for the field is shown in API client tools, such as Shopify'sGraphQL Explorer:
- A notice about the deprecation is posted in the thedeveloper changelog.
- The API reference is updated to identify the deprecated fields and applicable alternatives.
- If there is an imminent backwards-incompatible change that affects your app, then theemergency developer contactfor your app might be contacted about the deprecation.
REST API deprecation practices
Anchor link to section titled "REST API deprecation practices"When Shopify deprecates a resource or a property of a resource in the REST Admin API, the change is communicated in one or more of the following ways:
- TheAPI Health reportlists which resources require changes.
Calls that include the deprecated behavior return the response header
X-Shopify-API-Deprecated-Reason
and a link to get more information:A notice about the deprecation is posted in thedeveloper changelog.
TheREST Admin API referenceis updated to identify the affected resource and any action you need to take.
If there is an imminent backwards-incompatible change that affects your app, then theemergency developer contactfor your app might be contacted about the deprecation.
Webhook payloads can change between API versions, similar to API response payloads. You can select the API version that you want to use for webhooks, and that version will be used for all webhooks that are sent to your app.
When your selected API version becomes unsupported, Shopify falls forward to using the next supported stable version. Webhooks include theX-Shopify-Api-Version
request header to indicate the API version that was used to generate the webhook. If this value is different than the version that you selected, then your selected API version is no longer supported.
When your app is affected by the webhook changes in a newer API version, you should update your app before support for your selected API version is removed.
Learn more aboutmanaging webhook versions.