Skip to main content

How to add or remove Shopify customer and order tags on subscription events

PayWhirl's subscription tagging features allow you to add or remove customer tags when subscriptions are created, canceled, paused, etc.

Written by Ryan P.

PayWhirl's tag workflow feature allows you to automatically control how customer tags are added or removed for different subscription events. You can also conditionalize the tags based on the specific product(s) purchased.

A basic example would be to tag a customer in Shopify with "Active Subscription" when a new subscription is created and remove it when paused.

Customer tags can be used in conjunction with other apps that automatically discount purchases, provide access to content, or use customer tags to enable functionality for customers. The possibilities are truly endless.


Event Triggers

PayWhirl supports the following subscription event triggers:

  • Subscription created

  • Subscription paused

  • Subscription resumed

  • Subscription canceled

  • Subscription expires

  • Subscription payment fails (retrying)

  • Subscription payment fails (last attempt)

  • Subscription payment succeeds

You can add or remove customer tags in Shopify on each event trigger listed above.

Conditions

You can further conditionalize the triggers with the following options:

  • Subscription contains ANY of the selected products

  • Subscription DOES NOT contain ANY of the selected products

  • Subscription contains ALL of the selected products

  • Subscription contains ANY of the selected product variants

  • Subscription DOES NOT contain ANY of the selected product variants

  • Subscription contains ALL of the selected product variants

  • Subscription contains ANY product with matching title

  • Subscription contains ANY product variant with matching title

  • Customer has no active subscriptions

For example, if a customer creates a subscription for a product titled "Coffee Subscription," you can tag them with "Active Coffee Subscriber," but if they subscribe to a product titled "Coffee Filters," then you can tag them with "Active Filter Subscriber," and so on.

A common use case for tag workflows is automatically creating a subscription membership to discount customer purchases on Shopify. Several discounting apps provide this functionality based on customer tags.

Another use-case for tag workflows would be to allow access to special content on your Shopify store when customers have a specific tag in Shopify. A few access control apps provide this functionality in the Shopify app store.

Subscription-based wholesale memberships are another option. You can show wholesale pricing to customers with a specific tag using several apps on Shopify.

Any app with customer tags in Shopify should work seamlessly with PayWhirl's tag workflow features. PayWhirl will add or remove customer tags based on the subscription events you need, and you can add functionality as needed with other apps that use tags.

Order Tags

You can automatically tag orders, in addition to customers, on some subscription events. Adding tags to orders is only available on Subscription is created and Subscription payment succeeds events.

Tag variables

You can use variables in customer and order tags to include information from the subscription or the order that triggered the workflow. When the workflow runs, PayWhirl replaces each variable with its corresponding value.

For example:

Subscription - {{subscription_id}}

would create a tag containing the subscription’s PayWhirl ID.

Subscription and schedule variables

These variables describe the subscription and its billing or delivery schedule:

  • {{subscription_id}} — The PayWhirl subscription ID.

  • {{subscription_created_at}} — The date and time the subscription was created.

  • {{subscription_created_at_day}} — The day the subscription was created.

  • {{subscription_created_at_month}} — The month the subscription was created.

  • {{subscription_created_at_year}} — The year the subscription was created.

  • {{subscription_initial_order_number}} — The Shopify order number associated with the subscription’s initial order.

  • {{billing_interval_type}} — The billing interval unit, such as day, week, month, or year.

  • {{billing_interval_count}} — The number of billing interval units between payments.

  • {{billing_anchor}} — The subscription’s billing anchor, when one is configured.

  • {{billing_anchor_weekday}} — The weekday used for an applicable billing anchor.

  • {{billing_anchor_day_of_month}} — The day of the month used for an applicable billing anchor.

  • {{billing_anchor_month}} — The month used for an applicable billing anchor.

  • {{delivery_interval_count}} — The number of delivery interval units between scheduled deliveries.

For example, a subscription billed every two months would have a billing interval type of month and a billing interval count of 2.

Order-specific variables

The following variables describe the order associated with the workflow event:

  • {{payment_number}} — The subscription payment or recurring order number.

  • {{subscription_item_quantity}} — The total quantity of subscription items included in the order.

  • {{subscription_line_item_count}} — The number of separate subscription line items included in the order.

These order-specific variables are available only for the following workflow events:

  • Subscription is created

  • Subscription payment succeeds

  • Future subscription price change applied

If a tag containing one of these variables is used with another event, PayWhirl skips that tag.

Understanding the quantity variables

The two quantity variables measure different things.

Suppose an order contains:

  • Coffee × 2

  • Filters × 1

  • Mug × 1

The resulting values would be:

  • {{subscription_item_quantity}} = 4

  • {{subscription_line_item_count}} = 3

subscription_item_quantity adds together the quantities from every subscription line. subscription_line_item_count counts the number of separate subscription lines.

These values describe the subscription items in the current order. They do not count all active subscriptions belonging to the customer.

Example quantity tags

You can include the variables directly in customer or order tags.

For total quantity:

Subscription quantity - {{subscription_item_quantity}}

An order containing four subscription units would produce:

Subscription quantity - 4

For the number of separate line items:

Subscription line items - {{subscription_line_item_count}}

An order containing three separate subscription lines would produce:

Subscription line items - 3

Please let us know if you have any questions or feedback.

Sincerely,

The PayWhirl Team

Did this answer your question?