Recurly affiliate tracking, from signup to renewal.

Recurly affiliate tracking with AffiliateTracking takes one account custom field and one webhook. The first payment credits the affiliate, renewals follow, and refunds and voids come back.

Payments and renewalsRefunds and voidsCloud and self-host

Your server, creating the Recurly accountExample

The one custom field Recurly needs, set when your server creates the account.

From click to commission

How a Recurly payment finds its affiliate

The same path as every other sale, with a custom field on the account carrying the token.

  1. 01The click

    A visitor opens an affiliate's link. AffiliateTracking records the click and sends them to your site with a signed token.

  2. 02The script keeps it

    t.js saves the token in a cookie on your domain for your attribution window, 30 days unless you change it.

  3. 03The account carries it

    Your server saves the token in the account's aff_token field when it creates the account.

  4. 04Recurly tells us

    The payment arrives, AffiliateTracking reads the field, the 13 fraud rules run, and the account stays linked.

Set it up in four steps

Step 3 is the only code. The rest happens in Recurly and in your settings.

  1. Add the script to your site

    Paste it on every page, right before </head>. Your workspace settings show the tag with your own address filled in.

  2. Add one custom field in Recurly

    Under Configuration, Custom Fields, add a field to Accounts. Keep it off hosted pages, so customers never see it.

  3. Pass the token when you create the account

    Read the at_token cookie on your server and send it as the aff_token custom field, like the example above. Creating a purchase instead? The account inside it takes the same field.

  4. Add a webhook and a read-only key

    Under Integrations, Webhooks, add your address with a username and password. Then make a read-only API key, so AffiliateTracking can read the field. Paste all three into your settings.

What each Recurly notification does

Each notification has to pass the password check, and it counts once, however many times Recurly sends it.

Checked against the code on . A $0 invoice, like a trial, earns nothing but still links the customer. Commission is on the total after discounts and before tax.
Recurly notificationWhat AffiliateTracking does
Successful payment, firstReads aff_token on the account, credits the affiliate and links the account to them for good.
Successful payment, renewalEach renewal credits the linked affiliate. The field isn't needed again.
Successful refundTakes back the same share of the commission. Partial refunds take back part of it.
Void paymentTakes back the commission for that payment.

Good to know before you start

Four details worth knowing before you go live.

Free trials

Your server sets the field when it creates the account. The first paid renewal after the trial earns the commission.

Read-only is enough

The API key only reads accounts. AffiliateTracking never changes anything in your Recurly site.

Your account codes stay yours

Use whatever account code you like. The link lives in the custom field, not the code.

Pick XML

Choose XML as the webhook format when you add the endpoint in Recurly.

Where Recurly sales show up

Each paid sale becomes a journal in the partner's ledger, in the sale's own currency. A refund adds a second journal that takes the share back. Nobody edits a journal after the fact.

Partners see the same entries in their portal, with proof that every journal sums to zero. Follow a Recurly renewal into the books.

Partner ledger on demo data: every journal entry with its source, amount, line count, a journal sum of 0 and a running balance.
A partner ledger on demo data. Recurly events post journals like these.

Recurly FAQ

How do I run an affiliate program with Recurly?

Recurly bills your customers and AffiliateTracking tracks who sent each one. Add the script, add one account field, pass the token when you create the account and point a webhook at your workspace. Then invite affiliates.

Do I need a developer?

For step 3, yes. It's one extra field wherever your server creates the Recurly account.

Does it work with Recurly.js?

Yes. Recurly.js collects the card, and your server creates the account. That's where the field goes.

What happens when I refund or void a payment?

A refund takes back the same share of the commission, and a void takes back all of it. If you already paid the affiliate, it comes off their next payout.

Does Recurly pay my affiliates?

No. AffiliateTracking works out who's owed what, and you pay them yourself through PayPal, Wise or your bank.

Your Recurly billing,
now with affiliates.

Self-host for free: the code is open source. Or let us run it for you.