Sync Gift Card Balances to Klaviyo Profiles | Boost Marketing ROI
Sync Shopify Gift Card Balances to Klaviyo Profiles
10 min setup
No coding required
Runs automatically
Enhance your marketing campaigns by syncing Shopify customer gift card balances with their Klaviyo profiles. This template allows you to use gift card data in Klaviyo flows, such as browse and cart abandonment emails, to drive conversions and personalize customer engagement. Leverage balance information to create more effective, data-driven marketing strategies.
How it works
10 steps to start syncing Shopify gift card balances to Klaviyo profiles daily
Daily Schedule
App connector: [Schedule](/content/apps/schedule/integrate "View Schedule integration page"/index.html)• Time to complete: 1 minute
Why this matters: This trigger runs the gift card balance sync automatically once per day, ensuring your Klaviyo data stays current without overwhelming your systems with constant updates. Without automation, you'd need to manually track which customers have gift cards and what their balances are.
The schedule trigger runs daily at midnight (00:00 UTC). Each time it runs, it kicks off the entire workflow to retrieve all gift cards, calculate balances, and update Klaviyo profiles. You can adjust the frequency by modifying the schedule—for example, you could change it to weekly if daily seems excessive, or twice daily during high gift card redemption periods. The trigger automatically initiates at the configured time with no manual action required.
Get List of Gift Cards
App connector: [Shopify](/content/apps/shopify/integrate "View Shopify integration page"/index.html)• Time to complete: 0 minutes (Auto-configured)
Why this matters: This step retrieves all active gift cards from your Shopify store so the workflow knows which customers have gift card balances and how much value they hold. Without this comprehensive list, you'd have no way to calculate and sync total balances to Klaviyo.
The step fetches up to 8,000 gift cards from Shopify using the gift cards API endpoint. This includes the gift card ID, initial value, current balance, customer ID, and important dates like creation, expiration, and any disable dates. The limit is set to 8,000 to handle stores with large gift card programs—if you have more than 8,000 active gift cards, you may need to implement pagination or contact support to handle your volume.
Retrieve Shop
App connector: [Shopify](/content/apps/shopify/integrate "View Shopify integration page"/index.html)• Time to complete: 0 minutes (Auto-configured)
Why this matters: This step fetches your Shopify store domain, which is used to construct direct admin links to gift cards in the data table. These links help your team quickly access specific gift cards in Shopify admin without manually searching for them.
Loop Through Gift Cards
App connector: [Loop](/content/apps/loop/integrate "View Loop integration page"/index.html)• Time to complete: 0 minutes (Auto-configured)
Why this matters: With potentially thousands of gift cards to process, this loop ensures each one gets individually evaluated—retrieving its owner's details, storing it in the database, and calculating their total balance. Without this loop, the workflow could only handle one gift card at a time.
Retrieve Customer
App connector: [Shopify](/content/apps/shopify/integrate "View Shopify integration page"/index.html)• Time to complete: 0 minutes (Auto-configured)
Why this matters: Each gift card is assigned to a customer, and you need that customer's email address to match them in Klaviyo and sync their balance. This step fetches the complete customer record including email, name, and other details needed for syncing.
Update or Create Record
App connector: [Data](/content/apps/data/integrate "View Data integration page"/index.html)• Time to complete: 0 minutes (Auto-configured)
Why this matters: This step stores complete gift card details in a MESA data table, creating a centralized record of all your gift cards with customer information and direct admin links. This database enables the balance calculation in the next step and provides a searchable reference for your team.
Query Gift Card Balance
App connector: [Data](/content/apps/data/integrate "View Data integration page"/index.html)• Time to complete: 0 minutes (Auto-configured)
Why this matters: Customers can have multiple gift cards, and Klaviyo needs one total balance number to use in segmentation and personalization. This query adds up all gift card balances for the current customer, giving you their complete gift card value across all cards.
Get Klaviyo Profile from Email
App connector: [Klaviyo](/content/apps/klaviyo/integrate "View Klaviyo integration page"/index.html)• Time to complete: 0 minutes (Auto-configured)
Why this matters: Before updating a customer's gift card balance in Klaviyo, you need to find their profile and verify it exists. This step searches Klaviyo by email address to locate the matching customer profile and retrieve its ID for updating.
Filter: Klaviyo Profile Exists
App connector: [Filter](/content/apps/filter/integrate "View Filter integration page"/index.html)• Time to complete: 0 minutes (Auto-configured)
Why this matters: This filter prevents errors by only continuing to the profile update step when a matching Klaviyo profile was found. If a customer exists in Shopify but not in Klaviyo, attempting to update their profile would fail, so the workflow stops here for those customers.
Update Klaviyo Profile with Balance
App connector: [Klaviyo](/content/apps/klaviyo/integrate "View Klaviyo integration page"/index.html)• Time to complete: 0 minutes (Auto-configured)
Why this matters: This is where the gift card balance actually gets synced to Klaviyo. The customer's total balance gets added as a custom property called "Gift Card Balance," making it available for email segmentation, flow triggers, and personalization tags in your campaigns.
Frequently asked questions
Will this sync gift cards for customers who aren't in Klaviyo yet?
No, the workflow only updates existing Klaviyo profiles. If a Shopify customer with a gift card doesn't have a Klaviyo profile yet, Step 9's filter stops the workflow for that customer.
What happens if the SQL query in Step 7 needs adjustment?
The query currently includes WHERE "Disabled At" IS NOT NULL, which only counts disabled gift cards—you likely want IS NULL to count only active cards. You can edit this query directly in the workflow configuration to match your business logic, such as excluding expired cards or only counting cards above a certain balance threshold.
Can I sync this more frequently than daily if I have a high-volume gift card program?
Yes, you can change the schedule in Step 1 to run more frequently—every 12 hours, every 6 hours, or even hourly. However, be aware that processing thousands of gift cards multiple times per day increases your MESA automation usage and API calls to both Shopify and Klaviyo, so balance frequency with your actual business needs.
Does this work for subscription customers on Recharge?
This template syncs gift card balances for standard Shopify customers. If your store also has Recharge subscribers, see Connect Claude to Recharge for a related workflow that scores subscription churn risk with AI and can trigger a Klaviyo win-back message.