Skip to content

A receipt printer's poll (Epson Server Direct Print)

POST
/v1/print/epson/sdp
curl --request POST \
--url 'https://api.aerandil.com/v1/print/epson/sdp?tenant=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data ConnectionType=GetRequest \
--data ID=example \
--data Name=example \
--data Password=example \
--data ResponseFile=example

Where a printer configured for Epson Server Direct Print comes for its work. The printer POSTs a form (application/x-www-form-urlencoded): ConnectionType=GetRequest asks for the next job and is answered 200 text/xml with <PrintRequestInfo Version="2.00"> — one <ePOSPrint> with <Parameter> (devid, timeout, printjobid) and <PrintData> (the receipt’s <epos-print>) — or an empty 200 when nothing is queued; ConnectionType=SetResponse reports the jobs’ results in ResponseFile (<PrintResponseInfo>) and is answered an empty 200. Public: a printer carries no bearer. The printer names its tenant (tenant query parameter), its device by ID (the device’s code) and proves it with the secret whose SHA-256 the device holds (print_secret_hash), as the HTTP Basic password or a Password form field. Refusals carry no body: 401 (not an active printer holding that secret; with a Basic challenge), 429 (more than a burst of 5 polls, refilled at one a second), 404 (AERANDIL_PRINT_SDP_ENABLED is off).

tenant
required
string format: uuid

The tenant the printer is registered under (not a secret).

Media typeapplication/x-www-form-urlencoded
object
ConnectionType
required
string
Allowed values: GetRequest SetResponse
ID

The printer’s Server Direct Print ID: its device code.

string
Name
string
Password

The printer’s secret, when not sent as HTTP Basic.

string
ResponseFile

SetResponse only: the <PrintResponseInfo> document.

string

A job as <PrintRequestInfo>, or an empty body.

Media typetext/xml
string

Not an active printer holding that secret (no body).

Server Direct Print is not enabled (no body).

Polling faster than a printer is set to (no body).