One printer per brand in a ghost kitchen
A ghost kitchen can send each virtual brand to its own printer_code, or stamp the brand on a shared ticket. The API does not infer the brand.
For Ghost kitchens with several brands on one line
Overview
Several brands share a kitchen. The ticket has to say which brand, and sometimes which printer, or the pass will plate the wrong bag. Your order router already knows the brand. Put that printer_code on the POST.
A shared printer is one code plus a clear brand line in the ESC/POS header. Separate printers are several codes. The API will not split an order by brand unless you send separate jobs.
Include the marketplace source on the ticket. A website order and a delivery-app order can share the device and still need different headers.
Integration steps
- 01
Decide the printer before the click
Map the station, store, or line to a printer_code from GET /v1/printers. Do not ask the operator to pick a dialog.
- 02
Create the document in your system
PDF for driver printers, raw ZPL or ESC/POS when the device speaks that language.
- 03
POST when the business event happens
Pack, pay, check-in, or scan. Not on every autosave. Use the business id as Idempotency-Key.
- 04
Show the job result where the work is
queued is not done. Surface AGENT_OFFLINE and PRINT_ERROR to the person at the bench.
Node.js
// Ghost-kitchen ticket
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" }
Details for this setup
Brand on the ticket
Print it in double size if the printer supports the size command. The API will not restyle the bytes.
One agent, many queues
One kitchen PC can expose several USB printers, each with a code. The agent prints only what you send; it does not fetch the document from the platform for you.
Questions
Can one API key serve every brand?
Yes, inside one PrintBase organization. Use separate organizations only if staff must not see each other's printers.
Who chooses the printer?
Your menu or brand table, not the diner. The call is still POST /v1/print-jobs with a Bearer API key, and HTTP 201 means queued rather than printed.
Reprint a missed ticket?
New idempotency key, same printer, header marked REPRINT. The call is still POST /v1/print-jobs with a Bearer API key, and HTTP 201 means queued rather than printed.
Is there a delivery-app plugin?
No. Normalize the order in your router, then print. The call is still POST /v1/print-jobs with a Bearer API key, and HTTP 201 means queued rather than printed.
Free plan: 100 jobs a month on one computer, no card.