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

# Klaviyo integration

{% embed url="<https://dollarlabs.neetorecord.com/watch/f38147f1887b80612c9e>" %}

Connect Klaviyo to receive every DollarBack credit event as a Klaviyo metric and keep each profile's credit balance and referral code in sync, so you can build flows, segments, and campaigns around store credit.

## Prerequisites

* A Klaviyo account with admin access.
* At least one active earning program, so there are events to sync ([Set up purchase cashback](/dollarback-store-credit/earning-cashback-programs/set-up-purchase-cashback.md)).

## Connect Klaviyo

1. Go to **DollarBack admin → Integrations** and find the **Klaviyo** card.
2. Click **Set up**. The Klaviyo page opens.
3. Click **Connect with Klaviyo** and approve the OAuth connection in the Klaviyo tab that opens. Sign in to the Klaviyo account you want linked.
4. Klaviyo shows **Authorization Successful**, and after a few seconds the tab takes you back to the Klaviyo page in DollarBack, which now shows **Connected**. Events begin syncing immediately; no API keys to copy.
5. Click **Sync Balance** once, so customers who already have credit get their balance properties in Klaviyo (see [Sync buttons](#sync-buttons)).

{% hint style="info" %}
Klaviyo needs a plan that includes **Klaviyo, Omnisend, Mailchimp and Flow integrations**. On other plans the Klaviyo page shows **Upgrade to Connect** instead of **Connect with Klaviyo**, with the banner "Integrations aren't available on your current plan." Click it to compare plans on the **Billing** page ([Choose a plan and start your trial](/dollarback-store-credit/getting-started/choose-a-plan-and-start-your-trial.md)).
{% endhint %}

<figure><img src="https://2844543096-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcVBfwy7Yj4tU8TsxkHEr%2Fuploads%2Fgit-blob-a8dd768cf1af9993eec75747350b9d87d09634e1%2Fdb-integrations-hub-marketing-annotated.png?alt=media" alt="The Integrations page in DollarBack. The Marketing and automations section shows cards for Klaviyo and Omnisend (both Connected) and Shopify Flow (Enabled), each with a Manage button, and cards for Mailchimp and Judge.me (Not Connected) with a Set up button."><figcaption><p>Every integration starts on the Integrations page. Click Set up on the card you need. Once it is connected, the button reads Manage.</p></figcaption></figure>

<figure><img src="https://2844543096-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcVBfwy7Yj4tU8TsxkHEr%2Fuploads%2Fgit-blob-c10a2519322b027eabe5767c85f0ff6693962451%2Fdb-klaviyo-connected-annotated.png?alt=media" alt="The Klaviyo integration page with a Connected badge and the buttons Disconnect Klaviyo, Sync Balance, Sync Referral Codes and Send Demo Events. Below, the Synced Properties panel (dbBalance, dbFormattedBalance, dbCurrency, dbSymbol, dbReferralCode) and the Synced Events panel each have Current and Deprecated tabs. The events are grouped into Store credit, Referral, Discount codes and Tiers."><figcaption><p>Once Klaviyo is connected, its page lists every property and event DollarBack sends under the new names. The Deprecated tabs list the old names, which are still sent.</p></figcaption></figure>

## Synced events

Each event appears in Klaviyo as a metric under the connected integration, attached to the customer's profile.

DollarBack sends every event **twice**: first under its old Title Case name, then under its new name. The old names are deprecated. They still go out with their old values, so flows built on them keep running, but build new flows on the new names. The Klaviyo page in DollarBack lists both, on its **Current** and **Deprecated** tabs.

| Klaviyo event             | Old name (deprecated)          | Fires when                                                                                                                               | Key fields                                                                                                                                             |
| ------------------------- | ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `store_credit_credited`   | Store Credit Credited          | Credit is issued: order cashback, a signup, newsletter, social, review or custom reward, a merchant API or CSV credit, or a Flow deposit | amount, formattedAmount, currency, symbol, reason, expiresAt, formattedExpiresAt, expiryDays, offerTitle, orderId, orderName                           |
| `birthday_reward`         | Birthday Reward Credited       | A birthday reward is issued as store credit                                                                                              | amount, formattedAmount, currency, symbol, reason, expiresAt, formattedExpiresAt, expiryDays, offerTitle                                               |
| `store_credit_debited`    | Store Credit Debited           | Credit is removed: a refund, cancellation or order-edit clawback, a merchant API or CSV debit, or a Flow deduction                       | amount, formattedAmount, currency, symbol, reason, offerTitle, orderId, orderName                                                                      |
| `store_credit_redeemed`   | Store Credit Redeemed          | A customer spends credit at checkout                                                                                                     | amount, formattedAmount, currency, symbol, reason, orderId, orderName                                                                                  |
| `store_credit_expiring`   | Store Credit Expiry Threshold  | Credit crosses a reminder threshold you set in the Expiry Notification Schedule                                                          | amount (the part of that credit still unspent), formattedAmount, currency, symbol, reason, expiresAt, formattedExpiresAt, remainingDays, transactionId |
| `referral_code_generated` | Referral Code Generated        | A referral code is created for a customer                                                                                                | referralCode, reason                                                                                                                                   |
| `referral_rewarded`       | Referral Reward Credited       | A referrer earns a reward                                                                                                                | amount, formattedAmount, currency, symbol, reason, expiresAt, formattedExpiresAt, expiryDays, orderId, orderName, refereeFirstName, refereeLastName    |
| `discount_code_credit`    | Discount Code Credited         | A reward discount code is issued, earned through a program or claimed in the reward marketplace                                          | discountCode, rewardSummary, offerTitle, reason, orderId, orderName, amount, formattedAmount, currency, symbol                                         |
| `discount_code_expiring`  | Discount Code Expiry Threshold | An unused reward discount code crosses a reminder threshold                                                                              | discountCode, rewardSummary, offerTitle, reason, expiresAt, formattedExpiresAt, remainingDays                                                          |
| `tier_upgraded`           | Customer Tier Upgraded         | A customer moves up a tier, or reaches their first tier                                                                                  | tier, previousTier, reason                                                                                                                             |
| `tier_downgraded`         | Customer Tier Downgraded       | A customer moves down a tier, or loses their tier                                                                                        | tier, previousTier, reason                                                                                                                             |

Some fields are left out when they don't apply: a signup reward has no `orderId`, and credit that never expires has no `expiresAt`. In the new events:

* `expiresAt` is the date in your store's time zone (`March 5, 2027`), and `formattedExpiresAt` adds the time and zone (`March 5, 2027 at 3:07 AM EST`).
* `formattedAmount` uses the same money format as your DollarBack emails: `$36.85`, `CA$10.33`. `symbol` follows it, so it's `CA$` for Canadian dollars.
* `reason` says why the event happened, for example `Order Cashback`, `Signup Bonus`, `Order Refund` or `Manual Debit`.

Claiming a reward-marketplace reward sends only `discount_code_credit`. The store credit it costs doesn't send a debited event.

{% hint style="info" %}
There is no event when credit actually expires. To reach customers at the last moment, add a 1-day threshold to your Expiry Notification Schedule and trigger on `store_credit_expiring` where `remainingDays` is 1. Use `formattedExpiresAt` as it is. On the old *Store Credit Expiry Threshold* event, `expiresAt` is a raw date-time value that you have to format in your template, for example `{{ event.expiresAt|format_date_string|date:'F j, Y' }}`.
{% endhint %}

## Profile properties

Alongside each event, DollarBack updates these custom properties on the Klaviyo profile. Each one is written under its new name and, deprecated, under its old name:

| Property           | Old name (deprecated)    | Contains                                                    |
| ------------------ | ------------------------ | ----------------------------------------------------------- |
| dbBalance          | Dollar Balance           | The customer's current store-credit balance as a number     |
| dbFormattedBalance | Dollar Formatted Balance | The balance formatted for display (e.g. $24.50)             |
| dbCurrency         | Dollar Currency Code     | The balance's currency code (e.g. USD)                      |
| dbSymbol           | Dollar Symbol            | The currency symbol                                         |
| dbReferralCode     | Referral Code            | The customer's referral code (set when a code is generated) |

Because properties update with every event, segments built on them stay current without scheduled exports.

DollarBack finds the Klaviyo profile by the first of these that the Shopify customer has:

1. Email address
2. Phone number
3. First and last name
4. Shopify customer ID

## Sync buttons

Events only update the profiles of customers who have credit activity after you connect. To fill in everyone else, use the buttons on the Klaviyo page:

| Button                  | What it does                                                                                                                                         | When to use it                                                         |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| **Sync Balance**        | Queues a bulk sync that sends your customers' current store-credit balances to their Klaviyo profiles (*dbBalance* and the other balance properties) | Right after you connect, or when balance properties look out of date   |
| **Sync Referral Codes** | Queues a bulk sync that sends your customers' referral codes to *dbReferralCode*                                                                     | After you connect, or after you set up or change your referral program |
| **Send Demo Events**    | Sends every event with sample values to a demo profile. DollarBack also does this once when you connect                                              | To build flows before a real customer earns anything                   |
| **Disconnect Klaviyo**  | Disconnects Klaviyo and stops all sends                                                                                                              | When you no longer use Klaviyo                                         |

While a sync runs, the page shows **Klaviyo Sync In Progress** and both sync buttons are disabled. A sync can take a few minutes, depending on the number of customers. If you disconnect during a sync, it stops, and the next sync starts from the beginning.

## Flow and campaign ideas

* **Credit reminder flow**: trigger on `store_credit_credited`, wait 7 days, and email customers who haven't ordered since: "You still have {{ person|lookup:'dbFormattedBalance' }} waiting."
* **Expiry winback**: trigger on `store_credit_expiring` and send an urgency email/SMS using the `remainingDays` and `formattedAmount` event fields. Pairs with (or replaces) DollarBack's own expiry reminder email.
* **Deliver the code your way**: trigger on `discount_code_credit` and send the `discountCode` in your own Klaviyo design instead of the DollarBack template.
* **Tier welcome**: trigger on `tier_upgraded` and greet the customer with the new `tier` name.
* **Balance segment**: a segment where *dbBalance* is greater than 0 for "has credit to spend" campaigns; include the referral code property in newsletters to promote sharing.

{% hint style="warning" %}
If you rebuild an email in Klaviyo (for example the credited notification), consider disabling the matching DollarBack template under **Notifications** so customers don't receive both.
{% endhint %}

## Verify it works

1. Trigger a credit: place a small test order or credit a customer manually.
2. In Klaviyo, open that customer's profile: the *Store Credit Credited* and `store_credit_credited` events should appear in the activity feed within a few minutes, and the *dbBalance* properties should match the widget balance.

To build flows before a real customer earns anything, click **Send Demo Events** on the Klaviyo page in DollarBack. It sends every event, under its new name with sample values, to a demo profile. DollarBack also does this once when you connect.

## Common issues

* Events aren't appearing: confirm the card still shows **Connected**, then trigger a fresh event; historical events from before connection are not backfilled.
* Each event shows up twice: that's expected. One is the old name and one is the new name (see [Synced events](#synced-events)). Trigger each flow on only one of them.
* Properties are stale or missing: they update on events, and when you click **Sync Balance** or **Sync Referral Codes**. A profile with no credit activity since you connected won't have them until you run a sync.
* The page shows **Upgrade to Connect**: your plan does not include integrations. Upgrade on the **Billing** page.
* Bulk-imported credit didn't create events: the import must run with its send-to-integrations toggle enabled ([Bulk import credit (CSV)](/dollarback-store-credit/analytics-data-and-account/bulk-import-credit-csv.md)).

## Related articles

* [Omnisend integration](/dollarback-store-credit/integrations/omnisend-integration.md)
* [Shopify Flow: triggers and actions](/dollarback-store-credit/integrations/shopify-flow-triggers-and-actions.md)
* [Email notifications overview](/dollarback-store-credit/notifications/email-notifications-overview.md)
* [Credit expiry and reminders](/dollarback-store-credit/spending-store-credit-and-rewards/credit-expiry-and-reminders.md)
