Skip to main content
Version: v1 (Current)

Print server processing flow

A print integration has three separate responsibilities: create and track a print job, obtain printable content, and deliver that content to a physical printer. A successful API request proves only the operation that endpoint performs. Creating a job or generating an image does not prove a badge came out of the printer.

Prepare the project​

  1. Configure a credential type, its badge template and the version/design used by the rendering workflow.
  2. Use the attendee credential API to list credentials at GET /api/v1/projects/{teamSlug}/{projectSlug}/attendees/{attendee}/credentials, or inspect the attendee’s Credentials section in the dashboard. Use a returned credential record’s id; do not substitute the attendee ID, credential identifier string or type slug. Ensure the attendee has the intended credential. Attendee IDs and attendee credential IDs are different identifiers; rendering requests below require the credential ID.
  3. Configure the access point and, if needed, the reader that will handle the job. Use IDs belonging to the same project.
  4. Authenticate the print integration and verify its access to the project, printable entity and private broadcast channels. Keep project API keys out of public browser code.
  5. Verify one preview, one job lifecycle and one physical print with the installed client before starting an event. Check orientation, resolution, stock and the selected physical printer.

The current job model supports polymorphic printable entities. The API creation controller recognizes attendee credentials and social-stream posts; badge-image rendering endpoints described here use attendee credentials. A job's support for a printable type does not establish that every renderer or installed client supports it.

Discover badge templates​

On the project API base /api/v1/projects/{teamSlug}/{projectSlug}, use GET /badge-templates or POST /badge-templates/search to discover template content linked to this project's credential types. These paths are outside /printing. This v1 registration exposes list/search, not a badge-template detail, create, update or delete endpoint; do not invent /badge-templates/{id} from a returned ID.

Both methods use the same list authorization/query lifecycle. The base permission is view_badge_templates, with the project's authenticated/page context and applicable permission-plan row scope. The explicit query requires a non-null current-version pointer, at least one credential type in this project using the template, and either matching owning team or is_public. It does not simply filter the template's own project_id. An unlinked team/public template can therefore be absent. Public template status is an eligibility condition, not anonymous authentication or a new operation grant.

List/search default to limit=100, with maximum 1000 and resource pagination. Nonpositive limits use the default; values over the maximum fail with 422. Follow data, links and meta; no default stable sort is added by this controller. It permits broad Orion filtering/sorting, including the relation filter attendeeCredentialTypes.id, but it declares no searchable text fields. POST search can carry supported filter/sort descriptors; do not assume a free-text search matches template names. Query capabilities do not grant access to otherwise excluded templates.

The serializer always loads the linked current version and its assets. It returns template id/name, version_id as a version-row ID, version_updated_at, raw design/settings, and an assets map keyed by stored filename. It does not return the template slug, display version number, publication flag or a credential-type list. Accepted includes are currentVersion, currentVersion.assets, attendeeCredentialTypes and projectTags; only projectTags adds an explicit optional project_tags field here. Do not expect arbitrary loaded relations to become response fields.

This synthetic shape is not a usable badge design or an executed result:

{
"data": [
{
"id": 123,
"name": "Documentation badge",
"version_id": 456,
"version_updated_at": "2026-10-15T12:00:00+00:00",
"design": {},
"settings": {},
"assets": {"example.png": null}
}
],
"links": {},
"meta": {}
}

A current-version pointer is not a published-version selection or validation that design content is nonempty/renderable. There is no explicit publication filter in this discovery query. If the relation cannot resolve, the resource returns an empty array row rather than a normal template object; discard that unusable item and ask the template owner to reconcile its current version. Do not repair it by choosing an unrelated template ID or writing directly to storage.

Asset mappings omit empty filenames; duplicate stored filenames overwrite earlier map entries in iteration order, so use distinct filenames. Asset URLs can be null when unavailable and request five-minute signing where supported; other storage adapters can return configured ordinary URLs. Refresh through an authorized discovery call rather than saving expiring URLs as permanent design assets. An assets map, version timestamp or 200 response proves neither upload/malware readiness nor a successful rendered/physical badge.

If a template is missing, check the credential-type link in this project, owning team/public flag, current pointer, caller permission and page/data scope, then pagination and filters. For blank rows or design, inspect the selected version with its owner. For missing images, inspect stored filenames, null/expired links and actual renderer access. Verify allowed/denied callers, another project's credential type, linked/unlinked and public/private templates, unpublished current content, missing version and duplicate/null assets in an authorized test environment. Structural and isolated serializer checks do not establish those deployed authorization, storage or print outcomes.

Current API operations​

All paths below are relative to:

/api/v1/projects/{teamSlug}/{projectSlug}/printing

These routes inherit Sanctum authentication and project/team scoping. The public routes register these job operations:

OperationRoute
Create jobPOST /print-jobs
Read jobGET /print-jobs/{print_job}
Update jobPUT or PATCH /print-jobs/{print_job} through the same resource update operation
Search jobsPOST /print-jobs/search
Batch createPOST /print-jobs/batch
Batch updatePATCH /print-jobs/batch

There is no ordinary job index or delete operation in this route registration. Use the REST API reference for the exact search and batch envelopes; do not infer a list endpoint or batch request shape from the single-job example.

Separate content operations are registered as:

OperationRouteController response
Badge previewPOST /previewprint_preview, resolution, orientation
Badge HTMLPOST /htmlhtml, resolution, orientation
Published badge contentPOST /printcontent, resolution, orientation
Batch previewPOST /batch-previewPer-item results; verify the batch contract before use
Batch print contentPOST /batch-printPer-item results; verify the batch contract before use

The earlier conceptual names /print-preview, /print-badge, /update-job and /create-audit-log are not the current routes. Do not build a client against them.

Create and track a job​

For an attendee badge, submit an existing credential and access point. This illustrative JSON requires IDs from your project and a fresh UUID idempotency key:

{
"attendee_credential_id": 123,
"access_point_id": 45,
"requires_approval": true,
"approval_mode": "manual",
"idempotency_key": "55811e3c-6829-4f0d-8a7c-133e035896d2"
}

The current request accepts attendee_credential_id or social_stream_post_id, access_point_id, optional access_point_reader_id, requires_approval, approval_mode and idempotency_key. The access point must belong to the project. A supplied reader must belong to the project and is additionally constrained by the access point when that value is present in the request. Supply exactly the intended printable ID; if both printable IDs reach the controller, the attendee credential branch takes precedence.

The server derives project ownership and printable model identity. Creation strips client-supplied status, approval identity/time, morph fields and arbitrary metadata. For social posts, the controller derives social-stream metadata. Do not submit a template ID as a substitute for a printable entity.

Approval behavior:

  • requires_approval defaults to true in the controller. A job requiring approval starts as pending_approval, with a default controller mode of manual. Explicitly supply the flag and mode as shown so validation and intent agree.
  • With requires_approval: false, the initial status is approved, the mode is null and the controller records the authenticated actor and approval time.
  • Approval modes are manual and auto. Selecting the mode auto while still requiring approval does not by itself make this controller create an approved job.
  • The idempotency key is a UUID, generated when omitted. The create validator requires a supplied key to be unique; do not assume repeating a POST returns an existing job. Reconcile an uncertain create result before issuing a new key and risking a duplicate physical print.

The model recognizes pending_approval, approved, ready_to_print, printing, completed, rejected and failed. These are allowed status values, not proof of a server-enforced transition graph. The reviewed update rules validate membership in that list. Send the intended status when updating; the controller reads it directly when deciding whether to stamp a new approval actor/time.

For example, after an actual approval:

{
"status": "approved"
}

A transition into approved from another status stamps the authenticated actor and current time. The update rules also accept caller-supplied approved_by_id, approved_by_type and approved_at. The controller replaces these with the current actor/time only when entering approved from a different status. An update that keeps an already approved job approved, or changes it to another status, does not take that stamping branch. Treat these stored fields as workflow metadata, not an immutable approval audit trail. Restrict write access to trusted integrations and reconcile the actor and transition in your application. Only report completed after the installed client's supported completion check. An HTTP success response to a status update does not independently verify printer output.

The job resource exposes printable identity, project/access-point/reader IDs, status, idempotency key, approval fields, metadata and timestamps. printable appears when loaded; supported includes are printable and printable.attendee. Loading attendee details increases the personal data returned to the client; request it only when the workflow needs it.

Single-job update contract and recovery​

Use the numeric print-job row ID for {print_job}; it is not a credential ID, attendee ID or idempotency key. PUT and PATCH share this partial-update controller. Always send an explicit status, including when changing only approval mode or the approval actor/time fields. Current statuses are pending_approval, approved, ready_to_print, printing, completed, rejected and failed. The validator marks status as optional, but the updater directly reads it when the stored job is not already approved. A body without status can therefore fail before saving; do not rely on that omission working because an already-approved job took a different branch.

The other validated update keys are approval_mode (manual, auto or null), approved_by_id (integer or null), approved_by_type (user, access_point, system or null) and approved_at (date or null). These are optional and omitted values are preserved. The caller-supplied actor-type aliases differ from the fully qualified actor class stamped by the server when entering approved; do not copy a response's class string back as a validated input alias. Prefer sending status alone for approval rather than supplying actor/time yourself.

This update path does not change the printable, project, access point/reader, approval requirement, idempotency key or arbitrary metadata. Those keys are absent from the selected update rules and are not passed through validated-only retrieval; an HTTP success is not proof they changed. Use the appropriate supported configuration or create workflow instead of echoing the entire returned job as an update body.

No transition graph, compare-and-swap precondition, completed-output verification or replay receipt is implemented by this updater. For example, the method itself does not prevent rejected → completed. Coordinate transitions through the trusted print integration, read current state before sending, and reconcile competing writers or an uncertain response before retry. An explicit approved update from another status stamps actor/time; repeating it after approval does not re-stamp those fields. A lost response may follow a persisted save or emitted event, so retrying is not evidence of exactly-once processing. Orion's outer transactions are disabled in the reviewed platform configuration; do not infer whole-request rollback from inherited transaction hooks.

Read back the returned data resource and a fresh authorized GET, checking job ID, project, intended status and approval metadata. The resource exposes the fields listed above; optional printable contains the mapped credential/social resource only when loaded and can be null. Do not assume nested attendee fields are safe for a public client. Test allowed and denied principals, another project's ID, missing-status rejection, competing writers and actual broadcast/client completion in an authorized environment. Isolated request/updater/serializer checks do not prove those deployed outcomes or physical printing.

Batch job requests​

Batch job operations use a resources envelope containing 1–1,000 resources. This limit applies to jobs, separately from the smaller credential-content batches below. For batch creation, provide a list of objects using the same printable, access-point and approval fields as single creation. Each item must satisfy its own printable-ID requirement; a credential in one item does not satisfy another item's requirement. Supplied idempotency keys must be unique both within the request and against existing jobs. Omitted keys are generated by the creation controller.

Batch updates use job IDs as resource keys, rather than a list of objects with an id property. For example, after independently confirming that jobs 123 and 124 should enter the indicated states:

{
"resources": {
"123": {"status": "approved"},
"124": {"status": "rejected"}
}
}

Use actual print-job IDs from the current project. Every resource key must be an integer or a string of digits. Update rules allow status, approval actor/type/time and approval mode; they do not provide a general printable, access-point or metadata replacement operation. Include status in each item because the current update controller reads that attribute when deciding whether to stamp approval identity and time.

The creation request's batch whitelist covers the two printable IDs, approval requirement/mode, access point, optional reader and idempotency key. Its request-level authorize() and the current PrintJobPolicy methods return true; those methods alone do not establish project access. Authentication, route middleware, project-scoped fetches and applicable permission/data-scope rules remain separate checks. Validate the deployed integration principal before relying on the endpoint. Neither the whitelist nor an accepted batch establishes atomic execution, safe replay, printer delivery or an enforced approval transition graph.

Generate content​

The single preview, HTML and print-content requests accept:

{
"attendee_credential_id": 123
}

The controller first looks up the credential within the current project, then authorizes printPreview or print on that credential. The reviewed credential policy allows a reader for the same project, a project principal for its own credential, an attendee for their own credential, and an administrator with the configured attendee-credential view permission. Other principals are denied by that policy. Route authentication and additional platform scopes still apply; verify the actual principal you deploy.

Single-content request rules require an integer credential ID but do not perform the project-scoped existence check themselves. The controller then looks up the credential within the route project and throws an exception if absent. Do not assume an unknown or foreign-project integer produces the same validation response as a malformed ID or as a batch existence failure. Confirm the deployed error response before building client error mapping.

/preview calls the credential's preview-image renderer and writes a preview_requested audit record. /html writes a preview audit record and returns rendered HTML, or a server error when no HTML is generated. /print commits its print_generated audit record before invoking image rendering and returning the published badge content. A later rendering failure can therefore leave that audit record present. In this controller, /print does not create a PrintJob or submit anything to the OS spooler. These single content requests do not take a print-job ID or check its approval status; the integration must coordinate its approval workflow and content requests deliberately.

Template version, image format and failures​

The credential rendering path follows its credential type's linked badge template and currentVersion. The parser requires current_version_id, a resolvable current version and non-empty design content. Do not assume the method name returnPublishedBadgeImage selects the newest published version independently: this path prepares the linked current version before rendering. Confirm the intended version is current before an event.

The image converter returns a full PNG data URL beginning data:image/png;base64,. Handle that prefix when passing content to a client expecting raw bytes or bare base64. The response's resolution describes physical width, height and units from current-version settings; it is not a pixel-dimension pair. Defaults are width 3.5, height 5.55, units in, and orientation portrait when those settings are absent.

Preview generation requests a repeated watermark and overrides rendering DPI to 300. Published-content generation does not request a watermark and uses version settings; the converter defaults to 300 DPI when no numeric DPI is provided. Missing watermark assets or watermark-processing failures are logged and can leave an otherwise returned image without a watermark. Do not use watermark presence as an authorization or approval boundary.

Image generation builds HTML and runs the server-side wkhtmltoimage converter under a virtual display, using temporary files that it removes afterward. Failed conversion or empty image output throws an exception. Fonts and image assets must be available to the renderer; the HTML-rendering service can embed preloaded asset data. The installed desktop client's own caching and offline behavior are separate.

Missing template/version data can make image generation return null. Other parts of the response still read template settings, so do not assume every incomplete design produces a clean, uniform error. The HTML controller explicitly returns a server error for empty HTML. Before accepting image results, check both the per-item error (for batches) and that content is a non-empty value in the expected format; error: null alone is not a guarantee of usable content. Fix the template/current version, attendee association or renderer availability before retrying.

Batch content generation​

Batch content requests are different from batch job creation and updates. Use POST /batch-preview for 1–25 credential IDs, or POST /batch-print for 1–100. Every ID must belong to the current project. The batch-print request also accepts an optional access_point_id from that project. That access point is recorded in the audit entry; it does not cause the API to select or contact a physical printer.

For example, this payload can be used with either batch content endpoint when both credentials belong to the project:

{
"attendee_credential_ids": [123, 124]
}

An empty array, an oversized array or an ID outside the project fails request validation before the controller processes the batch. The rules do not require distinct IDs, and the controller iterates the input IDs in order. Deduplicate your input before submission if each credential should be generated once; repeated IDs can cause repeated generation and audit entries.

After validation, the response is a bare JSON array, with results in input order. Each result includes attendee_credential_id, resolution, orientation, error and either print_preview or content. A normal successful controller result has error: null. For a caught per-item failure, content and dimensions are null and error contains a message, such as:

[
{
"attendee_credential_id": 124,
"content": null,
"resolution": null,
"orientation": null,
"error": "Not authorized to print this credential"
}
]

This illustrates a failed batch-print item, not a response envelope or a guarantee that the example credential is unauthorized. Match each result to its credential ID and inspect error before handing content to the client. HTTP success alone is not success for every item.

The controller catches per-item authorization failures and rendering exceptions, so a batch can return a mixture of successful and failed items. It also handles a credential disappearing between validation and processing as a not-found item. Audit writes occur before rendering: a preview-requested or print-generated audit record is therefore not proof that content generation succeeded. Other exceptions can still abort the request; preview audit writes are not enclosed in a whole-batch transaction, while batch print wraps its processing in a transaction. Do not assume all errors become per-item results or that every batch is all-or-nothing.

For recovery, retain the original input and per-item results. Retry only the failures whose cause has been resolved. If the response was lost, reconcile the relevant audit/client state before resubmitting the entire batch; these content requests do not provide a documented idempotent replay result. They still do not create print jobs or verify physical delivery.

Realtime and physical delivery​

The model dispatches PrintJobCreated and PrintJobUpdated. The base event broadcasts after commit on private portal.AccessPoint.{accessPointId} and portal.Project.{projectSlug} channels when those identities resolve. This is not the older illustrative accessPoint-XYZ channel. Channel authorization, transport, queue operation and client reconnect behavior require deployment verification.

PrintJobUpdated inherits the same channel/payload implementation as creation, but its reviewed class chain declares no broadcastAs. The short catalog/dependency identity is therefore not proof of an explicit short wire alias; verify the deployed formatter and host listener before subscribing literally. Model updates dispatch it through the model event mapping. It reports a model update, not an enforced transition graph, completed physical output or exactly-once delivery.

The broadcast payload is a model object, rather than the REST resource envelope. Its printable details are assembled separately: credential events can include attendee ID, first name, last name and contact email; social-post events can include poster identity and media URLs. REST include choices do not suppress those event fields. Subscribe only from clients entitled to receive that project/access-point data, avoid logging complete payloads, and reconcile the job through the API after reconnecting.

Use realtime messages as a notification to reconcile job state. A desktop client's SQLite queue, approval UI, printer pooling, retry schedule, OS job tracking and offline behavior are client-specific. Verify those features in its supported implementation; the platform API does not guarantee them merely by storing job statuses.

Troubleshooting​

SymptomCheck
Job rejected during creationProject-scoped credential/post and access point IDs, reader association, approval mode and UUID uniqueness. Do not substitute attendee ID for credential ID.
Job remains pending despite auto modeCheck requires_approval; mode alone does not change the controller's initial-status branch.
No ordinary job list responseThe route registers search, not index. Use the current API reference for search.
Job exists but nothing printsConfirm the installed client received or reconciled it, approved it, fetched content and submitted it to the correct physical printer.
Preview works but job approval is bypassedSingle content endpoints authorize the credential and do not inspect a job's approval status. Review integration orchestration.
No realtime notificationCheck private channel identity/authorization and deployed broadcast processing, then reconcile server job state. Avoid blindly creating another job.
Audit says print generated but badge is absentThe content controller records generation, not physical delivery. Check the client and spooler result.
Duplicate/retried create rejectedA supplied idempotency UUID must be unique. Locate the existing job before generating another key.

Verification scope​

The documented route, job validation/controller, credential policy, content batch, renderer and broadcast-payload contracts completed source review through 2026-10-15. Scoped offline checks cover canonical job creation (one case/four assertions), batch-content validation (one/10), batch-update keys and approval metadata (two/eight), direct credential print policy (one/14), and embedded assets/font synthesis (two/five). A fresh-reader review checked setup, approvals, recovery, image format and delivery limits. These checks do not execute the full deployed HTTP authorization, image converter, broadcast transport, installed client, concurrent processing or physical printing; those remain acceptance work. The examples illustrate request contracts; they are not live print instructions for an existing project.