# Shopify Flow Integration Appstle Memberships integrates natively with [Shopify Flow](https://www.shopify.com/flow), Shopify's built-in automation platform. Use Flow to automate membership operations — send emails, tag customers, update CRMs, trigger Slack alerts, and more — without writing any code. > **ℹ️ Why Shopify Flow?** Flow actions run within Shopify's authenticated context, so there's no need for API tokens or credentials. This makes Flow the most secure way to automate membership operations. ## Getting Started 1. In the Appstle Memberships admin, go to **Settings → Integrations → Shopify Flow** and enable it 2. Open the [Shopify Flow editor](https://admin.shopify.com/store/YOUR_STORE/apps/flow) in your Shopify admin 3. Create a new workflow — select an Appstle Memberships trigger to start ## Triggers Triggers fire automatically when membership lifecycle events occur. All triggers include a full set of membership and customer properties. ### Membership Lifecycle Triggers | Trigger | Handle | Description | | --- | --- | --- | | **Membership Created** | `membership-created` | A new membership contract is created (includes `order_id` of the originating order) | | **Membership Updated** | `membership-updated` | Membership details are modified (e.g., address, custom attributes) | | **Membership Activated** | `membership-activated` | A paused or new membership becomes active | | **Membership Paused** | `membership-paused` | Membership is put on pause | | **Membership Cancelled** | `membership-cancelled` | Membership is cancelled | | **Membership Expired** | `membership-expired` | Membership expires, OR perks are removed for cancelled/paused memberships | | **Membership Swap Product** | `membership-swap-product` | The product/plan in a membership is changed to a different one | | **Next Order Date Changed** | `next-order-date-changed` | The next renewal date is rescheduled | | **Billing Interval Changed** | `billing-interval-changed` | Billing frequency is updated (e.g., monthly → annual) | ### Billing Triggers | Trigger | Handle | Description | | --- | --- | --- | | **Membership Billing Success** | `membership-billing-success` | Renewal payment processed successfully — includes the new order ID | | **Membership Billing Failure** | `membership-billing-failure` | Renewal payment failed — use this to trigger dunning emails or pause logic | ## Trigger Properties All triggers include these membership and customer properties: ### Membership Properties | Property | Type | Description | | --- | --- | --- | | `Membership ID` | Number | Internal membership contract ID | | `Status` | String | Current status: `ACTIVE`, `PAUSED`, `CANCELLED`, `EXPIRED`, `FAILED` | | `Next Billing Date` | DateTime | ISO 8601 next renewal date | | `Billing Interval` | String | Billing frequency unit: `DAY`, `WEEK`, `MONTH`, `YEAR` | | `Billing Interval Count` | Number | Number of intervals between renewals (e.g., `1` for monthly, `12` for annual) | | `Membership Selling Plan Name` | String | Name of the membership plan (e.g., "Gold Member — Monthly") | | `Membership Selling Plan ID` | Number | Shopify selling plan ID | | `product_id` | Number | Shopify product ID for the membership product | | `Variant ID` | Number | Shopify product variant ID | | `Original Order ID` | Number | Order ID that created the membership | | `Original Order Name` | String | Order name (e.g., "#1001") | ### Customer Properties | Property | Type | Description | | --- | --- | --- | | `customer_id` | Number | Shopify customer ID | | `Customer Email` | String | Customer's email address | | `Customer Phone` | String | Customer's phone number | | `Customer Display Name` | String | Customer's full display name | | `Customer First Name` | String | Customer's first name | | `Customer Last Name` | String | Customer's last name | ### Billing Event Properties For **Membership Billing Success** and **Membership Billing Failure** triggers, these additional fields are included: | Property | Type | Description | | --- | --- | --- | | `Billing Attempt Status` | String | `SUCCESS` or `FAILURE` | | `Billing Attempt ID` | Number | Shopify billing attempt ID | | `Billing Date` | DateTime | Scheduled billing date (ISO 8601) | | `Billing Attempt Time` | DateTime | Actual attempt timestamp (ISO 8601) | | `Billing Attempt Count` | Number | How many times billing has been attempted for this cycle | For **Membership Billing Success** only: | Property | Type | Description | | --- | --- | --- | | `order_id` | Number | The Shopify order ID created by the successful renewal | | `Recurring Order ID` | Number | Same as `order_id` | | `Recurring Order Name` | String | Order name (e.g., "#1002") | ## Example Workflows ### Send a welcome email when a new membership is created **Trigger:** Membership Created **Action:** Klaviyo / Omnisend / Shopify Email — send "Welcome to the membership" email - Use `Customer Email` as the recipient - Use `Membership Selling Plan Name` to personalize the plan name ### Tag customer when they reach Gold tier **Trigger:** Membership Updated **Condition:** `Membership Selling Plan Name` contains `"Gold"` **Action:** Shopify — Add customer tag `gold-member` ### Trigger dunning flow on billing failure **Trigger:** Membership Billing Failure **Condition:** `Billing Attempt Count` equals `1` (first failure) **Action:** Klaviyo — Trigger "Update Payment Method" flow - Pass `Customer Email` and `Membership ID` to the email template ### Pause account access on cancellation **Trigger:** Membership Cancelled **Action:** Shopify — Add customer tag `membership-cancelled` **Action 2:** Klaviyo — Send "We're sorry to see you go" email with win-back offer ### Create a renewal order record in your CRM **Trigger:** Membership Billing Success **Action:** Salesforce / HubSpot (via Flow connector) — Log renewal event - Use `order_id`, `Customer Email`, and `Membership Selling Plan Name` ### Alert your team on membership expiry **Trigger:** Membership Expired **Action:** Slack — Send message to `#membership-churn` channel with customer details ## Notes - Shopify Flow is available on **Shopify Basic plan and above** - Flow integration must be enabled in Appstle Memberships under **Settings → Integrations** - All Flow trigger events are logged in the membership's Activity Log with source `SYSTEM_EVENT` - The `Membership Billing Failure` trigger fires on every failed attempt — use `Billing Attempt Count` to distinguish first failures from retries - Imported membership contracts do not fire `membership-created` (only contracts created through the checkout flow do)