API v1 · Production ready

QR Code & Barcode API

Generate QR codes, UPI payment QR codes, and barcodes with optional logo embedding. Support for Code128, EAN-13, UPC-A. Binary and URL output modes.

Get started free Documentation GETPOST https://api.corenexis.com/qr-barcode/v1
99.9%Uptime SLA
<100msAvg Generation Time
6Output Types
UPIPayment QR Ready
Features

Everything you need

Generate QR codes, barcodes, and UPI payment codes with a single API call.

QR Code Generation

Standard QR codes for text, URLs, contacts, WiFi, and any data up to 4,296 characters.

UPI Payment QR

Generate UPI-compatible QR codes that work with Google Pay, PhonePe, Paytm, and all UPI apps.

Barcode Generation

Code128, EAN-13, and UPC-A barcode formats for retail, logistics, and inventory.

Image-to-QR

Upload any image and get a QR code that opens the image directly when scanned.

Pricing

Simple, transparent pricing

Start free and scale as you grow. No hidden fees.

Free
Free
  • 50 generations/month
  • 5 requests/minute
  • QR code generation
  • UPI payment QR generation
  • All barcode formats (Code128, EAN-13, UPC-A)
  • Image-to-QR generation
  • Up to 300px output size
  • Text, URL & contact QR codes
Start Free
Starter
$2.99 /mo
  • 500 generations/month
  • 20 requests/minute
  • QR code generation
  • UPI payment QR generation
  • All barcode formats (Code128, EAN-13, UPC-A)
  • Image-to-QR generation
  • Logo embedding (up to 512 KB)
  • Up to 600px output size
  • Google Drive & CDN logo support
  • Email support
Get Started
Most popular
Pro
$9.99 /mo
  • 5,000 generations/month
  • 30 requests/minute
  • QR code generation
  • UPI payment QR generation
  • All barcode formats (Code128, EAN-13, UPC-A)
  • Image-to-QR generation
  • Logo embedding (up to 2 MB)
  • Up to 1000px output size
  • Google Drive & CDN logo support
  • Priority support
Get Pro
Agency
Custom
  • Unlimited generations
  • Custom rate limits
  • QR, UPI & all barcode formats
  • Image-to-QR generation
  • Logo embedding (custom limits)
  • High-resolution output
  • 24/7 priority support
Contact Sales
Documentation

API reference

Everything you need to integrate the QR Code & Barcode API.

Authentication

All API requests require authentication using your API key. Send it via the X-API-KEY header with every request.

Header
X-API-KEY: your_api_key_here

Get your API key. Sign up at dash.corenexis.com to get your API key instantly.

API endpoint

GETPOSThttps://api.corenexis.com/qr-barcode/v1

The API accepts both GET and POST requests. Use GET for simple requests and POST when uploading logo or image files.

Output mode

By default the API returns raw binary PNG image directly — ideal for piping, saving to file, or embedding. Set output=url to receive a JSON response with a CDN URL instead.

Parameter Type Description
output String binary (default) — raw PNG image with metadata in response headers. url — JSON response with CDN URL (expires in 2 hours).

Common parameters

Parameter Type Description
X-API-KEY Header String Your API key (required in request header)
type Required String Generation type: qr, upi, code128, ean13, upc, image
size Integer Output width in pixels. Min: 100, Max: 1000. Default: 300
logo String / File Logo to embed in center. Accepts: public image URL, Google Drive link, or file upload (POST). Works with qr, upi, and image types.

Generation types

All generation types are available on every plan. Plans differ in output size, logo size limits, rate limits, and monthly quota.

QR code — type=qr

Generate standard QR codes for text, URLs, vCards, WiFi, or any data.

Parameter Type Description
data Required String Content to encode. Max: 4,296 digits (numeric), 2,611 chars (alphanumeric), or 1,273 bytes (UTF-8/binary).

UPI payment QR — type=upi

Generate UPI-compatible payment QR codes that work with Google Pay, PhonePe, Paytm, and all UPI apps.

Parameter Type Description
pa Required String UPI ID (e.g. name@upi). Max: 50 characters.
pn String Payee display name. Max: 100 characters.
am Number Amount in INR. Max: ₹1,00,000. Omit for dynamic amount.
tn String Transaction note. Max: 80 characters.

Barcodes — type=code128 / ean13 / upc

Parameter Type Description
data Required String Code128: Any text, max 80 characters.
EAN-13: Exactly 13 digits.
UPC-A: Exactly 12 digits.

Image-to-QR — type=image

Upload an image and receive a QR code. When scanned, the image opens directly in the browser.

Parameter Type Description
data or image Required String / File data: Public image URL (Google Drive, CDN, direct link). image: File upload via POST. Max: 5 MB. Supported: PNG, JPG, WEBP, GIF.

Logo support. Logo embedding works with qr, upi, and image types. Provide via public URL (including Google Drive and CDN links without extensions), or as a file upload via POST. Free plan does not include logo support.

Supported types overview

qr · upi · code128 · ean13 · upc · image

Code examples

Simple QR code

# Binary output — save PNG directly
curl -H "X-API-KEY: your_api_key" \
  "https://api.corenexis.com/qr-barcode/v1?type=qr&data=https://google.com" \
  --output qr.png

# URL output — get JSON with CDN link
curl -H "X-API-KEY: your_api_key" \
  "https://api.corenexis.com/qr-barcode/v1?type=qr&data=https://google.com&output=url"
// Binary — get image directly
const response = await fetch('https://api.corenexis.com/qr-barcode/v1?type=qr&data=https://google.com', {
  headers: { 'X-API-KEY': 'your_api_key' }
});
const blob = await response.blob();
document.getElementById('qr').src = URL.createObjectURL(blob);

// URL — get JSON with CDN link
const res = await fetch('https://api.corenexis.com/qr-barcode/v1?type=qr&data=https://google.com&output=url', {
  headers: { 'X-API-KEY': 'your_api_key' }
});
const data = await res.json();
console.log('QR URL:', data.data.url);
import requests

headers = {"X-API-KEY": "your_api_key"}

# Binary — save image
response = requests.get("https://api.corenexis.com/qr-barcode/v1",
    headers=headers, params={"type": "qr", "data": "https://google.com"})
with open("qr.png", "wb") as f:
    f.write(response.content)

# URL — get JSON
response = requests.get("https://api.corenexis.com/qr-barcode/v1",
    headers=headers, params={"type": "qr", "data": "https://google.com", "output": "url"})
print(response.json()["data"]["url"])
$ch = curl_init();
curl_setopt_array($ch, [
    CURLOPT_URL => "https://api.corenexis.com/qr-barcode/v1?type=qr&data=https://google.com&output=url",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ["X-API-KEY: your_api_key"],
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
echo "QR URL: " . $data["data"]["url"];

UPI payment QR

# Dynamic amount
curl -H "X-API-KEY: your_api_key" \
  "https://api.corenexis.com/qr-barcode/v1?type=upi&pa=merchant@upi&pn=My+Store&output=url"

# Fixed amount with note
curl -H "X-API-KEY: your_api_key" \
  "https://api.corenexis.com/qr-barcode/v1?type=upi&pa=merchant@upi&pn=My+Store&am=499&tn=Order+Payment&output=url"

# UPI QR with logo (POST)
curl -X POST "https://api.corenexis.com/qr-barcode/v1" \
  -H "X-API-KEY: your_api_key" \
  -F "type=upi" -F "pa=merchant@upi" -F "pn=My Store" \
  -F "am=999" -F "logo=@store-logo.png" -F "output=url"
const params = new URLSearchParams({
  type: 'upi', pa: 'merchant@upi', pn: 'My Store',
  am: '499', tn: 'Order Payment', output: 'url'
});
const response = await fetch(`https://api.corenexis.com/qr-barcode/v1?${params}`, {
  headers: { 'X-API-KEY': 'your_api_key' }
});
const data = await response.json();
console.log('UPI QR:', data.data.url);
import requests
response = requests.get("https://api.corenexis.com/qr-barcode/v1",
    headers={"X-API-KEY": "your_api_key"},
    params={"type": "upi", "pa": "merchant@upi", "pn": "My Store",
            "am": "499", "tn": "Order Payment", "output": "url"})
print(response.json()["data"]["url"])

Barcodes

curl -H "X-API-KEY: your_api_key" \
  "https://api.corenexis.com/qr-barcode/v1?type=code128&data=INV-2026-00451&output=url"
curl -H "X-API-KEY: your_api_key" \
  "https://api.corenexis.com/qr-barcode/v1?type=ean13&data=4006381333931&output=url"
curl -H "X-API-KEY: your_api_key" \
  "https://api.corenexis.com/qr-barcode/v1?type=upc&data=012345678905&output=url"
curl -H "X-API-KEY: your_api_key" \
  "https://api.corenexis.com/qr-barcode/v1?type=qr&data=https://example.com&logo=https://cdn.example.com/logo.png&output=url"
curl -H "X-API-KEY: your_api_key" \
  "https://api.corenexis.com/qr-barcode/v1?type=qr&data=https://example.com&logo=https://drive.google.com/file/d/1aBcDeFg/view?usp=sharing&output=url"
curl -X POST "https://api.corenexis.com/qr-barcode/v1" \
  -H "X-API-KEY: your_api_key" \
  -F "type=qr" -F "data=https://example.com" \
  -F "logo=@my-logo.png" -F "size=500" -F "output=url"

Image-to-QR

curl -H "X-API-KEY: your_api_key" \
  "https://api.corenexis.com/qr-barcode/v1?type=image&data=https://example.com/photo.jpg&output=url"
curl -X POST "https://api.corenexis.com/qr-barcode/v1" \
  -H "X-API-KEY: your_api_key" \
  -F "type=image" -F "image=@photo.jpg" \
  -F "logo=@brand-logo.png" -F "size=500" -F "output=url"
const formData = new FormData();
formData.append('type', 'image');
formData.append('image', fileInput.files[0]);
formData.append('output', 'url');

const response = await fetch('https://api.corenexis.com/qr-barcode/v1', {
  method: 'POST',
  headers: { 'X-API-KEY': 'your_api_key' },
  body: formData
});
const data = await response.json();
console.log('QR:', data.data.url);
console.log('Image:', data.data.hosted_image_url);

Image-to-QR expiry. The QR code URL expires in 2 hours. The hosted image URL expires in 30 days. Both timestamps are in the response.

Response format

Binary output (default)

When output=binary (or omitted), the API returns raw PNG image data directly. Metadata is in response headers:

Response Headers
Content-Type: image/png
Content-Length: 4523
X-Plan: starter
X-Remaining: 487
X-Rate-Limit: 20
X-Monthly-Limit: 500
X-Size-KB: 4.42
X-Type: qr
X-QR-Size: 300
X-Logo: false
X-Text-Mode: binary
X-Text-Usage: 1.6%

URL output — output=url

{
  "success": true,
  "plan": "starter",
  "data": {
    "type": "qr",
    "format": "png",
    "mimetype": "image/png",
    "qr_size": 300,
    "logo": false,
    "text_info": {
      "mode": "binary",
      "byte_length": 20,
      "char_length": 20,
      "max_allowed": 1273,
      "usage_pct": 1.6
    },
    "url": "https://cdn.corenexis.com/qr_1711612800_a3f2d8e1.png",
    "size": 4.52,
    "expiry": "2026-03-28T16:00:00+00:00"
  },
  "usage": {
    "remaining": 487,
    "rate_limit": 20,
    "monthly_limit": 500
  }
}
{
  "success": true,
  "plan": "starter",
  "data": {
    "type": "upi",
    "format": "png",
    "mimetype": "image/png",
    "qr_size": 300,
    "logo": true,
    "url": "https://cdn.corenexis.com/upi_1711612800_b4e1c9f2.png",
    "size": 5.18,
    "expiry": "2026-03-28T16:00:00+00:00"
  },
  "usage": {
    "remaining": 486,
    "rate_limit": 20,
    "monthly_limit": 500
  }
}
{
  "success": true,
  "plan": "starter",
  "data": {
    "type": "code128",
    "format": "png",
    "mimetype": "image/png",
    "width": 420,
    "height": 120,
    "logo": false,
    "url": "https://cdn.corenexis.com/code128_1711612800_c5d2a8b3.png",
    "size": 1.23,
    "expiry": "2026-03-28T16:00:00+00:00"
  },
  "usage": {
    "remaining": 485,
    "rate_limit": 20,
    "monthly_limit": 500
  }
}
{
  "success": true,
  "plan": "pro",
  "data": {
    "type": "image",
    "format": "png",
    "mimetype": "image/png",
    "qr_size": 500,
    "logo": false,
    "hosted_image_url": "https://cdn.corenexis.com/img_1711612800_f7a4c0d5.jpg",
    "hosted_image_expiry": "2026-04-27T14:00:00+00:00",
    "note": "Scan the QR code to view the image directly in any browser.",
    "url": "https://cdn.corenexis.com/image_1711612800_d6e3b9c4.png",
    "size": 6.85,
    "expiry": "2026-03-28T16:00:00+00:00"
  },
  "usage": {
    "remaining": 4988,
    "rate_limit": 30,
    "monthly_limit": 5000
  }
}

Response fields

Field Type Description
type String Requested generation type
format String Output format (always png)
mimetype String MIME type (image/png)
url String CDN URL to download the generated image (2-hour expiry)
size Float File size in KB
expiry String ISO 8601 expiry timestamp for the QR/barcode URL
qr_size Integer QR output width in pixels (QR/UPI/Image types)
logo Boolean Whether a logo was embedded
text_info Object QR data analysis — mode, length, max capacity, usage % (QR type only)
width / height Integer Actual barcode dimensions (barcode types only)
hosted_image_url String Hosted image CDN URL — 30-day expiry (Image type only)
hosted_image_expiry String ISO 8601 expiry for hosted image (Image type only)

Usage object

Field Type Description
remaining Integer Remaining generations this billing period
rate_limit Integer Max requests per minute
monthly_limit Integer Total monthly limit for your plan

URL expiry. QR/barcode CDN URLs expire in 2 hours. Image-to-QR hosted image URLs expire in 30 days. Download or cache before expiry.

Error codes

HTTP Code Description
400 Bad Request Missing or invalid parameters — type, data, UPI fields, barcode format, or size out of range.
400 Data Too Long QR text exceeds capacity (4,296 numeric / 2,611 alphanumeric / 1,273 bytes).
400 Logo Size Exceeded Logo file size exceeds your plan’s limit.
400 Width Exceeded Requested output size exceeds your plan’s maximum.
401 INVALID_KEY API key is invalid, expired, or not found.
401 Missing API Key X-API-KEY header is not present.
402 NO_SUBSCRIPTION QR & Barcode API not enabled. Subscribe to a plan first.
402 SUBSCRIPTION_EXPIRED Subscription expired. Renew to continue.
403 KEY_DISABLED API key disabled. Generate a new key.
403 ACCOUNT_SUSPENDED Account suspended. Contact support.
429 RATE_LIMIT_EXCEEDED Too many requests per minute. Wait and retry.
429 QUOTA_EXCEEDED Monthly quota reached. Upgrade your plan.
500 Server Error Internal error. Try again.

Error response examples

{
  "success": false,
  "code": "PARAM_LIMIT_EXCEEDED",
  "message": "Logo size (650.0 KB) exceeds your plan limit (512.0 KB). Reduce logo size or upgrade your plan.",
  "param": "max_logo_size_bytes",
  "provided": 665600,
  "max_allowed": 524288
}
{
  "success": false,
  "code": "PARAM_LIMIT_EXCEEDED",
  "message": "Requested size (500) exceeds your plan limit (300). Reduce size or upgrade your plan.",
  "param": "max_qr_image_width",
  "provided": 500,
  "max_allowed": 300
}
{
  "success": false,
  "error": "Data too long for QR code. Mode: binary | Your length: 1500 | Max: 1273. Limits — Numeric: 4296 | Alphanumeric: 2611 | Binary/UTF-8: 1273 bytes."
}
{
  "success": false,
  "code": "RATE_LIMIT_EXCEEDED",
  "message": "Too many requests. Please wait before making another request."
}

Plan limit errors. When rejected due to plan limits (logo size, output width), your monthly quota is not consumed. Only successful generations count.

Rate limiting. Rate limits per minute: Free (5/min), Starter (20/min), Pro (30/min). If you receive 429, wait 60 seconds before retrying.

Ready to get started?

Create your free account and start generating QR codes in seconds. No credit card required.

Stay in the loop

New APIs, features and offers, straight to your inbox. No spam.

Already subscribed? Manage preferences