A referral code is a unique identifier, usually a short string of letters and numbers like MARIA10, that attributes a new customer to the person who referred them. Enter it at signup or checkout and the business knows exactly who sent you, and it can reward one or both sides.
That’s the glossary answer to “what is a referral code,” and every page ranking for this question stops right about there. I run code-based attribution in production, so this guide covers what the glossaries skip, which is where it gets genuinely interesting: how a code resolves to a person server-side, what happens when a cookie and a code disagree, and how to launch a code program of your own, step by step.
TL;DR: A referral code is a short, unique identifier (like MARIA10 or X7K2-9QPD) that a business assigns to one specific customer or partner; when a new customer enters it, the tracking system looks up the code’s owner, records the conversion, and issues rewards to both sides. Unlike a referral link, a code needs no click and no cookie; the buyer carries it in their head, which is why codes survive podcasts, screenshots, and word of mouth where links fail.
What is a referral code?
A referral code is a unique alphanumeric string that a business assigns to one specific person so that new customers who enter it can be credited to that person. If you want the referral code meaning in one line, or a friend asks what’s a referral code, the answer’s the same: it’s the string that names your referrer. So what does a referral code mean beyond that? The fuller definition has three parts: a code is unique (one owner per code), human-shareable (short enough to say out loud or type from memory), and attributional (its whole job is answering “who sent this customer?”).
Codes come in two broad formats:
- Name-based codes like MARIA10 or GRAHAM20. Readable, memorable, easy to say on a podcast. Best for partners and advocates who actively share.
- Random codes like X7K2-9QPD. Unguessable and collision-proof. Best when codes are auto-generated for every customer, or when guessability would invite abuse.
Who gets one depends on the program. In a customer referral program, every existing customer typically gets a code automatically (that’s the answer to “what is my referral code”: check the profile, rewards, or invite tab of the app). In an affiliate or influencer program, codes go to approved partners, often alongside a tracking link; I unpacked the affiliate vs referral split separately if you’re weighing the two models. You’ll also hear “invite code” used interchangeably; the table below covers the one real distinction.
Referral code vs promo code vs invite code vs referral ID
The four terms get blurred constantly, so here’s the clean version. The load-bearing distinction: a promo code attributes a sale to a marketing campaign, while a referral code attributes it to a person.
| Term | Attributes the sale to | Who holds it | Typical example |
|---|---|---|---|
| Referral code | One specific person | An existing customer or partner | MARIA10 |
| Promo code | A campaign or offer | Anyone; it is broadcast publicly | SUMMER25 |
| Invite code | A person, and sometimes gates access | An existing member | Early-access apps, private betas |
| Referral ID | One specific person (same as a referral code) | Same holder; just a different label | Often numeric, like 48291 |
The overlap is real, though: plenty of referral codes double as promo codes because they carry a discount. The difference lives in the tracking system, and it clarifies everything: SUMMER25 tells the business “the summer campaign worked,” while MARIA10 tells it “pay Maria.”
How do referral codes work?
Referral codes work as lookup keys: when a new customer enters a code, the business’s system looks up which person owns that exact string, records a conversion against them, and triggers the rewards once any qualifying conditions are met. The buyer’s side needs no technology at all: no cookie, no click, no app; they just remember the string and hand it over at checkout. Three mechanical layers make that work, and each one’s simpler than you’d guess.
How a code maps to one person
Under the hood, a referral code is a value in a database table, pointing at exactly one customer or partner record. When Maria joins a program, the system mints her code and stores the pair: MARIA10 -> maria's account. Every future redemption is a lookup against that table, and that’s all the machinery there is: one table, one lookup, and the whole “who sent this customer?” question is settled.
Two things have to be true at mint time for this to work at scale:
- Uniqueness is enforced at generation, not hoped for. A collision, two people holding the same string, would make attribution ambiguous, so serious systems check every candidate against every existing code, and a vanity-code request for a taken name gets rejected, exactly like a username.
- Uniqueness is enforced regardless of case. Buyers type codes in whatever case they feel like, so well-built systems match them case-insensitively; Stripe, for instance, requires active promotion codes to be unique regardless of case. MARIA10 and maria10 must never belong to two different people.
Here’s a detail only operators think about: reserve your namespace. If public promos look like SUMMER25 and referral codes look like MARIA10, keep the formats visibly distinct and block referral signups from claiming campaign-style names; otherwise someone eventually registers the vanity code SALE20 and collects commissions on buyers who thought they were typing a generic promo. Clever play on their side, easy block on yours.

What happens when a referral code is redeemed
When a buyer claims a referral code at checkout or signup, 5 things happen in sequence, usually within a second or two:
- The code is validated. Does it exist, is it active, has it expired, has this buyer already used one?
- The owner is resolved. The system looks up the code and finds the referrer’s record.
- The conversion is recorded with the order value, the buyer, the code, and the owner. This record is the source of truth for everything downstream.
- The buyer-side reward applies immediately. The discount comes off the order, or the credit lands in the new account.
- The referrer-side reward is computed and held as pending. Pending, not paid, because refunds exist.
Now the fun part: real numbers. Say you sell a $40/mo product, Maria’s code gives new customers 10% off for their first 3 months, and Maria earns a 20% recurring commission.
A buyer redeems MARIA10. They pay $36/mo for months 1 through 3, then $40/mo after. Maria’s commission, computed on what the customer actually paid, is $7.20/mo for the first 3 months and $8/mo thereafter. If the customer refunds in month 2, that month’s $7.20 is clawed back from Maria’s pending balance before any payout goes out. Over a 12-month retention, Maria earns $93.60, the customer saved $12, and you gave up $105.60 total to acquire a customer worth $468 in first-year revenue. I love that the whole program grades out to one figure: a 22.6% blended acquisition cost, and that’s the number to judge it by.
Notice the design choice buried in there: commission on the discounted amount, not the sticker price. Decide that one on purpose; get it backwards in either direction and you’ll be having an awkward conversation with either your finance team or your referrers.
Referral codes vs referral links vs cookies
A referral link does the same attribution job with a URL parameter and a cookie instead of a typed string; I dissected that whole pipeline in what is an affiliate link. The two mechanisms fail in opposite places, which is exactly why mature programs issue both:
| Referral link | Referral code | |
|---|---|---|
| Buyer effort | One click | Remember the code and type it |
| What can break it | Ad blockers, expiring cookies | Nothing; the buyer carries the attribution |
| Works in audio, print, and in person | No; there is nothing to click | Yes: podcasts, TV screens, screenshots, conference booths |
| Click analytics | Full funnel, from click to sale | Blind until the code is redeemed |
| Best channels | Blogs, newsletters, YouTube descriptions | Audio, video, print, in-person |
The link column’s weakness is that its attribution lives in a browser: ad blockers can stop the tracking script, and Safari’s Intelligent Tracking Prevention caps script-set cookies at 7 days. A code has nothing to block and nothing to expire; the price is typing friction and no click to count at the top of the funnel. It’s a fair trade. But that blind top of funnel also buys you something: every redemption you do see came from a buyer who cared enough to type the code, which is unusually clean intent data.
My rule of thumb: links for channels where clicking is natural, codes for channels where it isn’t. Both pointing at the same person in the same tracking system.
Real referral code examples from brands you know
The fastest way to build intuition for program design is to read real programs side by side, and the pedigree here is hard to beat: Dropbox’s referral program famously took the company from 100,000 to 4,000,000 users in 15 months, roughly 3,900% growth by Drew Houston’s own numbers. Here are 5 programs, verified against each one’s own pages:
| Brand | Code style | Referrer gets | New customer gets | Qualifying action |
|---|---|---|---|---|
| Tesla | Personal link/code | $250 in Tesla Credits (expire after 12 months) | 3 months of Full Self-Driving (Supervised) on Model 3/Y | Complete a vehicle purchase; capped at 10 referrals per calendar year |
| Dropbox | Personal invite link | 500 MB per referral (Basic, up to 16 GB) or 1 GB (paid plans, up to 32 GB) | 500 MB bonus space | Friend installs the desktop app, signs in, and verifies email |
| Coinbase | Personal code/link | $10 in crypto | $10 in crypto | Friend verifies ID and trades $100+ within 180 days |
| Cash App | Short code entered in-app | $5 | $5 | Friend enters the code within 14 days, links a debit card, and sends a $5+ payment |
| Fetch | Plain code, QR, or link | 2,000 points | 2,000 points | Friend snaps their first receipt; no referral limit |
I’ve noticed consumer programs tune these terms constantly, sometimes mid-quarter, so treat the linked program pages as the source of truth; I checked the figures above in July 2026.
Read the last column closely; not a single program pays out on signup alone. Each qualifying action is a fraud gate, and it’s smart design: it makes the reward expensive to farm with fake accounts while staying trivial for a genuine new user. That’s the pattern to copy in the walkthrough below.

Single-use vs evergreen referral codes
An evergreen code belongs to a person and works indefinitely; a single-use code dies after one redemption. Most of the examples above are evergreen: Maria’s code is Maria’s code for as long as she’s in the program, and a hundred people can redeem it. That’s the right default for advocates, because the code becomes part of their identity (“use code MARIA10”).
Single-use codes earn their complexity in three situations:
- High-value rewards. If each redemption costs you $250, you want each code spendable exactly once, issued to a known person.
- Controlled offers. A win-back campaign or VIP tier where total redemptions must be capped precisely.
- Gated access. Beta invites where each existing member gets 3 codes, full stop.
Also, expiry is a separate dial from use count. Expiring codes create urgency and limit long-tail liability; evergreen codes maximize redemptions. And here’s a piece of prior art worth stealing: Buyapowa reports that Wealthsimple lets customers apply a referral code up to 30 days after signing up, converting “I forgot to enter my friend’s code” from a support ticket into a recovered referral. A post-signup grace window costs a little attribution strictness and buys a lot of goodwill; I’d make that trade every time.

The edge cases every glossary skips
Everything above is how codes work when everyone behaves. Programs get judged by the other days, and every one of these cases has a clean answer you can set up in advance.
Code leakage to coupon aggregators. The moment a code carries a discount, it’ll end up on coupon sites, usually within days. Buyers who were never referred find it via a “10% off” search, and your referrer gets credited (and paid) for demand they didn’t create; it’s not fraud, but it inflates their numbers and your acquisition costs. A casual customer program can sometimes shrug it off (the discount still converted a fence-sitter), but the moment a code is supposed to measure a specific paid partner, revoke it and reissue; influencer programs feel this one even more, and I covered the playbook in influencer discount codes.
Self-referral. Someone signs up using their own code: discount for the new account, reward for the old one. Every serious platform blocks the exact-match case automatically, but determined self-referrers use a second email. The real defenses are the qualifying actions from the examples table (a linked debit card is hard to duplicate) and payment-fingerprint checks.
One code going viral. A partner’s code hits a big Reddit thread and produces 4,000 redemptions in a weekend. Triumph or incident? Both, and the time to decide your policy is beforehand: velocity alerts, a manual-review threshold on pending rewards, and cap structures like Tesla’s 10-per-year all exist for exactly this moment. Set them up on a quiet afternoon and the viral weekend becomes purely good news!
The cookie and the code disagree. A buyer clicks Dev’s link on Monday (cookie stored), then checks out on Friday with Maria’s code typed in. Who gets paid? My stance, stated plainly: the entered code should beat the stored cookie, every time. The cookie records something a browser did days ago; the code records something the buyer deliberately did at the moment of purchase, and deliberate beats ambient.
Whichever rule you pick, write it down where partners can read it and apply it without exceptions. A published rule turns your first attribution dispute into a quick, friendly email instead of a trust incident.
Refunds and chargebacks. A conversion isn’t revenue until the refund window closes. Rewards should sit in a pending state long enough for clawbacks to net against them, which is why the payout step below has a holding period built in.
How to create a referral code program: step by step
You can stand up a working code program in an afternoon, and it’s a satisfying build; here’s how to create referral codes for your business in 8 steps, each one a decision worth making deliberately rather than by default (the full cash-commission version of this walkthrough is my guide to building a SaaS affiliate program).
- Define the two-sided reward and the qualifying action. Decide what the referrer earns, what the new customer gets, and, critically, what the buyer must do before anything pays out: reward the action that proves a real customer (a first payment, a verified account plus real usage), never the signup alone.
- Pick a naming convention. Readable owner slug plus a numeric suffix (MARIA10) for partners who share publicly; auto-generated random codes when every customer gets one. You don’t need a standalone referral code generator; any referral tracking software will generate referral codes automatically with uniqueness enforced. If you allow vanity codes, ban ambiguous characters (0/O, 1/l/I), reserve your promo-code namespace, and match case-insensitively.
- Pair every code with a real discount. This is the step most first-time programs skip, and it’s why their codes go unused. A bare attribution code asks the buyer to do data entry for someone else’s benefit; a code worth 10% off gives them a selfish reason to type it, and buyer-side motivation is the entire engine of a code program.
- Wire the tracking so every redemption resolves to an owner and an order value. The code needs to connect to your billing system, not sit in a spreadsheet, because attribution without the order amount can’t compute percentage rewards, and attribution outside billing can’t see refunds.
This is the layer we built Rekomi’s coupon attribution for: Rekomi mints per-affiliate Stripe promotion codes off a parent campaign coupon (a Growth and Pro plan feature), credits the owning partner the moment a customer redeems one at checkout (no click and no cookie required), and reverses the commission automatically if the order refunds. Partners can even self-mint vanity codes from their portal when you enable it, and all of it works from day one on a Rekomi trial.
- Set the attribution rules and write them down. Code vs link precedence (see my stance above), the attribution window, first-touch or last-touch when two referrers collide, and whether codes apply retroactively post-purchase. Publish them to your partners: four decisions on one page, and this step’s done.
- Add the fraud guards. Self-referral blocking, a velocity alert for redemption spikes, and a pending period on rewards that outlasts your refund window. An hour of setup here buys you a calm, boring first quarter, which is exactly the kind you want.
- Set the payout path and threshold. Decide how referrers receive money or credit, on what schedule, and above what minimum balance. Account credit is trivial; cash requires a payment rail, tax handling, and per-country support, and I wrote up the full mechanics in how affiliate payouts actually work.
- Instrument and iterate. Watch redemption rate per code issued, revenue per redemption, refund rate on referred orders vs organic, and the concentration of your top sharers. A program where 5 people drive 80% of redemptions wants deeper partner rewards; broad shallow sharing wants a lower-friction buyer offer.
Referral code FAQ
Is a referral code the same as a promo code?
No. A promo code attributes a sale to a marketing campaign and is broadcast to everyone; a referral code attributes a sale to one specific person and is unique to them. Plenty of referral codes also carry a discount, so they feel identical to the buyer, but in the tracking system one answers “which campaign worked” and the other answers “who gets the reward.”
Where do I find my referral code?
In almost every app, your referral code lives under Profile, Account, Rewards, or an “Invite friends” menu item. If you can’t find a code, search the app’s help center for “referral”; some programs give you a shareable link instead of a plain code, and a few (like Cash App) only surface the entry field to new users during their first 14 days.
How do I get a referral code?
It depends which side you’re on. As a customer, you usually get one automatically just by having an account: open the app’s rewards or invite section and your code is waiting. As a business, the way to make a referral code is through your referral or affiliate platform, which mints a unique one per customer or partner; the 8-step walkthrough above covers the decisions involved.
Do referral codes expire?
Some do, some don’t; the program’s terms are the only reliable answer. Personal evergreen codes typically last as long as the account, while promotional offers and earned rewards often have their own clocks (Tesla’s referral credits, for example, expire 12 months after they’re granted). If a code fails at checkout, expiry and prior use are the two most common reasons.
Can I use my own referral code?
Definitely not, and every well-run program blocks it. Redeeming your own code (directly or through a second account) is self-referral, the most common form of referral abuse; programs enforce the ban with account matching, payment fingerprinting, and qualifying actions that are hard to fake, and attempting it typically forfeits the rewards.
Are referral codes case sensitive?
Almost never in well-built systems, but don’t rely on it. Stripe, for example, enforces that active promotion codes are unique regardless of case, and most checkout systems match codes case-insensitively because buyers type in whatever case they like. Codes display in uppercase by convention, not because the capitals matter; if a legitimate code is rejected, retype it exactly as shown before assuming case is the problem.
What is a referral ID?
A referral ID is the same thing as a referral code: a unique identifier that maps a new customer to their referrer. Some platforms expose it as a numeric database identifier (48291) rather than a friendly string (MARIA10), and some use “referral ID” for the internal identifier while the shareable “referral code” is an alias pointing at it. Mechanically, both are lookup keys to the same record.
Go find a code in the wild
The fastest way to make all of this concrete: go find your own referral code in an app you already pay for (profile or rewards tab, 2 minutes) and read its qualifying action and reward structure against the design decisions above. You’ll never look at a “use code JESS15” callout the same way again.
And if it’s your program on the line, you can have real codes attributing real revenue this week: open a free 14-day Rekomi trial, create a campaign, and mint a coupon code for your first partner. The first redemption arriving with a name attached is my favorite moment in this whole business; it’s when a referral program stops being theory.



