Welcome to the January 2021 edition of our API features roundup, designed to help you understand how you can adopt all the latest changes to improve the quality of your apps and streamline your development experience.
In this version, we released one of our most requested features ever: native support for subscriptions through our newSubscription APIs. Here’s a sample of what’s also included in this version: scheduled fulfillments to facilitate prepaid subscriptions, automatic activation of app charges, and more granular financial information on orders and transactions like fees and tip totals.
The 2021-01 launch also coincides with the removal of version 2020-01, so remember tocheck your API health reportto make sure you're compatible andreview the changes coming.
In this article, we look at the features included in the 2021-01 release.
Table of contents
1. Subscription APIs
This version includes new APIs built topower subscriptions on Shopify. These additions allow partners and developers to build apps that integrate natively with checkout, dramatically improving the customer experience on shops that offer subscriptions. The Subscription APIs fully integrate with Shopify across the whole lifecycle of the order, so it's easy to provide accurate shipping rates, allow for the application of discounts, and then manage and fulfill the order from the Shopify Admin.
We've included several new endpoints and resources to help you manage subscriptions on behalf of merchants.Selling plansare a flexible resource to set delivery policies and billing policies like “subscribe and save” for groups of products. When a customer places an order that includes a product with a selling plan, developers can managesubscription contractsto facilitate easyrecurring paymentson whatevercustomer payment methodsare available.
Subscription contracts, subscription billing attempts, and customer payment methods have all received their own webhook topics, so you’ll always be able to stay up to date with common subscription events.
Visit our blog post:Introducing Shopify Subscription APIs: Build Apps That Integrate with Shopify Checkoutto learn more about our new Subscription APIs.
Build apps for Shopify merchants
你是否想为Shopify应用构建应用程序Store, offer custom app development services, or are looking for ways to grow your user base, the Shopify Partner Program will set you up for success. Join for free and access educational resources, developer preview environments, and recurring revenue share opportunities.
Sign up2. Product Subscription App Extension
To power the native tools at the heart of the new subscription experience, we've released a new kind of app extension that allows app developers to facilitate subscription management directly inside the Shopify Admin. You can create this new kind of app extension using a single command from theShopify App CLI, and it includes scaffolding for everything you need to start building an excellent merchant experience.
The Shopify App CLI also comes fully equipped with a simulator for your Product Subscription App Extension, allowing you to preview changes to your scaffolded app extension code in real-time.
When you're ready to deploy your app extension, you can push it up to your Partner Dashboard, where you have full control over the version history, and publish your app extension to every shop that has your app installed with the click of a button.
Shops with subscription apps installed render a subscription card on the product page in the Shopify Admin, which passes data to the modal powered by your published app extension code. This entire exchange happens between code hosted on Shopify, so Product Subscription App Extensions are incredibly fast.
For more information on building Product Subscription App Extensions, visit ourtutorial.
3. Scheduled fulfillments
最后基于订阅的改变这个版本is scheduled fulfillments. Fulfillment orders now support theSCHEDULED
status, which will show up for any orders that include a prepaid subscription. These fulfillment orders include afulfillAt
date, which will transition theSCHEDULED
fulfillment order into anOPEN
state when it expires.
As of 2021-01, API clients can also reschedule fulfillment orders to a later date by using the newfulfillmentOrderReschedule
mutation, and specifying afulfillAt
date in the future. Rescheduling a fulfillment order is especially helpful for prepaid subscriptions, when a customer may want to skip a shipment of consumable items like coffee or granola if they haven't run out. This functionality is not yet available through the Shopify Admin UI, and is powered exclusively through the GraphQL API.
Below is an example request to reschedule a fulfillment order:
For detailed information on how subscriptions and fulfillments work together, visit our tutorial oncreating and managing fulfillments for prepaid subscriptions.
4. Automatic activation of app charges
In prior versions, billing for an app using the REST API was a three-step process:
- Step one: Create an application charge
- Step two: The merchant accepts or declines the charge
- Step three: If the charge is accepted, make an API call to activate the pending
accepted
charge
As of 2021-01, apps no longer need to perform that third step. Accepted application charges will automatically be transitioned into an “active” state, eliminating the possibility of charges that have been created by the app, accepted by the merchant, but then never activated and paid out to the partner.
5. Financial reporting improvements
The 2021-01 version includes two changes to improve the accuracy of accounting apps.
First,TransactionFee
is a new object available as a part of the Admin GraphQL API. This new object includes much more detailed information about fees collected as a part of Shopify Payments payouts, including the flat rate charges, percentage charges, and a breakdown of the tax charged on these fees.
Second, the GraphQL Admin API now includes tips received as a part of an order in both shop and presentment currencies using thetotalTipReceivedSet
field on the order object. This increased granularity will help accounting apps report even more accurately on fees and tips on any given order transaction.
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 upcoming 2021-01 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:
Stay in the know
Subscribe to receive What's New with Shopify, our monthly email featuring Shopify's latest product news.