Skip to content

Integrations

Store integrations such as Zapier, Make, Power Automate and Business Central connect to Printsluis with an API key of the customer’s organization, the same keys as the HTTP API. This page describes what such an integration uses: the header that identifies it, a connection test, the lists for printer pickers, and webhook triggers.

The customer creates a key on the portal’s API keys page and pastes it into the integration. Ask only for the scopes the integration needs:

Scope For
print:create Print actions, and test prints
print:read Reading a job and its status
printers:read Printer and alias pickers
webhooks:manage Triggers: subscribing to events and unsubscribing (see Triggers)

webhooks:manage is never selected by default, and keys made before an integration needed it don’t have it: the customer creates a key with it. Whoever holds such a key can send the organization’s events to any address, so the portal shows a warning with it.

Send the X-Printsluis-Integration header with every request:

POST /v1/print-jobs
Authorization: Bearer pgw_…
X-Printsluis-Integration: zapier
Content-Type: application/json

The values are zapier, make, power-automate and business-central. A print job (and a test print) records it, and returns it as integration in its JSON, also in the portal’s job details. Any other value, or none, records no integration (null) and never fails a request. The header is not part of an idempotent request: a retry with the same Idempotency-Key without it returns the same job.

GET /v1/me tells whether the key works and what it may do. Any valid key may call it, whatever its scopes; an invalid or revoked key gets 401.

{
"kind": "organization",
"name": "Zapier",
"scopes": ["print:create", "printers:read", "webhooks:manage"],
"organization": { "id": "0193a6f0-2b4c-7d5e-8f6a-1b2c3d4e5f6a", "name": "Apotheek Noord" },
"partner": null
}

Show the organization’s name as the connection’s label, and check scopes before offering an action or trigger the key can’t use. A partner’s key has "kind": "partner" and the partner; its organization is filled only when X-Organization-Id names one of its customer organizations.

Request Scope Gives
GET /v1/printers?enabled=true printers:read Printers that accept jobs: id, friendlyName, location, formats and availability
GET /v1/printers?enabled=true&format=pdf printers:read Only those that print PDF (or zpl)
GET /v1/aliases printers:read Aliases: name, such as labels-warehouse, and the printerId it points to

Both are single, unpaged requests. Prefer an alias in a print action: the customer can move it to another printer without changing the flow, and an alias can fail over to its next printer. Print to an alias with "target": { "alias": "labels-warehouse" }, or to a printer with "target": { "printerId": "…" }.

Triggers are webhooks, managed as REST hooks with a key that has webhooks:manage:

  1. Subscribe when the user turns the trigger on: POST /v1/webhooks with the store’s hook URL and the event types of the trigger.

    { "url": "https://hooks.example.com/…", "description": "Zapier: failed jobs", "eventTypes": ["print_job.failed"] }

    The response (201) has the endpoint, with its id, and its signing secret, which is not shown again. Location is the endpoint’s absolute URL.

  2. Unsubscribe when the trigger is turned off: DELETE /v1/webhooks/{id}, or DELETE on the Location URL. 204 when deleted; 404 webhook_not_found when it was already gone, which counts as done.

Useful event types for triggers:

Trigger Event type
A job failed (or may not have printed) print_job.failed: failed, expired or indeterminate; data.status tells which
A job finished print_job.finished: any final status, including succeeded and cancelled
A printer needs attention or is unreachable printer.needs_attention, printer.unreachable
An agent went offline agent.offline

Webhooks must be in the organization’s plan (403 plan_limit otherwise). Each subscription shows up on the portal’s Webhooks page, where the customer’s admins can disable or delete it, and in their audit log by the key that made it. Verify each request’s signature with the secret, as described under Verifying the signature.