API Reference

เอกสารอ้างอิง API: QR โค้ดและบาร์โค้ด

Two endpoints, one envelope. Generate QR codes and 1D barcodes in batches, get back a ZIP with every image plus a CSV manifest — built for print shops, ERPs and label pipelines that cannot afford a manual step.

REST JSON over HTTPS Host api-v2.qrbatch.com Version v4 Auth token in body

Overview

Batch QR generation for posters, product labels and mail merges.

One request turns a list of strings into a ZIP of QR images plus a CSV manifest. The endpoint accepts application/json, a form post, or a query string; any field you omit falls back to the default listed under Request parameters.

Method
POST
Payload
JSON · form · query
Auth
token in body
Returns
ZIP + CSV
Everything is generated synchronously and returned as URLs in the response body. The ZIP is a convenience bundle — you can also fetch each image from data.qrcode_data[n].path.

Endpoint

POST https://api-v2.qrbatch.com/qrbatchv4api/create/createAPI.php

Base host: api-v2.qrbatch.com. HTTPS only. CORS is open (Access-Control-Allow-Origin: *), so browser-side calls work, but never ship a token inside client-side code.

Need vector output? QR codes are also available as SVG at create/create_svg.php with the same payload. Batches of 100 or more return 202 with a job_id; poll create/create_status.php?job_id=… until it answers code: 0.

Authentication

Body token, no header plumbing.

Every request may carry a token — the auth code shown in your account. Signed-in calls draw from your plan quota; calls without a token draw from the anonymous per-IP allowance.

TOKEN {{ token ? token : 'No token attached — anonymous quota applies' }}

Clicking fills your live token into every example on this page. The token is read from your signed-in session in this browser — it is never sent to us by this page.

Where the token lives

  • Send it in the request body as "token": "…". There is no Authorization header handling.
  • An invalid or expired token answers 302; treat it as "signed out" and re-authenticate rather than retrying.
  • Rotating your password invalidates previously issued tokens.

Quotas & limits

Quota is counted per generated item, not per request. The allowance resets at 00:00 server time.

Caller Daily allowance Per-request cap Rejection
Anonymous (no token) 50 codes per IP address 50 301
Signed in Your plan’s daily volume Your plan’s batch size 303
Add-on packs Added on top of the plan allowance — —
A request that would exceed the cap is rejected whole — nothing is generated and no quota is consumed. Split large jobs into batches sized to your plan’s per-request cap.

Request parameters

Grouped by object. Only contents is strictly required.

Top level

Parameter Type Required Default Description
contents array | string required — QR payloads, one per image. A plain string is split on newlines; empty lines are dropped.
data array | string optional — Alias of contents, honoured only when contents is empty or missing.
token string optional "" Account auth code. Empty means the anonymous per-IP allowance.
file_name_type int optional 1 1 = sequential index (1, 2, …), 2 = sanitized content, 3 = the matching entry from names.
labels array | string optional [] Caption printed under each code when label_setting.use_content is 0. Length must equal contents, otherwise 302.
names array | string optional [] File names used when file_name_type is 3.
color object optional see below Module, background and caption colours.
base object optional see below Size, DPI and image format.
logo object optional see below Centre logo overlay.
label_setting object optional see below Caption typography and placement.

base — geometry & format

Parameter Type Required Default Description
size int optional 200 Image side length in pixels.
margin int optional 10 Quiet-zone padding in pixels. Keep at least 4 modules of white space for reliable scanning.
dpi int optional 96 Written into the PNG metadata; use 300 for print.
img_type int optional 1 1 = PNG, 2 = JPEG.
transparent bool optional false Transparent background (PNG only).
fault string optional Medium-High Error correction: Low, Medium-Low, Medium-High, High. Raise it when a logo covers the centre.

color

Parameter Type Required Default Description
front_color string optional "0,0,0" QR module colour, as an R,G,B triplet.
bg_color string optional "255,255,255" Background colour, as an R,G,B triplet.
font_color string optional "0,0,0" Caption text colour, as an R,G,B triplet.

logo

Parameter Type Required Default Description
size int optional 2 Logo width as a fraction of the code width — 2 means 20%.
file string optional "" Path or URL of the logo image on the server.

label_setting

Parameter Type Required Default Description
show_label int optional 0 1 prints a caption band under the code; 0 leaves it bare.
use_content int optional 1 1 = caption repeats the QR content, 0 = caption comes from labels[].
font_size int optional 15 Caption font size in pixels.
margin int optional 10 Gap in pixels between the code and the caption.
location string optional bottom bottom or top.
font_type int optional 1 Accepted for compatibility with the web app; the API path always uses the bundled font.
line_type int optional 1 Accepted for compatibility with the web app; it does not alter API output.
Colours in color are RGB triplets such as "0,0,0", not hex. Hex values belong to the web-app payload, which is a different schema.

Code examples

The same call in six flavours.

Replace YOUR_TOKEN with your auth code, or press Get my token above to fill every example at once.

Payload

JSON body
{
  "contents": ["https://example.com/p/1001", "https://example.com/p/1002"],
  "file_name_type": 1,
  "base": {
    "size": 600,
    "margin": 12,
    "dpi": 300,
    "img_type": 1,
    "fault": "Medium-High"
  },
  "color": {
    "front_color": "0,0,0",
    "bg_color": "255,255,255",
    "font_color": "0,0,0"
  },
  "label_setting": {
    "show_label": 0,
    "use_content": 1,
    "font_size": 15,
    "margin": 10,
    "location": "bottom"
  },
  "token": "YOUR_TOKEN"
}

Same request, five languages

curl -X POST "https://api-v2.qrbatch.com/qrbatchv4api/create/createAPI.php" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": ["https://example.com/p/1001", "https://example.com/p/1002"],
    "file_name_type": 1,
    "base": { "size": 600, "margin": 12, "dpi": 300 },
    "token": "YOUR_TOKEN"
  }' 
const res = await fetch('https://api-v2.qrbatch.com/qrbatchv4api/create/createAPI.php', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    contents: ['https://example.com/p/1001', 'https://example.com/p/1002'],
    file_name_type: 1,
    base: { size: 600, margin: 12, dpi: 300 },
    token: 'YOUR_TOKEN'
  })
});

const { code, message, data } = await res.json();
if (code !== 0) throw new Error(message);
console.log(data.num, 'codes', data.zip_path);
import requests

res = requests.post(
    "https://api-v2.qrbatch.com/qrbatchv4api/create/createAPI.php",
    json={
        "contents": ["https://example.com/p/1001", "https://example.com/p/1002"],
        "file_name_type": 1,
        "base": {"size": 600, "margin": 12, "dpi": 300},
        "token": "YOUR_TOKEN",
    },
    timeout=120,
)
payload = res.json()
if payload.get("code") != 0:
    raise RuntimeError(payload.get("message"))

for item in payload["data"]["qrcode_data"].values():
    print(item["file_name"], item["path"])
<?php
$payload = [
    "contents" => ["https://example.com/p/1001", "https://example.com/p/1002"],
    "file_name_type" => 1,
    "base" => ["size" => 600, "margin" => 12, "dpi" => 300],
    "token" => "YOUR_TOKEN",
];

$ch = curl_init("https://api-v2.qrbatch.com/qrbatchv4api/create/createAPI.php");
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => ["Content-Type: application/json"],
    CURLOPT_POSTFIELDS => json_encode($payload),
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 120,
]);
$res = json_decode(curl_exec($ch), true);
curl_close($ch);

echo $res["code"] === 0 ? $res["data"]["zip_path"] : $res["message"];
const axios = require('axios');

axios.post('https://api-v2.qrbatch.com/qrbatchv4api/create/createAPI.php', {
  contents: ['https://example.com/p/1001', 'https://example.com/p/1002'],
  file_name_type: 1,
  base: { size: 600, margin: 12, dpi: 300 },
  token: 'YOUR_TOKEN'
}).then(({ data }) => {
  if (data.code !== 0) throw new Error(data.message);
  console.log(data.data.num, data.data.zip_path);
}).catch(err => console.error(err.message));
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
)

func main() {
	body, _ := json.Marshal(map[string]any{
		"contents":       []string{"https://example.com/p/1001", "https://example.com/p/1002"},
		"file_name_type": 1,
		"base":           map[string]any{"size": 600, "margin": 12, "dpi": 300},
		"token":          "YOUR_TOKEN",
	})

	resp, err := http.Post("https://api-v2.qrbatch.com/qrbatchv4api/create/createAPI.php", "application/json", bytes.NewBuffer(body))
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	var out struct {
		Code    int    `json:"code"`
		Message string `json:"message"`
		Data    struct {
			ZipPath string `json:"zip_path"`
			Num     int    `json:"num"`
		} `json:"data"`
	}
	json.NewDecoder(resp.Body).Decode(&out)
	if out.Code != 0 {
		panic(out.Message)
	}
	fmt.Println(out.Data.ZipPath)
}
Form posts work too: send application/x-www-form-urlencoded and let arrays serialise as contents[]=…. Nested objects still need to be JSON strings — they are parsed automatically on arrival.

Response

Synchronous — the work is done by the time you get 200.

200 OK
{
  "code": 0,
  "data": {
    "qrcode_data": {
      "0": {
        "path": "https://api-v2.qrbatch.com//qrbatchv4api/create/img/2026-10-26-101530-482/1.png",
        "file_name": "1",
        "content": "https://example.com/p/1001"
      },
      "1": {
        "path": "https://api-v2.qrbatch.com//qrbatchv4api/create/img/2026-10-26-101530-482/2.png",
        "file_name": "2",
        "content": "https://example.com/p/1002"
      }
    },
    "finish": 1,
    "domain": "https://api-v2.qrbatch.com/",
    "num": 2,
    "zip_path": "https://qrbatchzip-1256595918.cos.ap-singapore.myqcloud.com/qrcode/20261026-101530-6512a1b2c3d4e.zip",
    "time": "0.42",
    "create_time": "2026-10-26 10:15:30"
  }
}

Field reference

Field Type Description
code int 0 on success; anything else is an error — see Error codes.
data.qrcode_data object Generated images keyed by their position in contents.
…[n].path string Absolute URL of the image. Use this directly.
…[n].file_name string File name without extension.
…[n].content string The content that was encoded.
data.num int Number of images actually produced (empty inputs are skipped).
data.finish int 1 when the batch completed in this response.
data.zip_path string Absolute URL of a ZIP containing every image plus a CSV manifest.
data.time string Server-side duration in seconds, as a string.
data.create_time string Server timestamp, YYYY-MM-DD HH:MM:SS.
Image URLs are permanent but the paths contain a timestamped folder — do not construct them from a pattern. Always read what the response gives you.

Error codes

Failures return HTTP 200 with a non-zero code and a human-readable message. Branch on code, never on the message text.

code Meaning What to do
0 Success —
301 Missing contents, or the anonymous per-IP allowance is exhausted. Add contents; sign in or attach a token for a larger allowance.
302 Token could not be decrypted, or contents and labels have different lengths. Re-issue the token; align the two arrays.
303 Daily account allowance exhausted. Reduce the batch or upgrade the plan.
304 Batch larger than the plan’s per-request cap. Split the job into smaller batches.
404 Calling IP is blocklisted. Contact support with your egress IP.
500 Server-side file or archive creation failed. Retry once; if it persists, contact support.

Notes

  • Fields that look like JSON — color, base, logo, labels, label_setting — are parsed automatically when sent as strings, so form posts and query strings behave like JSON.
  • Omitted fields use the defaults in Request parameters; you never have to send the full object.
  • Empty or whitespace-only entries are dropped, so the number of images can be smaller than the number of inputs. Check data.num.
  • Quota is consumed per produced image, not per request.
  • Payloads are plain text — URLs with tracking parameters are encoded verbatim.
  • Requests are rate-limited per IP in addition to the daily quota.

Support

Stuck on a response code? Send us the request you made (with the token removed) and the full response body — that is usually enough to pinpoint it.

Email support Report a documentation issue

Overview

Retail GTINs, GS1 logistics labels, asset tags and serial plates.

The Barcodes API renders 1D symbologies in batches. Send a list of values plus one code_type and you get back a ZIP of PNG, JPEG or SVG files, each named the way you asked for.

Method
POST
Symbologies
10 type values
Auth
token in body
Returns
PNG · JPEG · SVG
Pixel geometry is decided by two numbers: base.size is the width of the narrowest bar, base.height is how tall the bars are. Everything else derives from those, so a label that is 40 mm wide at 300 DPI is size: 3, height: 300, dpi: 300.

Endpoint

POST https://api-v2.qrbatch.com/qrbatchv4api/barcode/createAPI.php

ปลายทางเดียวรองรับทุกฟอร์มเอาต์พุต ตั้งค่า base.img_type ใน JSON body โครงสร้างคำขอและคำตอบเหมือนเดิม การเปลี่ยนจาก PNG สำหรับดูตัวอย่างเป็น SVG สำหรับงานพิมพ์จึงแก้เพียงฟิลด์เดียว

base.img_type เอาต์พุต ไฟล์ ตัวเข้ารหัส ใช้กับ
1 PNG .png ราสเตอร์ ค่าเริ่มต้น หน้าจอ ฝังใน PDF เครื่องพิมพ์ฉลากตามต้องการ
2 JPEG .jpg ราสเตอร์ ไฟล์เล็กลงเมื่อไม่ต้องการความโปร่งใส
3 SVG .svg เวกเตอร์ งานพิมพ์ออฟเซตและเฟล็กโซ แท่งบาร์คมชัดทุกขนาด ไฟล์ละไม่กี่ KB
ปลายทางนี้คือสัญญาสาธารณะ เว็บแอปใช้เส้นทางภายในแยกต่างหาก การแก้ UI จึงไม่กระทบพฤติกรรมของ API ทั้งสามรูปแบบเปิด CORS และรับ application/json

Supported symbologies

Ten code_type values, mapped to the encoders below.

code_type applies to the whole batch. To mix symbologies, send several requests — or use the QR API above if your payload is free-form text.

code_type Symbology Input Typical use
code128 Code 128 (auto subset) Any ASCII character; the encoder picks subset A/B/C per value. Shipping, asset tags — the densest general-purpose 1D code
code128A Code 128 subset A Uppercase, digits and control characters. Older systems locked to uppercase
code128B Code 128 subset B Full ASCII including lowercase. Mixed-case text
code128C Code 128 subset C Digits only, in pairs. Numeric serials, GS1 data
code39 Code 39 A–Z, 0–9, and - . $ / + % and space. Industrial, automotive, defence
code39ext Code 39 Extended Full ASCII via shift pairs. Legacy systems that need symbols
ean13 EAN-13 13 digits including the check digit. Retail GTIN-13
ean8 EAN-8 8 digits including the check digit. Small retail packages
ean128 GS1-128 GS1 application identifiers, e.g. (01)…(10)…. Shipping and food traceability
upc UPC-A 12 digits including the check digit. North American retail
There is no auto-correction for the PNG/JPEG path: an EAN-13 value of the wrong length or a Code 39 value containing an illegal character aborts the batch. Validate lengths and character sets before you send.

Request parameters

Top level

Parameter Type Required Default Description
contents array required — One barcode value per item. Empty entries are skipped.
base object required — Geometry and output format. The key must be present even if you only override one field.
code_type string optional code128 Symbology for the whole batch — see Supported symbologies. Unknown values fall back to Code 128.
token string optional "" Account auth code. Empty means the anonymous per-IP allowance.
file_name_type int optional 1 1 = sequential index, 2 = sanitized content, 3 = the matching entry from names.
names array optional [] File names used when file_name_type is 3.
show_label bool optional true พิมพ์ค่าเป็นข้อความที่อ่านได้ใต้แท่งบาร์ เอาต์พุต SVG จะเพิ่มแถบคำอธิบายเหนือ base.height
font_size int optional 12 ขนาดตัวอักษรคำอธิบายเป็นพิกเซล ใช้กับทุกฟอร์แมต
color object optional see below Bar and background colours.

base — geometry & format

Parameter Type Required Default Description
size int optional 2 Width of the narrowest bar, in pixels. This is the scan-density dial.
height int optional 60 Bar height in pixels, excluding the caption band.
margin int optional 10 Quiet-zone padding in pixels added on all four sides.
dpi int optional 96 Written into the PNG metadata; use 300 for print.
img_type int optional 1 1 = PNG, 2 = JPEG, 3 = SVG ทั้งสามแบบให้บริการโดยปลายทางเดียวกัน
transparent bool optional false ไม่วาดพื้นหลัง ใช้กับ PNG และ SVG ส่วน JPEG ไม่รองรับความโปร่งใส

color

Parameter Type Required Default Description
front_color string optional "#000000" Bars, as a hex colour such as #0f766e.
bg_color string optional "#FFFFFF" Background, as a hex colour.
Barcode colours are hex strings, unlike the QR API which uses R,G,B triplets. Sending "0,0,0" here produces black but "255,255,255" is not a valid background — use "#FFFFFF".

Code examples

Replace YOUR_TOKEN with your auth code, or press Get my token in Authentication to fill every example on this page.

Payload

JSON body
{
  "contents": ["QRB-2026-0001", "QRB-2026-0002"],
  "code_type": "code128",
  "file_name_type": 1,
  "show_label": true,
  "font_size": 12,
  "base": {
    "size": 2,
    "height": 60,
    "margin": 10,
    "dpi": 300,
    "img_type": 1
  },
  "color": {
    "front_color": "#000000",
    "bg_color": "#FFFFFF"
  },
  "token": "YOUR_TOKEN"
}

A retail GTIN batch

EAN-13
{
  "contents": ["4006381333931", "4006381333948"],
  "code_type": "ean13",
  "show_label": false,
  "base": { "size": 2, "height": 80, "margin": 12, "dpi": 300 },
  "token": "YOUR_TOKEN"
}

Same request, four languages

curl -X POST "https://api-v2.qrbatch.com/qrbatchv4api/barcode/createAPI.php" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": ["QRB-2026-0001", "QRB-2026-0002"],
    "code_type": "code128",
    "show_label": true,
    "base": { "size": 2, "height": 60, "margin": 10, "dpi": 300 },
    "token": "YOUR_TOKEN"
  }' 
const res = await fetch('https://api-v2.qrbatch.com/qrbatchv4api/barcode/createAPI.php', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    contents: ['QRB-2026-0001', 'QRB-2026-0002'],
    code_type: 'code128',
    show_label: true,
    base: { size: 2, height: 60, margin: 10, dpi: 300 },
    token: 'YOUR_TOKEN'
  })
});

const { code, message, data } = await res.json();
if (code !== 0) throw new Error(message);

// path is relative; domain is the absolute prefix
data.qrcode_data && Object.values(data.qrcode_data).forEach(item => {
  console.log(item.domain + item.path);
});
import requests

res = requests.post(
    "https://api-v2.qrbatch.com/qrbatchv4api/barcode/createAPI.php",
    json={
        "contents": ["QRB-2026-0001", "QRB-2026-0002"],
        "code_type": "code128",
        "show_label": True,
        "base": {"size": 2, "height": 60, "margin": 10, "dpi": 300},
        "token": "YOUR_TOKEN",
    },
    timeout=120,
)
payload = res.json()
if payload.get("code") != 0:
    raise RuntimeError(payload.get("message"))

zip_url = payload["data"]["zip_path"]
print(zip_url)
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
)

func main() {
	body, _ := json.Marshal(map[string]any{
		"contents":  []string{"QRB-2026-0001", "QRB-2026-0002"},
		"code_type": "code128",
		"show_label": true,
		"base":       map[string]any{"size": 2, "height": 60, "margin": 10, "dpi": 300},
		"token":      "YOUR_TOKEN",
	})

	resp, err := http.Post("https://api-v2.qrbatch.com/qrbatchv4api/barcode/createAPI.php", "application/json", bytes.NewBuffer(body))
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	var out struct {
		Code int `json:"code"`
		Data struct {
			Domain  string `json:"domain"`
			ZipPath string `json:"zip_path"`
		} `json:"data"`
	}
	json.NewDecoder(resp.Body).Decode(&out)
	fmt.Println(out.Data.Domain + out.Data.ZipPath)
}

Response

200 OK
{
  "code": 0,
  "data": {
    "barcode_data": [
      {
        "path": "https://api-v2.qrbatch.com/qrbatchv4api/barcode/img/2026-10-26-101530-482/1.png",
        "file_name": "1",
        "content": "QRB-2026-0001",
        "format": "png"
      },
      {
        "path": "https://api-v2.qrbatch.com/qrbatchv4api/barcode/img/2026-10-26-101530-482/2.png",
        "file_name": "2",
        "content": "QRB-2026-0002",
        "format": "png"
      }
    ],
    "finish": 1,
    "domain": "https://api-v2.qrbatch.com/",
    "num": 2,
    "skipped": {},
    "time": "0.08",
    "create_time": "2026-10-26 10:15:30",
    "zip_path": "https://qrbatchzip-1256595918.cos.ap-singapore.myqcloud.com/barcode/20261026-101530-6512a1b2c3d4e.zip"
  }
}
URL แบบสมบูรณ์: path และ zip_path ใช้ได้ทันที ไม่ต้องต่อสตริง domain ยังคงอยู่ในคำตอบสำหรับไคลเอนต์ที่เขียนตามสัญญาเดิม

Field reference

Field Type Description
code int 0 on success — see Error codes.
data.barcode_data object ไฟล์ที่สร้างตามลำดับที่ส่งมา qrcode_data เก็บไว้เป็นชื่อเรียกแทนเพื่อความเข้ากันได้
…[n].path string URL แบบสมบูรณ์ของไฟล์ที่สร้าง ใช้ได้โดยตรง
…[n].domain string เก็บไว้เพื่อความเข้ากันได้ path เป็น URL แบบสมบูรณ์แล้ว
…[n].file_name string File name without extension.
…[n].content string The value that was encoded.
…[n].format string นามสกุลไฟล์ของรายการนี้: png, jpg หรือ svg
data.skipped object ค่าที่เข้ารหัสไม่ได้ ใช้ดัชนีใน contents เป็นคีย์ จะมีเฉพาะเมื่อบางรายการในชุดล้มเหลว
data.num int Number of files produced.
data.finish int 1 when the batch completed.
data.zip_path string URL แบบสมบูรณ์ของไฟล์ ZIP
data.time string Server-side duration in seconds, as a string.
data.create_time string Server timestamp.

Vector (SVG) output

Same payload, smaller feature set.

ส่ง "base": { "img_type": 3 } แล้วปลายทางเดิมจะสลับไปใช้ตัวเข้ารหัสเวกเตอร์ เอาต์พุตเป็นเวกเตอร์จริง แท่งบาร์คมชัดทุกขนาดการพิมพ์ ไฟล์ละไม่กี่ KB

พฤติกรรม PNG และ JPEG (img_type 1–2) SVG (img_type 3)
code_type ที่รองรับ ทั้งสิบค่า เก้าในสิบ — ทุกค่ายกเว้น ean128 ซึ่งคืนค่า code: 306
base.size ความกว้างแท่งที่แคบที่สุดเป็นพิกเซล ตัวคูณความกว้างที่ใช้กับรูปแบบแท่งที่คำนวณได้
base.height ความสูงแท่งเป็นพิกเซล ความสูงแท่งเป็นพิกเซล แถบคำอธิบายเพิ่ม 2 × font_size
font_size มีผล มีผล — กำหนดขนาดคำอธิบาย
margin, dpi มีผล ไม่มีผล — จัดระยะขอบในเลย์เอาต์ของคุณ
transparent มีผล (PNG) มีผล — ไม่วาดพื้นหลัง
หลักตรวจสอบ EAN-13 ต้องส่งมาเอง คำนวณอัตโนมัติจากตัวเลข 12 หลัก
SVG request
{
  "contents": ["4006381333931"],
  "code_type": "ean13",
  "show_label": true,
  "base": { "size": 2, "height": 60, "img_type": 3 },
  "color": { "front_color": "#000000" },
  "token": "YOUR_TOKEN"
}
ตรวจสอบ format: แต่ละรายการระบุ png, jpg หรือ svg เทียบกับที่คุณขอ นี่คือวิธีที่เร็วที่สุดในการจับ img_type ที่พิมพ์ผิด

Error codes

Same envelope as the QR API: HTTP 200 with a numeric code on failure. Branch on the number, not the message.

code Meaning What to do
0 Success —
301 contents missing or not an array, base missing, or the anonymous per-IP allowance is exhausted. Send both keys; sign in or attach a token for more volume.
302 Token could not be decrypted. Re-issue the token; check for truncation.
303 Daily allowance exhausted, or the batch exceeds the per-request cap. Split the batch or upgrade the plan — the response carries limit, used and remaining.
305 base.img_type ไม่ใช่ 1, 2 หรือ 3 ส่งค่าที่กำหนดไว้หนึ่งในสามค่า
306 code_type ที่ไม่รู้จัก หรือรหัสที่ฟอร์แมตที่ขอไม่สามารถเข้ารหัสได้ (เช่น ean128 กับ img_type: 3) เลือก symbology ที่รองรับ หรือเปลี่ยนเป็น img_type: 1
307 ทุกค่าในชุดเข้ารหัสไม่สำเร็จ อ่าน data.skipped เพื่อดูเหตุผลของแต่ละรายการ
404 Calling IP is blocklisted. Contact support with your egress IP.
500 ไม่สามารถสร้างหรือเขียนไดเรกทอรีเอาต์พุตได้ ลองอีกครั้งหนึ่งครั้ง หากยังไม่หาย ให้ติดต่อฝ่ายสนับสนุนพร้อม create_time

Notes

  • Quiet zone is not optional. Keep base.margin at 10 px or more. A barcode pasted flush against artwork frequently fails to scan even though it looks fine.
  • Bar width beats height. If a scanner struggles, raise base.size before raising height — height buys tolerance to being scanned at an angle, width buys resolution.
  • One symbology per request. code_type is batch-wide; split mixed jobs into separate calls and merge the ZIPs yourself.
  • File names are sanitised. With file_name_type: 2 anything outside [A-Za-z0-9-] becomes an underscore, and collisions get a numeric suffix.
  • Caption fonts. PNG/JPEG captions render with the bundled font at font_size; there is no custom-font option on the API path.
  • Quota is consumed per produced file, and empty contents entries are skipped before counting.

Support

For symbology-specific problems (a code that scans on one device but not another), send us the image, the encoded value and the scanner model. That combination resolves most cases in one reply.

Email support Open the barcode generator