
Overview
Referly is affiliate tracking and management software with a native Creem connection. An affiliate shares a link or a discount code, Referly records the click, and when that visitor buys through your Creem checkout the sale arrives on a signed webhook and is credited to the right affiliate. Setup is one webhook in Creem, two values pasted into Referly, and one metadata field carried through your checkout. Sales, subscription renewals, trials, refunds and chargebacks all arrive through that single webhook.What you can do with Referly
Launch an affiliate program
Track referrals and sales
Product-based commissions
Affiliate promo codes
Affiliate self-service
Flexible payouts
What you'll need
- A Creem account (production or test mode, Referly follows the key you connect with)
- A Referly account (start here)
- A Creem API key, plus the signing secret of the webhook you create in step 3
How It Works
Creem hosts checkout on its own domain, so the affiliate referral needs a way to travel from your site into the sale. That is the one piece you wire up yourself, and it is a single metadata field.- A visitor clicks an affiliate link and lands on your site. The Referly tracking script stores the
referral in their browser and exposes it as
window.affiliateId. - They go to checkout, and you attach that referral to the Creem checkout as
referly_refmetadata. For payment links, a drop-in snippet from Referly does this for you. - Creem processes the payment and sends a signed webhook to Referly.
- Referly matches the referral (or the discount code used at checkout) to the affiliate, calculates the commission, and records it.
referly_ref from checkout metadata, not creem_ref. Creem reserves creem_ref
for its own built-in affiliate feature, so the two can coexist.Integration Steps
Eight steps, about twenty minutes including the test purchase.Create your affiliate program in Referly
- Reward and trigger: a cash commission (percentage or flat amount), earned when a customer makes a payment. Product-specific rates can be added later, once Creem is connected and Referly can list your products.
- Commission frequency: choose Recurring if you want subscription renewals to pay commission. First payment only pays once per customer and ignores renewals.
- Payout hold: how long commissions are held before payout. This is also your refund window. A refund inside the hold reverses the commission automatically; after the hold, the commission has been released for payout and is not reversed.
- Affiliate portal: the page your affiliates sign up on and where they find their links and codes.

The commission step of the program wizard: reward type, trigger, frequency and amount.
Open the Creem connect dialog in Referly

The Creem dialog shows your webhook URL and the two fields you'll fill in shortly.
Add the webhook in Creem
- Give it a name you will recognize later, for example “Referly”.
- Paste the webhook URL from step 2 as the endpoint URL.
- Check that every event type is selected. They are selected by default, so the counter should match the full list; leave it that way.
- Click Create webhook.
- Open the webhook you just created and copy its signing secret; you will paste it into Referly in step 5.

All event types are selected by default. Check the counter matches the full list, then click Create webhook.
Create a restricted API key
creem_test_ key connects the same way and tracks Creem
Test Mode purchases instead, which is how you run the test purchase in step 8.
Full access switched off, with only the permissions Referly uses granted.
Connect in Referly
- Paste the API key from step 4
- Paste the webhook signing secret from step 3, including its prefix
- Click Connect

Connected, with the Test mode badge when a creem_test_ key is used.
Add the Referly tracking script to your site
<head> of your marketing site. It records affiliate
clicks, stores the referral for your program’s cookie window, and exposes it as
window.affiliateId for the next step.YOUR_PROGRAM_ID with the id shown in your dashboard; the copy button in Referly fills it
in for you.
The tracking script step in Referly, with the copyable snippet.
Pass the referral into checkout
window.affiliateId and send it along with
the rest of your checkout request; your server puts it in metadata.referly_ref.Payment links: the snippet appends metadata[referly_ref] to every <a> element on the page
whose href points at creem.io/payment/ or creem.io/test/payment/. It handles links that
appear after page load (it watches the DOM, so client-side rendering, modals and pricing toggles are
covered), updates a link again if the referral changes from the raw ref to the click id, and
decorates a link once more on click as a last resort.Links you build in JavaScript: the snippet only sees anchor elements. If a button opens Creem
from code (for example window.open or location.href), append the parameter yourself as in the
third tab, or use the Checkout API.Verify with a test purchase
- Visit your site through an affiliate link. Take any affiliate’s link from your Referly portal (or your own test affiliate’s) and open your site with it. The click appears on that affiliate in Referly.
- Check the link carries the referral. Hover a Creem payment link on the page: its address now
ends in
metadata[referly_ref]=.... Checkout API integrations should log thereferly_refvalue they send instead. - Buy with a test card. Complete the checkout with card
4111 1111 1111 1111, any future expiry and any CVC. In Referly, the buyer appears as a referral and the order appears as a sale with the commission calculated for that affiliate. - Refund the order in Creem (Orders, open the order, Refund). Referly marks the sale refunded and reverses the commission. This works because the sale is still inside your payout hold; a refund after the hold is not reversed automatically.
- Resend the webhook. In Creem, open the webhook’s deliveries and resend the
checkout.completedevent. Referly de-duplicates by Creem order id, so nothing changes: still one sale, no second commission. - Test a coupon-only sale if you use affiliate codes. Give an affiliate a Creem discount code in Referly, open a fresh private window without any affiliate link, and check out using the code. The sale is credited to that affiliate through the code alone.
- In Creem, switch out of Test Mode and repeat step 3 for the live environment: the same webhook URL, every event type selected, Create webhook, then copy the live webhook’s signing secret.
- Create a live API key with the same restricted permissions as step 4.
- In Referly, click Disconnect in the Creem dialog, then connect again with the live key and the live signing secret. The Test mode badge disappears. Test-mode sales stay in Referly as history; live sales arrive on the same webhook URL from here on.
What Gets Tracked
Once you are connected, these all happen on their own:Refunds and chargebacks
A refund or chargeback reverses the commission only while the sale is inside your payout hold (the hold you set in step 1). During the hold, the sale is marked refunded and the affiliate’s commission is taken back in full. Partial refunds reverse the entire commission, not a proportional share. After the hold, the commission has already been released for payout. Referly acknowledges the refund webhook but changes nothing: the sale stays as it was, the commission is not reversed, and the dashboard’s manual mark-as-refunded action is blocked for the same reason. Settle it with the affiliate directly. If refunds are common in your business, set a payout hold that covers your refund policy.Good to Know
- Check the event selection first. A webhook saved with only some events ticked fails quietly.
- Coupon attribution works without the snippet. If an affiliate’s discount code is used at
checkout, the sale is credited through the code even when no
referly_refmetadata is present. - One Creem key per Referly program. A key already connected to another Referly program is rejected.
- Re-created the webhook? Update the signing secret. Deleting and re-creating the endpoint in Creem gives you a new secret; paste the new one into Referly’s connect dialog, or deliveries fail their signature check.