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

跨境 WMS 批量打印 SKU 标签

复核或上架时按批发送 SKU 标签。每批使用稳定的幂等键,失败的一张单独补打。调用 POST /v1/print-jobs,API Key 只放在服务端。调用 POST /v1/print-jobs,API Key 只放在服务端。

面向 仓储系统里打 SKU 标签的开发

说明

一批 1000 个 SKU 不适合合成一个巨大 PDF 让驱动慢慢画。能用 TSPL 或 ZPL 就按张或按小批发送 raw。每一张的键里带上波次、SKU 和序号。打印机由门店电脑上的 Agent 主动连出,不需要公网 IP,也不需要把 9100 端口映射到互联网。

工位电脑上的 Agent 必须在线。一个波次打到错误工位,是你选错了 printer_code,不是接口猜错。

免费套餐只有 100 个任务。批量作业按付费套餐估算。任务在额度用尽时会按套餐规则停下,Essential 的说明是到量暂停,避免意外账单。

创建任务使用 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

// 一张 SKU 标签
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: 'raw',
    content: Buffer.from(payload).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" }

这一套的细节

不要整批无脑重放

只重发失败序号,并用新键。旧键会返回原来的任务。Agent 只打印你提交的内容,不会替你向平台拉取单据。Agent 只打印你提交的内容,不会替你向平台拉取单据。

条码清晰度

指令画出来的条码比缩小后的 PDF 更适合热敏头。Agent 只打印你提交的内容,不会替你向平台拉取单据。Agent 只打印你提交的内容,不会替你向平台拉取单据。

常见问题

有 WMS 插件吗?(详见本页)

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

一次请求打完全部?(详见本页)

可以循环调用。单次 body 过大更容易超时。调用的仍是 POST /v1/print-jobs,请求头为 Bearer API Key。HTTP 201 只表示已排队,不表示已经出纸。

多货主?(详见本页)(详见本页)

不同组织使用不同 API Key,避免互相看见打印机。Enterprise 接口可以建子组织。调用的仍是 POST /v1/print-jobs,请求头为 Bearer API Key。HTTP 201 只表示已排队,不表示已经出纸。

打印到一半电脑休眠?(详见本页)

后面的任务会 AGENT_OFFLINE。唤醒后从失败的序号继续。调用的仍是 POST /v1/print-jobs,请求头为 Bearer API Key。HTTP 201 只表示已排队,不表示已经出纸。

相关页面

  • WMS 或 OMS 如何自动打印 SKU 条码标签

    在 WMS 复核或上架动作里把 SKU 标签打到工位打印机。没有 WMS 插件,按工位发送 printer_code。调用 POST /v1/print-jobs,API Key 只放在服务端。

  • 佳博 GP-1324D 远程打印 TSPL 或 ZPL 标签

    GP-1324D 常见指令是 TSPL,部分机器可切到 ZPL。先在厂商工具里确认,再按 raw 发送。调用 POST /v1/print-jobs,API Key 只放在服务端。

  • TSC TTP-244 Pro 远程打印条码标签

    TTP-244 Pro 是 TSC 的 203 dpi 桌面机,指令用 TSPL。SIZE 和 GAP 写在指令里,不是 JSON 字段。调用 POST /v1/print-jobs,API Key 只放在服务端。

  • 一次打印很多标签时卡住

    把上千张标签拆成多个任务,每张使用稳定的幂等键。不要一次上传一个巨大的 base64,也不要无脑重放整批。调用 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