MizQR API tutorial: create and update QR codes with Node.js
Connect your own server workflow to a saved dynamic QR. This tutorial uses one small Node.js file to create a URL QR, keep its short link while changing the destination, and read scan totals. Use a verified workspace with current API access and keep the key on your server.
Download a server-side Node.js example to create a dynamic QR, update its destination and read recorded scan totals.
01
Prepare your workspace and server
Create a management key from Developer settings and copy the base URL shown in the API reference. The downloadable setup file includes PowerShell and Bash instructions. The example uses Node.js 22 or newer and needs no npm installation.
Check current API eligibility and dynamic-code allowances
Use a separate key per integration
Keep keys out of browser bundles and public repositories
02
Save a QR, then update that same record
POST /qrs creates a dynamic URL QR and returns data.id and data.short_url. Keep the returned UUID for PATCH /qrs/{id}; the short-code segment is a different value. Updating the destination preserves the short link that belongs in the printed artwork.
Create uses a real workspace record and the applicable allowance
The response is JSON; export PNG/SVG artwork from the workspace
A printed static QR cannot be edited through this workflow
03
Read activity and handle failures deliberately
GET /qrs/{id}/analytics returns recorded scans. Optional from/to dates use the workspace time zone; zero is a valid result. The example reports status and field names and never retries automatically, because a failed connection can follow a successful write.
Check the saved record before repeating an uncertain create/update
Respect Retry-After when the API rate-limits a request
Keep scans separate from completed orders, enquiries and revenue
A working starting point for your integration
Create, update and measure one dynamic QR.
Download a small Node.js 22+ example with no npm dependencies. Run it on your server or development computer, using an API-enabled workspace and a management key from Developer settings.
What the example does
Action
API request
Result
Create
POST /qrs
One saved dynamic URL QR, with a UUID and short link.
Update
PATCH /qrs/{id}
A new destination behind the same printed short link.
Measure
GET /qrs/{id}/analytics
Recorded scan totals for the chosen reporting period.
Keep credentials on your server.
Copy the API base from the reference and set MIZQR_API_BASE and MIZQR_API_TOKEN in your server environment. The setup file includes PowerShell and Bash instructions that prompt for the key. Use the UUID returned in data.id for later calls.
# After setting your server's API base and key:
node mizqr-api-example.mjs create --title "Menu campaign" --url https://example.com/menu
# Replace QR_ID with the UUID returned in the create response:
node mizqr-api-example.mjs update QR_ID --url https://example.com/new-menu
# Choose your reporting dates:
node mizqr-api-example.mjs analytics QR_ID --from 2026-11-01 --to 2026-11-14
The create command adds a real record and uses your plan allowance. It returns JSON; export the saved QR’s printable artwork from the workspace. Changing a dynamic destination keeps its short link, while an existing static QR stays as encoded.
Handle an uncertain result before retrying.
The example reports validation fields and rate-limit timing without logging your key or private error values. It does not retry writes automatically: a lost response can follow a successful save. Check the workspace before repeating a create or update. Scan totals can be zero and do not establish sales or bookings.
Prepared by the MizQR product team · Updated 14 November 2026. The repository includes offline request and error-handling tests.
Continue with MizQR
Put this guidance to work.
Open the relevant MizQR tool or workspace section to continue.