2021 update archive | Tools and apps | Shopify API Release: October Edition
A summary of API features as of October 2021. This article explains the significant improvements to the Storefront API, including the revamped Cart API and the ability to retrieve specific resources by ID.
A must-read for developers! We've compiled a summary of the API features updated in October 2021. This article explains the significant improvements to the Storefront API, including the revamped Cart API and the ability to retrieve specific resources by ID.
Welcome to the October 2021 API feature release summary. This page provides information to help you apply the latest changes to improve your app's quality and streamline your development environment.
This version includes significant improvements to the Storefront API, such as a revamped Cart API and the ability to retrieve specific resources by ID. It also includes Bulk Operation Webhooks, Manual Fulfillment Holds for easier management of pre-orders and other features, and SMS marketing consent endpoints to indicate that customers consent to receive SMS marketing communications.
With this release, version 2020-10 will be removed. Please remember to check your API health report and review future changes to ensure compatibility. A complete list of API changes related to this version can be found in the 2021-10 release notes (in English).
Build an app for Shopify merchants
register
1 Cart API
Previously, there were several major obstacles when managing carts with the Storefront API. The only way to get real-time product inventory, prices, discounts, etc., was to create or update a checkout. Shopify carefully limits checkouts to maintain a high level of customer experience. Requests to manage this "pseudo-cart" count towards the checkout throttling limit.
In version 2021-10, it's now possible to interact directly with carts using the Storefront API. This Cart API represents a significant leap in usability, allowing you to retrieve all contextual information about the next order without requiring the customer to create a checkout until they are ready to pay. Furthermore, these carts are not associated with checkout throttling; instead, they are subject to the same throttling as other storefront requests. Flash sales will greatly benefit from this update. Checkout queues are now available for carts created with the Storefront API.
Here is an example of a mutation that creates a shopping cart using the Storefront API.
Variables:
The API then returns one cart data entry.
For detailed information on how to manage your shopping cart using the Storefront API, please refer to the documentation (in English).
2. Improvements to the Storefront API
A new field has been added to QueryRoot to make retrieving individual resources easier. For example, you can now query blogs, collections, pages, and products directly by their ID or handle. This field allows you to quickly and efficiently retrieve the resources you need. You no longer need to search through a list of all resources returned from the index or use search endpoints to navigate through edges and nodes for each resource in the GraphQL response.
The following is an example of a GraphQL query that retrieves individual products from their handles.
Here is the response:
3 Bulk Operation Webhooks
In previous versions, you had to poll the status of a bulk operation to know when Shopify had finished processing it. The 2021-10 release includes a webhook that notifies clients about bulk operation completion, failure, or cancellation. The webhook further reduces the impact of bulk operations on API call limits, and you only need to wait for the webhook response containing the bulk operation status. No more polling!
The following is an example of a mutation to create a subscription for Bulk Operation Webhooks.
Here is an example of a payload that will be sent to a specific URL once a batch operation is complete.
For more details, please refer to the documentation on performing bulk operations using the GraphQL Admin API (in English).
4 Manual Fulfillment Holds
Version 2021-10 adds support to make the fulfillment workflow more powerful for clients using Fulfillment Orders. Fulfillment Orders can now support the "hold" action, allowing the app to set fulfillment on hold for items such as backorders and pre-orders before they become available for fulfillment.
The following is an example of a mutation to set the fulfillment order to hold.
Variables:
Here is the response:
These new actions will be available through Fulfillment Orders, not the traditional fulfillment platform. We strongly recommend that clients performing fulfillment operations use Fulfillment Orders rather than the traditional Order Fulfillment Endpoint.
5 SMS Consent
API clients can now obtain, add, and update customer consent to receive marketing materials via SMS. Updating this setting triggers the CUSTOMERS_MARKETING_CONSENT_UPDATE webhook, ensuring you always have up-to-date information on your customers' marketing preferences.
These settings are updated by the customerSmsMarketingConsentUpdate mutation. An example is shown below.
Here are the variables:
Here is the response:
This is a reminder, but all apps performing marketing activities are required to update customer records in Shopify with the marketing settings they collect from customers. Keeping your customers' marketing settings information up-to-date in Shopify ensures that all apps in your store respect each individual customer's marketing settings.
For more information on available marketing states and opt-in levels, please refer to the customerSmsMarketingConsentUpdate mutation documentation.
Check for changes regularly.
Original text by Shayne Parmelee, translated by Nozomi Fukatsu
Share this article
- Share on Facebook
- Share on X
- Share on LinkedIn




