> For the complete documentation index, see [llms.txt](https://hthcapital.gitbook.io/izigift-help-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hthcapital.gitbook.io/izigift-help-docs/basics/klaviyo-integration/store-credit-drops.md).

# Store Credit Drops

Store Credit Drops let you automatically issue Shopify store credit to customers from any Klaviyo flow — birthdays, win-backs, loyalty milestones, new subscriber rewards, and more. When the flow action fires, iziGift receives a webhook, looks up the customer in Shopify, and deposits store credit directly into their account.

***

## Before you begin

Make sure all three of the following are in place.

### Shopify new customer accounts

Store credit in Shopify only works with **new customer accounts**. Legacy customer accounts do not support store credit.

To check: in your Shopify admin go to **Settings → Customer accounts** and confirm new customer accounts are enabled.

### iziGift permissions

iziGift needs the `write_store_credit_account_transactions` permission to issue store credit on your behalf. If this scope is missing, you will see an **"Approve Permissions"** banner on the Store Credit Drops page. Click it and complete the Shopify OAuth flow — your data will not be affected.

### iziGift plan

Store Credit Drops are available on iziGift Pro and higher plans.

***

## Part 1: Create a campaign in iziGift

### Step 1: Open Store Credit Drops

1. In iziGift, go to **Integrations → Klaviyo**
2. Select the **Store Credit Drops** tab

### Step 2: Create a campaign

1. Click **Create Campaign**
2. Fill in the campaign details:
   * **Campaign name** — for your reference (e.g. "Birthday Reward" or "Win-Back $10")
   * **Description** — optional, internal notes only
   * **Default credit amount** — enter the number you want to issue per drop, e.g. `10` or `25`. No need to add decimals. The amount will be issued in your store's default currency.
   * **Expires in days** — optional; leave blank for no expiry
3. Click **Create**

### Step 3: Copy your setup values

After the campaign is created, iziGift displays three values. **Copy all three** — you will paste them into Klaviyo in Part 2.

| Value                    | Where it goes in Klaviyo               |
| ------------------------ | -------------------------------------- |
| **Destination URL**      | The webhook URL field                  |
| **Authorization header** | A request header named `Authorization` |
| **JSON body**            | The webhook body field                 |

> These values are always available later. On the Store Credit Drops page, click **Show details** on any campaign card to view and copy them again.

***

## Part 2: Configure the Webhook action in Klaviyo

Open the Klaviyo flow where you want store credit issued. Add a **Webhook** action at the point in the flow where the drop should fire.

### Step 1: Set the URL

Paste the **Destination URL** from iziGift into the URL field.

### Step 2: Add the Authorization header

1. Scroll to the **Headers** section
2. In the first empty header row, set the key to `Authorization` and paste the value from iziGift (it starts with `Bearer`)

### Step 3: Set the JSON body

Paste the JSON body from iziGift into the body field. It will look like this:

```json
{
  "webhook_id": "your-campaign-webhook-id",
  "recipient_email": "{{ person.email }}"
}
```

The `{{ person.email }}` tag is Klaviyo's liquid syntax — Klaviyo fills it in automatically with the profile's email when the flow runs.

### Step 4: Save and activate

1. Click **Save** on the webhook action
2. Make sure your flow is set to **Live** — draft flows do not fire

***

## Optional: Override credit amount per drop

If you need to issue a different amount from the campaign default for a specific flow branch, add `credit_amount` to the JSON body:

```json
{
  "webhook_id": "your-campaign-webhook-id",
  "recipient_email": "{{ person.email }}",
  "credit_amount": 25
}
```

You can also add a `note` field (max 500 characters) for internal record-keeping. It is not shown to the customer.

***

## Part 3: Add a notification email (recommended)

iziGift issues the credit silently — it does not send the customer an email. Add an **Email** action after the webhook action in your Klaviyo flow to let the customer know their credit is ready.

Example subject line: *"You've got $10 in store credit — shop now"*

You can use `{{ person.first_name }}` and any other Klaviyo profile properties to personalize the email.

***

## Testing your setup

Before activating your flow for real customers:

1. In Klaviyo, trigger the flow manually for a test profile whose email matches a real customer in your Shopify store
2. In iziGift, go to **Integrations → Klaviyo → Webhook Logs** and confirm a `success` entry appears
3. In your Shopify admin, check the customer's account to confirm the store credit was added

***

## Webhook logs

All activity is visible under **Integrations → Klaviyo → Webhook Logs**. You can filter by status, campaign, and date range.

| Status       | Meaning                                                                           |
| ------------ | --------------------------------------------------------------------------------- |
| `success`    | Store credit was issued to the customer                                           |
| `processing` | Webhook received, being processed                                                 |
| `failed`     | Could not issue credit after all retries — see the error message on the log entry |

### Common failure reasons

| Error                  | What to do                                                                                                                                  |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `no_matching_customer` | No Shopify customer profile found for that email. See the note below on Shopify customers.                                                  |
| Auth error (401)       | The Authorization header in Klaviyo doesn't match iziGift. Open the campaign card in iziGift, click **Show details**, and recopy the value. |
| Payload error (400)    | The `webhook_id` is missing or doesn't match any campaign. Confirm the JSON body was copied correctly.                                      |

***

## Important notes

### The recipient must have a Shopify customer profile

Store credit is issued to the customer's Shopify account. A "Shopify customer" means anyone who has an existing profile in your Shopify store — this includes people who have purchased, but also people who have created an account, signed up via a form that syncs to Shopify, or been added manually.

If no Shopify customer profile exists for the recipient's email at the time the webhook fires, iziGift will automatically retry for a few minutes to account for brief delays. If no profile is found after retries, the drop will permanently fail.

**Common use cases where this works well:**

* Birthday flows for customers in your Shopify store
* Win-back flows for lapsed purchasers
* Post-purchase loyalty milestones (e.g. after X orders)
* New subscriber welcome rewards — as long as the Klaviyo form or sign-up flow also creates or syncs a profile in Shopify

### Double opt-in and new subscribers

If your Klaviyo list has **double opt-in** enabled, Klaviyo will not trigger the flow until the subscriber confirms their email. This is Klaviyo behavior — iziGift cannot issue credit until the webhook fires.

Make sure any new subscriber flow you connect to Store Credit Drops also results in a Shopify customer profile being created. If the person opts in to Klaviyo but no Shopify profile exists, the drop will fail.

### Create a separate campaign for each flow

We recommend creating one campaign per Klaviyo flow rather than reusing the same campaign across multiple flows. Each campaign tracks its own success and failure counts, and as we roll out per-campaign analytics you will be able to see which flows are driving the most value and which are underperforming — but only if each flow has its own campaign.

### Deleting a campaign is a breaking change

> **Warning:** Deleting a campaign immediately disables the webhook. Any Klaviyo flow pointing to that campaign's webhook ID will stop issuing store credit — silently and permanently.

If your Klaviyo flow has an email action that tells customers they received store credit, and you delete the campaign, customers will continue receiving that email but will **not** receive any credit. These two things must be handled together.

**Before deleting a campaign:**

1. Pause or deactivate the Klaviyo flow that uses it
2. Remove or update the email action in that flow so customers are not notified of credit that will not arrive
3. Then delete the campaign in iziGift

If you want to change the credit amount or campaign name, you do not need to delete — just update the campaign in place.
