Creating Recharge Quick Action URLs manually
Recharge Quick Actions allow you to automate your notifications, making it easier for customers to interact with their subscriptions. We designed the Quick Action URL Builder to automate the process of building Quick Action URLs. Use Klaviyo to send out Recharge Quick Actions, as this is the supported setup.
This guide explains how Quick Action URLs are structured. The use of custom-created URLs is not supported by Recharge.
- Recharge Checkout on Shopify
- Shopify Checkout Integration
Before you start
- Custom-created Quick Action URLs are not supported by Recharge. The Quick Actions URL Builder is designed to simplify the process of creating Quick Action URLs that can be used with Klaviyo. This setup is supported by Recharge.
- Quick Actions use the customer hash to identify the customer, meaning that a manually constructed Quick Actions URL only applies to one customer. We recommend using the Klaviyo integration to automate your notifications and contact multiple customers at once with the same URL.
- You can work with a developer to build middleware to use Recharge Quick Actions with an alternative email client. This custom-built setup is not supported by Recharge.
Quick Actions URL structure
Each Quick Action URL begins with your .myshopify.com
URL and the redirect to the Quick Actions tool:
https://mystore.myshopify.com/tools/recurring/quick_actions/
The specific Quick Action components are added next and are responsible for applying the selected action to a specific customer. Individual Quick Action URLs are made up of at least three distinct variables:
- The customer hash - A unique identifier to ensure the action is performed on the correct account. This can be found in the Customer Export under the Hash column.
- The Quick action - This indicates what action must be performed.
- The Subscription ID - This is the unique identifier that ensures the action is performed on the right subscription.
The following URL highlights an example of a Quick Action URL used to add a one-time product to a subscription:
https://mystore.myshopify.com/tools/recurring/quick_actions/5244250087ca77ba5cd96c57/process?action=add_onetime&subscription_id=111076384&shopify_variant_id=32475718385739
Variable |
Example |
Purpose |
The customer hash |
5244250087ca77ba5cd96c57 |
Confirms that the action is performed for a specific customer. |
The action |
action=add_onetime |
Confirms that the action being performed is to add a one-time product to the order. |
The Subscription ID |
111076384 |
Confirms which subscription to add the one-time order to. |
Action names and required variables
The variables required to perform an action may change depending on the action type. Refer to this chart to confirm which variables are needed for the action you wish to accomplish:
Action |
Action name |
Required variables |
Example |
Reactivate subscription |
reactivate |
customer_hash, subscription_id |
|
Skip next order |
skip_next |
customer_hash, subscription_id |
|
Skip entire next order |
skip_next |
customer_hash, subscription_id, |
|
Swap current subscription |
swap |
customer_hash, subscription_id, shopify_variant_id |
|
Add one-time product to next order |
add_onetime |
customer_hash, subscription_id, shopify_variant_id, quantity |
|
Ship now next order |
ship_now |
customer_hash |
|
Ship now entire next order |
ship_now |
customer_hash, subscription_id, |
|
Apply discount to next order |
apply_discount |
customer_hash, subscription_id, discount_code |
|
View customer portal page |
view_portal_page |
customer_hash, page orders, addresses, customer, payment_sources, payment_source) |
https://examplestore.myshopify.com/tools/recurring/quick_actions/5244250087ca77ba5cd96c57/process?action=view_portal_page&page=subscriptions |
Reactivate subscription and apply discount |
reactivate, apply_discount |
customer_hash, subscription_id, discount_code |
|
Reactivate subscription and add one-time product |
reactivate, add_onetime |
customer_hash, subscription_id, shopify_variant_id, quantity |
https://examplestore.myshopify.com/tools/recurring/quick_actions/5244250087ca77ba5cd96c57/process?action=reactivate&action=add_onetime&subscription_id=111076384&shopify_variant_id=32475718385739 |
Add subscription |
add_subscripton |
customer_hash, shopify_variant_id, charge_interval_frequency, order_interval_unit, quantity |
https://examplestore.myshopify.com/tools/recurring/quick_actions/ae1236544fsd54/process?action=add_subscription&shopify_variant_id=123456&charge_interval_frequency=30&order_interval_unit=days&quantity=1 |
Add subscription and apply discount |
add_subscription, apply_discount |
customer_hash, shopify_variant_id, charge_interval_frequency, order_interval_unit, quantity, discount_code |
https://examplestore.myshopify.com/tools/recurring/quick_actions/ae1236544fsd54/process?action=add_subscription&action=apply_discount&shopify_variant_id=123456&charge_interval_frequency=30&order_interval_unit=days&quantity=1&discount_code=10off |
Manually create a Quick Actions URL for Klaviyo
We recommend using the Quick Actions URL Builder to build URLs that can be included in your Klaviyo notifications. While you can manually create Quick Action URLs for Klaviyo, they are unsupported by Recharge.
Step 1 - Create your Quick Actions URL
Construct your Quick Actions URL. We recommend building your Quick Actions URL manually first so that you can test the URL for accuracy.
Once you've confirmed the manual Quick Actions URL works as expected, you can replace the Quick Action variables with the correct Klaviyo variables.
For example, the manual Quick Actions URL to allow a customer to view their customer portal uses your store URL and one specific customer hash:
//.myshopify.com/tools/recurring/quick_actions/123456/process?action=view_portal_page&page=subscriptions
Replace the customer hash variables with the applicable Klaviyo variable to create the Quick Actions URL:
<a href="{{ organization.url }}tools/recurring/quick_actions/{{ person.recharge_customer
}}/process?action=view_portal_page&page=subscriptions">View your subscription</a>
Tip: See Recharge Quick Actions for examples of each Quick Action URL, or our article on Recharge Quick Actions and Klaviyo use cases.
Campaigns
When creating campaigns you typically must include {% for sub in person.rc_all_subscriptions
%} {% if sub.status == 'CANCELLED' %}
or {% for sub in person.rc_all_subscriptions
%} {% if sub.status == 'ACTIVE' %}
at the beginning of each Quick Actions URL to loop and find the subscriptions associated with this customer.
The status you use depends on the type of campaign you’re running. CANCELLED status would be if you’re targeting cancelled subscriptions and ACTIVE subscriptions would be if you're targeting active subscriptions.
Typically, Quick Actions URLs for campaigns target all of the subscriptions a customer has. You can use HTML and IF statements to further customize who the campaign should send to if the customer has multiple subscriptions.
Subdomains and redirects
You must hardcode your URL in Klaviyo instead of using {{ organization.url }}
if you are using a subdomain instead of a domain in your notifications or a redirected URL. Using the {{ organization.url }}
variable with a subdomain or a redirect causes a 404 error even when everything is configured correctly.
<a href=".shop.myshopify.com/tools/recurring/quick_actions/
{{ person.recharge_customer }}
/process?action=view_portal_page&page=subscriptions">
View your subscription
</a>
Step 2 - Add your Quick Actions URL to a Klaviyo Flow or Campaign
Add a Quick Action URL to a Klaviyo Flow
- Create a Flow in Klaviyo.
- Select Metric as your Trigger setup.
- Use the appropriate Metric to trigger the notification. The metric must end in "on ReCharge" to work successfully.
- Build your Flow. Use the Email action to create an email where you can send out the Quick Actions URL created in Step 2. You can add the URL to the Source code in a Text Block. Alternatively, you may want to offer the Quick Actions URL through a button or image.
Add a Quick Action URL to a Klaviyo campaign
Follow Klaviyo’s instructions on sending out an email campaign. You may want to use Recharge custom properties in Klaviyo to create segments or lists to send to specific customers.
Required and optional variables
Recharge Quick Action URLs are unique to your customers based on their subscription data. These URLs are dynamic links that are automatically generated. Variables allow you to create your content so it appears relevant to the reader.
You can add additional variables to display additional information when constructing your Klaviyo email. Note that different Metrics contain different variables.
For more information about variables in Klaviyo, visit Template Tags and Variable Syntax.
Subscription cancelled on ReCharge
Available variables
Klaviyo variable |
Description |
{{ organization.url }} |
URL of your store name. This is specified in Klaviyo: Your Store > Account > Contact Information > Organization > Website URL |
{{ person.rc_customer_hash }} |
The Recharge customer hash Note: Previously, the correct variable for the customer hash was {{ person.recharge_customer }}. Flows using the old variable will still work. |
{{ event.extra.id }} |
subscription_id (the Recharge subscription id) |
Subscription started on ReCharge
Available variables
Klaviyo variable |
Description |
{{ organization.url }} |
URL of your store name. This is specified in Klaviyo: Your Store > Account > Contact Information > Organization > Website URL |
{{ person.rc_customer_hash }} |
The Recharge customer hash
Note: Previously, the correct variable for the customer hash was {{ person.recharge_customer }}. Flows using the old variable will still work.
|
{{ event.extra.id }} |
subscription_id (the Recharge subscription id) |
Order Upcoming on Recharge
Available variables
Klaviyo variable |
Description |
{{ organization.url }} |
URL of your store name. This is specified in Klaviyo: Your Store > Account > Contact Information > Organization > Website URL |
{{ person.rc_customer_hash }} |
The Recharge customer hash
Note: Previously, the correct variable for the customer hash was {{ person.recharge_customer }}. Flows using the old variable will still work.
|
{{ event.line_items.0.subscription_id }} |
This is an array of all the items in the upcoming order (this could contain one or more subscriptions or one-time products), combined with the subscription ID variable used in the "Order upcoming on Recharge" email, to loop through the items. |
Campaigns
Quick Action URLs in campaigns typically must begin with {% for sub in person.rc_all_subscriptions
%} {% if sub.status == 'CANCELLED' %}
or {% for sub in person.rc_all_subscriptions
%} {% if sub.status == 'ACTIVE' %}
. This loops through and finds the specific customer subscriptions with the status being targeted.
-
{% for sub in person.rc_all_subscriptions %} {% if sub.status == 'ACTIVE' %}
is used to target all customers who have an active subscription. -
{% for sub in person.rc_all_subscriptions %} {% if sub.status == 'CANCELLED' %}
is used to target all customers who have ever cancelled a subscription.
Available variables
Klaviyo variable |
Description |
{{ organization.url }} |
URL of your store name. This is specified in Klaviyo: Your Store > Account > Contact Information > Organization > Website URL |
{{ person.rc_customer_hash }} |
The Recharge customer hash
Note: Previously, the correct variable for the customer hash was {{ person.recharge_customer }}. Flows using the old variable will still work.
|
{{ sub.subscription_id }} |
This is the subscription ID variable used to pull the subscription ID related to |
Quick Action URLs do not apply to prepaid products. You can use the loop {% if
sub.status == 'CANCELLED' and sub.is_prepaid == False % }
or {% if sub.status
== 'ACTIVE' and sub.is_prepaid == False %}
to prevent customers with prepaid subscriptions from receiving your campaigns.