The Voucherify + Iterable Integration lets you send unique voucher or referral codes in Iterable campaigns and journeys. Each voucher is generated and assigned to a recipient in real time through an Iterable data feed.
With this integration, you can ensure that only eligible recipients receive valid codes, and you can track when vouchers are published and redeemed.
# In this article
# Requirements
To set up this integration, you need the following:
- An active Voucherify account
- The Manage Integrations permission for your Iterable project (required to create data feeds)
# Setup instructions
To connect your Voucherify and Iterable accounts, you'll create an API key in Voucherify, then use it to configure a data feed in Iterable.
# In Voucherify
To generate an API key for the integration:
- Sign in to your Voucherify account, and go to Project Settings > General.
- Under Integration Keys, create a new API key.
- Configure the key with the following settings:
- Name: Iterable Integration
- Role: User
- Integration: Iterable
- Save the key, and copy it to your clipboard. The secret key is only visible for 15 minutes after creation, so make sure to copy it right away.
IMPORTANT
Make sure to save your API key in a secure location before closing the menu, as you won't be able to view it again after 15 minutes.
# In Iterable
To create a data feed that connects to Voucherify:
Sign in to your Iterable account, and go to Content > Data Feeds.
Click New Data Feed.
Give the data feed a name (for example, "Voucherify Integration").
(Optional) Under Template Handlebars Alias, assign an alias (for example,
welcome_codes) to uniquely identify this data feed in your Iterable email templates. To learn more, see Referencing Data Feeds by Alias.-
Under URL, enter the URL for Voucherify's publications endpoint. Note that the endpoint URL varies by region:
-
Europe (default):
https://api.voucherify.io/v1/publications/create -
US:
https://us1.api.voucherify.io/v1/publications/create -
Asia (Singapore):
https://as1.api.voucherify.io/v1/publications/create
-
Europe (default):
-
Add the following query parameters to the URL:
-
Set the
customer[source_id]to the user identifier for your Iterable project. To ensure this value is correctly formatted for use in a URL, enclose it in a merge tag using the#urlEncodeHandlebars helper.For example:
customer[source_id]={{#urlEncode}}{{userId}}{{/urlEncode}} -
Set the
campaign[name]to the name of the Voucherify campaign that issues the voucher codes. Remember: Campaign names with spaces should be URL encoded.For example:
campaign[name]=Welcome%20Codesorcampaign[name]={{urlEncode}}Welcome Codes{{/urlEncode}}
The full URL should look something like this:
https://api.voucherify.io/v1/publications/create?customer[source_id]={{#urlEncode}}{{userId}}{{/urlEncode}}&campaign[name]=WelcomeCodesNOTE
To learn more about adding parameters to an API query link, see:
-
Under Authorization Token, enter the Voucherify API key you created earlier.
(Optional) Set custom headers and a rate limit, as necessary.
Click Save Data Feed.
For detailed instructions on data feeds and their properties, see Managing Data Feeds.
# Using Voucherify data feeds in Iterable templates
Once you've created your Voucherify data feed, you can use it in an Iterable email template to display voucher codes and metadata.
In Iterable, open an email template or create a new one.
Under Advanced Options, enable the Generate with Data Feeds option.
Select your Voucherify data feed from the dropdown menu.
-
Choose whether or not to enable caching:
Enabled: Choose this option if the data feed response is the same for all recipients (for example, a current active promotion). Iterable caches the response for 1 hour, which reduces the number of API calls to Voucherify.
Disabled: Choose this option if each recipient needs a unique code (recommended for unique voucher codes). With this option, Iterable requests a fresh code for every recipient, ensuring each user receives their own unique voucher.
TIP
For campaigns that deliver voucher codes, you should almost always disable caching to ensure each recipient receives a unique code. Only enable caching if you're distributing the same promotional code to all recipients.
-
If you added an alias when creating the data feed, you can reference values directly in your template using the alias. For example:
To display a voucher code in your email:
[[welcome_codes.voucher.code]]
To display a voucher's metadata (for example, the marketing text associated with a promotional offer):
[[welcome_codes.voucher.metadata.marketing_text]]
Save the template.
For more information on using data feeds in Iterable templates, see Using Data Feeds in Templates.
# Sending voucher campaigns
Once you've configured a template to fetch voucher codes from Voucherify through your data feed, you can create a campaign that uses the template and send it to users when you're ready.
Before sending a campaign to all recipients, it's a good idea to preview the email to make sure the voucher codes are generating correctly. Here are a couple of options for doing that:
Use the Preview option to confirm that voucher codes populate in the message as expected for test users.
Send a proof of the message to yourself or a colleague, and verify that the voucher codes display correctly and that the links work as expected.
When you're ready, schedule or send the campaign. At send time, Iterable will call Voucherify, assign a unique code to each recipient, and merge it into the rendered email message the user receives.
You can track voucher publication and redemption activity in Voucherify Analytics to monitor how recipients are using their codes.
# Troubleshooting
If you're experiencing issues with the integration, try the following:
- Voucher code not appearing: Verify that your campaign name matches exactly what you have set up in Voucherify. Campaign names are case-sensitive and must match the name you configured in your data feed URL.
- Feed error: Confirm your Voucherify API key is active and has Iterable integration permissions. You may need to regenerate the key in Voucherify if it's expired or been revoked.
- Duplicate codes: Ensure caching is disabled when issuing per-user vouchers. If caching is enabled, all recipients will receive the same code.
# Want to learn more?
For more information about some of the topics in this article, check out these resources. Iterable Academy is open to everyone — you don't need to be an Iterable customer!
Iterable Academy
Support docs