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: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 Countabove1. - 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-failurewebhook but no Flow trigger. The try still counts, soBilling Attempt Countcan go up by more than one between two triggers. Billing Datestays the same on every try. It’s the date the renewal was due.Billing Attempt IDandBilling Attempt Timebelong to the try that fired the trigger, so they change on each retry.Next Billing Datealready 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 inNext Billing Dateand noBilling Date. To tell which renewal a try belongs to, readBilling Dateon 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 Countreaches 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. Thesubscription.billing-failurewebhook says whether another try is scheduled, inretryingNeeded. - 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 StatusSKIPPED_DUNNING_MGMTinstead ofFAILURE, and Flow has no other trigger for the skipped order. With Pause the subscription or Cancel the subscription, the status staysFAILURE, the trigger’sStatusis alreadyPAUSEDorCANCELLED, 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 theLine Items array contains:
Actions
Every action is logged in the subscription activity log with sourceSHOPIFY_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 Line Item
Add Line Item
Remove Line Item
Remove Line Item
Update Line Item Quantity
Update Line Item Quantity
Update Line Item Price
Update Line Item Price
Update Line Item Attributes
Update Line Item Attributes
Replace/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.Subscription management
Update Subscription Status
Update Subscription Status
Hide Subscription
Hide Subscription
contract_id (required)Merge Subscriptions
Merge Subscriptions
Split Subscription
Split Subscription
Update Selling Plan
Update Selling Plan
Update Order Note / Update Note Attributes
Update Order Note / Update Note Attributes
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.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.Billing & schedule
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.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.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.Update Billing Interval
Update Billing Interval
Update Frequency by Selling Plan
Update Frequency by Selling Plan
contract_id (required), selling_plan_id (required)Update Next Billing Date
Update Next Billing Date
2026-03-15T10:00:00Z.Input fields: contract_id (required), next_billing_date (required)Skip Next Order
Skip Next Order
Attempt 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.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.
Retry Failed Billing
Retry Failed Billing
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.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 Discount Code
Apply Discount Code
contract_id (required), discount_code (required)Remove Discount
Remove Discount
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
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
PAUSEDWhen the action pauses the subscription, the customer also gets the Subscription Paused email. See Update Subscription Status.Cancel 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
- 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. 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.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
Change one attribute on a line and keep the others
Change one attribute on a line and keep the others
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’sSubscription 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 messagetoHappy anniversary
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 asuccess_message. Later steps in the workflow read them like the trigger’s variables:
- Add the Appstle action to your workflow.
- In a later step, click Add variable.
- Under the action’s name, choose its variable, such as
updateOrderNoteunder Update Order Note, then the field you want.
Flow output check:
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:
successfrom Attempt Billing and Retry Failed Billing is alwaystrue. 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_idis Appstle’s ID for the order, the ID that Attempt Billing takes. It isn’t the trigger’sBilling Attempt ID, which is Shopify’s.new_contract_idfrom Split Subscription is the ID of the new subscription.line_ids_movedrepeats the line IDs you sent. They belong to the original subscription: the lines on the new subscription have new IDs.discount_idfrom Remove Discount is empty when no discount on the subscription matcheddiscount_code, so nothing was removed.old_delivery_pricefrom Update Delivery Price is the delivery price before the change.selling_plan_nameand the interval fields from Update Frequency by Selling Plan come from the selling plan you chose.billing_intervalanddelivery_intervalareDAY,WEEK,MONTHorYEAR.updated_statusisACTIVE,PAUSEDorCANCELLED.is_one_time_product,remove_discount,is_skip,remove_pricing_policyandoverwrite_existingshow 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_noteandnew_variant_idwith any: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.