How to auto-print Shopify POS receipts
Print an extra Shopify POS receipt on a counter printer from your backend. This does not replace the POS device's own paired printer.
For Retail counters that need a server-side copy, not a replacement for the POS printer pairing
Overview
Shopify POS already prints to the receipt printer paired in the POS app. PrintBase does not intercept that pairing, and it does not ship a POS extension. Use this path when a cloud system — a back office, a kitchen display, a second counter — must print a receipt the POS tablet is not driving.
Take the order from the Shopify order webhook, format a short ESC/POS ticket (or a small PDF if the counter printer is a normal OS queue), and POST it to the printer_code of that second printer. The agent runs on the computer that owns the printer, not on the POS tablet.
Keep the API key off the tablet. Idempotency-Key should be the POS order id so a replayed webhook does not print a second customer copy unless you mint a new key.
Integration steps
- 01
Leave the POS pairing alone
Let Shopify POS keep its paired printer for the cashier copy. Add the PrintBase agent only on the machine that should print the extra ticket.
- 02
Build a short ticket
For a thermal printer, build ESC/POS bytes: init, store name, lines, total, feed, cut. For a laser, render a small PDF instead.
- 03
Send raw or pdf, not both
ESC/POS is content_type raw and base64 content. A PDF receipt is content_type pdf. Mixing them is INVALID_CONTENT when PDF bytes are marked raw.
- 04
Key by the POS order
Use the Shopify order id as Idempotency-Key for the first copy. Staff reprints get a new key.
- 05
Watch PRINTER_OFFLINE at the counter
A USB receipt printer that is turned off fails the job. GET the job and surface the reason code on your back-office screen.
Node.js
// Extra counter receipt as ESC/POS raw bytes
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-pos:${order.id}`,
},
body: JSON.stringify({
printer_code: Number(process.env.PRINTER_CODE),
content_type: 'raw',
content: receipt.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
ESC/POS on the second printer
The agent does not translate UTF-8 into the printer's code page. Encode the bytes for that model before base64. 80 mm paper is about 48 columns; 58 mm is about 32. Cut only after line feeds so the knife does not slice the total.
How you know it printed
Create returns id and status queued. The job then moves queued, dispatched, printing, completed. Failures use reason codes such as AGENT_OFFLINE, PRINTER_OFFLINE, DOWNLOAD_FAILED, PRINT_ERROR, and INVALID_CONTENT. Poll GET /v1/print-jobs/{id}. Webhooks exist on paid plans only, and only for print_job.completed and print_job.failed.
Questions
Does this replace Shopify POS hardware setup?
No. POS still pairs its own printer. This prints a job your server creates.
Can the POS app call 127.0.0.1:17891?
Only from an origin the local agent allows: localhost or a printbase.cloud host. A Shopify POS origin is not that list. Call the cloud API from your server.
Why would I print a second receipt?
A kitchen, a pickup counter, or a back office that is not the tablet Shopify POS is printing on.
Is there a Shopify POS plugin?
No PrintBase POS plugin is part of this product. Integration is the API.
Free plan: 100 jobs a month on one computer, no card.