Skip to main content
Appstle Subscriptions uses Shopify metafields and tags to store subscription data, power the storefront widget, and enable automation workflows. Every metafield on this page uses the namespace appstle_subscription without an $app: prefix, which means other apps, themes, and Liquid templates can read it. Appstle also keeps a few app-owned metafields in Shopify’s $app namespace for its own storefront script. They are private to the app and are not part of this interface.

Metafields overview

Metafields are set on four Shopify resource types:

Shop metafields

Shop metafields store the app’s configuration and are written whenever a merchant saves settings in the Appstle admin. Updates are synchronous (immediate).

appstle_subscription / setting

appstle_subscription / labels

appstle_subscription / shop_info

appstle_subscription / selling_plans

appstle_subscription / all_Selling_Plans

The key uses mixed case (all_Selling_Plans) — this is intentional and must not be changed.

appstle_subscription / checkout_validation

Widget templates

Build-a-Box metafields

The bab_info_* keys are zero-indexed. A store with three bundles has keys bab_info_0, bab_info_1, and bab_info_2.

Selling plan metafields

appstle_subscription / selling_plan

Order metafields

appstle_subscription / details

The IDs of the contract, its plans and its variants, customer.id and firstOrder.id are plain numbers, not gid:// strings. Only the IDs inside subscriptionLineItemList are gid:// strings, as Shopify returns them. Fields with no value, such as cancellationReason on an active contract, are left out. firstOrder is the order the contract was created from, and it is repeated on every renewal order. firstOrder.createdAt is when the contract was created, not when the order was. On a first order it can be a few seconds later than the contract’s createdAt in Shopify: Appstle first writes the time it processed the new contract, and doesn’t rewrite the value only to replace it with Shopify’s. For the exact time, read createdAt from Get raw Shopify GraphQL contract response. One order can create more than one contract. On a first order, subscriptionContracts lists every contract created from the order, and Appstle rewrites the value when one of them changes, so it shows their current status and plans. subscriptionContract holds just one of them, so on an order that may have several contracts, read subscriptionContracts. On a renewal order, both hold only the contract that was billed, as it was when the order was created. A change to currentCycle alone doesn’t rewrite a first order’s value, so on a first order currentCycle can lag behind the contract. Get the current cycle from Get current billing cycle number for a subscription contract, or read currentCycle on the latest renewal order.

Customer metafields

appstle_subscription / subscriptions to subscriptions_3

The four keys together hold at most 18,000 bytes, which is a few dozen subscriptions. When a customer has more, Appstle puts the active subscriptions first and leaves out whatever doesn’t fit, so paused and cancelled subscriptions can be missing. Read all four keys and join their lists. This is the joined list for a customer with one active and one cancelled subscription:
sellingPlanIds, variantIds, sellingPlanNames and variantNames are sets. Each holds a value once even when several lines share it, their order is arbitrary and can change when the lines change, and they don’t line up: the third name doesn’t belong to the third ID.
startDate, nextBillingDate and cancelledOn end with the time zone in square brackets, as in 2026-12-07T09:00Z[UTC], and leave out the seconds when they are zero. JavaScript’s new Date() and Python’s datetime.fromisoformat() reject that form. Remove the bracketed part first, for example value.replace(/\[.*\]$/, "") in JavaScript.
To gate content on an active subscription, check status === "active" on each entry of the joined list. Don’t treat a customer as subscribed because the list has entries: cancelled subscriptions are in it too. To gate on a plan, check whether an active entry’s sellingPlanIds includes the plan’s ID.
Appstle writes these metafields asynchronously, typically a few seconds after a change, and not every change rewrites them. For a subscription’s current state, such as its next billing date, read it with Appstle’s Admin API.

Using metafields in Liquid

The metafields on this page use the appstle_subscription namespace without an $app: prefix, so they are accessible directly in Liquid:
A customer’s subscriptions are split across the keys subscriptions to subscriptions_3. See Customer metafields.

Order tags

Order tags identify the type of subscription order. They are never removed once applied. Each setting holds one tag or a comma-separated list, and every entry is a Liquid template, so a tag can include a value from the subscription, such as plan_{{ subscriptionContract.sellingPlanGroupNames }}. The Liquid template variables work in order tags and in customer tags. Appstle cuts each order tag to its first 40 characters, so keep the fixed part short.
A tag that contains a variable changes from one order to the next, so don’t test for it with an exact match. Match the part that never changes with “starts with” or “contains”, in Shopify Flow, in a Liquid condition or in your own code. When a contract changes, Appstle renders the first-order tags again and adds any new value next to the old one, so a first order can carry both.
Configure tags in More → Tag Settings, under Order Tagging Settings.
If you need to apply tags to orders created before you configured tags, use the applyMissedOrderTags API endpoint to backfill them.

Customer tags

Customer tags are dynamic — they change as subscription status changes. They follow a strict priority hierarchy: Active > Paused > Inactive. Only one status tag is active at a time. Tags are updated on every subscription lifecycle event: contract created, paused, resumed, cancelled, and billing attempts.

Liquid template variables

Customer tags and order tags support Liquid template syntax. Wrap variables in double curly braces:
Available variables: A variable that is a list renders its entries one after another with nothing between them, and in no fixed order. A contract with two plans named Monthly and Weekly renders as MonthlyWeekly or WeeklyMonthly. Add Liquid’s join filter to put a separator between the entries: {{subscriptionContract.sellingPlanNames | join: "_"}} renders Monthly_Weekly or Weekly_Monthly. A variable that doesn’t exist, such as {{contract.id}}, renders as nothing. In order tags, keep commas out of a template. Appstle splits the setting at commas first and renders each entry on its own, so a comma inside a template, such as a join separator, cuts it in two. Customer tags work the other way round: Appstle renders the setting first and then splits the result at commas, so {{subscriptionContract.sellingPlanNames | join: ","}} gives the customer one tag per plan. When any customer tag setting contains a variable, Appstle adds every customer tag in lowercase. Template examples:

Complete metafield reference

FAQ

Yes. The subscription metafields on this page use the appstle_subscription namespace without an $app: prefix, so they are accessible in Liquid via {{ shop.metafields.appstle_subscription.setting }}, {{ customer.metafields.appstle_subscription.subscriptions }}, and so on.
Appstle rewrites them asynchronously, typically a few seconds after a subscription is created, billed or changes status, plans or products. A change to the next billing date alone, such as a skipped order, doesn’t rewrite them. For a subscription’s current state, use Appstle’s Admin API.
Tags follow the priority hierarchy Active > Paused > Inactive. If a customer has both active and paused subscriptions, the active tag takes precedence. The inactive tag is only applied when all contracts are cancelled.
Yes. Use the applyMissedOrderTags API endpoint to apply tags to orders that were created before your tag configuration was set up.

Next steps

Build your own frontend

Selling plans, the cart and the customer portal from your own UI.

JavaScript hooks

Listen to the events the widget, cart and customer portal fire on your storefront.

Webhooks

Receive subscription lifecycle and billing events on your server.

API changelog

Dated changes to the Subscriptions APIs, Flow, JavaScript events and metafields, with what to do about each.