Refficks

Recurly affiliate tracking with Refficks

Recurly reports every paid invoice, refund and final chargeback, and Refficks reads each one with a read-only key, so subscription revenue credits the partner who brought the customer.

Nobody has walked these steps against a real Recurly setup yet. They are built from the provider's documentation, listed at the bottom of this page.

What it gives you

  • Every paid invoice (a first payment, each renewal, an upgrade, a one-off charge) is a sale on its amount before tax, however it was paid: by card, with account credit, or with a gift card's balance.
  • A refund takes back its share of the commission, to the card or to the customer's credit balance alike; a chargeback takes it back when Recurly reports it final.
  • Subscriptions are kept in step: trials, plan changes, pauses, cancellations, expiries and reactivations show on the customer's card.
  • A partner's coupon code on an invoice credits that partner, and so does a visitor id or link code in Refficks's custom fields.

What it does not

  • Buying a gift card earns nothing; the card earns when it pays an invoice.
  • A credit for a plan change is not a refund, and changes nobody's commission.
  • Shipping is not yet taken out of the amount a partner earns on.
  • Past invoices are not imported when you connect. If you need them, ask us: we can import them for you.
  • Recurly reports a chargeback only once it is final, and only with its chargeback feature on Adyen, Chase Orbital or Stripe. Without it Refficks never hears of one: cancel its commission on the Commissions screen.
  • A refund that is voided in Recurly does not give the commission back by itself. Your admins are told whose commission it was, and somebody takes the reversal back in History while nothing has been paid on it.
  • Sites still on Recurly's old invoices, without Credit Invoices, are not read.

Steps

These are the steps as they read inside Refficks. Where one says “below”, it means this guide's page in Refficks, where your own script, addresses and checks are.

  1. 1. Connect Recurly

    In Recurly, open Integrations → API Credentials → Add Private API Key. Name it Refficks and tick Read-Only. Refficks checks the key cannot change anything before keeping it, and refuses one that can.

    In Recurly, open Integrations → Webhooks and add an endpoint in JSON format; Refficks shows its address below once you connect. Copy the endpoint's secret key.

    Below, say where your Recurly site is hosted, paste the key and the secret, and press Connect.

    Tick the notifications listed below the address on the endpoint. Ticking more only fills the list of deliveries; ticking fewer means Refficks misses what you leave out.

    The connection is made on this guide in Refficks, once you have an account.

  2. 2. Put the Refficks script on your site

    Every page, including the one people sign up on. Recurly knows its own accounts, never the visit, so a buyer reaches Refficks from Recurly as somebody it has never seen unless your site said who they were first.

    Your copy of the Refficks script, with your own key in it, is on the Integrations page in Refficks.

  3. 3. Give each Recurly account your own user id

    Recommended. Create each Recurly account with the code your app already uses for the user (account: { code: user.id } in Recurly.js or your server), and say the same id to Refficks when the person signs up or signs in, with the script below. A Recurly invoice for that account is then a sale by somebody Refficks knows.

    Use an id nobody can guess, such as your user id, not a sequential number: anybody can say any id to Refficks from a browser.

    The code for this step is written for your account, and is on this guide in Refficks.

  4. 4. On Recurly's hosted payment pages

    Set the page's confirmation address to your own page with ?account=ACCOUNT_CODE on the end, and put the script below on that page. Recurly writes the new account's code in place of ACCOUNT_CODE, and the script says it to Refficks.

    If you pass no account code, Recurly uses the buyer's email address as the code, so the page says the address. Recurly Checkout, the newer page, does not say that it fills in ACCOUNT_CODE; use the custom field below there.

    The code for this step is written for your account, and is on this guide in Refficks.

  5. 5. Or pass the visitor in a custom field (Recurly Pro or Elite)

    In Recurly, create the custom fields refficks_visitor and refficks_ref on Subscription (Hidden, API only). When your server creates the subscription, set refficks_visitor to the visitor id the Refficks script keeps on your site, from the rk_vid cookie, as below. refficks_ref takes a partner's link code, if you already know it.

    Set them when the subscription is created: a field set afterwards reaches only later invoices. Recurly Starter has no custom fields.

    The code for this step is written for your account, and is on this guide in Refficks.

  6. 6. Give each partner their code in Recurly

    Create each partner's discount code as a Recurly coupon with the same code. An invoice that redeems it is credited to that partner.

  7. 7. Make a test purchase

    On a sandbox site, buy a plan. Its invoice arrives below with what it would have credited; a sandbox site never credits anybody. Recurly can take up to 48 hours to send from a sandbox.

Sources

Have an account? Open this guide in Refficks for your own script and the checks that show when it is working. New to Refficks? Create an account.

More in Checkouts and billing