Using Shopify Flow to identify subscription orders
Learn how to tag and identify subscription products by leveraging Recharge with Shopify Flow.
This guide walks you through leveraging Recharge and Shopify to automatically tag orders to determine if the order is a one-time, subscription checkout, or a recurring subscription.
Platform:
- Shopify Checkout Integration
Before you start
- You must use Shopify Flow to follow this guide.
- This guide provides one example of how to configure Shopify Flows to automatically tag orders, but there are various methods to apply this logic and customize Shopify Flows to fit your store's specific business needs.
- This guide discusses a custom configuration and is not supported by Recharge as per the design and integration policy.
How it works
Stores often leverage Shopify Flow to automate repetitive and time-consuming business tasks. With Shopify Flow, you can create custom workflows to manage inventory, process orders, and engage customers without manual intervention.
Stores may embed logic into their Flows to treat subscription and non-subscription orders differently. For example, a store may add additional order tags or notes to subscription orders for their fulfillment systems to handle these shipments differently than one-time orders. Other stores may need to add an additional insert or line item into a subscription order.
In scenarios like this, merchants need access to data that indicates whether the order includes subscription items and originates from Recharge. Although Recharge can apply order tags to subscription orders, due to constraints with the Shopify Subscriptions API, Recharge's tags can only get added to orders after they are initially created, which can cause delays.
The following solution documents how to identify subscription orders in a way that does not use Shopify tags as the source of truth. We encourage you to implement this logic to track your subscription orders as you implement custom flows.
Step 1 - Create the workflow and trigger
The trigger and purpose of the workflow will be determined by your store’s business requirements.
For this example we’ll use “Order created” which triggers when a customer places any order, whether checkout on the storefront or a recurring order through Recharge.
To create the workflow:
- Log in to your Shopify admin.
- Select Flow from your list of apps.
- Click Create new workflow.
- This workflow must trigger when an order is created in Shopify. Click Select a trigger.
- Click Shopify as the trigger.
- Search for and select Order created.
Step 2 - Set up conditions to identify order types
Step 1 - Set the app name to equal Online Store
This step creates branches in the Flow based on whether an order was created through Shopify’s Online Store.
- Click Then on the Order created trigger and select Condition.
- Click on Select condition to add your conditions.
- Set the conditions to only trigger the workflow if all conditions are met.
- Click Add criteria to configure the condition.
- Click Order, then select app and target the app name.
- Set the condition equal to and set the name to Online Store.
Step 2 - Check if a selling plan exists for the customer
This step determines if an order through the Online Store contains a product with a selling plan, indicating that the order was a subscription checkout order. If no line items contain a selling plan id, then this is a one-time checkout order.
- Click Then on the App name is equal to Online Store condition and select Condition.
- Set the conditions to only trigger the workflow if all conditions are met.
- Click Add criteria.
- Click Order and search for selling plan. Click lineItems, then sellingPlan, and select sellingPlanId.
- Make sure the condition is set to if At least one of order / line items and the Selling plan id is set to Not empty and exists.
Step 3 - Determine if the order is a recurring subscription
If the app name returns as Recharge Subscriptions, this allows you to determine that this order is a recurring subscription.
- Click Otherwise on the App name is equal to Online Store condition and select Condition.
- Set the conditions to only trigger the workflow if all conditions are met.
- Click Add criteria.
- Click Order, then select app and target the app name.
- Set the condition equal to and set the name to Recharge Subscriptions.
Step 3 - Create additional actions in the Flow
Note:
You can use any naming convention you prefer when adding tags. The following instructions provide example naming conventions for demonstration purposes.
Once you have the logic set up, you can take any required actions in the Flow according to your store’s specific business needs.
As an example, the following steps will assume a store needs to identify the type of order that was processed and tag them accordingly.
Subscription checkout
- Click Then on the Selling plan selling plan id is not empty and exists condition and select Actions.
- Search for “tag” in the search bar and select Add order tags.
- Add the tag subscription checkout to identify customers with a checkout subscription.
One-time
- Click Otherwise on the Selling plan selling plan id is not empty and exists condition and select Actions.
- Search for “tag” in the search bar and select Add order tags.
- Add the tag one-time checkout to identify customers checking out with one-time orders.
Subscription recurring
- Click Otherwise on the App name is equal to Online Store condition and select Actions.
- Search for “tag” in the search bar and select Add order tags.
- Add the tag recurring subscription to identify customers with a recurring subscription from Recharge.
Updated 4 months ago