1. When Batch Generation Is Required
Single-code generation works for one-off use cases. Batch generation via API is required when:
- Each code is unique per unit (serialised product, personalised mailer, event ticket).
- Volume is too high for manual generation (1,000+ codes per batch).
- QR generation is part of an automated workflow (order fulfilment, asset tagging, print job preparation).
2. Common API Approaches
Most QR generation APIs accept a POST request with payload parameters and return a PNG, SVG, or base64 string:
```json
POST /v1/qr/batch
{
"codes": [
{ "id": "unit-001", "data": "https://example.com/product/001" },
{ "id": "unit-002", "data": "https://example.com/product/002" }
],
"format": "svg",
"errorCorrection": "M",
"size": 400
}
```
Responses are typically a job ID with a webhook or polling endpoint for large batches.
3. Rate Limits and Throttling
Production QR generation APIs enforce rate limits (e.g., 500 requests/minute, 100,000/day on standard tiers). For very large runs (100,000+ unique codes), use an async batch job model: submit the full payload list, receive a job ID, and poll or await a webhook callback when the batch is complete.
4. Open-Source Self-Hosted Options
For volume that would incur significant API cost, self-hosting a QR generation library is the right choice:
-
qrcode (Python): Generate QR PNGs locally.
-
node-qrcode (Node.js): Generate SVGs and PNGs server-side.
-
ZXing (Java): Mature, full-featured, used in enterprise production.
Self-hosted generation eliminates API cost and data privacy concerns (payload data never leaves your infrastructure).
5. Webhook Integration for Print Workflows
In automated print workflows, the QR generation job completion webhook triggers the next step: sending the generated QR image set to the variable data printing (VDP) system, which merges them onto a template and sends the print job to the press. A complete workflow can go from order data to press-ready file with no human intervention.
Putting this into practice
Start with the smallest real test you can run. Generate the code, print it at the exact size you plan to use, and scan it with two different phones in the lighting where it will live. Check that the destination page loads quickly on a mobile connection and that the call to action next to the code tells people what they will get. If anything feels slow or unclear, fix it before you print a full batch, because reprints cost more than a short test. Keep a note of the size, material, and placement that worked so the next batch starts from a proven setup.
Common mistakes to avoid
The most common mistakes are easy to avoid once you know them. Long payloads make modules tiny, low contrast makes edges hard to read, and text placed too close to the border eats the quiet zone the scanner needs. Covering a corner finder pattern with a logo or a sticker breaks detection entirely, and a code placed behind glare or on a curved surface fails even when the print is perfect. Review each of these points on a proof copy, and treat any failure as a reason to adjust the design rather than a reason to blame the scanner.
Quick checklist
- Keep the payload as short as practical so modules stay large.
- Keep dark modules on a light background with strong contrast.
- Leave a clear quiet zone on all four sides of the symbol.
- Test the printed code at the real viewing distance and lighting.
- Confirm the destination page loads fast on a phone.
- Recheck the code after any change to the link, design, or placement.
Related tools and guides
- Use the [QR size calculator](/qr-size-calculator) to match the printed size to the expected scan distance before you commit to a print run.
- The [error correction simulator](/error-correction-simulator) shows how damage tolerance changes the density of the symbol at each level.
- Test every code with the [QR scanner](/qr-scanner) on more than one phone before you publish or print it.
- Create a fresh code with the [URL QR code generator](/url-qr-code-generator) when the destination is a web page.
- Run unfamiliar destinations through the [QR safety checker](/qr-safety-checker) before you share a code widely.
- The [blog](/blog) collects more guides on sizing, printing, security, and payments for QR codes.