Skip to main content
Appstle Subscriptions integrates natively with Shopify Flow, Shopify’s built-in automation platform. You can build powerful subscription automation — pausing after failed payments, applying loyalty discounts, swapping seasonal products — without managing API keys or writing backend code. Flow runs within Shopify’s authenticated context, so no credentials are required.
Shopify Flow is available on Shopify Basic plan and above. Appstle triggers fire only after you enable the Flow integration in your Appstle admin. Appstle actions don’t need the integration enabled, but the store’s Appstle plan must include API access, the same access that Admin API keys need. Without it, every Appstle action fails. A few actions also need a plan feature: see the notes under Billing & schedule.

Getting started

1

Enable the integration

In the Appstle admin, go to App Integrations and click Integrate on the Shopify Flow card. Select Send subscription events to Shopify Flow, then click Save.
2

Open the Flow editor

Navigate to the Shopify Flow editor in your Shopify admin.
3

Create a workflow

Click Create workflow, choose an Appstle trigger, add conditions if needed, and attach Appstle actions.

Triggers

Triggers fire automatically when subscription events occur. All triggers include the full subscription and customer property sets described below.

Subscription lifecycle

Billing events

When Upcoming Order Notification fires

The trigger fires when an upcoming order comes inside its subscription’s buffer: the number of days before billing that Appstle sends the Upcoming Order email. The buffer counts back from the order’s scheduled time, so a 2-day buffer starts 48 hours before the order is billed. Appstle checks for orders inside their buffer every 14 minutes, so the trigger fires within about 15 minutes of that point.
  • Where the buffer comes from: Appstle saves a buffer on each subscription when the subscription is created. It takes the plan’s Reminder email option when the plan sets one, otherwise the Upcoming Order email’s Send Upcoming Order Email (Days Before Charge) setting, otherwise 1 day. Changing either setting later doesn’t change existing subscriptions. To change one subscription, click Edit next to Email Buffer Days in the Upcoming Orders Email card on its page. To change several, select them on the Subscriptions list and use the Set email reminder days bulk action.
  • With the email and the webhook: the trigger fires when Appstle queues the Upcoming Order email, at the same time as the subscription.upcoming-order-notification webhook. It fires even when the Upcoming Order email is disabled, so don’t read it as “an email was sent”.
  • When it doesn’t fire: for a subscription that isn’t active, for a subscription with Stop sending upcoming order emails selected, and for an order that’s skipped.
  • It can fire again for the same order. Rescheduling the order resets it. So does a change that rebuilds the subscription’s upcoming orders, such as a new next billing date or billing frequency. If the order is still inside the buffer afterward, the trigger fires again. Build your workflow so that a second run for the same Subscription ID and Billing Date does no harm.
To test a workflow, move a test subscription’s next order inside its buffer. Get the order’s id from Get upcoming orders. Then call Reschedule a billing attempt with a billingDate inside the buffer and rescheduleFutureOrder=false. The call needs a plan that includes next billing date changes (see Billing & schedule). The trigger fires within about 15 minutes, and again after each reschedule into the buffer. The customer gets the same emails as for a real change, so use a test customer.

Schedule changes

Trigger properties

Subscription properties

Included with every trigger:

Customer properties

Included with every trigger:

Subscription Created properties

For the Subscription Created trigger only:

Billing event properties

For Subscription Billing Success, Subscription Billing Failure, and Upcoming Order Notification only: For Subscription Billing Success only:

During payment retries

When a payment fails, Appstle tries again on the schedule in the store’s Failed Payment Recovery settings, so a workflow can see the same renewal several times. A retry you start with Retry Failed Billing works the same way.
  • Subscription Billing Failure fires after every failed try that Shopify reports, out-of-stock failures included. A retry that goes through fires Subscription Billing Success with a Billing Attempt Count above 1.
  • A try that Shopify rejects outright doesn’t fire the trigger. When Shopify rejects the billing request before it tries the payment, Appstle sends the subscription.billing-failure webhook but no Flow trigger. The try still counts, so Billing Attempt Count can go up by more than one between two triggers.
  • Billing Date stays the same on every try. It’s the date the renewal was due. Billing Attempt ID and Billing Attempt Time belong to the try that fired the trigger, so they change on each retry.
  • Next Billing Date already shows the following cycle. Before Subscription Billing Failure fires for a try that Appstle will retry, Appstle moves the subscription’s next billing date to the following cycle. Each time it moves the date, Subscription Next Order Date Changed fires too, with the new date in Next Billing Date and no Billing Date. To tell which renewal a try belongs to, read Billing Date on Subscription Billing Failure or Subscription Billing Success.
  • The trigger doesn’t say whether Appstle will try again. The last try is the one where Billing Attempt Count reaches the store’s total number of payment attempts, which includes the first charge. That’s Total payment attempts on a Fixed schedule, or the attempts of every active phase added up in a Phased campaign. Appstle can also stop earlier without another trigger, for example when the subscription is paused or cancelled before the next try. The subscription.billing-failure webhook says whether another try is scheduled, in retryingNeeded.
  • The last failed try applies the store’s recovery action, set under If every attempt fails. With Skip this order, keep the subscription active, that try’s Subscription Billing Failure has Billing Attempt Status SKIPPED_DUNNING_MGMT instead of FAILURE, and Flow has no other trigger for the skipped order. With Pause the subscription or Cancel the subscription, the status stays FAILURE, the trigger’s Status is already PAUSED or CANCELLED, and Subscription Paused or Subscription Cancelled fires as well. When Shopify rejected that last try outright, Subscription Billing Failure doesn’t fire for it, so a skipped order fires no trigger at all.

Subscription Updated properties

For the Subscription Updated trigger only:

Subscription Cancelled properties

For the Subscription Cancelled trigger only:

Line items schema

Each object in the Line Items array contains:

Actions

Every action is logged in the subscription activity log with source SHOPIFY_FLOW. Every action except Update Pricing Policy returns the values it applied or created, so a later step can use them. For example, the step after Split Subscription can read the ID of the new contract. See Use action results in later steps. A field that takes a contract ID accepts the number (9876543210), the number as a string ("9876543210") or the full Shopify ID (gid://shopify/SubscriptionContract/9876543210). That goes for contract_id in the actions that take one, and for source_contract_id and destination_contract_id in Merge Subscriptions. selling_plan_id likewise accepts a number or gid://shopify/SellingPlan/111. Any other value, such as an order’s gid://shopify/Order/… ID, counts as missing, and the action fails as if you had left the field empty. A number that isn’t one of the store’s subscription contracts fails differently: Attempt Billing, Retry Failed Billing and Update Frequency by Selling Plan fail with a bad-request error, and every other action fails with a server error that Flow retries. Every action ignores spaces and line breaks at the start and end of a text value, except order_note in Update Order Note, which is saved exactly as you send it. So an ID that Add variable inserts as a loop on several lines works as it is.

Line item management

Add a product variant to an existing subscription.Input fields:
Remove a product from a subscription.Input fields:
Change the quantity of a product in a subscription.Input fields:
Change the price of a product in a subscription.Input fields:
Replaces every custom attribute on a line item with the list you send, and fires Subscription Updated. An attribute you leave out is removed. To change one attribute, send the line’s full current list with that value changed, as in the attribute example under Example workflows.Input fields:
Swap a product variant for another in a subscription.Input fields:This action takes numeric variant IDs only. A gid:// ID fails with Invalid old_variant_id format: … or Invalid new_variant_id format: …. contract_id accepts either form, and so does product_variant_id in Add Line Item.The new line doesn’t keep the old line’s quantity. Each entry in new_variant_id gets the quantity after its colon, or 1 when there’s no colon. For example, replacing a line of quantity 4 with new_variant_id set to 11111 leaves a line of 11111 with quantity 1.To keep the old quantity, put a Flow variable after the colon. Every Appstle trigger carries the subscription’s Line Items, which Liquid reads as lineItems.items. This expression prints the quantity of the line that has the old variant. Replace NEW_VARIANT_ID with the new variant’s numeric ID, and OLD_VARIANT_ID with the ID you put in old_variant_id:
When the old line has quantity 3, the field becomes NEW_VARIANT_ID:3 and the new line gets quantity 3. The expression handles one old variant, so add one action for each variant you swap. It also assumes only one line has the old variant: with two, it prints both quantities one after the other, such as 34.

Subscription management

Set a subscription’s status to Active, Paused, or Cancelled.Input fields:The customer gets the store’s Subscription Paused, Subscription Resumed or Subscription Cancelled email, unless that email is turned off under Notification Settings → Email Notifications in the Appstle admin. The action has no option to skip the email for a single change. When the subscription already has the status you set, the action changes nothing and sends no email.
Permanently remove a subscription from Appstle. The contract is cancelled in Shopify if it isn’t already, and it no longer appears in the merchant portal or the customer portal. Hiding can’t be undone.Input fields: contract_id (required)
Combine two subscriptions into one.Input fields:
Split specific line items out into a new subscription contract.Input fields:
Change the selling plan on one line item of a subscription.Input fields:
Update Order Note — sets the order note text on a subscription. Required: contract_id. Optional: order_note, saved exactly as you send it, line breaks included (leave it empty to clear the note).Update Note Attributes — sets custom key-value note attributes on a subscription. When it changes an attribute, it fires Subscription Updated, so a workflow on that trigger can start itself again.The Overwrite Existing Attributes checkbox starts unchecked, and Flow sends false when you leave it that way. The action then merges: it keeps the attributes already on the subscription and adds the ones in note_attributes, replacing any with the same key. Keys match exactly, letter case included. Check the box and the action replaces the subscription’s attributes with only the ones in note_attributes.Merging can’t remove an attribute. To remove one, check the box and send the full list without it. The trigger’s Order Note Attributes hold the current list.
With Overwrite Existing Attributes checked, the action removes every attribute that isn’t in note_attributes, including any that the storefront or another app added. Leave the box unchecked unless the list is the complete set you want to keep.

Billing & schedule

Attempt Billing and Retry Failed Billing bill the customer right away, so your Appstle plan must include immediate order placement. Stores that choose a paid plan today get it, and the Free plan doesn’t include it. A store that chose its plan earlier, or is on a custom plan, may not have it: contact support@appstle.com to check. Without it, the action fails with “You don’t have permission to place immediate orders. Please upgrade your plan to enable this feature.” The Admin API’s attempt-billing endpoint (PUT /api/external/v2/subscription-billing-attempts/attempt-billing/{id}) needs the same permission.Attempt Billing also counts toward the store’s daily limit on immediate orders, which new installs and reinstalls get: 3 a day unless support has raised it. When the store has used its immediate orders for the day, the action fails with a bad-request error (HTTP 400) whose message names the limit and when it resets. Flow doesn’t retry a bad-request error, so to bill the order, run the action again after midnight UTC.
Update Next Billing Date needs a plan that includes next billing date changes. Stores that choose a paid plan today get it, and the Free plan doesn’t include it. A store on a plan without it gets the error “Upgrade your plan to modify next billing date.” A store that chose its plan earlier, or is on a custom plan, may not have it: contact support@appstle.com to check. The Admin API’s update-billing-date endpoint (PUT /api/external/v2/subscription-contracts-update-billing-date) and reschedule-order endpoint (PUT /api/external/v2/subscription-billing-attempts/reschedule-order/{id}) need the same permission.
Update Billing Interval, Update Frequency by Selling Plan and Update Delivery Interval need a plan that includes billing interval changes. Update Line Item Price and Update Delivery Price need a plan that includes contract price changes (the Edit subscription prices plan permission). Stores that choose a paid plan today get both, and the Free plan doesn’t include them. Without them, the action fails with “Upgrade your plan to modify billing interval.” or “Upgrade your plan to modify contract price.” A store that chose its plan earlier, or is on a custom plan, may not have them: contact support@appstle.com to check. The Admin API’s delivery price endpoints (PUT /api/external/v2/subscription-contracts-update-delivery-price, PUT /api/external/v2/subscription-contracts-update-delivery-price-override and PUT /api/external/v2/subscription-contracts-sync-shipping-price) don’t need contract price changes.
Change the billing frequency.Input fields:
Change billing and delivery frequency using an existing selling plan.Input fields: contract_id (required), selling_plan_id (required)
Reschedule the next billing date. Dates must use ISO 8601 format: 2026-03-15T10:00:00Z.Input fields: contract_id (required), next_billing_date (required)
Skip (or unskip) the next scheduled order.Input fields:
Place an upcoming order now instead of waiting for its billing date. Provide a contract_id or a billing_attempt_id.Input fields:For billing_attempt_id, use the id field (not billingAttemptId) from the Admin API’s upcoming or past orders endpoints. The trigger’s Billing Attempt ID is Shopify’s ID, so the action rejects it.The action succeeds once billing has started, not when the payment goes through. The charge reaches Shopify shortly after, and the result fires Subscription Billing Success or Subscription Billing Failure.The action fails with a bad-request error, which Flow doesn’t retry, when Appstle refuses the order. Its message says why:
  • The order is already billed, or it was skipped and a later order has gone through.
  • The subscription isn’t active.
  • Another billing operation for the subscription is in progress.
  • The order is waiting to be combined with another order from the same customer.
  • The store checks inventory before billing, and the order can’t go out because products are out of stock.
  • The order would charge more than the store’s charge cap allows.
  • The store has used its immediate orders for the day.
Run the action again once the cause is gone. Each run that gets past the daily limit uses one of the day’s immediate orders, even when Appstle then refuses the order for another reason.
Retry the subscription’s most recent failed billing attempt. The action reuses the failed order instead of creating a new one.Input fields:The action succeeds once billing has started, not when the payment goes through. The charge reaches Shopify shortly after, and the result fires Subscription Billing Success or Subscription Billing Failure.The action fails if the failed order is no longer the latest of the subscription’s past orders: for example, a later order went through, or the customer skipped an upcoming order (skipped orders count as past orders). It also fails while another billing operation for the subscription is in progress.
Update Max Cycles — set the maximum number of orders the subscription can place, counting the first order. Required: contract_id, max_cycles. max_cycles must be at least 1 and not below the number of orders the subscription has already placed: 0 doesn’t remove the maximum, and the action fails. Once the subscription has placed that many orders, no more orders are scheduled or charged. It isn’t cancelled: it is paused if Auto-pause subscriptions after maximum orders reached is on in Shop Settings (under Additional Order Settings), and otherwise stays active with nothing scheduled.Update Min Cycles — set the minimum number of orders, counting the first order, that the subscription must place before the customer can cancel it from the customer portal. Required: contract_id, min_cycles.

Discounts & pricing

Apply a discount code to a subscription.Input fields: contract_id (required), discount_code (required)
Remove a discount. Provide either discount_id or discount_code.Input fields: contract_id (required), discount_id or discount_code (one required)With discount_code, the action looks for a discount on the subscription whose code matches exactly, letter case included: welcome10 doesn’t match WELCOME10. Spaces and line breaks at the start and end of the code you send are ignored. When none matches, there is nothing to remove, so the action succeeds and changes nothing. When you send discount_id, the action uses it and ignores discount_code. When the subscription can’t be read from Shopify, the action fails with a server error, and Flow retries it.
Update pricing policy with cycle-based discounts.
This action doesn’t work yet. Every run fails and changes nothing on the subscription. With a line_id, it fails with Line item pricing policy update is not yet supported in flow actions. Without one, it fails with Pricing policy update with cycles is not yet fully supported in flow actions. Please use base price update only. To change a line’s price from a workflow, use Update Line Item Price.
Input fields:

Delivery & shipping

Change the delivery frequency.Input fields: contract_id (required), delivery_interval_count (required), delivery_interval (required — DAY, WEEK, MONTH, or YEAR)
Change the shipping method on a subscription.Input fields: contract_id (required), delivery_method_title (required). Optional: delivery_method_code, delivery_method_presentment_title, delivery_method_id.The action changes the method’s name and code. With delivery_method_id, it uses that Shopify shipping method’s name, and its price when the method has a fixed rate or a live Shopify Markets rate. Without delivery_method_id, the delivery price stays as it is, so add an Update Delivery Price action when the new method costs something different.Unless it applies a live Shopify Markets rate, the action also turns on Use Custom Delivery Price for the subscription. While that’s on, automatic shipping price syncs skip the subscription, including Refresh Shopify shipping rates before recurring orders. The one exception is an address change that switches between shipping, local delivery and pickup: with Recalculate shipping price when delivery method changes on, it still recalculates the price. To resume the syncs, uncheck Use Custom Delivery Price in the subscription’s Delivery Information section, or turn it off with the Admin API.
Change the shipping price. Required: contract_id, delivery_price. The new price lasts only while Use Custom Delivery Price is on for the subscription. Otherwise the next automatic shipping price sync can replace it.
Update the delivery address.Required fields: contract_id, address1, city, country_codeOptional fields: address2, province, province_code, zip, country, first_name, last_name, phone, company
Send a payment method update request to the customer. Required: contract_id.

Example workflows

Trigger: Subscription Billing FailureCondition: Billing Attempt Count ≥ 3Action: Update Subscription Status → PAUSEDWhen the action pauses the subscription, the customer also gets the Subscription Paused email. See Update Subscription Status.
Trigger: Order cancelled (Shopify’s own trigger, under Shopify in Flow’s trigger picker)Condition: at least one of the order’s tags is equal to appstle_subscription_first_order (in Flow, pick order → tags, then At least one of and Equal to)Action: Update Subscription Status
  • Subscription Contract ID: the expression below
  • New Status: CANCELLED
The expression fills the field with the contract’s ID, such as gid://shopify/SubscriptionContract/9876543210. If you click Add variable and pick order → lineItems → contract → id, Flow inserts the same loop on three lines. That works too: Flow sends the line breaks with the ID, and the action ignores them.The condition limits the workflow to first orders, so Flow stops before the action when a renewal order or an order with no subscription is cancelled. Appstle adds the tag shortly after checkout, when it processes the new subscription. If an order is cancelled before then, for example by an automatic fraud check, Flow may not see the tag, and the subscription stays active.appstle_subscription_first_order is Appstle’s default first-order tag. If you changed it under More → Tag Settings, use your tag. If your tag contains a variable, its value changes from order to order, so match its fixed part instead of using Equal to. If you removed the tag, first orders carry none and the condition never passes.The expression works when the order holds one subscription line item. With two or more, even from the same contract, it prints every ID into the field, and the action fails.
Trigger: Subscription Billing FailureCondition: Billing Attempt Count ≤ 2Wait: 1 day (Flow’s Wait step), so the customer has time to update their cardAction: Retry Failed Billing → contract_id = the trigger’s Subscription IDA failed retry fires Subscription Billing Failure again with a higher Billing Attempt Count, so the condition stops the workflow after the third attempt. Appstle’s Failed Payment Recovery settings also retry failed payments, so make sure the two schedules don’t overlap.
Trigger: Subscription Billing SuccessCondition: Total Successful Orders ≥ 6Action: Apply Discount Code → LOYAL10
Trigger: Subscription CancelledCondition: Contract Amount > 100Action: Send Slack notification (via Shopify Flow’s Slack connector)
Trigger: Upcoming Order NotificationAction: Replace/Swap Product Variant
  • Subscription Contract ID: the trigger’s Subscription ID
  • Old Variant ID: the retired variant’s numeric ID
  • New Variant ID: the replacement variant’s numeric ID, a colon and the expression from Replace/Swap Product Variant, so the new line keeps the old quantity
On a subscription that doesn’t have the retired variant, the action fails and changes nothing.
Trigger: Subscription Next Order Date Changed. Other subscription triggers with Line Items work the same way, except Subscription Updated: the action fires Subscription Updated, so a workflow on that trigger can start itself again.Action: Update Line Item Attributes
  • Subscription Contract ID: {{ subscriptionId }}, the trigger’s Subscription ID
  • Line Item ID: the first expression below, on one line. It picks the line whose variant is 1234567890
  • Attributes: the second expression below, on one line. It copies each attribute on that line and changes Gift message to Happy anniversary
The action replaces every attribute on the line with the list it gets, so the list has to carry the attributes you want to keep. The json filter quotes and escapes each key and value. The expression changes an attribute that’s already on the line and doesn’t add a missing one. When no line has the variant, Line Item ID is empty and the action fails without changing anything. It also fails on a line with no attributes, because the list it builds is empty. The expressions expect only one line with that variant.

Use action results in later steps

Each Appstle action (except Update Pricing Policy) returns the values it applied or created, plus a success_message. Later steps in the workflow read them like the trigger’s variables:
  1. Add the Appstle action to your workflow.
  2. In a later step, click Add variable.
  3. Under the action’s name, choose its variable, such as updateOrderNote under Update Order Note, then the field you want.
For example, this Log output text reads three results from an Update Order Note step that set the note to Flow output check:
The run’s log shows:
Contract, selling plan and billing attempt IDs come back as plain numbers, such as 9876543210, even when the action was given the full Shopify ID. Counts, such as quantity and max_cycles, are numbers. Yes-or-no fields, such as success, is_skip and remove_discount, are true or false. Prices, such as base_price, are decimals. Every other value is text. When an action fails with a server error, Flow retries it, and the steps after it wait. The fields each action returns: What some result fields hold:
  • success from Attempt Billing and Retry Failed Billing is always true. It means billing has started, not that the payment went through. The outcome comes later, from Subscription Billing Success or Subscription Billing Failure: see During payment retries.
  • billing_attempt_id is Appstle’s ID for the order, the ID that Attempt Billing takes. It isn’t the trigger’s Billing Attempt ID, which is Shopify’s.
  • new_contract_id from Split Subscription is the ID of the new subscription. line_ids_moved repeats the line IDs you sent. They belong to the original subscription: the lines on the new subscription have new IDs.
  • discount_id from Remove Discount is empty when no discount on the subscription matched discount_code, so nothing was removed.
  • old_delivery_price from Update Delivery Price is the delivery price before the change.
  • selling_plan_name and the interval fields from Update Frequency by Selling Plan come from the selling plan you chose.
  • billing_interval and delivery_interval are DAY, WEEK, MONTH or YEAR. updated_status is ACTIVE, PAUSED or CANCELLED.
  • is_one_time_product, remove_discount, is_skip, remove_pricing_policy and overwrite_existing show the setting the action used, which is the default when the field was left empty.
  • Most other fields repeat what the action was given, such as line_id, next_billing_date, order_note and new_variant_id with any :quantity.
To check a workflow, turn it on and trigger the event for a test subscription, then open the run in Recent runs. A step’s Step data shows its input and the results that later steps use, not every result field.

Field reference

Attributes JSON format — for attributes and note_attributes fields:
Replace/Swap Product Variant format:
  • old_variant_id: comma-separated numeric variant IDs to replace — 12345,67890
  • new_variant_id: comma-separated numeric variant IDs, each with an optional :quantity (default 1) — 11111:2,22222. The new line doesn’t keep the old line’s quantity.
  • gid:// variant IDs fail. Use the numeric ID, such as 12345.

Next steps

Webhooks

Receive subscription lifecycle and billing events on your server, and verify their signatures.

Admin API integration guide

Manage subscriptions, products, discounts and shipping from your server.

Klaviyo events

The events Appstle sends to Klaviyo, when each is sent and the properties it carries.

API changelog

Dated changes to the Flow triggers and actions and the Subscriptions APIs, with what to do about each.