# Referral QR Code for App Installs: A Per-User Link

> Build a referral QR code for app installs: encode a per-user referral link, show it in the app or print it, and credit the inviter after the friend installs.

_Last updated: 2026-10-26_

A referral QR code for app installs encodes a per-user referral link. The friend scans it with the phone camera, taps the link, installs the app, and signs up. The invitation follows the install, and your app claims the referral so the inviter is credited. The QR code is only the way the link reaches the phone.

This guide builds the in-person path: a link per inviter, a QR code in the app or on print, and a credit after the install. It uses the same referral link, claim and webhook as every other referral.

## Why a referral QR code needs a link behind it

A QR code is a printed string. If the string is a store URL, every scan lands on the store listing and the invitation is lost: nothing says who the friend met. If the string is a referral link, the scan starts the same path as a tapped message, and the install can be credited to the person who showed the code.

Both phone cameras decode the code and show the URL, and the friend taps it. That tap is a real tap on a link, which is what lets the app open when it is installed, and what starts the invitation when it is not. [QR code deep linking](https://warplink.app/blog/qr-code-deep-linking) covers the camera behavior in detail.

## Step 1: Create a referral link per inviter

Create the link when the user opens your invite screen, and store the link id with that user so the webhook can name the inviter.

```bash
curl -X POST https://api.warplink.app/v1/links \
  -H "Authorization: Bearer wl_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "app_id": "YOUR_APP_ID",
    "slug": "invite-ana",
    "destination_url": "https://example.com/invite",
    "is_referral": true
  }'
```

The response includes `short_url`. A link needs an app to be a referral link, and a request without one answers `400 VALIDATION_ERROR`.

## Step 2: Turn the link into a QR code

You have two routes, and they share the same link.

For print, such as a card, a poster or a staff badge, open the link in the dashboard and use its QR code dialog. Pick a size, switch the border on or off, and download the PNG. The code holds the short link, so you can change the destination later without reprinting.

For a code on the inviter's own screen, render the `short_url` with a QR library in your app. On iPhone, Core Image has a QR generator built in:

```swift
import CoreImage.CIFilterBuiltins
import UIKit

func qrImage(for urlString: String) -> UIImage? {
    let filter = CIFilter.qrCodeGenerator()
    filter.message = Data(urlString.utf8)
    filter.correctionLevel = "H"
    guard let output = filter.outputImage?
        .transformed(by: CGAffineTransform(scaleX: 10, y: 10)) else { return nil }
    return UIImage(ciImage: output)
}
```

Show it on the invite screen next to the share sheet: "Show this code to a friend."

## Step 3: The friend scans and installs

The friend points the camera at the code and taps the link it shows. From there the path is the one every referral link follows.

- With the app installed, the app opens on the destination you set.
- On Android without the app, the friend goes to Google Play, installs, and the SDK reads the invitation from the install referrer at first launch.
- On iPhone without the app, the friend sees a short invitation page, installs from the App Store, and taps the paste button in your app. [The iPhone path](https://warplink.app/blog/ios-referral-link-after-install) has the code.

A friend who already has the app counts as a referral only when **Count people who already have the app** is on for the app. It is off by default.

## Step 4: Claim after sign-up

Once the new user has an account, claim with your own id for them, such as a UUID stored in its own column:

```swift
WarpLink.claimReferral(installerId: user.warplinkId) { result in
    guard case .success(let claim) = result, claim.status == .claimed else { return }
    // Recorded. Your webhook grants the reward.
}
```

The first valid claim for an app and installer id wins, so a friend who scans two codes credits one inviter. Android, React Native and Flutter have the same call.

## Step 5: Grant the reward from the webhook

We send your backend a signed `referral.claimed` webhook. Look up the inviter from `data.link.id`, verify the signature, and grant the reward in your system. We credit the install and keep the record. Your backend grants the reward. [Verify a referral before you grant the reward](https://warplink.app/blog/verify-referral-before-reward) lists the checks, and [the store rules for referral rewards](https://warplink.app/blog/app-store-referral-rewards-rules) cover what you can offer.

## When to use one code per person or one per place

- **One per user:** the invite screen shows the user's own code. Each friend who installs is credited to that user.
- **One per host:** a gym front desk, an event table or a store counter shares one printed code. Create one link per host so the Referrals report separates them.
- **One per placement:** a poster in a lobby needs no inviter. Use a campaign link per placement instead, as in [QR code generators that open your app](https://warplink.app/blog/best-qr-code-generators-that-open-your-app).

## Print checklist

- Leave a blank border around the code and print it large enough to scan from the distance people stand.
- Use the highest error-correction level, which the dashboard PNG already uses.
- Test with a phone that has no copy of the app. [Referral Link Checklist: 20 Checks Before Launch](https://warplink.app/blog/referral-link-checklist-for-launch) lists the phone test.

## Frequently Asked Questions

### How do I make a referral QR code that works for app installs?

Encode a referral link, not a store URL. Create a link per user with `is_referral` set to true, render its `short_url` as a QR code, and let the friend scan and tap it. The invitation follows the install, and `claimReferral` credits the inviter after the friend signs up.

### Does the QR code carry the referral through the App Store?

The QR code only holds the link. The link carries the referral through the install: on Android through the Google Play install referrer, and on iPhone through the invitation page and the paste button in your app.

### Can WarpLink generate the QR image for each user?

You can download a QR code for any link from its page in the dashboard, which suits print. For a code per user inside your app, render the link's `short_url` with any QR library, such as Core Image on iPhone.

### Can a staff member or event host share one code with many people?

Yes. A printed code for one referral link credits the host for each friend who installs and signs up. Create one link per host so each person has their own results in the Referrals report.

### Does the friend need to scan from the inviter's screen?

No. The code can sit on a screen, a card or a poster. The friend scans it with the phone camera and taps the link it shows, which starts the same referral path as a shared message.

## Related Guides

- [QR Code Deep Linking](https://warplink.app/blog/qr-code-deep-linking): what a scan does and how to print it.
- [Referral Code vs Referral Link](https://warplink.app/blog/referral-code-vs-referral-link): when a typed code is the right fit.
- [Exact vs Estimated Referral Matches](https://warplink.app/blog/referral-attribution-exact-vs-estimated): what each match proves.
- [Referrals guide](https://warplink.app/docs/guides/referrals): links, claims, the report and troubleshooting.
- [QR and in-person referrals](https://warplink.app/use-cases/qr-referrals): the use case on one page.

## How WarpLink Helps

A referral QR code needs three things that a QR generator cannot give you. Linking puts a referral link behind the code so the scan opens the app or starts the invitation. Attribution credits the install that follows a tap on that link and records how it matched. Analytics shows the results in the Referrals report next to your other links. Your backend grants the reward from the signed webhook.

[Create a free WarpLink account](https://dash.warplink.app/auth/signup) and turn on **Referral link** for a link. The free plan covers 10,000 clicks a month. See [install attribution](https://warplink.app/install-attribution) for the wider picture.
