Skip to content
Last updated

Shopify Flow Integration

Appstle Loyalty provides native Shopify Flow integration with 8 triggers and 6 actions. These extensions are defined in the app configuration and processed through ShopifyFlowService.

Triggers

Triggers fire when loyalty events occur, sending customer and loyalty data to Shopify Flow.

TriggerHandleDescription
Loyalty Sign Uployalty-sign-upCustomer signs up for the loyalty program
Loyalty Points Earnedloyalty-points-earnedCustomer earns loyalty points
Loyalty Points Redeemedloyalty-points-redeemedCustomer redeems loyalty points
Loyalty Credits Earnedloyalty-credits-earnedCustomer earns store credits
Loyalty VIP Tier Achievedloyalty-vip-tier-achievedCustomer achieves a VIP tier
Customer's Birthdaybirthday-triggerTriggered on customer's birth date
Referral Reward Createdreferral-reward-createdReward created for the referring customer
Referred Reward Createdreferred-reward-createdReward created for the referred customer

Trigger Properties

All triggers include these fields:

Top-level fields:

  • customer_reference — Shopify customer reference
  • Note (String) — Activity description

Points/Credits triggers only (loyalty-points-earned, loyalty-points-redeemed, loyalty-credits-earned):

  • Points / Credits (Decimal) — Amount earned/redeemed
  • Earn Rule ID / Redeem Rule ID (Decimal) — Activity rule ID

Customer Loyalty Details (nested object):

FieldTypeDescription
availablePointsFloatCurrent available points balance
pendingPointsFloatPoints pending approval
creditedPointsFloatTotal lifetime credited points
spentAmountFloatTotal amount spent by customer
currentVipTierStringCurrent VIP tier name (if applicable)
rewardedForFacebookBooleanCompleted Facebook like
rewardedForTwitterBooleanCompleted Twitter follow
rewardedForInstagramBooleanCompleted Instagram follow
rewardedForYoutubeBooleanCompleted YouTube subscribe
rewardedForTiktokBooleanCompleted TikTok follow
rewardedForNewsLetterBooleanSubscribed to newsletter
rewardedForSmsBooleanSubscribed to SMS
rewardedForCreatingAccountBooleanCreated store account
referredCompletedIntNumber of successful referrals
referralLinkStringCustomer's referral URL
dobStringDate of birth (ISO format)
rewardsArrayList of CustomerReward objects

CustomerReward object:

FieldTypeDescription
descriptionStringReward description
pointTransactionIdIntInternal transaction ID
pointRedeemRuleIdIntRedemption rule ID
discountCodeStringGenerated discount code
usedAtStringWhen reward was used
orderIdIDShopify order ID (if used)
orderNameStringShopify order name
statusRewardStatusUSED, UNUSED, or REFUNDED
createAtStringCreation timestamp
expireDateStringExpiration timestamp
variantIdIDProduct variant ID (if applicable)

:::note The GraphQL schema for Flow exposes a subset of fields from CustomerLoyaltyResponseVM. Fields like storeCreditBalance, rewardedForPinterest, rewardedForSharingOnFacebook, rewardedForSharingOnX, customerStatus, achievableTierId, and vipTierExpiredAt exist in the Java DTO but are not currently exposed to Shopify Flow. :::

Actions

Actions allow Shopify Flow workflows to modify loyalty data.

ActionHandleEndpointDescription
Add Pointsadd-pointsPOST /shopify-flow/add-pointsAward loyalty points
Remove Pointsremove-pointsPOST /shopify-flow/remove-pointsDeduct loyalty points
Add Store Creditsadd-store-creditsPOST /shopify-flow/add-store-creditsAward store credits
Remove Store Creditsremove-store-creditsPOST /shopify-flow/remove-store-creditsDeduct store credits
Reward Points for Reviewsreward-points-for-reviewsPOST /shopify-flow/reward-points-for-reviewsAward points for product reviews
Assign VIP Tierassign-vip-tierPOST /shopify-flow/assign-vip-tierAssign or change a customer's VIP tier

Add Points

Fields:

FieldKeyTypeRequiredDescription
Customer Identifiercustomer-identifierStringCustomer ID or email (use {{customer.email}})
Points To AddpointsToAddStringPoints to award (e.g., 10)
Rule Idrule-idIntegerStatic rule ID from Appstle Loyalty
ReasonreasonStringVisible to customer

:::caution The field points (Decimal) is deprecated. Use pointsToAdd instead. If unavailable, remove and re-add the action. :::

Remove Points

Fields:

FieldKeyTypeRequiredDescription
Customercustomer_referenceShopify customer reference
Points To RemovepointsToRemoveStringPoints to deduct
ReasonreasonStringVisible to customer

Add Store Credits

Fields:

FieldKeyTypeRequiredDescription
Customercustomer_referenceShopify customer reference
Store Credits To AddstoreCreditsToAddStringAmount in store currency
ReasonreasonStringVisible to customer

Remove Store Credits

Fields:

FieldKeyTypeRequiredDescription
Customercustomer_referenceShopify customer reference
Store Credits To RemovestoreCreditsToRemoveStringAmount to remove
ReasonreasonStringVisible to customer

Reward Points for Reviews

Fields:

FieldKeyTypeRequiredDescription
Customer Emailcustomer-emailStringCustomer email variable
Product IDproduct-idStringProduct ID variable
Ratingreview-ratingStringReview rating value
Review Typereview-typeStringOne of: REVIEWS_IO, AIR_REVIEWS, OKENDO, LEAVE_REVIEW_LOOX_IO, LEAVE_REVIEW_STAMPED_IO, LEAVE_REVIEW_PRODUCT_REVIEWS
Images Countimage-countStringNumber of images (if applicable)
Videos Countvideo-countStringNumber of videos (if applicable)

Assign VIP Tier

Fields:

FieldKeyTypeRequiredDescription
Customer Identifiercustomer-identifierStringCustomer ID or email (use {{customer.email}})
VIP Tier Namevip-tier-nameStringExact name of the VIP tier to assign (must match a tier configured in your loyalty program)
Lock Tierlock-tierStringSet to "true" to lock the customer at this tier and prevent automatic recalculation from changing it. Default is "false".
ReasonreasonStringReason for assigning this VIP tier

:::note The tier name must exactly match a VIP tier configured in your Appstle Loyalty settings (e.g., "Gold", "Silver"). If the customer is already on the specified tier, no changes are made. :::

Flow Templates

Appstle provides pre-built Flow templates for common review integrations:

TemplateHandleDescription
Points for Reviews.iopoints-for-reviews-ioAuto-reward Reviews.io submissions
Points for Okendo Reviewspoints-for-okendo-reviewsAuto-reward Okendo reviews
Points for Loox Reviewspoints-for-loox-reviewsAuto-reward Loox reviews
Points for Air Reviewspoints-for-air-reviewsAuto-reward Air reviews
Points for Rivyo Reviewsappstle-review-collected-loyalty-pointsAuto-reward Rivyo Reviews submissions

Example Workflows

Welcome Email on Sign Up

Trigger: Loyalty Sign Up

Action: Send email marketing
  Customer Email: {{customer.email}}
  Subject: "Welcome to our Loyalty Program!"

Tag VIP Customers

Trigger: Loyalty VIP Tier Achieved
  Condition: currentVipTier equals "Gold"

Action: Add customer tags
  Tags: "vip-gold"

Birthday Reward

Trigger: Customer's Birthday

Action: Add Points
  Customer Identifier: {{customer.email}}
  Points To Add: 100
  Reason: "Happy Birthday! 🎉"

Assign VIP Tier via Flow

Trigger: Any Flow trigger or condition

Action: Assign VIP Tier
  Customer Identifier: {{customer.email}}
  VIP Tier Name: "Gold"
  Reason: "Upgraded to Gold tier via Shopify Flow"

Review Points (Okendo)

Trigger: Okendo review submitted (via Okendo integration)

Action: Reward Points for Reviews
  Customer Email: {{customer.email}}
  Product ID: {{product.id}}
  Rating: {{review.rating}}
  Review Type: "OKENDO"

Technical Reference

Extension Location: theme-app-extension-v4/extensions/

Source Files:

  • ShopifyFlowService.java — Trigger dispatch logic
  • ShopifyFlowResource.java — Action REST endpoints
  • ShopifyFlowActionRequest.java — Action request DTO

Authentication: Actions use Shopify's JWT validation via ShopifyFlowJwtFilter.