PrintBase
  • Product
  • Pricing
  • Docs
  • Resources
PrintBase/专题/行业打印场景

连锁门店由总部下发单据

总部审核单据后,按门店的 printer_code 打到该门店。不要在门店离线时改打到总部打印机。调用 POST /v1/print-jobs,API Key 只放在服务端。

面向 连锁零售的总部系统

说明

总部系统里一张出库或价签,应该出现在对应门店的打印机上。每个门店一台 Agent,配置表里是该店的 printer_code。总部服务器只发 HTTPS。打印机由门店电脑上的 Agent 主动连出,不需要公网 IP,也不需要把 9100 端口映射到互联网。

门店电脑没开机时,任务失败要留在这张单据上,而不是悄悄打到别的店。店员上班后用新键补打。

价签如果是标签机,用标签尺寸;通知如果是 A4,用门店激光打印机的另一个 code。

创建任务使用 POST /v1/print-jobs,请求头 Authorization: Bearer,正文包含 printer_code、content_type(pdf 或 raw)以及 content 或 content_url 二者之一。免费套餐是一台电脑每月 100 个任务。

创建任务使用 POST /v1/print-jobs,请求头 Authorization: Bearer,正文包含 printer_code、content_type(pdf 或 raw)以及 content 或 content_url 二者之一。免费套餐是一台电脑每月 100 个任务。

接入步骤

  1. 01

    先绑定工位和打印机

    从 GET /v1/printers 拿到 code,写进工位或门店配置,不要弹出系统对话框。请求使用 POST /v1/print-jobs,请求头为 Authorization: Bearer,printer_code 来自 GET /v1/printers。

  2. 02

    在业务系统里生成文件

    驱动打印机用 PDF。小票和条码指令用 raw。请求使用 POST /v1/print-jobs,请求头为 Authorization: Bearer,printer_code 来自 GET /v1/printers。

  3. 03

    在业务事件发生时提交

    打包、支付、签到或扫码。不要每次自动保存都打。幂等键用业务单号。请求使用 POST /v1/print-jobs,请求头为 Authorization: Bearer,printer_code 来自 GET /v1/printers。

  4. 04

    把结果给到现场

    queued 不是已经出纸。AGENT_OFFLINE 和 PRINT_ERROR 要显示给操作员。请求使用 POST /v1/print-jobs,请求头为 Authorization: Bearer,printer_code 来自 GET /v1/printers。

Node.js

// 下发到指定门店的 PDF
const res = await fetch('https://api.printbase.cloud/v1/print-jobs', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.PRINTBASE_API_KEY}`,
    'Content-Type': 'application/json',
    'Idempotency-Key': idempotencyKey,
  },
  body: JSON.stringify({
    printer_code: Number(process.env.PRINTER_CODE),
    content_type: 'pdf',
    content: pdf.toString('base64'),
    copies: 1,
  }),
});
if (!res.ok) throw new Error(`PrintBase ${res.status}: ${await res.text()}`);
const job = await res.json();
// { id: "job_abc", status: "queued" }

这一套的细节

配置表

门店编码到 printer_code。没有配置就拒绝打印。Agent 只打印你提交的内容,不会替你向平台拉取单据。Agent 只打印你提交的内容,不会替你向平台拉取单据。

加速节点

国内门店的 Agent 可以选择 cn.api.printbase.cloud,路径不变。Agent 只打印你提交的内容,不会替你向平台拉取单据。Agent 只打印你提交的内容,不会替你向平台拉取单据。

常见问题

要 VPN 进每家店吗?

打印不需要。Agent 向外连接。调用的仍是 POST /v1/print-jobs,请求头为 Bearer API Key。HTTP 201 只表示已排队,不表示已经出纸。

店长能看到别的店的打印机吗?

不要把所有店放进一个他们都能列出的界面。密钥和查询权限按你的账号模型控制。调用的仍是 POST /v1/print-jobs,请求头为 Bearer API Key。HTTP 201 只表示已排队,不表示已经出纸。

有连锁插件吗?(详见本页)

没有。调用的仍是 POST /v1/print-jobs,请求头为 Bearer API Key。HTTP 201 只表示已排队,不表示已经出纸。

免费套餐?(详见本页)(详见本页)

一台电脑 100 个任务。多家门店需要能覆盖电脑数量的套餐。调用的仍是 POST /v1/print-jobs,请求头为 Bearer API Key。HTTP 201 只表示已排队,不表示已经出纸。

相关页面

  • 门店收银不买云打印机也能打小票

    收银电脑上已经有的小票机,装上 Agent 就能接收服务器发来的小票。不必换成带 SN 的云打印机。调用 POST /v1/print-jobs,API Key 只放在服务端。

  • 云打印机和电脑加普通打印机

    云打印机自带联网和厂商账号。普通打印机加一台电脑上的 Agent,也能收服务器发来的任务。本页不估算耗材或流量费。调用 POST /v1/print-jobs,API Key 只放在服务端。

  • 异地打印:不做 VPN,也不做内网穿透

    门店 Agent 主动连出。总部服务器只访问 HTTPS 接口。不要把打印机 9100 端口映射到公网。调用 POST /v1/print-jobs,API Key 只放在服务端。

免费套餐:一台电脑每月 100 个任务,不需要信用卡。

免费注册查看 API 文档
PrintBase

PrintBase connects your applications to physical printers anywhere - securely, reliably, and in real time.

Product
Receipt PrintingLabel PrintingDashboardDevicesWebhooks
Resources
DocsBlogStatusAPI ReferenceDownloadPrintBase vs PrintNodePrintNode PricingFAQ
Guides
All guidesIntegrationsPrintersCode samplesComparisonsUse casesTroubleshooting
Company
ContactSecurityPrivacy

© 2026 Aveniq Technologies OÜ. All rights reserved. PrintBase is a service of Aveniq Technologies OÜ.

PrivacyTermsRefunds