The Recurly integration brings Recurly account, subscription, payment, and dunning activity into Iterable as Recurly sends notifications. Use it to keep user profiles current with each customer's subscription, to segment users by subscription status and plan, and to trigger journeys when a subscription changes or a payment fails. For example, you can recover failed payments with a message about the amount due and why the charge failed, tailor offers to each subscriber's plan, or win back subscribers whose subscriptions were canceled or expired.
# In this article
- How the integration works
- Connection requirements
- Setting up the Recurly integration
- User profile fields
-
Recurly events synced to Iterable
- recurlyPaymentFailed event
- recurlyPaymentPastDue event
- recurlySubscriptionCanceled event
- recurlySubscriptionCreated event
- recurlySubscriptionExpired event
- recurlySubscriptionPaused event
- recurlySubscriptionReactivated event
- recurlySubscriptionRenewed event
- recurlySubscriptionResumed event
- recurlySubscriptionUpdated event
- Troubleshooting
# How the integration works
The integration receives a notification from Recurly when an account, subscription, payment, or dunning event changes. Recurly's notifications include only the type of change and the record's ID, so the integration reads the full record from Recurly with your private API key before it sends anything to Iterable.
Each notification updates a user profile, tracks a custom event, or both:
| Recurly notification | What Iterable stores |
|---|---|
| Account created or updated | User profile update |
| Subscription created, updated, renewed, paused, resumed, canceled, expired, or reactivated | User profile update and a subscription event, such as recurlySubscriptionCanceled
|
| Payment failed |
recurlyPaymentFailed event |
| Dunning event created |
recurlyPaymentPastDue event |
Payment and dunning notifications don't change the user profile. On a subscription notification, the profile fields describe only the subscription that triggered it, not every subscription on the account. If Iterable rejects the profile update for a subscription notification, it still tracks the subscription event.
For the fields the integration sets, see User profile fields and the event sections that follow it.
# How users are matched
Identity Key on the Settings page sets how Iterable identifies users. It doesn't use the Primary Identifier on the Iterable connection.
| Identity Key | Recurly identifier | Iterable identifier | Supported Iterable project types |
|---|---|---|---|
| Account email address | email | Hybrid, email-based | |
| User ID | Account code | userId | Hybrid, userID-based |
Choose the Identity Key that matches how your existing Iterable users are identified:
Select User ID if your users'
userIdvalues are Recurly account codes, or if the project has no users yet and you want to identify all users by Recurly account code. Iterable stores the account code as theuserIdand doesn't send the account's email address. Not available for email-based projects.Select Email if your users are identified by
email, or byuserIdvalues that aren't Recurly account codes. Iterable matches each account by its email address. Not available for userID-based projects.
Iterable never falls back to the other identifier. If a Recurly account doesn't
have the identifier you choose, it skips the notification.
Every profile update also stores the account code in recurlyAccountCode,
whether you match accounts by email or by user ID.
To learn more about project types, read Project Types and Unique Identifiers.
# What isn't synced
Iterable doesn't sync:
- Recurly notifications that aren't listed in How the integration works, such as other account or payment notifications. Iterable accepts them and ignores them.
- XML notifications. The Recurly endpoint must send JSON.
- Accounts, subscriptions, and payments from before you add the endpoint in Recurly. History isn't imported.
- A combined view of accounts with several subscriptions. Each subscription notification overwrites the profile's subscription fields.
# Connection requirements
To connect Iterable with Recurly, you need:
A Recurly private API key.
A server-side API key for the Iterable project that receives the data.
-
A field to identify the user that matches in Iterable:
- When you match users by email, an email address on every Recurly account.
- When you match users by user ID, an account code that matches your Iterable user IDs.
# Setting up the Recurly integration
Complete these two steps in order. First create the fields that need a specific data type in Iterable, and then connect Recurly.
# Step 1: Create Recurly fields in Iterable
This step is required. Create the fields in the following table in Iterable,
each with the type double, before you start
Step 2: Connect Recurly to Iterable.
Creating them first makes sure that Iterable stores Recurly's amounts with the
correct data type.
Skipping this step carries a risk that the fields are created with the incorrect data type, which can lead to amounts that are wrong or missing in Iterable.
| Field | Where to create it |
|---|---|
amount_due | Custom events recurlyPaymentFailed and recurlyPaymentPastDue
|
recurringAmount | User profile fields |
unit_amount | Each of the eight subscription events, from recurlySubscriptionCanceled to recurlySubscriptionUpdated
|
To create the user profile field, read Adding user profile fields. To create an event field, first add the event if it doesn't exist yet. Read Adding a new custom event and Adding fields to a custom event.
Every other field, including the dates, gets the correct type on its own.
# Step 2: Connect Recurly to Iterable
In Iterable, go to Integrations > Integrations Hub.
Find Recurly, select Connect, and then select Add Connection.
-
On Connections:
- Under Iterable Connection, enter your Iterable API key. (Ignore Primary Identifier on the Iterable connection. Recurly uses Identity Key on Settings.)
- Under Recurly Connection, enter your Recurly Private API Key.
- Under Region, choose the Recurly data center that hosts your site: US or EU. The default is US.
- Copy the webhook URL shown on the page.
-
In the Recurly Admin Console, go to Integrations > Webhooks and add an endpoint:
- Paste the webhook URL.
- Set the payload format to JSON. Recurly doesn't sign XML notifications, and the integration doesn't support them.
- Subscribe the endpoint to these notifications: Account (created, updated), Subscription (created, updated, renewed, paused, resumed, canceled, expired, reactivated), Payment (failed), and Dunning Event (created).
- Copy the endpoint's signing secret.
For more information, see Recurly's webhook documentation.
Back on Connections in Iterable, paste the signing secret into Webhook Signing Secret. Until it matches the endpoint's signing secret, the integration rejects every notification.
-
On Settings:
- Under Identity Key, choose how Recurly accounts are matched to Iterable users: Email or User ID. The default is Email, but you might need User ID, depending on your project. See How users are matched.
- Confirm that you created the amount fields in Iterable in Step 1. See Step 1: Create Recurly fields in Iterable.
Select Finish.
Update a test account in Recurly, for example by changing its first name. In Iterable, open the matching user profile and confirm that it has
recurlyAccountCodeand the new name.
# User profile fields
Account and subscription notifications create or update the Iterable user. The identifier from How users are matched identifies the profile. Each custom event the integration tracks has its own section after this one. When a Recurly value is empty, the integration leaves that field out.
firstName, lastName, and recurlyAccountCode come from the Recurly account.
The other fields come from the subscription, and only subscription
notifications set them.
User profiles have the following fields:
| Field | Type | Description |
|---|---|---|
billingCurrency | string | The subscription's currency code, such as USD. |
firstName | string | The first name on the Recurly account. |
lastName | string | The last name on the Recurly account. |
primaryPlanCode | string | The subscription's plan code. |
recurlyAccountCode | string | The Recurly account code. |
recurringAmount* | double | The subscription's recurring charge before tax. |
subscriptionEndDate | date | When the subscription's current billing period ends. |
subscriptionStartDate | date | When the subscription was activated. |
subscriptionStatus | string | The subscription's state in Recurly, such as active. |
* recurringAmount is Recurly's subtotal for the subscription. When Recurly
doesn't return a subtotal, the integration multiplies the unit amount by the
quantity. Create recurringAmount as a double user profile field in Iterable
before you connect Recurly. See
Step 1: Create Recurly fields in Iterable.
# Recurly events synced to Iterable
The integration tracks the following custom events.
# recurlyPaymentFailed event
A failed payment notification tracks recurlyPaymentFailed. The event is dated
with the time of the change in Recurly and has the following fields:
| Field | Type | Description |
|---|---|---|
account_code | string | The Recurly account code. |
amount_due* | double | The invoice's unpaid balance. |
currency | string | The invoice's currency code, such as USD. |
failure_reason | string | Recurly's decline message and status code for the failed payment. |
invoice_number | string | The Recurly invoice number. |
invoice_state | string | The invoice's state in Recurly, such as past_due. |
* Create amount_due as a double field on the recurlyPaymentFailed event
in Iterable before you connect Recurly. See
Step 1: Create Recurly fields in Iterable.
# recurlyPaymentPastDue event
A new dunning event on an unpaid invoice tracks recurlyPaymentPastDue. The
event is dated with the time of the change in Recurly and has the following
fields:
| Field | Type | Description |
|---|---|---|
account_code | string | The Recurly account code. |
amount_due* | double | The invoice's unpaid balance. |
currency | string | The invoice's currency code, such as USD. |
invoice_number | string | The Recurly invoice number. |
invoice_state | string | The invoice's state in Recurly, such as past_due. |
* Create amount_due as a double field on the recurlyPaymentPastDue event
in Iterable before you connect Recurly. See
Step 1: Create Recurly fields in Iterable.
# recurlySubscriptionCanceled event
When a subscription is canceled, the integration tracks
recurlySubscriptionCanceled. The event is dated with the time of the change
in Recurly and has the following fields:
| Field | Type | Description |
|---|---|---|
account_code | string | The Recurly account code. |
currency | string | The subscription's currency code, such as USD. |
current_period_ends_at | date | When the current billing period ends. |
current_period_started_at | date | When the current billing period started. |
plan_code | string | The subscription's plan code. |
plan_name | string | The subscription's plan name. |
quantity | long | The plan quantity on the subscription. |
subscription_id | string | The Recurly subscription ID. |
subscription_state | string | The subscription's state in Recurly, such as active. |
unit_amount* | double | The plan's price per unit. |
* Create unit_amount as a double field on the recurlySubscriptionCanceled
event in Iterable before you connect Recurly. See
Step 1: Create Recurly fields in Iterable.
# recurlySubscriptionCreated event
When a subscription is created, the integration tracks
recurlySubscriptionCreated. The event is dated with the time of the change
in Recurly and has the following fields:
| Field | Type | Description |
|---|---|---|
account_code | string | The Recurly account code. |
currency | string | The subscription's currency code, such as USD. |
current_period_ends_at | date | When the current billing period ends. |
current_period_started_at | date | When the current billing period started. |
plan_code | string | The subscription's plan code. |
plan_name | string | The subscription's plan name. |
quantity | long | The plan quantity on the subscription. |
subscription_id | string | The Recurly subscription ID. |
subscription_state | string | The subscription's state in Recurly, such as active. |
unit_amount* | double | The plan's price per unit. |
* Create unit_amount as a double field on the recurlySubscriptionCreated
event in Iterable before you connect Recurly. See
Step 1: Create Recurly fields in Iterable.
# recurlySubscriptionExpired event
When a subscription is expired, the integration tracks
recurlySubscriptionExpired. The event is dated with the time of the change
in Recurly and has the following fields:
| Field | Type | Description |
|---|---|---|
account_code | string | The Recurly account code. |
currency | string | The subscription's currency code, such as USD. |
current_period_ends_at | date | When the current billing period ends. |
current_period_started_at | date | When the current billing period started. |
plan_code | string | The subscription's plan code. |
plan_name | string | The subscription's plan name. |
quantity | long | The plan quantity on the subscription. |
subscription_id | string | The Recurly subscription ID. |
subscription_state | string | The subscription's state in Recurly, such as active. |
unit_amount* | double | The plan's price per unit. |
* Create unit_amount as a double field on the recurlySubscriptionExpired
event in Iterable before you connect Recurly. See
Step 1: Create Recurly fields in Iterable.
# recurlySubscriptionPaused event
When a subscription is paused, the integration tracks
recurlySubscriptionPaused. The event is dated with the time of the change
in Recurly and has the following fields:
| Field | Type | Description |
|---|---|---|
account_code | string | The Recurly account code. |
currency | string | The subscription's currency code, such as USD. |
current_period_ends_at | date | When the current billing period ends. |
current_period_started_at | date | When the current billing period started. |
plan_code | string | The subscription's plan code. |
plan_name | string | The subscription's plan name. |
quantity | long | The plan quantity on the subscription. |
subscription_id | string | The Recurly subscription ID. |
subscription_state | string | The subscription's state in Recurly, such as active. |
unit_amount* | double | The plan's price per unit. |
* Create unit_amount as a double field on the recurlySubscriptionPaused
event in Iterable before you connect Recurly. See
Step 1: Create Recurly fields in Iterable.
# recurlySubscriptionReactivated event
When a subscription is reactivated, the integration tracks
recurlySubscriptionReactivated. The event is dated with the time of the change
in Recurly and has the following fields:
| Field | Type | Description |
|---|---|---|
account_code | string | The Recurly account code. |
currency | string | The subscription's currency code, such as USD. |
current_period_ends_at | date | When the current billing period ends. |
current_period_started_at | date | When the current billing period started. |
plan_code | string | The subscription's plan code. |
plan_name | string | The subscription's plan name. |
quantity | long | The plan quantity on the subscription. |
subscription_id | string | The Recurly subscription ID. |
subscription_state | string | The subscription's state in Recurly, such as active. |
unit_amount* | double | The plan's price per unit. |
* Create unit_amount as a double field on the
recurlySubscriptionReactivated event in Iterable before you connect Recurly.
See
Step 1: Create Recurly fields in Iterable.
# recurlySubscriptionRenewed event
When a subscription is renewed, the integration tracks
recurlySubscriptionRenewed. The event is dated with the time of the change
in Recurly and has the following fields:
| Field | Type | Description |
|---|---|---|
account_code | string | The Recurly account code. |
currency | string | The subscription's currency code, such as USD. |
current_period_ends_at | date | When the current billing period ends. |
current_period_started_at | date | When the current billing period started. |
plan_code | string | The subscription's plan code. |
plan_name | string | The subscription's plan name. |
quantity | long | The plan quantity on the subscription. |
subscription_id | string | The Recurly subscription ID. |
subscription_state | string | The subscription's state in Recurly, such as active. |
unit_amount* | double | The plan's price per unit. |
* Create unit_amount as a double field on the recurlySubscriptionRenewed
event in Iterable before you connect Recurly. See
Step 1: Create Recurly fields in Iterable.
# recurlySubscriptionResumed event
When a subscription is resumed, the integration tracks
recurlySubscriptionResumed. The event is dated with the time of the change
in Recurly and has the following fields:
| Field | Type | Description |
|---|---|---|
account_code | string | The Recurly account code. |
currency | string | The subscription's currency code, such as USD. |
current_period_ends_at | date | When the current billing period ends. |
current_period_started_at | date | When the current billing period started. |
plan_code | string | The subscription's plan code. |
plan_name | string | The subscription's plan name. |
quantity | long | The plan quantity on the subscription. |
subscription_id | string | The Recurly subscription ID. |
subscription_state | string | The subscription's state in Recurly, such as active. |
unit_amount* | double | The plan's price per unit. |
* Create unit_amount as a double field on the recurlySubscriptionResumed
event in Iterable before you connect Recurly. See
Step 1: Create Recurly fields in Iterable.
# recurlySubscriptionUpdated event
When a subscription is updated, the integration tracks
recurlySubscriptionUpdated. The event is dated with the time of the change
in Recurly and has the following fields:
| Field | Type | Description |
|---|---|---|
account_code | string | The Recurly account code. |
currency | string | The subscription's currency code, such as USD. |
current_period_ends_at | date | When the current billing period ends. |
current_period_started_at | date | When the current billing period started. |
plan_code | string | The subscription's plan code. |
plan_name | string | The subscription's plan name. |
quantity | long | The plan quantity on the subscription. |
subscription_id | string | The Recurly subscription ID. |
subscription_state | string | The subscription's state in Recurly, such as active. |
unit_amount* | double | The plan's price per unit. |
* Create unit_amount as a double field on the recurlySubscriptionUpdated
event in Iterable before you connect Recurly. See
Step 1: Create Recurly fields in Iterable.
# Troubleshooting
# No data arrives in Iterable
Check the Recurly endpoint and the integration settings:
- Webhook Signing Secret must match the signing secret of the Recurly endpoint. Until they match, the integration rejects every notification.
- The endpoint's payload format must be JSON.
- The endpoint must be subscribed to the notifications listed in Step 2: Connect Recurly to Iterable.
# Some accounts don't appear in Iterable
When you match accounts by email, the integration skips accounts without an email address. When you match by user ID, it skips accounts without an account code. The integration doesn't fall back to the other identifier. See How users are matched.
# Amounts are wrong or missing in Iterable
When you send brand new data fields that Iterable hasn't stored previously and
your project
allows Iterable to automatically create new fields,
Iterable sets a field's type from the first value the field receives, and it
can't change the type later. If recurringAmount, unit_amount, or
amount_due received a whole amount, such as 49, before you created it as
double, Iterable typed the field as a whole number. A whole-number field may
not store or handle decimal amounts correctly, so amounts can be wrong or
missing in Iterable.
Recurly starts sending notifications after you add the endpoint in Step 2. To
avoid a wrong type, create the fields as double first. See
Step 1: Create Recurly fields in Iterable.
If a field already has the wrong type, contact Iterable support for help.