As businesses scale, manual workflows become bottlenecks. If you need a QR code for a single restaurant menu, generating it manually in a dashboard is fine. But what if you need to generate thousands of unique QR codes for product inventory, ticket bookings, personalized marketing flyers, or digital business cards?
That is where a QR Code API comes in.
By integrating a QR Code API into your application or database, you can programmatically generate, customize, and track QR codes in real-time.
In this guide, we'll walk through how the API works, its benefits, and how to automate your QR code generation using QR Zam’s API.
What is the QR Zam API?
The QR Zam API allows external software applications to send data (like a URL, contact details, or text) to our servers and receive a fully generated, ready-to-use QR code or image response.
With our API, you can generate:
- Static QR Codes: Encode the data directly inside the pattern (great for one-off Wi-Fi setups or simple text).
- Dynamic QR Codes: Encode a short, trackable URL pointing to our server, redirecting the user to the destination. Dynamic QR codes allow you to edit the target link later and track scan analytics.
Refer to the full QR Zam API Documentation for complete endpoint references.
Why Automate with the QR Zam API?
- Efficiency at Scale: Generate millions of unique QR codes automatically without human intervention.
- Dynamic Flexibility: Automatically generate dynamic codes during user sign-up or order checkout, ensuring each customer gets a personalized experience.
- Analytics Integration: Sync scan data (location, device, time) directly into your internal CRM or dashboard.
- Seamless Branding: Apply custom colors, shapes, frames, and logos programmatically to match your brand identity.
Step-by-Step: How to Use the QR Code API
Step 1: Get Your API Key
Before making requests, you need to authenticate your application:
- Log into your QR Zam Dashboard.
- Navigate to the API Management page.
- Generate or copy your API key (available as either a Public API Key for public image generation or a Secret API Key for admin management).
!CAUTION Treat your API key like a password. Never commit it to public git repositories or expose it on client-side code.
Step 2: Make Your First API Request
The base URL for all endpoints is https://api.qrzam.com/v1. To generate a dynamic link QR code, make a POST request to the /admin/qrcodes endpoint.
API Request Endpoint:
POST https://api.qrzam.com/v1/admin/qrcodes
Request Headers:
X-API-KEY: YOUR_SECRET_API_KEY
Content-Type: application/json
Request Payload (JSON):
{
"name": "Customer Receipt QR",
"active": true,
"dynamic": true,
"type": 0,
"data": {
"url": "https://yoursite.com/orders/12345"
},
"design": {
"backColor": "#FFFFFF",
"frontColor": "#4F46E5",
"logoSize": 100
}
}
Step 3: Parse the API Response
The API will return a standardized JSON response format containing the generated QR code metadata:
Response Payload (JSON):
{
"code": 0,
"message": "",
"timestamp": 1695256938,
"data": {
"id": "5035fd56-8b5d-4d69-a060-e42ffad81691",
"createdAt": "2023-09-21T00:42:19.583Z",
"updatedAt": "2023-09-21T00:42:19.583Z",
"name": "Customer Receipt QR",
"active": true,
"dynamic": true,
"type": 0,
"data": {
"url": "https://yoursite.com/orders/12345"
},
"design": {
"backColor": "#FFFFFF",
"frontColor": "#4F46E5",
"logoSize": 100
}
}
}
Now, your application can redirect users to their dynamic link or display their custom branded QR code.
Example Implementations
Here is how you can perform this API call in different programming languages:
Python Example
import requests
url = "https://api.qrzam.com/v1/admin/qrcodes"
headers = {
"X-API-KEY": "YOUR_SECRET_API_KEY",
"Content-Type": "application/json"
}
payload = {
"name": "Order Invoice QR",
"active": True,
"dynamic": True,
"type": 0,
"data": {
"url": "https://yoursite.com/invoice/9876"
}
}
response = requests.post(url, json=payload, headers=headers)
data = response.json()
print("QR Code ID:", data['data']['id'])
Node.js (JavaScript) Example
const axios = require("axios")
async function generateQR() {
const response = await axios.post(
"https://api.qrzam.com/v1/admin/qrcodes",
{
name: "Order Invoice QR",
active: true,
dynamic: true,
type: 0,
data: {
url: "https://yoursite.com/invoice/9876"
}
},
{
headers: {
"X-API-KEY": "YOUR_SECRET_API_KEY",
"Content-Type": "application/json"
}
}
)
console.log("QR Code ID:", response.data.data.id)
}
generateQR()
Best Practices for QR Code API Integration
- Use Vector Formats for Printing: Always request
SVGorPDFformat if you plan to print the QR codes on physical materials. - Implement Caching: Cache generated QR image references or download the output to your own cloud storage (like AWS S3) to optimize page load times.
- Utilize Public Endpoint for Simple Generation: For quick, unmanaged static QR codes, you can call
GET /public/qrcodes/generatewith query parameters.
FAQ
Does the API support custom logo uploads?
Yes! You can pass a logo URL or image path inside the design settings, and the API will place it center with proper rendering.
Where can I check the full endpoint list?
You can find the complete interactive documentation, including folder and landing page endpoints, directly at qrzam.com/api.
Start Automating Today
Ready to integrate QR codes into your tech stack? Get started with our developers' documentation.
