Shopify Flow
With Shopify Flow and Shopwaive create automations when customers place orders, inventory is out of stock, or thousands of other actionable events
Getting started
Shopify Flow enables merchants to create powerful workflows triggered by events. For example, when an order is placed, a transaction can be automatically recorded in a connected Google Sheet, or a customer can receive deposits in credit. The possibilities are endless.
There are many different workflows and options available. One example provided below explains how to make deposits or debits on a recurring schedule, i.e. on the 1st day of each month $50 is deposited to all (or only specific) customers in a defined segment
Actions
In this section we provide several example use-cases with templates that demonstrate Shopwaive Actions you can add to your Shopify Flow. Actions perform a task when your flow is triggered. Shopwaive offers several Actions you can choose from and we're adding more each day. Choose from the Increment action to create deposits and debits on a customer's account, the Assign action to set the balance of a customer's account to a specific value, the Create discount action to create a discount code and optionally send the code in an email to an individual customer or an entire customer segment, the Create gift code action to create a gift code and optionally send the code in an email to a customer, or the Email action to send an email with balance to your customer.
Need to trigger your flow when data changes in Shopwaive? See Triggers
Recurring Deposits and Debits
Connecting Shopwaive to Shopify Flows assumes you have already installed the app on your store and purchased a subscription plan. Learn more about our pricing plans and features.
Follow these steps to create a scheduled and recurring deposit or debit:
Step 1: Add the Scheduled time trigger, which will activate the flow to run at a scheduled time, and with recurring or repeat options you define
Step 2: Click the Then plus icon on the Schedule time trigger, select Action and then choose the Shopwaive app from the apps listed in the Installed apps section
Step 3: Choose the Increment balance action from the Shopwaive actions list
Step 4: Fill in the options available, you can choose an entire customer segment by providing the customer segment query or you can choose a single customer by providing the email. Note that you need to choose between customer_email OR segment_query, but not both. Whichever you choose, leave the other input blank. The former selects a single customer while the latter selects a group of customers in a segment (if any exists)
New! For triggered events such as when an order is created, you can now use the native Shopify Flow Look up customer in segment action shown to filter customer deposits based on customer segments
Variable syntax is supported in Shopify Flows, which means you can use data from an action upstream in the flow like an email address from a draft order that was created {{draftOrder.email}} or the shop's contact email address {{shop.contactEmail}}, as a few examples.
Alternatively, leave the customer_email input blank and instead define customer segment query like the one shown in the example below that selects only customers who have been tagged
For the amount you can choose a static value like 50 in the example above OR you can use a multiplier.
For example, you can create a Cash Back Rewards flow that deposits 20% cash back on each purchase, or for only specific SKUs, variants, or those defined in a specific collection.
An example of this is shown below, when an Order created is set as the trigger, you can choose the order.totalPriceSet.presentmentMoney.amount when the order.fullyPaid is TRUE as a dynamic variable for the amount. Then, you can multiply this by any value, for 20% cash back we choose 0.2.
Note that if you choose to require the order.fullyPaid field to be TRUE, that some Orders that require authorization, for example some forms of payment will prevent the Order to be paid at the time the Order is created, because it first goes through an Authorized state. In this case, Orders that have an authorization delay before being updated to paid will not process through the Flow since its only fired when an Order is first created. Therefore you may wish to relax this requirement and proceed with the deposit and instead create a debit if an authorized order with earned credit is later cancelled.
For more information on Shopwaive's Loyalty programs including tips and guidance, see Cash Back and Loyalty
Step 5: Select Apply changes and then Turn on workflow when you are ready to make the flow live
In the example above, you setup recurring deposits. You can achieve recurring debits using the same flow (just duplicate it), and then for the amount, choose a negative value. See example scenarios below
Example 1
If a customer has a $0 balance but are included in a debit flow based on the segment query defined, a debit flow would not have any effect as customer balances cannot be negative
Example 2
Similarly, if a customer has a $20 beginning balance and subject to a -$50 debit flow, then the customer's final balance after the flow is complete would be $0
Another example provided below explains how to connect a Google Sheet that automatically records the order transaction data when a customer redeems store credit
Debits for Order cancellation or Refund
Want to automatically remove the earned credit or cash back if an Order is cancelled? Or refund credit spent on an order? No problem. Just follow these steps to implement an Order cancellation or Refund flow.
You have two options for Order refunds and cancellations.
Option 1
Explicitly, you can now use the Refund balance and/or Void deposits actions with Shopify Flow as shown below.
The Refund balance action is provided an order id and will explicitly refund the amount redeemed on an order.
If you use the Redeem Checkout UI with the Gift card extension enabled, a gift code is automatically applied when the customer uses one-click redemption. The gift card redeemed at checkout is automatically disabled when an order is placed and cannot be refunded in the Shopify admin. Instead, enter an amount of 0.00 when processing redeemed gift card Refunds in the Shopify admin. Then, you can use the Refund balance action to refund a customer's balance redeemed with a gift code instead of refunding the gift card directly.
If you do not enter 0.00 in the gift card ending with ***SHOP at the time an order is refunded in the Shopify Admin, you will receive an error and will need to refund a customer's balance manually.
If you do not use the Redeem Checkout UI with the Gift card extension enabled, you can ignore this tip
For voiding deposits, Shopwaive will debit any amount earned on a previous Loyalty program for the Order id provided. This Shopwaive API method voids any earnings or deposits created by order or line item id provided. Use with Refund or Cancellation trigger. If multiple deposits were created on a single order, then all deposits will be voided if only the Order ID is provided. If you prefer to void only deposits created by a specific line item purchased on an order, leave the Order ID field blank and provide the Line Item ID instead
Option 2
Implicitly, you can use the Increment balance action in a flow as shown below. The Increment balance action will create a debit, and the amount debited can be a static value or a liquid variable depending on the original order.
If an order is cancelled, previously earned cash back may be something you wish to void. We will simply modify the earned credit or cash back flow so that it is triggered by Order cancellation instead of Order created webhook, and then change the increment value to an equivalent negated amount as the original order (original increment amount times -1). An example of the flow is shown below. Or, simply import the flow template into the Shopify Flow app.
Connect Google Sheets
One of our most popular Shopify Flows allows Shopify merchants to easily connect a Google Sheet to record all your customer transaction history. Follow these steps to get setup in just a few short minutes.
Shopwaive offers multiple ways to redeem store credit. For example, customers can use the Storefront widget after adding items to their cart to apply store credit and be routed to checkout. Alternatively, Shopify Plus merchants can choose to use the Checkout widget that is shown only during the checkout flow. A 3rd option includes enabling Checkout extensions to allow customers to redeem credit by logging in and entering their email address in the discount code field at checkout.
The workflow we create will account for all of the aforementioned redemption options.
Follow these steps to create the Google Sheet workflow:
Step 1: Add the Order paid trigger, which will activate the flow to run each time this occurs
Step 2: Next, add a conditional check to determine a customer checked out with the extension. In this case we check if a discount code was used equal to the customer's email
Step 3: If the conditional check in Step 2 is true. Then we Add row to spreadsheet. Connect your Google Sheet by entering your Spreadsheet URL, Tab name, and Row contents. Your Spreadsheet URL will be a unique URL link found in the Google Sheets app after you create a sheet. Your Tab name will also be unique, for new sheets this is typically defaulted to Sheet1 but you can name it anything that is convenient.
Create a Sheet by visiting Google docs and click the blank spreadsheet. For the Column headers, add these to your sheet.
For the Row contents, simply copy/paste the Row contents liquid code provided below.
Step 4: Back up to the Check if conditional block, and add to the Otherwise route. If a discount code is not found equal to the order customer email, then we add another Check if conditional block. In this conditional check, we check if the Order tags includes Shopwaive
Step 5: Add to the Then route to add this case to the same Spreadsheet setup in Step 3
The Spreadsheet URL and Tab name will be the same URL and Tab name connected in Step 3.
For the Row contents, simply copy/paste the Row contents liquid code provided below
You are done! Now just apply changes and turn on your flow. Place a test order and check to see the Google Sheet populate with the order data.
Advanced users: You can add to this example, including adding other pertinent order transaction data for instance to the Sheet, by editing the Row contents liquid code and adding additional Columns to capture the extra data. Contact our team if you need developer support at support@shopwaive.com. We are glad to help
Automatically expire credit 60 days after deposit
With the expirationdate field you can define a static date using the format YYYY-mm-dd, or use liquid to expire the credit 60 days from the date the deposit posts.
To expire credit 60 days from the date of deposit, use the following snippet,
Send an email when credit is deposited
Developers and brand managers can setup a flow to send an automatic email notification when credit is deposited with Shopwaive's Send email Shopify Flow action. In the example below, customer's are incentivized when purchasing a specific product or collection item by receiving a cashback credit, and then sent an email of their new balance.
Before sending email you will need to enable Notifications from Settings and verify your branded sending domain following this guide
Download example template below for the Send email Shopify Flow action
Use the {balance}
merge tag anywhere in the Subject title, Body message, Headline, or Call-to-action to display the customer's balance. Note the single curly brackets and no spaces between the bracket and balance keyword used for the Shopwaive merge tag, not to be confused with liquid double curly brackets. The merge tag should be used previously as typed above.
Alternatively, you can trigger the Send email action with a HTTP POST trigger to send any custom data to display with liquid variable syntax, for example {{ available }} or {{ transaction }}.
Anywhere in the Headline, Body message, or Call-to-action you can style text using HTML markup. For example, you can use plain text like Redeem for the Call to action or use an HTML span tag as shown below to make the Call-to-action button font display bold, the former plain text option will inherit the global CSS
Create a discount code and optionally send email
Developers and brand managers can setup a flow to create a discount code and send an automatic email notification with the code and backlink to your site with Shopwaive's Create discount Shopify Flow action. In the example below, a discount code is created and sent to the customer when a draft order is created in the Shopify admin.
In the app, when you authenticate your DNS records and enable Email campaigns you can send email notifications and reference templates that you design in the Shopwaive app to show the discount code to your customer with backlinks to your site that are a pixel-perfect match of your brand.
An example template that uses the discount code merge tag can be referenced in your Create discount Shopify Flow action. You can even send bulk emails to customer segments with the discount created. You can start with the discount code template that can be added once you install the app and open the email editor. The template already includes the discount code merge tag. Then as you make edits to your design just ensure you keep the discount code merge tag in a location in your HTML template you wish to display the code.
The Create discount and Create gift code actions are new an exciting solutions offered by Shopwaive in Shopify Flow. Contact us at support@shopwaive.com if you have any questions or need help getting setup, we're happy to help.
Create a gift code and optionally send email
Developers and brand managers can setup a flow to create a gift card code and send an automatic email notification with the code and backlink to your site with Shopwaive's Create gift code Shopify Flow action. In the example below, a gift card code is created and sent to the customer when a draft order is created in the Shopify admin.
Ensure you meet the requirements to use this feature. To use this enterprise feature, you must have an active Shopwaive Checkout subscription plan, a Shopify Plus subscription, and you must enable the Shopwaive Gift Extension in the app. If you've never enabled Gift Cards from the Shopify Admin, you must do this first and create a test card from the admin before connecting Shopwaive. Proceeding without these requirements being met will result in no action taken.
In the app, when you authenticate your DNS records and enable Email campaigns you can send email notifications and reference templates that you design in the Shopwaive app to show the gift card code to your customer with backlinks to your site that are a pixel-perfect match of your brand.
An example template that uses the gift code merge tags can be referenced in your Create gift code Shopify Flow action. For the gift card template, you have the option to include the gift card balance and the redeemable code. You can start with the gift code template which already includes the necessary code and balance merge tags. You can start with this to design your own, then as you make edits to your design ensure you keep the gift code merge tag in a location in your HTML template you wish to display the gift code and the credit value merge tag in a location in your HTML template you wish to display the initial gift balance. If you wish to not show these dynamic variables, you can simply delete these <span> tags from your HTML.
Triggers
In this section we provide example use-cases with templates that demonstrate Shopwaive Triggers you can add to your Shopify Flow. Triggers are powered by subscriptions to webhooks that fire when data changes in Shopwaive. The Shopwaive data-changed event sends a payload to your Shopify Flow that is used to start your flow, when for example, your customer's balance changes. Shopwaive currently offers three triggers, but we're adding more each day.
Choose from the HTTP POST trigger to send a POST request to the Shopwaive /api/trigger endpoint to power your Shopify Flow, or the Balance change trigger to power your Shopify Flows when a customer's available balance changes and the Balance changes from order trigger, that fires for the specific event that a customer's available balance changes due to an associated order resource (i.e. when a customer redeems, an order id is attached to the payload sent to your Shopify Flow).
HTTP POST
When you add the HTTP POST trigger to a Shopify Flow, send any of the Trigger variables shown in the screenshot below in the request body to the POST /api/trigger endpoint. To view the schema of the request body, just add any action downstream of the HTTP POST trigger, and the environment variables that are available are shown with their descriptions if you click the downstream action variable input.
Although you can make direct POST requests to the Shopwaive API, if you desire to first send the data to Shopify Flow for conditional checks before making deposits or debits, for example from a CRM or your own backend servers, then you can use the HTTP POST trigger to send this data to Flow for processing. You can send a range of Trigger variable types, like generic strings, numbers, or booleans, all of which can be used to determine conditional logic in your downstream Shopify Flow. To setup the POST request, refer to the Shopwaive API for including your X-Shopwaive-Access-Token in the Header, as you would do for all other POST requests
The id field need not be included in the body of the request as it is automatically created by Shopwaive. All fields in the request body are optional, you can use only what you need.
Balance change
Add the Balance change trigger to a Flow to power any workflow when your customer's balance changes. When you add this trigger to a Shopify Flow, we make it easy to subscribe to the Shopwaive Webhook services without the hassle of adding the infrastructure to your backend code
Note the key difference in the Balance change and Balance changes from order trigger is that the latter will include the Order resource associated with the trigger event. Use the Balance change trigger for all changes to a customer's balance that are unrelated to an Order resource (i.e. adjustments made by an Admin in the app or API, Offers created in the app, bulk import operations, etc.)
Balance changes from order
Add the Balance changes from order to subscribe to balance changes that result from an Order adjustment, like when a customer redeems their balance. Using this special subscription topic, you get the same previous
, transaction
, and available
fields as you do with the Balance changes trigger, but also the order_id
resource that is associated with the event.
Download the Balance changes from order template or the Balance change template, and contact support@shopwaive.com if you have any questions using Shopwaive Triggers in Shopify Flow
Begin your Shopify work flow with a prebuilt template
With Shopwaive and Shopify Flows, you can create powerful automations that connect apps and work flows that power your business. Contact us to receive our support importing or creating your work flow with specific or detailed criteria, aspects of your loyalty program, funneling triggers to power deposits and debits, or redemption and earn requirements. This is one reason of many why brands are switching to Shopwaive; we provide custom white-glove service to create a Rewards and Loyalty program that you define and we bring to life. We've included a link to some successful flows we've prebuilt that you can use as a template and build on to.
Click here to download a selection of Shopwaive work flows to use as a starting template or to reuse popular liquid snippets
You know your customers better than any other software or platform, thats why with Shopwaive we give the control back to you. You leverage our expertise to implement the program in just days, not weeks or months. Contact us anytime at support@shopwaive.com for help, we're here and happy to support
Last updated