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 to check your API health report to make sure you're compatible and review the changes coming.
For a full list of API changes associated with this version, visit the 2022-04 release notes.
Table of contents
- Customer Segmentation
- Product Taxonomy
- Fulfillment and Delivery time
- App subscription billing discounts
- Storefront API Cart Updates
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.
Customer Segments are much more powerful. Segments 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 the segmentCreate
mutation, 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 on the segmentation API at 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 through productTaxonomyNodes
through the GraphQL API.
The following query will get all of the product taxonomy 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 a complete list of the taxonomy nodes queryable with the API, visit our documentation.
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 the appSubscriptionCreate
mutation 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
CartDeliveryGroups
allow 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.
The CartDeliveryGroup
object 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 the cartCreate and customerCreate mutations to create a cart for a logged-in customer.
Stay on top of changes
For all Shopify platform changes, make sure to subscribe to the developer 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 upcoming 2022-07 release 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.
Read more
- Using the Shopify API to Credit Merchants for App Charges
- Client Collaboration: 8 Tips to Deliver Successful Projects
- 7 Ways to Create an Amazing Customer Experience for Your Clients’ Ecommerce Stores
- How to Build a Shopify App: The Complete Guide
- An Overview of Liquid: Shopify's Templating Language
- Storefront API Learning Kit
- Creating Useful CSS Hooks in Liquid
- How to Create Your First Shopify Theme Section
- API Deprecation at Shopify: 2021-10 Edition
- API Deprecation at Shopify: 2022-04 Edition