Skip to main content

Jobs

List jobs, newest first​

GET /v1/jobs

Scope: jobs:read

Filter metadata with metadata.<key>=<value> query parameters.

Parameters

NameInTypeRequiredDescription
cursorquerystring
limitquerystring1–100, default 25
toquerystringCreated before (ISO 8601)
fromquerystringCreated at or after (ISO 8601)
printerIdquerystring
deviceIdquerystring
statequery"queued" | "sending" | "printed" | "failed" | "cancelled"

Responses

StatusDescription
200A page of jobs.

Fields of the 200 response:

FieldTypeRequiredDescription
dataobject[]yes
data[].idstringyes
data[].idempotencyKeystring | nullyes
data[].deviceIdstring | nullyes
data[].printerIdstring | nullyes
data[].source"local" | "cloud"yes
data[].mode"live" | "test"yestest: created with a jp_test_ key
data[].typestringyes
data[].templateIdstring | nullyesThe template the job was printed from, if any
data[].state"queued" | "sending" | "printed" | "failed" | "cancelled"yes
data[].attemptintegeryes
data[].errorCodestring | nullyes
data[].errorMessagestring | nullyes
data[].metadataobjectyes
data[].contentRetainedbooleanyesWhether the content is still stored (needed to reprint)
data[].hasPreviewbooleanyesSandbox jobs (jp_test_ keys): GET /v1/jobs/{id}/preview returns the printed receipt as PNG
data[].createdAtstringyesISO 8601 date-time
data[].updatedAtstringyesISO 8601 date-time
data[].dispatchedAtstring | nullyes
data[].printedAtstring | nullyes
data[].expiresAtstring | nullyes
data[].eventsobject[]
nextCursorstring | nullyesPass as ?cursor= for the next page
curl "https://api.jodaprint.dev/v1/jobs" \
-H "Authorization: Bearer $JODAPRINT_API_KEY"

Create a print job​

POST /v1/jobs

Scope: jobs:write

Dispatched at once when the device is online, otherwise queued until it reconnects or the job expires.

Parameters

NameInTypeRequiredDescription
Idempotency-KeyheaderstringSame key within 24 hours returns the first job and prints nothing.

Request body

A job-request (protocol/schemas/job-request.json) plus the target: printerId, or deviceId with an optional alias. The Idempotency-Key header overrides idempotencyKey in the body. To print a template, send templateId and its variables in data instead of type, encoding and content; the cloud renders it (GET /v1/templates lists them).

FieldTypeRequiredDescription
idempotencyKeystringSame key within 24 h returns the first job and prints nothing.
printerprinter-refSelects a printer by id, alias or name (A7). Omit the whole reference to use the default printer.
templateIdstringPrint a stored template (ZPL, EPL or receipt) filled with data. The job then has no type or encoding.
type"receipt" | "escpos" | "raw" | "zpl" | "epl" | "pdf" | "image" | "text" | "html"
encoding"json" | "base64" | "utf8" | "url"
datastring | receipt-document | objectyesJob content, or template variables with templateId.
optionsjob-optionsPrint options (A7). Printers ignore options they do not support.
metadataobjectFree key/value pairs stored with the job and searchable.
printerIdstringExample: "prn_01J8Z2ABCDEF"
deviceIdstringExample: "dev_01J8Z2ABCDEF"
aliasstringExample: "receipt"
{
"printerId": "prn_01J8Z2ABCDEF",
"type": "receipt",
"encoding": "json",
"data": {
"width": "80mm",
"blocks": [
{
"type": "text",
"value": "Hello"
},
{
"type": "cut",
"mode": "partial"
}
]
},
"options": {
"copies": 1
},
"metadata": {
"orderId": "10492"
}
}

Responses

StatusDescription
200A job with this idempotency key already exists; it is returned unchanged.
201The job was created.
400INVALID_JOB
402LICENSE_LIMIT: monthly jobs of the plan used up

Fields of the 200 response:

FieldTypeRequiredDescription
idstringyes
idempotencyKeystring | nullyes
deviceIdstring | nullyes
printerIdstring | nullyes
source"local" | "cloud"yes
mode"live" | "test"yestest: created with a jp_test_ key
typestringyes
templateIdstring | nullyesThe template the job was printed from, if any
state"queued" | "sending" | "printed" | "failed" | "cancelled"yes
attemptintegeryes
errorCodestring | nullyes
errorMessagestring | nullyes
metadataobjectyes
contentRetainedbooleanyesWhether the content is still stored (needed to reprint)
hasPreviewbooleanyesSandbox jobs (jp_test_ keys): GET /v1/jobs/{id}/preview returns the printed receipt as PNG
createdAtstringyesISO 8601 date-time
updatedAtstringyesISO 8601 date-time
dispatchedAtstring | nullyes
printedAtstring | nullyes
expiresAtstring | nullyes
eventsobject[]
events[].state"queued" | "sending" | "printed" | "failed" | "cancelled"yes
events[].errorCodestring | nullyes
events[].atstringyesISO 8601 date-time
curl -X POST "https://api.jodaprint.dev/v1/jobs" \
-H "Authorization: Bearer $JODAPRINT_API_KEY" \
-H "Idempotency-Key: order-10492-receipt" \
-H "Content-Type: application/json" \
-d '{"printerId":"prn_01J8Z2ABCDEF","type":"receipt","encoding":"json","data":{"width":"80mm","blocks":[{"type":"text","value":"Hello"},{"type":"cut","mode":"partial"}]},"options":{"copies":1},"metadata":{"orderId":"10492"}}'

Get a job with its state history​

GET /v1/jobs/{id}

Scope: jobs:read

Parameters

NameInTypeRequiredDescription
idpathstringyes

Responses

StatusDescription
200The job, with events.
404JOB_NOT_FOUND

Fields of the 200 response:

FieldTypeRequiredDescription
idstringyes
idempotencyKeystring | nullyes
deviceIdstring | nullyes
printerIdstring | nullyes
source"local" | "cloud"yes
mode"live" | "test"yestest: created with a jp_test_ key
typestringyes
templateIdstring | nullyesThe template the job was printed from, if any
state"queued" | "sending" | "printed" | "failed" | "cancelled"yes
attemptintegeryes
errorCodestring | nullyes
errorMessagestring | nullyes
metadataobjectyes
contentRetainedbooleanyesWhether the content is still stored (needed to reprint)
hasPreviewbooleanyesSandbox jobs (jp_test_ keys): GET /v1/jobs/{id}/preview returns the printed receipt as PNG
createdAtstringyesISO 8601 date-time
updatedAtstringyesISO 8601 date-time
dispatchedAtstring | nullyes
printedAtstring | nullyes
expiresAtstring | nullyes
eventsobject[]
events[].state"queued" | "sending" | "printed" | "failed" | "cancelled"yes
events[].errorCodestring | nullyes
events[].atstringyesISO 8601 date-time
curl "https://api.jodaprint.dev/v1/jobs/<id>" \
-H "Authorization: Bearer $JODAPRINT_API_KEY"

Preview of a sandbox job​

GET /v1/jobs/{id}/preview

Scope: jobs:read

The receipt a sandbox job (jp_test_ key) printed on the cloud's virtual printer, as PNG. Only receipt, escpos, raw and text jobs have one; it is deleted with the job content.

Parameters

NameInTypeRequiredDescription
idpathstringyes

Responses

StatusDescription
404JOB_NOT_FOUND or NOT_FOUND (no preview)
curl "https://api.jodaprint.dev/v1/jobs/<id>/preview" \
-H "Authorization: Bearer $JODAPRINT_API_KEY"

Cancel a queued cloud job​

POST /v1/jobs/{id}/cancel

Scope: jobs:write

Parameters

NameInTypeRequiredDescription
idpathstringyes

Responses

StatusDescription
200The job, now cancelled.
409JOB_ALREADY_FINISHED

Fields of the 200 response:

FieldTypeRequiredDescription
idstringyes
idempotencyKeystring | nullyes
deviceIdstring | nullyes
printerIdstring | nullyes
source"local" | "cloud"yes
mode"live" | "test"yestest: created with a jp_test_ key
typestringyes
templateIdstring | nullyesThe template the job was printed from, if any
state"queued" | "sending" | "printed" | "failed" | "cancelled"yes
attemptintegeryes
errorCodestring | nullyes
errorMessagestring | nullyes
metadataobjectyes
contentRetainedbooleanyesWhether the content is still stored (needed to reprint)
hasPreviewbooleanyesSandbox jobs (jp_test_ keys): GET /v1/jobs/{id}/preview returns the printed receipt as PNG
createdAtstringyesISO 8601 date-time
updatedAtstringyesISO 8601 date-time
dispatchedAtstring | nullyes
printedAtstring | nullyes
expiresAtstring | nullyes
eventsobject[]
events[].state"queued" | "sending" | "printed" | "failed" | "cancelled"yes
events[].errorCodestring | nullyes
events[].atstringyesISO 8601 date-time
curl -X POST "https://api.jodaprint.dev/v1/jobs/<id>/cancel" \
-H "Authorization: Bearer $JODAPRINT_API_KEY"

POST /v1/jobs/{id}/reprint

Scope: jobs:write

Only while its content is retained. The new job has metadata.reprintOf.

Parameters

NameInTypeRequiredDescription
idpathstringyes

Responses

StatusDescription
201The new job.
409CONFLICT: content no longer retained

Fields of the 201 response:

FieldTypeRequiredDescription
idstringyes
idempotencyKeystring | nullyes
deviceIdstring | nullyes
printerIdstring | nullyes
source"local" | "cloud"yes
mode"live" | "test"yestest: created with a jp_test_ key
typestringyes
templateIdstring | nullyesThe template the job was printed from, if any
state"queued" | "sending" | "printed" | "failed" | "cancelled"yes
attemptintegeryes
errorCodestring | nullyes
errorMessagestring | nullyes
metadataobjectyes
contentRetainedbooleanyesWhether the content is still stored (needed to reprint)
hasPreviewbooleanyesSandbox jobs (jp_test_ keys): GET /v1/jobs/{id}/preview returns the printed receipt as PNG
createdAtstringyesISO 8601 date-time
updatedAtstringyesISO 8601 date-time
dispatchedAtstring | nullyes
printedAtstring | nullyes
expiresAtstring | nullyes
eventsobject[]
events[].state"queued" | "sending" | "printed" | "failed" | "cancelled"yes
events[].errorCodestring | nullyes
events[].atstringyesISO 8601 date-time
curl -X POST "https://api.jodaprint.dev/v1/jobs/<id>/reprint" \
-H "Authorization: Bearer $JODAPRINT_API_KEY"