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:

  1. Log in to your Shopify admin.
  2. Select Flow from your list of apps.
  3. Click Create new workflow.
  4. This workflow must trigger when an order is created in Shopify. Click Select a trigger.
  5. Click Shopify as the trigger.
  6. 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.

  1. Click Then on the Order created trigger and select Condition.
  2. Click on Select condition to add your conditions.
  3. Set the conditions to only trigger the workflow if all conditions are met.
  4. Click Add criteria to configure the condition.
  5. Click Order, then select app and target the app name.
  6. 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.

  1. Click Then on the App name is equal to Online Store condition and select Condition.
  2. Set the conditions to only trigger the workflow if all conditions are met.
  3. Click Add criteria.
  4. Click Order and search for selling plan. Click lineItems, then sellingPlan, and select sellingPlanId.
  5. 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.

  1. Click Otherwise on the App name is equal to Online Store condition and select Condition.
  2. Set the conditions to only trigger the workflow if all conditions are met.
  3. Click Add criteria.
  4. Click Order, then select app and target the app name.
  5. 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

  1. Click Then on the Selling plan selling plan id is not empty and exists condition and select Actions.
  2. Search for “tag” in the search bar and select Add order tags.
  3. Add the tag subscription checkout to identify customers with a checkout subscription.

One-time

  1. Click Otherwise on the Selling plan selling plan id is not empty and exists condition and select Actions.
  2. Search for “tag” in the search bar and select Add order tags.
  3. Add the tag one-time checkout to identify customers checking out with one-time orders.

Subscription recurring

  1. Click Otherwise on the App name is equal to Online Store condition and select Actions.
  2. Search for “tag” in the search bar and select Add order tags.
  3. Add the tag recurring subscription to identify customers with a recurring subscription from Recharge.

Need Help? Contact Us