How to auto-print Shopify packing slips
Render a Shopify packing slip to PDF in your app and send it to the bench printer. PrintBase has no Shopify plugin; the call is a normal print job.
For Shopify operations teams printing a slip with every order
Overview
A packing slip is not the carrier label. It is your list of lines, bins, and notes, and Shopify does not publish a stable anonymous PDF URL for it. You render that PDF yourself when the order is paid or when picking starts, then hand the file to the printer on the bench.
PrintBase still has no Shopify app. The practical hook is orders/paid or a pick-wave job in your own admin. Render one slip per order, name the printer_code of the slip printer (it may differ from the 4×6 label printer), and send content_type pdf. Keep the API key on the server that renders the slip.
Use an Idempotency-Key of shopify-slip plus the order id. Staff who reprint from your admin pass a new key, or the same key will return the original job and nothing new will print.
Integration steps
- 01
Separate slip printer from label printer
Register both queues in the agent. Store two printer_code values. A packing slip on a laser or 4-inch printer should not be forced through the shipping-label queue.
- 02
Render the slip in your app
Build a PDF from the order lines, SKU, quantity, and bin. Do this on the server when the order webhook arrives, not in the buyer's browser.
- 03
Base64 the PDF
Packing slips are rarely public URLs. Read the file and set content to standard base64 with content_type pdf.
- 04
Key the job to the order
Idempotency-Key shopify-slip:{orderId} makes webhook retries safe. A deliberate reprint uses a new key, for example with a reprint counter.
- 05
Print the label only after the slip is queued
If you also print a shipping label, send a second job to the label printer_code. They are two print jobs, two keys.
Node.js
// Render path: base64 packing-slip PDF for one Shopify order
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': `shopify-slip:${order.id}`,
},
body: JSON.stringify({
printer_code: Number(process.env.PRINTER_CODE),
content_type: 'pdf',
content: slipPdf.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" }
Details for this setup
PDF path for a packing slip
Use content_type pdf and exactly one of content (standard base64) or content_url (an http or https URL the agent can download). A private file must be fetched by your server and sent as base64, or exposed as a short-lived URL. On Windows the agent asks a PDF app to print to the named queue; if none is registered, the failure text names Adobe Reader or SumatraPDF as examples. macOS and Linux use lp.
Do not send the slip as ZPL
A packing slip is a document. Sending the PDF bytes as content_type raw fails with INVALID_CONTENT because the payload starts with %PDF-. Use pdf unless you deliberately layout the slip in ZPL.
Questions
Can I use Shopify's packing slip button?
That button is a person and a dialog. This path is for the unattended case, where your server already knows the order and the printer.
Does this replace Shopify Flow?
No. If you use Flow, the HTTP action still has to call your backend or the API. See the Flow packing-slip page for that shape. There is no PrintBase Flow app.
What paper size should the PDF be?
Match the tray. Letter or A4 for an office printer, 4 by 6 only if you really print slips on the label printer. The API does not rescale.
Can one webhook print slip and label?
Yes, as two POST /v1/print-jobs calls with different printer_code values and different idempotency keys.
Free plan: 100 jobs a month on one computer, no card.