Getting started
Enable the integration
Open the Flow editor
Create a workflow
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-notificationwebhook. 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 IDandBilling Datedoes no harm.
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:Subscription Updated properties
For the Subscription Updated trigger only:Subscription Cancelled properties
For the Subscription Cancelled trigger only:Line items schema
Each object in theLine Items array contains:
Actions
All actions return at minimum asuccess_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 Line Item
Add Line Item
contract_id, product_variant_id, quantity, is_one_time_product, success_messageRemove Line Item
Remove Line Item
contract_id, line_id, remove_discount, success_messageUpdate Line Item Quantity
Update Line Item Quantity
contract_id, line_id, quantity, success_messageUpdate Line Item Price
Update Line Item Price
contract_id, line_id, base_price, remove_pricing_policy, success_messageUpdate Line Item Attributes
Update Line Item Attributes
contract_id, line_id, success_messageReplace/Swap Product Variant
Replace/Swap Product Variant
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: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_messageSubscription management
Update Subscription Status
Update Subscription Status
updated_contract_id, updated_status, success_messageHide Subscription
Hide Subscription
contract_id (required)Output fields: contract_id, success_messageMerge Subscriptions
Merge Subscriptions
source_contract_id, destination_contract_id, success_messageSplit Subscription
Split Subscription
original_contract_id, new_contract_id, line_ids_moved, success_messageUpdate Selling Plan
Update Selling Plan
contract_id, line_id, selling_plan_id, success_messageUpdate Order Note / Update Note Attributes
Update Order Note / Update Note Attributes
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
PUT /api/external/v2/subscription-billing-attempts/attempt-billing/{id}) needs the same permission.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 Billing Interval
contract_id, billing_interval_count, billing_interval, success_messageUpdate Frequency by Selling Plan
Update Frequency by Selling Plan
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_messageUpdate Next Billing Date
Update Next Billing Date
2026-03-15T10:00:00Z.Input fields: contract_id (required), next_billing_date (required)Output fields: contract_id, next_billing_date, success_messageSkip Next Order
Skip Next Order
contract_id, line_id, is_skip, success_messageAttempt Billing
Attempt Billing
contract_id or a billing_attempt_id.Input fields: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 Failed Billing
Retry Failed Billing
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 / Min Cycles
Update Max / Min Cycles
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_messageDiscounts & pricing
Apply Discount Code
Apply Discount Code
contract_id (required), discount_code (required)Output fields: contract_id, discount_code, success_messageRemove Discount
Remove Discount
discount_id or discount_code.Input fields: contract_id (required), discount_id or discount_code (one required)Output fields: contract_id, discount_id, success_messageUpdate Pricing Policy
Update Pricing Policy
Delivery & shipping
Update Delivery Interval
Update Delivery Interval
contract_id (required), delivery_interval_count (required), delivery_interval (required — DAY, WEEK, MONTH, or YEAR)Update Delivery Method
Update Delivery Method
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.Update Delivery Price
Update Delivery Price
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 Shipping Address
Update Shipping Address
contract_id, address1, city, country_codeOptional fields: address2, province, province_code, zip, country, first_name, last_name, phone, companyUpdate Payment Method
Update Payment Method
contract_id.Example workflows
Auto-pause after 3 failed payments
Auto-pause after 3 failed payments
PAUSEDCancel the subscription when its first order is cancelled
Cancel the subscription when its first order is cancelled
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
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.Retry a failed payment after a day
Retry a failed payment after a day
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.Apply loyalty discount after 6 months
Apply loyalty discount after 6 months
LOYAL10Notify team on high-value cancellation
Notify team on high-value cancellation
Swap a retired product before each order
Swap a retired product before each order
- 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
Field reference
Attributes JSON format — forattributes and note_attributes fields:
old_variant_id: comma-separated numeric variant IDs to replace —12345,67890new_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 as12345.