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

社区团购分拣单和标签

按团长或线路生成分拣单和标签,打到仓库对应的打印机。接口不理解团购业务,只接收你生成的文件。调用 POST /v1/print-jobs,API Key 只放在服务端。

面向 社区团购和生鲜分拣

说明

截单之后,分拣单按线路或团长汇总,标签按包裹。你的系统算好这份数据,再分别发给仓库的激光打印机和标签机。两个设备是两个 printer_code。打印机由门店电脑上的 Agent 主动连出,不需要公网 IP,也不需要把 9100 端口映射到互联网。

分拣单用 PDF。包裹标签优先用标签机指令,避免条码被栅格化。幂等键包含线路和批次,重复点击截单不会打出第二套。

现场如果缺一张,只补那一张,不要把整条线路再打一遍。

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

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

// 线路标签
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" }

这一套的细节

两台打印机

A4 分拣单和热敏标签不要硬打在同一台机器上。Agent 只打印你提交的内容,不会替你向平台拉取单据。Agent 只打印你提交的内容,不会替你向平台拉取单据。Agent 只打印你提交的内容,不会替你向平台拉取单据。

批次号

写进幂等键和纸面,方便对单。Agent 只打印你提交的内容,不会替你向平台拉取单据。Agent 只打印你提交的内容,不会替你向平台拉取单据。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 只表示已排队,不表示已经出纸。

打错线路?(详见本页)(详见本页)

这是分组逻辑问题。接口会打你发给它的那台打印机。调用的仍是 POST /v1/print-jobs,请求头为 Bearer API Key。HTTP 201 只表示已排队,不表示已经出纸。

相关页面

  • 跨境 WMS 批量打印 SKU 标签

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

  • 连锁门店由总部下发单据

    总部审核单据后,按门店的 printer_code 打到该门店。不要在门店离线时改打到总部打印机。调用 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