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:

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

All actions return at minimum a success_message output field. Every action is logged in the subscription activity log with source SHOPIFY_FLOW. 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 ID, counts as missing, and the action fails as if you had left the field empty.

Line item management

Add a product variant to an existing subscription.Input fields:Output fields: contract_id, product_variant_id, quantity, is_one_time_product, success_message
Remove a product from a subscription.Input fields:Output fields: contract_id, line_id, remove_discount, success_message
Change the quantity of a product in a subscription.Input fields:Output fields: contract_id, line_id, quantity, success_message
Change the price of a product in a subscription.Input fields:Output fields: contract_id, line_id, base_price, remove_pricing_policy, success_message
Update custom attributes on a line item.Input fields:Output fields: contract_id, line_id, success_message
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.Output fields: contract_id, old_variant_id, new_variant_id, success_message

Subscription management

Set a subscription’s status to Active, Paused, or Cancelled.Input fields:Output fields: updated_contract_id, updated_status, success_message
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)Output fields: contract_id, success_message
Combine two subscriptions into one.Input fields:Output fields: source_contract_id, destination_contract_id, success_message
Split specific line items out into a new subscription contract.Input fields:Output fields: original_contract_id, new_contract_id, line_ids_moved, success_message
Change the selling plan on one line item of a subscription.Input fields:Output fields: contract_id, line_id, selling_plan_id, success_message
Update Order Note — sets the order note text on a subscription. Required: contract_id. Optional: order_note (leave it empty to clear the note).Update Note Attributes — sets custom key-value note attributes. Required: contract_id, note_attributes (JSON array). Optional: overwrite_existing (boolean, default false). Output includes attributes_count.

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.
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. 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.
Change the billing frequency.Input fields:Output fields: contract_id, billing_interval_count, billing_interval, success_message
Change billing and delivery frequency using an existing selling plan.Input fields: contract_id (required), selling_plan_id (required)Output fields: contract_id, selling_plan_id, selling_plan_name, billing_interval_count, billing_interval, delivery_interval_count, delivery_interval, success_message
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)Output fields: contract_id, next_billing_date, success_message
Skip (or unskip) the next scheduled order.Input fields:Output fields: contract_id, line_id, is_skip, success_message
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.Output fields: contract_id, billing_attempt_id, success, success_messagesuccess is true 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.
Retry the subscription’s most recent failed billing attempt. The action reuses the failed order instead of creating a new one.Input fields:Output fields: contract_id, billing_attempt_id, success, success_messagesuccess is true 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.Output fields: contract_id, max_cycles, success_messageUpdate 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.Output fields: contract_id, min_cycles, success_message

Discounts & pricing

Apply a discount code to a subscription.Input fields: contract_id (required), discount_code (required)Output fields: contract_id, discount_code, success_message
Remove a discount. Provide either discount_id or discount_code.Input fields: contract_id (required), discount_id or discount_code (one required)Output fields: contract_id, discount_id, success_message
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 → PAUSED
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, on one line
  • 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. Join it into one line: Flow passes line breaks to the action together with the ID, and the action fails with contract_id is required.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 the IDs one after the other with nothing between them, 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.

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.