Star CloudPRNT alternative without hosting a poll URL
CloudPRNT printers poll a URL you host. PrintBase lets your server push a job to an OS queue instead. You can keep CloudPRNT for other devices.
For Developers who do not want to host a CloudPRNT server
Overview
Star's CloudPRNT protocol guide says a compatible printer polls a server URL with HTTP POST on an interval, sends status, and receives a job if you have one. The guide's default poll for an mC-Print3 is 5 seconds when that feature is configured.
That design means you operate the URL the printer calls. PrintBase reverses the direction for the OS-queue path: your app posts /v1/print-jobs when the order exists, and the agent prints the Star queue. The printer does not poll PrintBase.
CloudPRNT also reports peripherals on some models. This API does not. If you need the scanner-on-the-printer events, CloudPRNT still does that job. Printing a receipt does not require it.
Integration steps
- 01
Install the agent where the printer is
The computer that can already print a test page runs the agent. GET /v1/printers and note the code.
- 02
Keep the API key on a server
Authorization: Bearer. Do not put the key in a browser, a theme, or a public automation log.
- 03
POST the document
content_type pdf or raw, exactly one of content or content_url, plus printer_code.
- 04
Use a stable Idempotency-Key
Retries reuse the key and the body. A reprint uses a new key. A mismatch returns HTTP 409.
Node.js
// Receipt PDF pushed to a Star queue
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: 'pdf',
content: receiptPdf.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
Do not disable a working poll blindly
If other software depends on CloudPRNT for that device, leave it. Use the agent on a different queue or a different printer.
TSP100 caution
Many TSP143 units want the futurePRNT driver and a PDF, not raw ESC/POS. Test one ticket.
Questions
Do I implement the CloudPRNT JSON?
Not for this path. You implement a print-jobs POST. The call is still POST /v1/print-jobs with a Bearer API key, and HTTP 201 means queued rather than printed.
Is 5 seconds a PrintBase interval?
No. That number is Star's documented default poll for the mC-Print3 when using CloudPRNT.
Can the same printer do both?
Only if you understand which path owns the device. Two owners will fight. Prefer one.
What status do I get?
PrintBase job status, not CloudPRNT's poll body. Failures use reason codes such as PRINTER_OFFLINE.
Free plan: 100 jobs a month on one computer, no card.