Sync codes with Klaviyo
Push unique discount codes straight into your Klaviyo email and SMS sends, and let Stackable keep the coupon stocked automatically, sized to how fast your flows send. No CSV exports, no running dry mid-campaign.
If you send discount codes through Klaviyo, you normally have to export a batch of codes as a file and upload it into Klaviyo yourself, then remember to top it up before a big send runs out. Stackable connects the two directly: your codes flow into a Klaviyo coupon on their own, and Stackable watches how quickly your flows use them and refills the coupon before it runs low.
This works with any code campaign in Stackable. Each shopper in your Klaviyo send receives their own unique code, so codes cannot be shared or scraped the way one shared code can. To make each code single-use as well, set the campaign’s Total uses to 1, or limit it to one use per customer.
When to use it
- You run email or SMS campaigns in Klaviyo and want each recipient to get their own code.
- You send on a schedule or through automated flows and do not want to babysit how many codes are left.
- You have been exporting CSVs of codes and uploading them into Klaviyo by hand.
You need a code campaign first
Klaviyo sync stocks a coupon with the unique codes from a Stackable code campaign. If you have not created one yet, set up a code campaign first, then come back to connect it to Klaviyo.
Before you start
You need a Klaviyo account and a Klaviyo private API key that has access to coupons. You create the key inside Klaviyo, under Settings, then API keys. Stackable never sees your Klaviyo password; it only uses this key, stored encrypted, and only ever shows you its last four characters.
Not seeing Klaviyo in your store?
Klaviyo sync is turned on per store. If you do not see the Klaviyo option in Settings, contact support and we will enable it for your store.
Connect your Klaviyo account
- In Klaviyo, go to Settings, then API keys, and create a private API key with coupon access. Copy it.
- In Stackable, open Settings and find the Klaviyo integration section.
- Paste your private API key into the Klaviyo private API key field and choose Connect Klaviyo.
- Once it shows Connected, you are ready to link a campaign.
Link a campaign to a Klaviyo coupon
Open the code campaign you want to send through Klaviyo and choose Sync to Klaviyo. You can either create a new Klaviyo coupon, which Stackable makes for you and keeps stocked, or point at a coupon that already exists in your Klaviyo account. Then set how many days of runway to keep stocked.
| Setting | What it means |
|---|---|
| Klaviyo coupon | Create a new coupon for this campaign, or reuse one already in your Klaviyo account. |
| Days of runway | How many days of sending to keep stocked ahead, based on your recent send rate. Higher runway means a bigger safety buffer before Stackable needs to top up again. |
After you link it, codes begin flowing to Klaviyo on the next sync cycle. In Klaviyo, add the coupon to your email or SMS the way you normally would, and each send pulls a unique code from the stocked pool.
How the automatic refill works
Stackable measures how fast your Klaviyo flows are actually using codes and tops the coupon up to match, rather than adding a fixed batch every day. If your sends speed up, it stocks more; if they slow down, it stocks less. When the pool runs low, it generates fresh unique codes automatically so a send never fails for lack of a code.
A coupon that keeps itself stocked
- Recent send rate
- about 400 codes per day
- Days of runway you set
- 7 days
- Stackable keeps stocked
- around 2,800 codes ready in Klaviyo
- When the pool dips
- new codes are generated and added automatically
Refills follow the campaign
Top-ups only run while the campaign is live. If you pause or end the campaign, Stackable stops refilling its Klaviyo coupon until it is live again, so a paused promotion never keeps minting codes.
You stay in control
You can change the days of runway at any time, pause the sync, or disconnect Klaviyo entirely from the same place you set it up.
Good to know
- Codes are unique to each recipient. To make a code usable only once, set the campaign’s Total uses to 1 or limit it to one use per customer, so a code that leaks cannot be reused.
- Usage limits and expiry are set on the campaign, and every code from that campaign follows those rules.
- Shopify allows a very large but finite number of codes per store. If your store approaches that overall limit, Stackable pauses new code creation and Klaviyo top-ups and asks you to clean up unused codes first, so you are never surprised by a hard stop.
Keep your Klaviyo key private
Treat your Klaviyo private API key like a password. If you ever rotate it in Klaviyo, reconnect in Stackable with the new key so syncing keeps working.