Skip to content

Create a print job from Base64 ​

Decode a small Base64 document and create a normal CloudPrint document and print job in one request.

POST/api/v1/print-jobs/from-base64API version: v1operationId: createPrintJobFromBase64View as Markdown

What this endpoint does ​

Decode a small Base64 document and create a normal CloudPrint document and print job in one request.

Authentication ​

Send a short-lived access token in Authorization: Bearer <access_token>.

Required scopes: documents:write, print_jobs:write

Request ​

Production base URL: https://public-api.cloudprint.me/api/v1/print-jobs/from-base64

Parameters ​

NameLocationTypeRequiredDescriptionConstraints
Idempotency-KeyheaderstringnoStable caller-generated key that makes retries return the original result instead of creating a duplicate.maxLength: 128
X-Request-IdheaderstringnoOptional request identifier for tracing; CloudPrint returns a safe value in the response header.maxLength: 128; example: "order-100045-attempt-1"

Request body ​

Content type: application/json

NameTypeRequiredDescriptionConstraints
document_base64string (byte)yesComplete document bytes encoded as Base64 without a data-URL prefix.—
document_filenamestring | nullnoFile name used for format detection and operator diagnostics.example: "order-100045.pdf"
document_formatstring | nullnoExplicit print format, such as pdf or raw. Both formats use documents:write.enum: pdf, raw; example: "pdf"
document_raw_languagestring | nullnoPrinter command language used by RAW data, for example ZPL or TSPL.enum: tspl, zpl, cpcl, escpos; example: null
printer_idstring (uuid)yesStable CloudPrint UUID of the destination printer.—
copiesintegernoNumber of copies CloudPrint asks the printer to produce.min: 1; max: 99; example: 1
intentstringnoBusiness purpose of the print job, used for diagnostics and sensible defaults.enum: document, shipping_label, product_label, invoice, packing_slip, a4_document, receipt; example: "shipping_label"
color_modestringnoRequested color handling; default leaves the decision to the printer configuration.enum: default, monochrome, color; example: "default"
duplex_modestringnoRequested one-sided or two-sided printing mode.enum: default, simplex, duplex_long_edge, duplex_short_edge; example: "default"
media_width_mmnumber | nullnoRequested media or label width in millimetres.min: 1; max: 2000; example: 58
media_height_mmnumber | nullnoRequested media or label height in millimetres.min: 1; max: 2000; example: 40
dpiinteger | nullnoTarget print resolution in dots per inch; use a value supported by the printer.min: 72; max: 2400; example: 203
scale_modestringnoControls whether the document keeps its size or is fitted to the target media.enum: none, fit; example: "none"
orientationstringnoRequested page orientation; default uses printer settings.enum: default, portrait, landscape; example: "default"
offset_x_mmnumbernoHorizontal print offset in millimetres.min: -2000; max: 2000; example: 0
offset_y_mmnumbernoVertical print offset in millimetres.min: -2000; max: 2000; example: 0
margin_top_mmnumbernoAdditional print margin in millimetres.min: 0; max: 2000; example: 0
margin_right_mmnumbernoAdditional print margin in millimetres.min: 0; max: 2000; example: 0
margin_bottom_mmnumbernoAdditional print margin in millimetres.min: 0; max: 2000; example: 0
margin_left_mmnumbernoAdditional print margin in millimetres.min: 0; max: 2000; example: 0

Example requests ​

cURL ​

bash
curl -sS https://public-api.cloudprint.me/api/v1/print-jobs/from-base64 \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: order-100045-label' \
  -d '{
    "document_base64": "JVBERi0xLjQK...",
    "document_filename": "order-100045.pdf",
    "printer_id": "11111111-1111-4111-8111-111111111111",
    "copies": 1,
    "intent": "shipping_label",
    "media_width_mm": 58,
    "media_height_mm": 40,
    "dpi": 203
  }'

Response ​

HTTP status: 201 — Print job created

Response fields ​

NameTypeRequiredDescriptionConstraints
print_job_idstring (uuid)yesStable UUID of the print job; persist it for status checks and support.—
document_idstring (uuid)yesStable UUID returned after a successful document upload.—
document_mime_typestringyesMIME type of the supplied document.example: "application/pdf"
document_formatstringyesExplicit print format, such as pdf or raw. Both formats use documents:write.enum: pdf, raw; example: "pdf"
document_raw_languagestring | nullyesPrinter command language used by RAW data, for example ZPL or TSPL.enum: tspl, zpl, cpcl, escpos; example: null
printer_idstring (uuid)yesStable CloudPrint UUID of the destination printer.—
statusstringyesCurrent resource or workflow state; use the endpoint-specific enum values.enum: pending, reserved, printing, printed, failed, cancelled; example: "pending"
copiesintegeryesNumber of copies CloudPrint asks the printer to produce.min: 1; max: 99; example: 1
intentstringyesBusiness purpose of the print job, used for diagnostics and sensible defaults.enum: document, shipping_label, product_label, invoice, packing_slip, a4_document, receipt; example: "shipping_label"
color_modestringyesRequested color handling; default leaves the decision to the printer configuration.enum: default, monochrome, color; example: "default"
duplex_modestringyesRequested one-sided or two-sided printing mode.enum: default, simplex, duplex_long_edge, duplex_short_edge; example: "default"
media_width_mmnumber | nullyesRequested media or label width in millimetres.min: 1; max: 2000; example: 58
media_height_mmnumber | nullyesRequested media or label height in millimetres.min: 1; max: 2000; example: 40
dpiinteger | nullyesTarget print resolution in dots per inch; use a value supported by the printer.min: 72; max: 2400; example: 203
scale_modestringyesControls whether the document keeps its size or is fitted to the target media.enum: none, fit; example: "none"
orientationstringyesRequested page orientation; default uses printer settings.enum: default, portrait, landscape; example: "default"
offset_x_mmnumberyesHorizontal print offset in millimetres.min: -2000; max: 2000; example: 0
offset_y_mmnumberyesVertical print offset in millimetres.min: -2000; max: 2000; example: 0
margin_top_mmnumberyesAdditional print margin in millimetres.min: 0; max: 2000; example: 0
margin_right_mmnumberyesAdditional print margin in millimetres.min: 0; max: 2000; example: 0
margin_bottom_mmnumberyesAdditional print margin in millimetres.min: 0; max: 2000; example: 0
margin_left_mmnumberyesAdditional print margin in millimetres.min: 0; max: 2000; example: 0
created_atstring (date-time)yesISO 8601 timestamp recorded by CloudPrint.—
reserved_atstring | null (date-time)yesISO 8601 timestamp recorded by CloudPrint.—
started_atstring | null (date-time)yesISO 8601 timestamp recorded by CloudPrint.—
completed_atstring | null (date-time)yesISO 8601 timestamp recorded by CloudPrint.—
failure_reasonstring | nullyesMachine-readable or diagnostic reason recorded when printing fails.—

Example response ​

json
{
  "print_job_id": "11111111-1111-4111-8111-111111111111",
  "document_id": "11111111-1111-4111-8111-111111111111",
  "document_mime_type": "application/pdf",
  "document_format": "pdf",
  "document_raw_language": null,
  "printer_id": "11111111-1111-4111-8111-111111111111",
  "status": "pending",
  "copies": 1,
  "intent": "shipping_label",
  "color_mode": "default",
  "duplex_mode": "default",
  "media_width_mm": 58,
  "media_height_mm": 40,
  "dpi": 203,
  "scale_mode": "none",
  "orientation": "default",
  "offset_x_mm": 0,
  "offset_y_mm": 0,
  "margin_top_mm": 0,
  "margin_right_mm": 0,
  "margin_bottom_mm": 0,
  "margin_left_mm": 0,
  "created_at": "2026-08-06T12:00:00Z",
  "reserved_at": "2026-08-06T12:00:00Z",
  "started_at": "2026-08-06T12:00:00Z",
  "completed_at": "2026-08-06T12:00:00Z",
  "failure_reason": "string"
}

Errors ​

HTTP statusDescription
400Invalid base64 request
401OAuth bearer token is missing or invalid
403OAuth bearer token lacks documents:write or print_jobs:write
409Idempotency key conflict or unsupported print route. Unsupported routes include details.reason.
413Document is too large
415Document format is not supported
422Document content, declared format, or print job request is invalid
429Rate limit exceeded
500Unexpected error
503Document security inspection is temporarily unavailable

Integration guidance ​

  • Base64 increases request size; prefer multipart upload or a public HTTPS URL for larger documents.
  • Use this shortcut for small receipts or labels when a separate upload is impractical. PDF and RAW input retain the existing documents:write authorization.
  • A 422 document rejection requires corrected input; retry a temporary inspection 503 with bounded backoff.
  • Apply the same idempotency and status-tracking rules as for normal job creation.

Guides for integrating CloudPrint, connecting the local agent and operating print workflows.