vsmsconnect — API — print

← all endpoints

GET/api/v1/businesses/:businessId/print/tills auth: jwt (administrator)

List every registered till for the business — name, machine id, `IsDefault`, `IsOnline`, `LastSeenAt`, and optional `LocationId`.

handlers: PrintController.listTills

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID. `requireBusinessAccess` enforces this matches the JWT.

Outputs

200
APIResponseDataList<TillDTO>
Till list.
PUT/api/v1/businesses/:businessId/print/tills/:tillId/name auth: jwt (administrator)

Rename a till. Fires `TILL_RENAMED` audit (resource type `TILL`).

handlers: PrintController.renameTill

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
tillId path
uuid
yes—Target till UUID.
tillName body
string
yes—New display name (1–500 chars).

Outputs

200
APIResponseDataObject<TillDTO>
Updated till.
404
APIError
Till not found for this business.
POST/api/v1/businesses/:businessId/print/tills/:tillId/test auth: jwt (administrator)

Dispatch a test PrintJob (`type='TEST'`) to the till. The agent picks it up on its next poll or via the SSE wake stream. Fires `TEST_PRINT_SENT` audit.

handlers: PrintController.testPrint

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
tillId path
uuid
yes—Target till UUID.

Outputs

200
APIResponseDataObject<{ printJobId: number }>
Newly created print-job id.
404
APIError
Till not found for this business.
POST/api/v1/businesses/:businessId/print/tills/setup-token auth: jwt (administrator)

Generate a one-time setup token used by the print agent's first-run wizard to claim a permanent TillToken. Optionally binds the resulting till to a specific Location (TAXCORE-246) — single-location merchants omit and the claim resolves to the business default. Fires `TILL_SETUP_TOKEN_GENERATED` audit.

handlers: PrintController.generateSetupToken

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
locationId body
uuid
no—Optional Location to bind the till to. Validated against the business — invalid → 422 LOCATION_NOT_FOUND.

Outputs

200
APIResponseDataObject<{ setupToken: string }>
Raw one-time setup token (only returned once).
422
APIError
LOCATION_NOT_FOUND — `locationId` does not belong to this business.
PATCH/api/v1/businesses/:businessId/print/default-till auth: jwt (administrator)

Set the default till for the business. Future auto-print jobs that don't carry an explicit till routing key target this till. Fires `TILL_DEFAULT_SET` audit.

handlers: PrintController.setDefaultTill

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
tillId body
uuid
yes—Till UUID to mark default.

Outputs

200
APIResponseDataObject<TillDTO>
Updated till.
404
APIError
Till not found.
GET/api/v1/businesses/:businessId/print/jobs auth: jwt (administrator)

List print jobs for the business, optionally filtered by status.

handlers: PrintController.listPrintJobs

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
status query
'PENDING' | 'PRINTED' | 'FAILED' | 'STALE'
no—Filter by `Status`.

Outputs

200
APIResponseDataList<PrintJobDTO>
Print jobs.
POST/api/v1/businesses/:businessId/print/jobs/:id/retry auth: jwt (administrator)

Reset a `FAILED` or `STALE` print job back to `PENDING` so the agent will pick it up again. Fires `PRINT_JOB_RETRIED` audit.

handlers: PrintController.retryPrintJob

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
id path
integer
yes—PrintJobId (BIGINT IDENTITY, coerced from string digits).

Outputs

200
APIResponseDataObject<PrintJobDTO>
Updated print job.
404
APIError
Print job not found or not retriable.
PUT/api/v1/businesses/:businessId/print/tills/:tillId/pos-register-id auth: jwt (administrator)

Manually point a claimed till at a physical register, or clear the assignment with an explicit null. The value is free text (max 100 chars) and is not validated against any provider device. Fires `TILL_REGISTER_ASSIGNED` audit.

handlers: PrintController.assignTillPosRegisterId

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
tillId path
uuid
yes—Target till UUID.
posRegisterId body
string | null
yes—Register identifier (trimmed, 1–100 chars), or null to clear. The key must be present; omitting it is a 422.

Outputs

200
APIResponseDataObject<TillDTO>
Updated till.
404
APIError
BUSINESS_NOT_FOUND — till not found for this business.
422
APIError
VALIDATION_ERROR — a path param is not a valid UUID or the body violates the schema.
DELETE/api/v1/businesses/:businessId/print/tills/:tillId/devices/:tillDeviceId auth: jwt (administrator)

Dismiss a stale device from a till's device list. Soft operation: the row is kept with `ForgottenAt` set, removes no access, and is revived if the device heartbeats again. Fires `TILL_DEVICE_FORGOTTEN` audit.

handlers: PrintController.forgetTillDevice

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
tillId path
uuid
yes—Target till UUID.
tillDeviceId path
uuid
yes—Target till device UUID.

Outputs

204
empty
Device dismissed.
404
APIError
VALIDATION_ERROR — device not found, already forgotten, or belongs to another business.
422
APIError
VALIDATION_ERROR — a path param is not a valid UUID or the body violates the schema.
POST/api/v1/businesses/:businessId/print/tills/:tillId/devices/:tillDeviceId/disconnect auth: jwt (administrator)

Cut one OAuth-paired (`mcp`) device off by revoking every live grant its client holds, so it stops collecting receipts until paired again. Unbinds the till if it still names that client, and retires the till's push registration when no other device remains attached. The device row is kept (use the DELETE route to forget it). Revoking zero grants is still a success. Fires `TILL_DEVICE_DISCONNECTED` audit.

handlers: PrintController.disconnectTillDevice

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
tillId path
uuid
yes—Target till UUID.
tillDeviceId path
uuid
yes—Target till device UUID.

Outputs

204
empty
Device disconnected.
404
APIError
VALIDATION_ERROR — device not found for this business.
422
APIError
VALIDATION_ERROR — device is not an OAuth (`mcp`) device (use revoke-setup-token for till-token devices), has no recognisable OAuth client, or a param is invalid.
501
APIError
VALIDATION_ERROR — device disconnect is not available on this deployment.
POST/api/v1/businesses/:businessId/print/tills/:tillId/revoke-setup-token auth: jwt (administrator)

Revoke a claimed till's TillToken and issue a fresh one-time setup token, forcibly cutting off a running print agent (lost device, reinstall, suspected leak). Fires `TILL_TOKEN_REVOKED` and `TILL_SETUP_TOKEN_GENERATED` (mode `revoke_and_reissue`) audits.

handlers: PrintController.revokeAndReissueSetupToken

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
tillId path
uuid
yes—Target till UUID.

Outputs

201
APIResponseDataObject<SetupToken>
Newly issued setup token.
404
APIError
BUSINESS_NOT_FOUND — till not found for this business.
422
APIError
VALIDATION_ERROR — a path param is not a valid UUID or the body violates the schema.
POST/api/v1/businesses/:businessId/print/jobs/retry-all auth: jwt (administrator)

Reset every failed (`FAILED` / `STALE`) print job for one till back to pending. Scoped to a till, not the business. Zero matches is not an error. Fires `PRINT_JOBS_BULK_RETRIED` audit.

handlers: PrintController.retryPrintJobsForTill

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
tillId body
uuid
yes—Till whose failed jobs are targeted.

Outputs

202
APIResponseDataObject<{ tillId: string; affected: number }>
Number of jobs retried.
422
APIError
VALIDATION_ERROR — a path param is not a valid UUID or the body violates the schema.
POST/api/v1/businesses/:businessId/print/jobs/dismiss-all auth: jwt (administrator)

Soft-dismiss every failed print job for one till so they leave the failed list. Zero matches is not an error. Fires `PRINT_JOBS_BULK_DISMISSED` audit.

handlers: PrintController.dismissPrintJobsForTill

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
tillId body
uuid
yes—Till whose failed jobs are targeted.

Outputs

202
APIResponseDataObject<{ tillId: string; affected: number }>
Number of jobs dismissed.
422
APIError
VALIDATION_ERROR — a path param is not a valid UUID or the body violates the schema.
POST/api/v1/businesses/:businessId/print/jobs/:id/dismiss auth: jwt (administrator)

Soft-dismiss one failed print job (status becomes `DISMISSED`, still listable via the status filter). A print job is not a fiscal record, so this only means the paper receipt did not print. Fires `PRINT_JOB_DISMISSED` audit.

handlers: PrintController.dismissPrintJob

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
id path
integer
yes—PrintJobId (BIGINT IDENTITY, coerced from string digits).

Outputs

202
APIResponseDataObject<{ printJobId: number }>
Job dismissed.
422
APIError
VALIDATION_ERROR — job not found for this business or not `FAILED`/`STALE`, or invalid params.