# Send QR code scans to your app

> Encode a WarpLink link in a QR code so a scan opens your app or the right store page. Change the destination later and count taps per placement.

Page: https://warplink.app/use-cases/qr-code-to-app

A QR code that opens your app should encode a WarpLink link, not a store URL. The camera shows the link, the person taps it, and the phone opens the app or the right store page. Give each placement its own link, and the taps from scans are counted per poster, package or screen.

## How it works

1. **Make one link per placement.** Create a link for each poster, package, menu or slide, with a slug that names it, such as poster-union-station. Set the destination to the screen in your app you want scanners to reach.
2. **Download the code.** Open the link in the dashboard and use the QR code dialog: choose a size, switch the border on or off, and download a PNG at the highest error-correction level.
3. **Print with room around it.** Keep a blank border around the code and print it large enough to scan. A scanning distance of about ten times the code width is the working rule.
4. **Change the destination, not the print.** The code holds the short link, so you can edit the destination later without reprinting. Pause the link when a campaign ends, and its history stays.
5. **Cover people without the app.** A visitor without the app lands on the store page you set as the fallback. With the SDK in your app, the first launch after install opens the destination the scan was meant for.
6. **Compare placements.** Each link shows clicks, unique clicks, installs, device, country and referrer. A scan that opens the link is recorded as a click, so the busiest poster is easy to find.

## Create the link behind a code

### REST API (TypeScript)

```typescript
// One link per placement. The slug names the poster, so each scan maps to a placement.
const response = await fetch("https://api.warplink.app/v1/links", {
  method: "POST",
  headers: {
    // API key from Keys > API
    Authorization: "Bearer wl_live_YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    app_id: "3f9a1c2e-6b7d-4e1a-9c2f-8a5b1d0e7c44",
    slug: "poster-union-station",
    destination_url: "https://app.example/menu",
    tags: ["print"],
  }),
});

const link = (await response.json()) as { short_url: string };
// Download the QR code for link.short_url from the link's page in the dashboard.
```

## What you get

- **Linking.** A short link behind the code opens the app through Universal Links and App Links, or the right store page. The destination can change while the print stays the same.
- **Attribution.** Installs that follow a tap on a WarpLink link, in any channel, include installs that began at a printed code. With the SDK, the first launch opens the destination.
- **Analytics.** Per-link clicks, unique clicks, installs, device, country and referrer, so each placement has its own numbers.

## Questions

### Why not put the App Store URL in the QR code?

A store URL sends everyone to the store, including people who have the app, and it cannot change after printing. A link you control opens the app when it is installed and lets you edit the destination later.

### Does a scan open the app directly?

The camera decodes the URL and shows it. The person taps it, which is a real tap, so Universal Links and App Links hand off to the installed app.

### Can I change where a printed code goes?

Yes. The code holds the short link. Edit the link's destination in the dashboard and the printed code follows.

### How big should the code be?

Print it so the scanning distance is about ten times the code width, and keep a blank border around it. The PNG from the dashboard uses the highest error-correction level.

### Can I see which poster got the most scans?

Yes, when each placement has its own link. The link page shows clicks, unique clicks, installs, device, country and referrer.

### Can I create codes from a script?

Create links with a POST to /v1/links, then download each code from the link's page in the dashboard.

## Related

- [QR codes and deep linking](https://warplink.app/blog/qr-code-deep-linking)
- [QR code generators that open your app](https://warplink.app/blog/best-qr-code-generators-that-open-your-app)
- [Deep linking](https://warplink.app/deep-linking)
- [Deferred deep linking](https://warplink.app/deferred-deep-linking)
- [Campaign attribution for apps](https://warplink.app/use-cases/campaign-attribution-for-apps)
