Developer docs
Printaloft is one small HTTPS API. You send a PDF to a role, Printaloft hands it to the right station and tells you what happened.
Basics
Base URL: https://api.printaloft.com. Every request carries your API key as “Authorization: Bearer pck_…”. Keys are per account and can be revoked one by one.
A role is a name you choose, for example packing-slip, invoice or label. In your account each role points to a printer and tray at a station. Your code only knows roles.
Submit a job
POST /v1/jobs with the PDF as Base64 (up to 20 MB). With ?wait=50 the request waits up to 50 seconds for the final status.
idempotencyKey is required and must be unique per print. Use something stable from your system, for example order number, document and attempt.
curl -X POST "https://api.printaloft.com/v1/jobs?wait=50" \
-H "Authorization: Bearer pck_…" \
-H "Content-Type: application/json" \
-d '{
"idempotencyKey": "order-1042:packing-slip:1",
"role": "packing-slip",
"pdfBase64": "JVBERi0xLjcK…",
"fileName": "packing-slip-1042.pdf",
"jobName": "Order 1042"
}'The answer
201 for a new job, 200 when the same key comes again. status is one of queued, delivered, spooled, printed, failed, cancelled or expired. ok is true only for printed.
If the job is not finished after the wait, ask again with GET /v1/jobs/<jobId>?wait=50.
{
"ok": true,
"accepted": true,
"jobId": "job_7f3c…",
"status": "printed",
"message": "Gedruckt.",
"printer": "Brother HL-L5100DN (Schacht 2)",
"stationOnline": true
}Ask for the status
Returns the same object as above. Repeat as often as you like, it never prints anything.
curl "https://api.printaloft.com/v1/jobs/job_7f3c…?wait=50" \
-H "Authorization: Bearer pck_…"Retries without double prints
Network errors and timeouts happen. Retry with the same idempotencyKey: you reach the same job and nothing is printed twice. The same key with a different PDF returns 409.
A wanted reprint gets a new key, for example by counting up the attempt at the end.
Cancel and deadlines
POST /v1/jobs/<jobId>/cancel cancels one job. POST /v1/jobs/cancel takes jobIds, idempotencyKeys or allOpen with olderThanSec. Anything not yet in the spooler can be cancelled.
Each job has a deadline until it reaches the spooler: 15 minutes by default, or expiresInSec per job (30 seconds to 24 hours). After that it is expired and never printed.
curl -X POST "https://api.printaloft.com/v1/jobs/cancel" \
-H "Authorization: Bearer pck_…" \
-H "Content-Type: application/json" \
-d '{ "allOpen": true, "olderThanSec": 600 }'Errors
| Code | Meaning |
|---|---|
400 | Invalid job |
401 | Missing or revoked key |
409 | Same key with different content, or the role cannot print safely right now (e.g. the queue names a different tray than the role's paper source); `message` gives the reason |
413 | PDF too large |
On 5xx without accepted: true the job was not taken; it is safe to retry with the same key.
The agent
A small program for the Windows PC or Mac next to your printers. Pair it once with a code from your account; after that it only opens outgoing HTTPS connections, fetches jobs, prints through the system print queue and reports back.
After you sign up, you download the agent and create API keys yourself in the console at app.printaloft.com. Questions? Write to mail@printaloft.com.