Creating Recharge Quick Action URLs manually
Recharge Quick Actions let you add subscription actions to your customer emails, such as skipping an order, reactivating a subscription, or adding a one-time product.
Recharge supports Quick Actions created with the Quick Actions URL Builder and used with Klaviyo.
This guide explains how Quick Actions URLs are structured, which variables each action requires, and what to consider when building URLs manually for testing or custom use.
- Shopify Checkout Integration
- Migrated Shopify Checkout Integration
Before you start
- Recharge supports Quick Actions when you create them with the Quick Actions URL Builder and use them with Klaviyo.
- Manually created Quick Actions URLs are not supported.
- If you use another email provider, you’ll need a custom middleware solution. This setup is not supported by Recharge.
Quick Actions URL structure
Each Quick Actions URL starts with your .myshopify.com domain followed by the Quick Actions path:
https://mystore.myshopify.com/tools/recurring/quick_actions/The rest of the URL identifies the customer, the action to perform, and the subscription or product involved.
- Customer hash: Identifies the customer
- Action: Defines the Quick Action to perform
- Subscription ID: Identifies the subscription the action applies to
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=32475718385739Variable |
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 | https://examplestore.myshopify.com/tools/recurring/quick_actions/5244250087ca77ba5cd96c57/process?action=reactivate&subscription_id=111076384 |
| Skip next order | skip_next | customer_hash, subscription_id | https://examplestore.myshopify.com/tools/recurring/quick_actions/5244250087ca77ba5cd96c57/process?action=skip_next&subscription_id=111076384 |
| Skip entire next order | skip_next |
customer_hash, subscription_id, all_in_order=1 |
https://examplestore.myshopify.com/tools/recurring/quick_actions/8bc00fef88a5f97f/process?action=skip_next&subscription_id=113426372&all_in_order=1 |
| Swap current subscription | swap |
customer_hash, subscription_id, shopify_variant_id |
https://examplestore.myshopify.com/tools/recurring/quick_actions/5244250087ca77ba5cd96c57/process?action=swap&subscription_id=111076384&shopify_variant_id=32475714715723 |
| Add one-time product to next order | add_onetime |
customer_hash, subscription_id, shopify_variant_id, quantity |
https://examplestore.myshopify.com/tools/recurring/quick_actions/5244250087ca77ba5cd96c57/process?action=add_onetime&subscription_id=111076384&shopify_variant_id=32475718385739 |
| Ship now next order | ship_now |
customer_hash subscription_id |
https://examplestore.myshopify.com/tools/recurring/quick_actions/5244250087ca77ba5cd96c57/process?action=ship_now&subscription_id=111076384 |
| Ship now entire next order | ship_now |
customer_hash, subscription_id, all_in_order=1 |
https://examplestore.myshopify.com/tools/recurring/quick_actions/8bc00fef88a5f97f/process?action=ship_now&subscription_id=113426372&all_in_order=1 |
| Apply discount to next order | apply_discount |
customer_hash, subscription_id, discount_code |
https://examplestore.myshopify.com/tools/recurring/quick_actions/5244250087ca77ba5cd96c57/process?action=apply_discount&subscription_id=111076384&discount_code=20OFF |
| 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 |
https://examplestore.myshopify.com/tools/recurring/quick_actions/5244250087ca77ba5cd96c57/process?action=reactivate&action=apply_discount&subscription_id=111076384&discount_code=20OFF |
| 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
Recharge recommends using the Quick Actions URL Builder to generate URLs for your Klaviyo notifications. While you can manually create Quick Action URLs in Klaviyo, they are not supported by Recharge.
Step 1 - Create your Quick Actions URL
Construct your Quick Actions URL. Build your Quick Actions URL manually first to test it for accuracy.
Once you've confirmed the manual Quick Actions URL works as expected, 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=subscriptionsAfter testing the URL, replace static values such as the customer hash or subscription ID with the corresponding Klaviyo variables:
<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 the customer's subscriptions. You can use HTML and IF statements to further customize who the campaign sends to when 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 to send 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 display the Quick Actions URL as a button or an 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 for specific customers.
Required and optional variables
Recharge Quick Action URLs are unique to your customers based on their subscription data. These URLs are dynamic, automatically generated links. Variables let you create content that 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 |
| {{ 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 |
| {{ 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 |
| {{ 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 targeted status.
-
{% 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 |
| {{ sub.subscription_id }} | This is the subscription ID variable used to pull the subscription ID related to {% for sub in person.rc_all_subscriptions %} {% if sub.status == 'CANCELLED' %} or {% for sub in person.rc_all_subscriptions %} {% if sub.status == 'ACTIVE' %}. |
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.
