Klaviyo Webhook Setup
Overview
The Klaviyo webhook integration allows you to automatically issue gift cards directly from your Klaviyo flows. This powerful feature gives you complete control over when and how gift cards are issued based on any trigger available in Klaviyo - from birthdays and anniversaries to customer loyalty milestones and custom events.
How It Works
The integration uses two Klaviyo flows working together:
Flow 1 (Webhook Trigger): Triggers a webhook to iziGift when your conditions are met, creating the gift card
Flow 2 (Email Delivery): Automatically sends the gift card email to the recipient when the gift card is created
This two-flow setup gives you complete control over both the gift card creation logic and the email design, all within Klaviyo.
Benefits
Automated gift card issuance from any Klaviyo trigger
Complete email customization using Klaviyo's powerful email builder
Dynamic personalization using Klaviyo profile and event data
Trigger-based campaigns for birthdays, anniversaries, loyalty rewards, and more
Seamless integration between Klaviyo's marketing automation and iziGift's gift card system
Real-time delivery of gift cards when flow conditions are met
No infinite loops - separate events prevent webhook campaigns from triggering themselves
Part 1: iziGift Admin Setup
Before configuring Klaviyo, you need to enable the webhook feature and create a webhook campaign in your iziGift admin.
Step 1: Enable Klaviyo Webhook Integration
Log in to your iziGift admin panel
Navigate to Settings → Gift Card Emails
Scroll down to find the Klaviyo Webhook Integration section
Toggle Enable Klaviyo Webhooks to ON
Click Save Settings
Step 2: Copy Your Authentication Token
After enabling webhooks, you'll see your unique authentication token displayed on the settings page.
Locate the Webhook Auth Token field
Click the Copy button to copy your authentication token
Important: Keep this token secure - you'll need it in Part 2 when configuring Klaviyo
Security Note: This token is unique to your shop and should be kept confidential. Never share it publicly or commit it to version control.
Step 3: Create a Webhook Campaign
Now you need to create a campaign that will be triggered by the Klaviyo webhook.
Go to the Campaigns page in iziGift
Click Create Webhook Campaign
Fill in the campaign details:
Campaign Name: Give your campaign a descriptive name (e.g., "Birthday Gift Card Campaign")
The system will automatically generate a unique Webhook ID for this campaign
Step 4: Copy Your Webhook ID
After creating the campaign, you'll see your webhook ID displayed.
Locate your new campaign in the campaigns list
Find the Webhook ID field
Click Copy to copy the webhook ID
Keep this ID handy - you'll need it when configuring Klaviyo
Part 2: Klaviyo Setup
Now that you've configured iziGift, it's time to set up your Klaviyo flow to trigger the webhook.
Step 1: Create or Open a Flow in Klaviyo
Log in to your Klaviyo account
Navigate to Flows in the left sidebar
Either create a new flow or open an existing flow where you want to add gift card issuance
Choose the appropriate trigger for your flow (e.g., Date Property for birthdays, Metric for custom events)
Step 2: Add a Webhook Action
In your flow builder, click the + button to add a new action
Search for and select Webhook from the actions list
Drag the webhook action to the desired position in your flow
Step 3: Configure the Webhook URL
In the webhook configuration panel, locate the Webhook URL field
Enter:
https://easy-gift-cards.com/api/klaviyo/webhook
Step 4: Add Authentication Header
Scroll down to the Headers section in the webhook configuration
Click Add Header
Add the following header:
Key:
authValue: Paste the authentication token you copied from iziGift in Part 1, Step 2
Note: Make sure the header key is exactly
auth(lowercase) and the value is your complete auth token from iziGift.
Step 5: Configure the Webhook Payload
Scroll down to the Body section
Select JSON as the format
Copy and paste the following JSON template:
Replace
YOUR_WEBHOOK_ID_HEREwith the webhook ID you copied from iziGift in Part 1, Step 4Customize the gift_card_value field:
Set the dollar amount for the gift card (must be between 0.01 and 3000.00)
You can use static values (e.g.,
25.00) or Klaviyo variables if needed
Step 6: Understanding Klaviyo Variables
You can use any Klaviyo profile properties or event properties in your webhook payload:
Profile Properties:
{{ person.email }}- Customer's email address{{ person.first_name }}- Customer's first name{{ person.last_name }}- Customer's last name{{ person.* }}- Any custom profile property
Event Properties:
{{ event.* }}- Any property from the triggering eventExample:
{{ event.total_spent }},{{ event.order_count }}, etc.
Example Personalized Messages:
"Happy Birthday {{ person.first_name }}! Enjoy your special day!""Thank you for being a loyal customer, {{ person.first_name }}!""Congratulations on your {{ event.order_count }}th order!"
Step 7: Review and Save the Trigger Flow
Review all your webhook settings:
✅ URL is correct:
https://easy-gift-cards.com/api/klaviyo/webhook✅ Auth header is set with your token
✅ Webhook ID is correct
✅ Required fields are included (webhook_id, recipient_email, recipient_first_name, recipient_last_name, gift_card_value)
Click Save or Update to save your webhook configuration
Turn on your flow to activate the integration
Part 3: Set Up the Gift Card Email Flow
Important: The webhook flow you just created only issues the gift card - it does NOT send the email to the recipient. You need to create a second flow in Klaviyo to send the actual gift card email.
When a gift card is issued via webhook, iziGift triggers a special Klaviyo event called "Webhook Gift Card Issued". This event contains all the gift card details that you can use to build a personalized email.
Step 1: Create a New Flow for the Email
In Klaviyo, go to Flows and click Create Flow
Select Create From Scratch
Give your flow a descriptive name like "Webhook Gift Card Email Delivery"
Step 2: Set the Trigger
Click Set Trigger
Select Metric as the trigger type
Search for and select "Webhook Gift Card Issued"
Click Done
Note: This is a different event from "Gift Card Issued". The "Webhook Gift Card Issued" event is specifically for gift cards created via webhooks, which prevents infinite loops.
Step 3: Add an Email Action
Click the + button below the trigger
Select Email from the actions list
Choose to create a new email or use an existing template
Step 4: Design Your Gift Card Email
When designing your email, you have access to the following event properties from the "Webhook Gift Card Issued" event:
Available Event Properties
Gift Card Information:
{{ event.gift_card_code }}- The gift card code{{ event.gift_card_amount }}- The gift card value/amount{{ event.gift_card_page_url }}- URL to the gift card download page{{ event.gift_card_image_url }}- URL to the gift card image{{ event.gift_card_variant_title }}- The variant title (if applicable)
Recipient Information:
{{ person.email }}- Recipient's email address{{ person.first_name }}- Recipient's first name{{ person.last_name }}- Recipient's last name
Campaign Information (if available):
{{ event.campaign_name }}- The name of your webhook campaign{{ event.campaign_webhook_id }}- The webhook ID{{ event.campaign_description }}- Campaign description
Step 5: Build Your Email Template
Here's a recommended structure for your gift card email:
Subject Line Example:
Email Body Example:
Step 6: Create a Download Button
To add a prominent download button to your email:
In the email builder, add a Button element
Set the button text to something like "Download My Gift Card" or "View Gift Card"
Set the button URL to:
{{ event.gift_card_page_url }}Style the button to match your brand colors
Step 7: Review and Activate
Preview your email to ensure all variables are displaying correctly
Send a test email to yourself
Click Save to save your email
Back in the flow builder, click Review and Turn On
Activate the flow
Important: Both flows must be active for the complete webhook integration to work:
Flow 1: Triggers the webhook to create the gift card
Flow 2: Sends the email with the gift card to the recipient
Testing Your Setup
Before going live, it's important to test your complete webhook integration (both flows).
Test the Webhook Trigger Flow
In your webhook trigger flow (Flow 1), use Klaviyo's Test Action feature
Select a test profile or create one with your email address
Click Send Test to trigger the webhook
This will create the gift card in iziGift and trigger the "Webhook Gift Card Issued" event
Test the Email Delivery Flow
After testing Flow 1, the "Webhook Gift Card Issued" event should trigger Flow 2
Check your email inbox for the gift card email
Verify that all variables are populated correctly (amount, code, download link)
Click the download button to ensure the gift card page loads properly
Verify in iziGift
Go to your Campaigns page in iziGift
Find your webhook campaign
Check that the Success Count has increased
Navigate to Gift Cards to see the newly issued gift card
Tip: If the email doesn't arrive, check that Flow 2 is active and that the trigger is set to "Webhook Gift Card Issued" (not "Gift Card Issued")
Required Webhook Payload Fields
When configuring your webhook payload, all of the following fields are required:
✅
webhook_id- The unique ID from your iziGift campaign✅
recipient_email- Valid email address✅
recipient_first_name- Customer's first name (max 255 characters)✅
recipient_last_name- Customer's last name (max 255 characters)✅
gift_card_value- Dollar amount between 0.01 and 3000.00
Note: The gift card message and customization should be done in the email template (Flow 2), not in the webhook payload. This gives you more flexibility to personalize the email using Klaviyo's email builder and event properties.
Common Use Cases
Birthday Campaigns
Flow 1 - Webhook Trigger:
Trigger: Date Property (Birthday)
Webhook Payload:
Flow 2 - Email Delivery:
Trigger: Metric (Webhook Gift Card Issued)
Email Subject:
Happy Birthday {{ person.first_name }}! 🎂Email Body: Include personalized birthday message with gift card details
Loyalty Milestones
Flow 1 - Webhook Trigger:
Trigger: Metric (Order count reaches X)
Webhook Payload:
Flow 2 - Email Delivery:
Trigger: Metric (Webhook Gift Card Issued)
Email Subject:
Thank you for being a loyal customer!Email Body: Celebrate their milestone with the gift card
Win-Back Campaigns
Flow 1 - Webhook Trigger:
Trigger: Customer hasn't purchased in 90 days
Webhook Payload:
Flow 2 - Email Delivery:
Trigger: Metric (Webhook Gift Card Issued)
Email Subject:
We miss you {{ person.first_name }}!Email Body: Re-engage them with a personalized message and gift card
Troubleshooting
Gift Cards Not Being Issued
Check Flow 1 (Webhook Trigger) in Klaviyo:
Verify the flow is turned on
Check that the webhook action is properly configured
Review the webhook URL for typos:
https://easy-gift-cards.com/api/klaviyo/webhookEnsure auth header is set correctly with key
auth(lowercase)Verify webhook_id matches your iziGift campaign
Check all required fields are in the JSON payload
Check in iziGift:
Verify webhook integration is enabled in Settings
Confirm the webhook campaign exists and is active
Check the campaign's Failed Count for errors
Review webhook logs (if available) for error messages
Gift Cards Created But Email Not Received
If the gift card is created in iziGift but the email isn't sent:
Check Flow 2 (Email Delivery) in Klaviyo:
Verify Flow 2 is turned on and active
Confirm the trigger is set to "Webhook Gift Card Issued" metric (not "Gift Card Issued")
Check that the email action is configured correctly
Verify event properties are mapped correctly in the email template
Look at Flow 2 analytics to see if the metric triggered but email failed
Test the Flow:
Check Klaviyo's flow analytics for Flow 2
Look for the "Webhook Gift Card Issued" events
Verify the email was sent and delivered
Check spam/junk folders
Authentication Errors
If you're receiving authentication errors:
Double-check your auth token is copied correctly (no extra spaces)
Verify the header key is exactly
auth(lowercase)Confirm webhooks are enabled in iziGift settings
Validation Errors
Common validation issues:
Invalid email: Ensure recipient_email is a valid email format
Missing fields: Verify all required fields are present in webhook payload
Value out of range: Gift card value must be between 0.01 and 3000.00
Text too long: First name and last name have 255 character limits
Monitoring & Analytics
View Campaign Performance
Go to Campaigns in iziGift
Find your webhook campaign
Review the metrics:
Success Count: Number of successfully issued gift cards
Failed Count: Number of failed attempts
Success Rate: Percentage of successful issuances
Best Practices
Test both flows thoroughly before activating for production
Monitor success rates regularly in both Klaviyo and iziGift
Use descriptive campaign names for easy identification (include "webhook" in the name)
Keep auth tokens secure and rotate them periodically
Set up separate campaigns for different use cases (birthdays, loyalty, etc.)
Use Klaviyo's flow analytics alongside iziGift metrics for complete visibility
Always use "Webhook Gift Card Issued" as the trigger for Flow 2 (not "Gift Card Issued")
Customize email templates in Flow 2 for each campaign type
Track email performance using Klaviyo's email analytics
Security & Privacy
Data Security
Auth tokens are encrypted and stored securely
All webhook requests are validated and logged
Cross-shop access is prevented through campaign verification
Email addresses are verified before gift card issuance
Rate Limiting
Webhooks are rate-limited to 60 requests per minute per shop
This prevents abuse and ensures system stability
Contact support if you need higher limits for high-volume campaigns
Getting Help
If you need assistance with your Klaviyo webhook integration:
Check the troubleshooting section above
Review your webhook logs in iziGift (if available)
Use the in-app chat support for personalized help
Include your campaign name and any error messages when reaching out
Quick Setup Summary
Here's a quick checklist to ensure your webhook integration is properly configured:
✅ iziGift Admin Setup
✅ Klaviyo Flow 1 (Webhook Trigger)
✅ Klaviyo Flow 2 (Email Delivery)
✅ Testing
Ready to automate your gift card campaigns? Follow the steps above and start delighting your customers with perfectly timed gift cards! 🎁
Last updated