Shopify API Release: April 2022

Welcome to the April 2022 edition of our API features roundup, designed to help you understand how you can adopt some of the latest changes to improve the quality of your apps and streamline your development experience.

This version includes the all-new Customer Segmentation API. It also includes new features to track fulfillment with fulfillment and delivery time data and offers improved visibility into Product Taxonomy.

This version also adds new features for offering discounts using the App Subscription API and includes updates to the Storefront API that make it possible to get delivery quotes from the cart API.

This release also coincides with the removal of version 2021-04, so remember tocheck your API health reportto make sure you're compatible and review the changes coming.

For a full list of API changes associated with this version, visit the2022-04 release notes.

1. Customer Segmentation

Customer Segments is a new feature that is replacing Customer Saved Searches. In the past, Customer Saved Searches only allowed for free-text searches across customers.

This means that a search for "Madison" might yield customers named Madison, people who live in Madison, Wisconsin, or people who have an address on Madison Ave. Unfortunately, there was no way to differentiate between these results and return customers that were important to you using Saved Searches.

客户群体更强大。段allow you to specify which customer fields need to match to be a group member. For example, segments might include things like:

  • Customers that purchased a particular product.
  • People from a specific city.
  • Customers who have spent a certain amount of money on the shop.

Merchants can then use this information to send marketing material to customers in a certain segment or learn more about segment member behaviors.

To create a new segment using the API, you can use thesegmentCreatemutation, using a name, and the query that you’d like to use to segment customers:

Response:

For more examples and to see all of the queries and mutations available to manage segments, visit our documentation onthe segmentation APIat shopify.dev.

2. Product Taxonomy

Standard Product types, launched as a part of the 2022-01 release, help store owners keep their products organized on the storefront. As of the 2022-04 release, an API is available to get information about all of the standard product types that Shopify supports. This information is accessible throughproductTaxonomyNodesthrough the GraphQL API.

下面的查询将得到所有产品的助教xonomy nodes that are related to jewelry:

Response:

When creating a product, you can use the provided standard type taxonomy values to ensure that products will show up exactly where they belong on the storefront.

To learn more about product types or receive acomplete listof the taxonomy nodes queryable with the API, visit ourdocumentation.

3. Fulfillment Time & Delivery Time

Three new fields are now available through the API to help understand the fulfillment and shipping expectations for fulfillment orders created through marketplaces. These fields are especially important for marketplaces that have a delivery guarantee.

For example, merchants might need to fulfill some orders earlier than others to meet customer delivery expectations.

The three new fields that are available on fulfillment orders are:

  • minDeliveryDateTime: This is the earliest date and time by which the delivery is expected to be completed.
  • maxDeliveryDateTime: This is the latest date and time by which the delivery is expected to be completed.
  • fulfillBy: This is the latest date and time by which the store owner should fulfill all items in the fulfillment order to meet the delivery deadlines for the order.

All of these fields are available in GraphQL, and can be fetched from fulfillment orders:

4. App Subscription Billing Discounts

As of the 2022-04 version, you can use the discount field as a part of theappSubscriptionCreatemutation to offer a subscription discount for recurring charges. These discounts can be percentage-based or a flat amount discounted from the subscription cost.

App subscription discounts can also apply to a set number of billing cycles. For example, you can offer a merchant 50% off for 3 billing cycles before having the price return to normal.

A mutation creating a subscription with a 50% discount, applied for 3 months:

Response:

For more examples of recurring charge discounts,visit our documentation at shopify.dev.

5. Storefront API Cart Update

CartDeliveryGroupsallow apps using the Storefront API to easily surface information about delivery options for one or more line items to a specific address. As long as a customer is logged in, you'll be able to get information about eligible delivery options right from the cart.

TheCartDeliveryGroupobject includes the destination address for a delivery group and the delivery options available for the line items in that group. Delivery options include the name, code, description, and price of the shipping method.

For more information about how to use this new feature, visit our developer documentation to learn about using thecartCreateandcustomerCreatemutations to create a cart for a logged-in customer.

Stay on top of changes

For all Shopify platform changes, make sure to subscribe to thedeveloper changelog, the primary source of information for all new product launches. Stay up to date using the changelog, and stay ahead of the curve by adopting new features as soon as they’re shipped into the upcoming2022-07release candidate.

You can also subscribe to our monthly What’s New for Partners and Developers at Shopify newsletter, which will help keep you on top of all platform updates.

Template Icon
Topics:

Grow your business with the Shopify Partner Program

Learn more