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:

  1. Flow 1 (Webhook Trigger): Triggers a webhook to iziGift when your conditions are met, creating the gift card

  2. 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

  1. Log in to your iziGift admin panel

  2. Navigate to SettingsGift Card Emails

  3. Scroll down to find the Klaviyo Webhook Integration section

  4. Toggle Enable Klaviyo Webhooks to ON

  5. Click Save Settings

Step 2: Copy Your Authentication Token

After enabling webhooks, you'll see your unique authentication token displayed on the settings page.

  1. Locate the Webhook Auth Token field

  2. Click the Copy button to copy your authentication token

  3. 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.

  1. Go to the Campaigns page in iziGift

  2. Click Create Webhook Campaign

  3. 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.

  1. Locate your new campaign in the campaigns list

  2. Find the Webhook ID field

  3. Click Copy to copy the webhook ID

  4. 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

  1. Log in to your Klaviyo account

  2. Navigate to Flows in the left sidebar

  3. Either create a new flow or open an existing flow where you want to add gift card issuance

  4. Choose the appropriate trigger for your flow (e.g., Date Property for birthdays, Metric for custom events)

Step 2: Add a Webhook Action

  1. In your flow builder, click the + button to add a new action

  2. Search for and select Webhook from the actions list

  3. Drag the webhook action to the desired position in your flow

Step 3: Configure the Webhook URL

  1. In the webhook configuration panel, locate the Webhook URL field

  2. Enter: https://easy-gift-cards.com/api/klaviyo/webhook

Step 4: Add Authentication Header

  1. Scroll down to the Headers section in the webhook configuration

  2. Click Add Header

  3. Add the following header:

    • Key: auth

    • Value: 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

  1. Scroll down to the Body section

  2. Select JSON as the format

  3. Copy and paste the following JSON template:

  1. Replace YOUR_WEBHOOK_ID_HERE with the webhook ID you copied from iziGift in Part 1, Step 4

  2. Customize 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 event

  • Example: {{ 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

  1. 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)

  2. Click Save or Update to save your webhook configuration

  3. 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

  1. In Klaviyo, go to Flows and click Create Flow

  2. Select Create From Scratch

  3. Give your flow a descriptive name like "Webhook Gift Card Email Delivery"

Step 2: Set the Trigger

  1. Click Set Trigger

  2. Select Metric as the trigger type

  3. Search for and select "Webhook Gift Card Issued"

  4. 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

  1. Click the + button below the trigger

  2. Select Email from the actions list

  3. 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:

  1. In the email builder, add a Button element

  2. Set the button text to something like "Download My Gift Card" or "View Gift Card"

  3. Set the button URL to: {{ event.gift_card_page_url }}

  4. Style the button to match your brand colors

Step 7: Review and Activate

  1. Preview your email to ensure all variables are displaying correctly

  2. Send a test email to yourself

  3. Click Save to save your email

  4. Back in the flow builder, click Review and Turn On

  5. 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

  1. In your webhook trigger flow (Flow 1), use Klaviyo's Test Action feature

  2. Select a test profile or create one with your email address

  3. Click Send Test to trigger the webhook

  4. This will create the gift card in iziGift and trigger the "Webhook Gift Card Issued" event

Test the Email Delivery Flow

  1. After testing Flow 1, the "Webhook Gift Card Issued" event should trigger Flow 2

  2. Check your email inbox for the gift card email

  3. Verify that all variables are populated correctly (amount, code, download link)

  4. Click the download button to ensure the gift card page loads properly

Verify in iziGift

  1. Go to your Campaigns page in iziGift

  2. Find your webhook campaign

  3. Check that the Success Count has increased

  4. 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:

  1. Verify the flow is turned on

  2. Check that the webhook action is properly configured

  3. Review the webhook URL for typos: https://easy-gift-cards.com/api/klaviyo/webhook

  4. Ensure auth header is set correctly with key auth (lowercase)

  5. Verify webhook_id matches your iziGift campaign

  6. Check all required fields are in the JSON payload

Check in iziGift:

  1. Verify webhook integration is enabled in Settings

  2. Confirm the webhook campaign exists and is active

  3. Check the campaign's Failed Count for errors

  4. 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:

  1. Verify Flow 2 is turned on and active

  2. Confirm the trigger is set to "Webhook Gift Card Issued" metric (not "Gift Card Issued")

  3. Check that the email action is configured correctly

  4. Verify event properties are mapped correctly in the email template

  5. Look at Flow 2 analytics to see if the metric triggered but email failed

Test the Flow:

  1. Check Klaviyo's flow analytics for Flow 2

  2. Look for the "Webhook Gift Card Issued" events

  3. Verify the email was sent and delivered

  4. 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

  1. Go to Campaigns in iziGift

  2. Find your webhook campaign

  3. 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:

  1. Check the troubleshooting section above

  2. Review your webhook logs in iziGift (if available)

  3. Use the in-app chat support for personalized help

  4. 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