# Dynamic QR codes

URL: https://qrdx.dev/docs/dynamic-qr-codes
Source: https://github.com/qrdxinc/qrdx/blob/main/apps/docs/content/docs/dynamic-qr-codes.mdx

Print a QR code once, change where it points later, and see how often and where it is scanned.

A dynamic QR code encodes a short link such as `https://qrdx.dev/q/aB3dE5f` instead of your final URL. Scanning it opens the short link, which redirects to the destination you set. You can change the destination at any time, so printed codes never go out of date, and every scan is counted. Use one whenever a code goes on something you can't reprint cheaply: menus, packaging, posters, business cards.

**Needs a QRdx account**

Static QR codes from the playground and the `qrdx` library stay free and unlimited. Dynamic codes need an account: Free includes 10 active dynamic codes, Pro and Business have no limit. See [Plans and limits](https://qrdx.dev/docs/plans-and-limits).

In a hurry? The short task pages: [Create a dynamic QR code](https://qrdx.dev/docs/help/dynamic-codes/create), [Change where a code points](https://qrdx.dev/docs/help/dynamic-codes/change-the-link), [See your scans](https://qrdx.dev/docs/help/dynamic-codes/scans) and [Archive, delete and restore codes](https://qrdx.dev/docs/help/dynamic-codes/archive-and-delete). The short version, with what a free account gets, is on the [free dynamic QR code generator](https://qrdx.dev/dynamic-qr-code) page.

## How it works [#how-it-works]

The printed code never changes: it holds the short link. When someone scans it, QRdx checks the code's settings (is it paused, scheduled, password-protected, routed by device or location), records the scan without cookies, and redirects to the destination. Changing the destination, the design or the settings takes effect on the next scan.

## Create a code [#create-a-code]

**Dashboard:** open [Codes](https://qrdx.dev/dashboard?to=codes) and click **New code**. The **New dynamic QR code** dialog asks what the code opens: **Website link**, or one of the [hosted page](https://qrdx.dev/docs/landing-pages) templates. For a link, enter the **Destination URL** and an optional **Title**, then create the code. Download it as PNG, WebP or SVG from the code's **Overview** tab.

![The New dynamic QR code dialog: the destination URL field, the short link domain, an optional custom back-half and title, folder and tags, and the design preview.](https://qrdx.dev/docs-static/shots/new-code-dialog.light.webp)

**Playground:** choose the **URL** content type, enter your link and switch the link from **Static** to **Dynamic**. The QR code now holds a short link and keeps your design. If you edit the URL afterwards, click **Point it to the new address** to update the destination. **Save design to code** stores the current design with the code. The action bar's **⋯** menu has **Make it dynamic…** for a code you designed as static.

![The QRdx playground: the Content tab on the left with a website address filled in, the Static or Dynamic choice under it and a row of styles to start from, and the live QR code preview on the right.](https://qrdx.dev/docs-static/shots/playground-content.light.webp)

Destinations must be `http://` or `https://` links. Links with a username or password, and links to other QRdx short links, are rejected. Every destination also goes through [safety checks](https://qrdx.dev/docs/code-controls#safety-checks-on-links).

## Custom back-halves [#custom-back-halves]

Every code gets a random 7-character back-half, the part after `/q/`. On Pro and Business you can choose your own, such as `https://qrdx.dev/q/spring-menu`: fill in **Custom back-half** when you create or edit a code, and the dialog tells you as you type whether it's free.

- 3 to 64 characters: letters, digits, `-` and `_`, not starting or ending with `-`.
- Back-halves are case-sensitive, like generated ones: `Spring-Menu` and `spring-menu` are two different links.
- On `qrdx.dev` a back-half is unique across all of QRdx, and words that read as QRdx pages (`admin`, `api`, `docs`, `login`, `pricing`, `settings` and others) are reserved.
- On your own [custom domain](https://qrdx.dev/docs/custom-domains) it only has to be unique on that domain, and only a few technical words (`api`, `_next`, `null`, `undefined`) are reserved, so `go.yourbrand.com/pricing` works. Such a back-half belongs to the domain: it has no `qrdx.dev/q/` link.

Changing the back-half of a code changes its link: QR codes printed with the old one stop working, so download the code again.

## Manage a code [#manage-a-code]

Open a code from [Codes](https://qrdx.dev/dashboard?to=codes). Its page has three tabs: **Overview** (the short link, the QR code and its downloads, scan totals, **Use with NFC** and shortcuts to its options), **Analytics** and **Settings**. Above the tabs:

- **Edit link** changes the destination or title. The printed code keeps working and opens the new destination on the next scan.
- **Change type** turns a website link into a [hosted page](https://qrdx.dev/docs/landing-pages), a page back into a link, or a page into another page type. The short link and the scans stay. See [Change what a printed code opens](https://qrdx.dev/docs/help/dynamic-codes/change-the-type).
- The **⋯** menu holds **Edit design in playground** (the editor opens with the code still bound to its short link), **Duplicate**, **Share analytics...**, **Move to folder...**, **Move to workspace...**, **Pause** or **Resume**, **Archive** and **Move to trash**.

![The page of a dynamic code named Loyalty card: its short link, the address it opens, scan totals, the QR image with download buttons, and the options grid.](https://qrdx.dev/docs-static/shots/code-overview.light.webp)

**Duplicate** makes a new code with a new short link and no scans. It copies the destination, design, folder, tags, notes and type, and, when your plan includes them, the code's controls, routing, UTM and pixel settings.

**Archive** keeps the code but switches it off: the short link shows a "This QR code is no longer active" page until you restore it, and archived codes don't count toward your plan limit. **Move to trash** does the same and lets you delete the code forever from **Trash**, which also removes its scan history; the short link then shows a "QR code not found" page.

**Version history**, at the bottom of the **Settings** tab, records every change to the code (up to 100 versions). Restoring a version saves the current settings first, so a restore can be undone.

## Organize codes [#organize-codes]

- **Folders** nest up to 5 levels deep. Drag codes onto a folder or use **Move to folder...**. Deleting a folder moves its codes and subfolders up one level.
- **Tags** filter the list: pick several to see codes that have all of them.
- **Favorites and notes:** star codes and keep private notes; notes are searchable.
- **Search** covers titles, destinations, notes, tags and back-halves, so pasting a short link finds its code.
- **Bulk actions:** select codes to move, tag, pause, archive, favorite, trash or download them as a ZIP of PNG, WebP, GIF, BMP, ICO, TIFF, CMYK TIFF or SVG files.
- **CSV import:** **Codes** → **Import** in the sidebar (or **New code** → **Import codes** → **From a CSV file**) creates up to 10,000 dynamic codes from one file: destination, title, folder, tags and an optional custom back-half in a `slug` column. You can file every code into one folder and tag them all. A long import can be paused, and it picks up after a reload or a dropped connection without making any code twice. It ends with a results CSV (each row's short link) and a ZIP of the codes as PNG or SVG. Importing more than one row, and custom back-halves, need Pro.

![The Codes page listing dynamic QR codes with their short links, destinations, tags, scan counts and a seven-day sparkline.](https://qrdx.dev/docs-static/shots/codes-list.light.webp)

## Who can do what [#who-can-do-what]

Codes belong to the workspace they're created in. Owners, admins and members create and edit codes; members delete their own codes, owners and admins any code; viewers and billing members only look. A workspace's codes use the best plan among its owners and billing members. See [Workspaces and teams](https://qrdx.dev/docs/teams).

## Scan analytics [#scan-analytics]

A code's **Analytics** tab shows scans over time, unique visitors, QR scans and NFC taps, top countries and cities, devices, operating systems, browsers and referrers for the last 7, 30 or 90 days, 1 year or 3 years, or for all time since the first scan. Free shows the last 1 year; Pro and Business show everything. **Export CSV** downloads the scans in the selected range.

![The Analytics tab of a dynamic code: scans over time, and breakdowns by country, city, device, operating system and browser.](https://qrdx.dev/docs-static/shots/code-analytics.light.webp)

Each scan records the time (UTC), the country, region and city from the network, the device type, operating system and browser from the user agent, and the referrer's host name. Instead of an IP address it stores a salted hash of the address, user agent and day, which counts unique visitors per day and can't be turned back into the address. Known bots, link previews and browser prefetches aren't counted. On Pro and Business a code can also [ask scanners for their precise location](https://qrdx.dev/docs/precise-location). Full list: [What QRdx records when someone scans](https://qrdx.dev/docs/help/privacy-and-security/scan-data).

## Limits and plans [#limits-and-plans]

| | Free | Pro | Business |
| --- | --- | --- | --- |
| Active dynamic codes | 10 | Unlimited | Unlimited |
| Scans | Unlimited | Unlimited | Unlimited |
| Scan history | 1 year | All | All |
| Custom back-halves | No | Yes | Yes |
| CSV import | 1 row | Up to 10,000 rows | Up to 10,000 rows |
| Bulk creation through the API | No | Up to 1,000 per request | Up to 1,000 per request |

**Codes never die**

Downgrading never turns off existing codes. Over the limit you can still edit and archive codes; you can't create or restore more until you're under it. See [What happens to your codes if you stop paying](https://qrdx.dev/docs/help/account-and-billing/never-hostage).

## For developers [#rest-api]

Everything above is available through the REST API under `https://api.qrdx.dev/v1/codes`, with an [API key](https://qrdx.dev/docs/developers/api-keys) or an OAuth token that has the `codes:read` or `codes:write` scope.

- [List codes](https://qrdx.dev/docs/developers/api/list-codes), [create codes](https://qrdx.dev/docs/developers/api/create-codes), [get](https://qrdx.dev/docs/developers/api/get-code), [update](https://qrdx.dev/docs/developers/api/update-code) and [delete](https://qrdx.dev/docs/developers/api/delete-code) a code, and [read its scans](https://qrdx.dev/docs/developers/api/get-code-scans).
- On Pro and Business, `POST /v1/codes` takes an array of up to 1,000 codes in one all-or-nothing request, with an `Idempotency-Key` header so a retry never creates duplicates and `Prefer: return=minimal` to leave out each code's design. The details are on [Create codes](https://qrdx.dev/docs/developers/api/create-codes).
- `slug` chooses the back-half, `domainId` a custom domain, `kind` switches between a redirect and a page, and `preciseLocation` turns on the location step. Every code comes back with `shortLink`, `defaultShortLink` and `nfcLink`.
- Every error has the same shape: see [Errors](https://qrdx.dev/docs/developers/errors).

The [REST API](https://qrdx.dev/docs/developers/rest-api) page explains authentication and rate limits; the [quickstart](https://qrdx.dev/docs/developers/quickstart) creates your first code from the terminal.

## Self-hosting [#self-hosting]

Dynamic codes work on a self-hosted instance with two optional variables: `NEXT_PUBLIC_SHORT_LINK_BASE_URL` sets the origin of short links (it defaults to your app URL) and `SCAN_HASH_SALT` sets the salt for visitor hashes (without it, one is derived from `BETTER_AUTH_SECRET`). Country, region and city come from Vercel's geo headers; behind Cloudflare only the country is read, and elsewhere locations show as unknown. [Area rules](https://qrdx.dev/docs/precise-location#route-scans-by-area) use Vercel's IP coordinates when a scanner didn't share a location, so off Vercel they only match shared locations. Rate limits apply when Upstash Redis is configured. See [Self-hosting](https://qrdx.dev/docs/self-hosting#optional-services).

## Related [#related]

- [Code controls](https://qrdx.dev/docs/code-controls): pause, password, schedule and scan limits
- [Smart routing](https://qrdx.dev/docs/smart-routing): a different destination by device, country or time
- [Custom domains](https://qrdx.dev/docs/custom-domains): short links on your own domain
- [A code opens the wrong page](https://qrdx.dev/docs/help/troubleshooting/wrong-destination)
