Skip to main content

Creating coupons via Iterable

In this tutorial, let's set up Iterable to automatically generate coupons inside Talon.One and deliver the coupon codes to customers.

To do so, we rely on the Iterable-specific Create coupon endpoint.

Talon.One requirements

You can edit the default format of the coupon codes in the campaign's Settings section.

Iterable requirements

  • You have created a campaign and a template.
  • You have added users to your Iterable project. Your user data includes the user's first name and email address. For this tutorial, we assume the corresponding fields are named firstName and email.
  • You have a way to identify a given customer across Talon.One and Iterable. For this tutorial, we assume the customer integration ID in Talon.One is identical to the customer's email address in Iterable.

Creating an API key in Talon.One

In the Campaign Manager, create an Iterable-specific API key:

  1. In your Application, click Settings > Integration API Keys.

  2. Click Create API Key.

  3. In the Create API Key drawer, select Production as the key type.

  4. In Key name, type a name to identify the key.

  5. In Key expiration date, select a date.

  6. In Third-party integration, select Yes.

  7. From Platform, select Iterable.

  8. Click Create API Key.

  9. Click to copy the key for use.

    note

    You cannot view or copy the API key after closing the drawer. If you lose it, create another API key.

Creating a data feed in Iterable

To generate the coupon in Iterable, we call the following endpoint:

GET Create coupon
https://integration.talon.one/iterable/coupon

See API Docs

To access this endpoint, create a data feed in Iterable:

  1. In Iterable, open Content > Data feeds.
  2. Click New data feed.
  3. In Name, enter a name for the feed.
  4. In URL, enter the URL of the Talon.One endpoint including parameters. To generate the URL, use the form below.
  5. Set Format to JSON.
  6. In Authorization token, type ApiKey-v1 YOUR_API_KEY, where YOUR_API_KEY is the API key you created.

Generating the URL

Generate the URL for the data feed with the following form.

You can use Iterable field values, for example {{userid}} or {{email}}.

Creating a template in Iterable

To generate and send the coupon code, let's create an email template in Iterable:

  1. In Iterable, open Content > Templates.

  2. Click New Template > Email.

  3. Enter a name and click Create template.

  4. In Details, click Edit details and make the following settings:

    1. Enter a subject for the email.
    2. Select Connect data feeds for dynamic template creation and choose the data feed you created.
  5. In Design, click Edit design. When asked, choose the WYSIWYG editor.

  6. Use the following example to create your email template:

    Hi {{firstName}},

    Thank you for your recent purchase.

    Use [[Value]] to get 10% off your next purchase over $20. The code is valid only for the next 7 days.

    To unsubscribe from these emails, click {{unsubscribeUrl}}.

You can now use this template in a campaign. For each email sent, a coupon code is generated in Talon.One and displayed in the email.

tip

In the example above, we use the following syntax:

When the campaign is triggered and the email template is sent, these placeholders are populated with values from Iterable and Talon.One.

Testing the connection

Let's test our setup using the Preview feature in Iterable.

To test the connection:

  1. In Iterable, open the template you created.
  2. Click Preview.
  3. In User data, enter the email address of an existing user and click Load user data.
    The user's data appears.
  4. In Data feeds, click Load data feeds.
  5. Check whether a coupon code is shown in the template preview.
  6. Check whether the coupon code has been added to your campaign in Talon.One.