API 文档

通过 REST API 从产品创建二维码和条形码。向 /api/v1 发送 JSON,获取已托管的 SVG 图稿,然后列出或更新同一批资源。

创建二维码

向 /api/v1/qr-codes 发送 POST,附带 type、内容和可选设计:颜色、模块样式、徽标、码眼和边框。响应包含已托管的 SVG URL。

{
  "name": "Website QR",
  "type": "url",
  "url": "https://forqrcode.com",
  "style": "rounded",
  "size": 500,
  "ecc": "M",
  "foreground_color": "#17191c",
  "background_color": "#ffffff",
  "qr_code_logo": "https://forqrcode.com/logo.png",
  "qr_code_logo_size": 25
}
二维码创建参考

创建条形码

向 /api/v1/barcodes 发送 POST,附带 symbology、value 以及可选颜色或尺寸。共有三十四种类型,从 Code 128 到 EAN-13。

{
  "name": "Product SKU",
  "type": "C128",
  "value": "FORQR-1001",
  "foreground_color": "#17191c",
  "background_color": "#ffffff",
  "width_scale": 2,
  "height": 80,
  "display_text": true
}
条形码创建参考

身份验证

每次请求以 Bearer 方式发送 API 密钥。可在控制台 → 账户 → API 中查看或重新生成。

Authorization: Bearer YOUR_API_KEY

基础 URL: https://forqrcode.com/api/v1

速率限制

每个 API 密钥每分钟 60 次请求。响应包含 X-RateLimit-Limit、X-RateLimit-Remaining、X-RateLimit-Reset 头。

错误

错误采用 JSON:API 格式:

{ "errors": [{ "title": "…", "status": "422" }] }

验证错误可能包含 source.pointer 字段。