Epson Server Direct Print: how it works and a push alternative
Epson Server Direct Print makes a TM printer poll your web server for ePOS-Print XML. How that polling works, and how to push ESC/POS or PDF through an agent instead.
For POS developers hosting or avoiding Epson's poll endpoint
Overview
Epson's Server Direct Print manual says a TM Intelligent printer periodically requests your web server, and you return ePOS-Print XML if there is something to print, or an empty response if there is not. Your server has to be reachable by the printer.
The PrintBase path does not use that poll. You POST ESC/POS as raw, or a PDF, to the printer_code of an Epson queue. The agent is on a PC that already prints to that Epson. The printer does not need to reach your cloud.
If you already return ePOS-Print XML and it works, this page is not a requirement to rewrite it. It is the alternative when you do not want a device-facing endpoint.
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
// ESC/POS receipt for an Epson 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: '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
XML versus bytes
Server Direct Print wants ePOS-Print XML in the poll response. PrintBase raw wants ESC/POS bytes, or a PDF. They are not the same body.
Intelligent printers
Epson's manual ties the feature to TM Intelligent printers and printers attached to them. A plain USB TM-T20 on a PC is a better fit for the agent.
Questions
Must the printer support Server Direct Print?
No, not for the agent path. It must appear as an OS printer.
Can I send ePOS XML as raw?
Only if the device prints that XML as-is, which a normal ESC/POS printer will not. Send ESC/POS bytes or PDF.
Who starts the connection?
For Server Direct Print, the printer does. For PrintBase, the agent does, outbound, and your server only talks to the API.
Is there an Epson plugin?
No. 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.