# Kiosk Printing: Automate Tickets and Receipts by API

> Build reliable kiosk printing for tickets, receipts, and PDFs. Connect local printers, prevent duplicate jobs, and handle offline kiosks with this guide.

Published 2026-12-02 · https://printscaler.com/blog/kiosk-printing-tickets-receipts-api

![Self-service touchscreen kiosk connected to a cloud service and a thermal printer dispensing a ticket](https://printscaler.com/blog/images/kiosk-printing-tickets-receipts-api-38.jpg)

Kiosk printing works best when the application—not the customer—chooses the printer, document format, and number of copies. For a web-based kiosk, your backend can submit a print job through PrintScaler, while an agent on the kiosk computer delivers it to the local printer. The important work is designing what happens around that request: repeated taps, disconnected devices, abandoned sessions, and documents that must not print after the customer leaves.

This guide walks through a practical architecture for self-service tickets, receipts, and PDF documents, including a working API example and an unattended-operation checklist.

## What makes kiosk printing different from ordinary printing?

At an office workstation, a person can select a printer, dismiss an error, and collect several pages. A public kiosk cannot assume any of that.

A visitor may tap Print repeatedly, leave during a delay, or start another transaction while the previous document is still queued. Staff may not be standing nearby when paper runs out.

A reliable design therefore needs clear answers to five questions:

- Which physical printer belongs to this kiosk?
- What event authorizes a document to print?
- How does the system distinguish a retry from an intentional reprint?
- How long is the document still useful?
- What should the screen show when printing is delayed or fails?

These decisions matter whether the output is a queue ticket, a purchase receipt, a visitor badge, or a full-page confirmation.

Removing the browser dialog solves only one part of the problem. For the browser-specific background, see the guide to [silent printing from a browser](https://printscaler.com/blog/silent-printing-from-browser).

## Choose a kiosk printing architecture

There are several ways to connect a kiosk application to its printer. The right choice depends on who manages the device and where the application runs.

| Approach | Suitable situation | Main operational consideration |
|---|---|---|
| Browser-managed printing | An attended station where a print dialog is acceptable | Customers may encounter printer selection or layout controls |
| Managed browser kiosk-printing configuration | A tightly controlled browser and operating-system image | Configuration and behavior must be maintained on each device |
| Native kiosk application | A team that owns the installed application and device integration | Printer access and updates become part of the application deployment |
| Backend API plus local agent | A web kiosk whose printing logic lives on a server | Requires internet access and deliberate handling of delayed jobs |

For the API approach, the path is straightforward:

```text
Kiosk browser
    -> Your authenticated backend
    -> PrintScaler API
    -> PrintScaler agent on the kiosk computer
    -> Assigned physical printer
```

The browser never needs the PrintScaler API key. It asks your backend to print a specific, authorized transaction document; your backend decides whether that request is valid.

The agent connects outbound over WebSocket, so this setup does not require opening inbound firewall ports. It is not an offline-first printing architecture, however: a cloud request needs connectivity to reach the service and then the kiosk.

## Match the document format to the kiosk output

Choose the format before writing the integration. A layout that looks correct in a browser preview may not be suitable for a narrow thermal printer.

### Use PDF for page-oriented documents

PDF is a practical choice for confirmations, forms, itineraries, and other documents with a fixed page layout.

Generate the PDF at the intended paper dimensions. Match the physical paper, printer configuration, and print options rather than relying on scaling to repair an unsuitable layout.

PrintScaler supports PDF options including copies, duplex, paper size, tray, DPI, color, fit to page, page ranges, rotation, and n-up. Read the selected printer's capabilities before offering paper or tray choices in an administrator interface.

### Use ESC/POS for compatible receipt printers

For short thermal receipts and queue tickets, ESC/POS can provide faster, sharper output than rendering the same content as PDF. Compatible printers may support cutting, QR codes, and other receipt-specific commands.

An 80 mm layout is not interchangeable with a 58 mm layout. Also verify character encoding, supported commands, cutter behavior, and the actual printable width on the exact printer model.

### Use ZPL or EPL for compatible label printers

A kiosk that produces adhesive identification or collection labels may be better served by a label printer using ZPL or EPL.

Do not send receipt commands to a label printer or assume every thermal printer understands the same language. Confirm the printer's language and resolution, then test the output on the actual label stock.

## Set up kiosk printing with PrintScaler

The following example uses a PDF confirmation generated by your application. The same submission endpoint supports RAW content when the kiosk uses a compatible receipt or label printer.

### 1. Install and pair the kiosk computer

Install the [PrintScaler agent](https://printscaler.com/download) on the computer attached to the printer. Windows, macOS, Linux, and Raspberry Pi are supported.

Link the computer by entering its pairing code in the dashboard. Then:

1. Confirm that the operating system can print to the device.
2. Find the printer in the PrintScaler dashboard.
3. Use the dashboard's test page button.
4. Record the correct printer ID in your backend configuration.
5. Reboot the kiosk and repeat the test.

The agent starts automatically after reboots and updates itself. Your kiosk browser, application startup, operating-system policies, and printer drivers still need their own deployment plan.

### 2. Store the printer assignment on the server

Keep a trusted mapping between kiosk identity and printer ID:

```text
lobby-kiosk-east -> printer 123
lobby-kiosk-west -> printer 456
```

This mapping belongs in your configuration or database—not in a customer-editable request field.

Authenticate the kiosk device separately from the visitor's temporary session. When a visitor requests a confirmation, the backend should establish:

- Which kiosk made the request.
- Which transaction belongs to the current session.
- Whether the transaction is eligible for printing.
- Which printer and template are assigned to that kiosk.

Do not create a public endpoint that accepts any printer ID and arbitrary content. That would turn a narrow kiosk feature into an unrestricted printing service.

### 3. Generate the final document on the backend

Generate the receipt or PDF from trusted transaction data. Avoid printing an arbitrary URL supplied by the kiosk browser.

For a small PDF, Base64 content is convenient because the submission does not depend on the printer service fetching a separate document URL. For larger documents, `pdf_uri` can be useful, provided the URL remains accessible long enough for processing.

Keep sensitive information out of the job title. A neutral identifier such as `Confirmation TX-8421` is usually more appropriate than a customer's name or contact details.

### 4. Submit the document with a stable idempotency key

This Python example uses only the standard library. It reads a generated PDF and submits it from a trusted backend process.

```python
import base64
import json
import os
from pathlib import Path
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen

api_key = os.environ["PRINTSCALER_API_KEY"]
printer_id = int(os.environ["PRINTSCALER_PRINTER_ID"])

# Load these from your stored print operation in production.
operation_id = "kiosk-east:tx-8421:confirmation:original"
pdf_path = Path("confirmation.pdf")

payload = {
    "printerId": printer_id,
    "contentType": "pdf_base64",
    "content": base64.b64encode(pdf_path.read_bytes()).decode("ascii"),
    "title": "Confirmation TX-8421"
}

request = Request(
    "https://api.printscaler.com/v1/printjobs",
    data=json.dumps(payload).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
        "X-Idempotency-Key": operation_id
    },
    method="POST"
)

try:
    with urlopen(request, timeout=30) as response:
        result = response.read().decode("utf-8")
        print(result)
except HTTPError as error:
    raise RuntimeError(
        f"Print submission returned HTTP {error.code}; inspect before retrying"
    ) from error
except (URLError, TimeoutError) as error:
    raise RuntimeError(
        "Submission outcome uncertain; retry with the same operation key"
    ) from error
```

Set `PRINTSCALER_API_KEY` and `PRINTSCALER_PRINTER_ID` in the backend environment. Use a test document without personal data for the first run.

The example intentionally prints the response rather than assuming a response schema. In the production worker, persist the returned job identifier and relevant response data using the documented response structure. See the [print job API reference](https://printscaler.com/docs#printjobs) for implementation details.

An HTTP success means the service accepted the submission; it does not mean the visitor has collected the paper.

### 5. Connect print state to the kiosk interface

PrintScaler tracks states including `new`, `sent_to_client`, `queued`, `in_progress`, `done`, `error`, `cancelled`, and `expired`.

Your application should translate those technical states into a small set of understandable screen messages. For example:

- **Preparing your document:** the application is generating or submitting it.
- **Printing requested:** the job has been accepted but completion is not confirmed.
- **Please collect your document:** the workflow has reached its configured completion condition.
- **Printing needs assistance:** the job failed or exceeded your operational deadline.

Use print-job state webhooks to update your application asynchronously. PrintScaler signs webhooks with HMAC-SHA256 and retries delivery; verify signatures and make your handler safe to process repeated events. The [webhook documentation](https://printscaler.com/docs#webhooks) covers the integration.

Treat reported completion as a workflow signal, not proof that a person received the correct sheet. An unattended kiosk still needs a clearly marked output area and a recovery process.

## Prevent duplicate tickets without blocking legitimate reprints

A kiosk visitor may tap twice. The browser may retry after a timeout. Your worker may restart after the service accepted a request but before your database recorded the response.

Handle those situations as retries of one print operation.

Create a database record before submission containing the transaction ID, document version, destination printer, and stable idempotency key. Reuse that key whenever retrying the same operation, and keep its destination and content unchanged.

Do not generate a new key for every HTTP attempt. That would make each retry look like a new print request.

A deliberate reprint is different. Create a separate operation with a new key, and record who or what authorized it. Depending on the business process, the document may also need a visible reprint marker.

Disabling the button improves the interface, but the backend must enforce these rules. For the deeper retry design, see [how to prevent duplicate print jobs](https://printscaler.com/blog/prevent-duplicate-print-jobs).

## Decide what happens when a kiosk goes offline

PrintScaler queues jobs while a computer is offline and prints them when it reconnects, subject to a configurable expiration time. That behavior is useful for some documents and risky for others.

A maintenance checklist might still be useful after a delay. A queue ticket or customer confirmation may be inappropriate once its visitor has left.

Define the policy before launch:

| Document | Question to resolve |
|---|---|
| Queue ticket | Is the number still valid after a connection outage? |
| Purchase receipt | Should a delayed receipt print where another customer can see it? |
| Visitor document | Must the visitor remain present to receive it? |
| Internal service sheet | Can it safely wait until the kiosk reconnects? |

Configure job expiration around the document's useful lifetime. Separately, give your application a deadline for changing the kiosk screen to an assistance message.

Those are not the same action: timing out the browser session does not automatically cancel an already submitted job. Consult the [job state reference](https://printscaler.com/docs#states) when designing the recovery flow.

If printing is essential to the transaction, stop offering that transaction when the kiosk is known to be unable to print. Do not promise fully offline cloud printing.

## Protect customer sessions and unattended hardware

A shared kiosk needs stronger separation between users than a personal workstation.

Clear the previous session's document preview, transaction identifiers, and temporary download links before starting the next session. Avoid storing the PrintScaler API key, generated documents, or sensitive transaction data in browser storage.

Also review the physical workflow:

- Can customers accidentally collect someone else's output?
- Is the paper exit obvious and accessible?
- Can staff replace paper without exposing the computer or cables?
- Is there an assistance path that does not require another printout?
- Could an abandoned document reveal personal information?

Use the minimum information necessary on public-facing output. Printing through an API does not itself establish compliance with any privacy, payment, or healthcare requirement.

## Test the failure cases before deployment

A successful test page is the beginning, not the acceptance test.

Run a small failure matrix on the actual kiosk hardware:

1. Tap Print repeatedly and verify that one operation is created.
2. Interrupt the browser connection after submission and retry safely.
3. Disconnect the kiosk computer, submit a test job, and verify the intended expiration behavior.
4. Remove paper and confirm the screen does not claim that a customer received a document.
5. Reboot during a transaction and check application recovery.
6. End one session, start another, and confirm that no prior document or status appears.
7. Request an authorized reprint and verify that it is recorded separately.

For several kiosks starting work at once, account for the API rate limit of 10 requests per second with a burst of 30. Queue submissions in your backend rather than allowing a burst of visitor taps to become uncontrolled API traffic.

## Budget by print request, not by page

PrintScaler pricing is per print request rather than per page. A multi-page PDF submitted as one request is therefore different from submitting each page separately.

The Free plan includes 100 prints per month and one connected computer, which can be useful for a pilot. A separate agent computer at each kiosk affects the computer count, even if each computer has only one printer. Check the [current plans](https://printscaler.com/pricing) against your expected requests and deployment layout.

## Build the kiosk around the complete printing workflow

Reliable kiosk printing combines fixed printer routing, server-side authorization, the right document format, stable retry identifiers, and a clear policy for delayed output. The API request is straightforward; the quality of the unattended experience depends on the decisions around it.

[Create a free PrintScaler account](https://printscaler.com/signup), pair one test kiosk, and validate both a successful print and an interrupted session before expanding the rollout.

## Frequently asked questions

### Can a web-based kiosk print without showing a browser dialog?

Yes. The browser can ask your backend to submit a print job through PrintScaler, and the agent delivers it to the assigned printer. Keep the API key on the backend and map the kiosk to its printer server-side.

### Does every kiosk need a computer running the PrintScaler agent?

For the agent-based setup described here, the printer must be accessible to a computer running the agent. Supported Epson receipt printers with Server Direct Print can connect to PrintScaler without a separate computer, which offers another option for tablet-based kiosks.

### What happens if the kiosk loses its internet connection?

A new cloud submission requires connectivity. Jobs already accepted can queue while the connected computer is offline and print when it returns, subject to their configured expiration time. For customer-facing output, choose an expiration policy that prevents stale documents from printing after the customer leaves.

### Should a kiosk use PDF or ESC/POS for receipts?

ESC/POS is generally a good fit for compatible thermal receipt printers and can be faster and sharper than PDF. PDF is useful for fixed-layout, page-oriented documents. Test the exact printer, paper width, character encoding, and cutting behavior before deployment.

### How do I stop repeated taps from printing duplicate tickets?

Create one backend print operation and reuse its idempotency key for every retry of that operation. Disable repeated taps for usability, but enforce duplicate prevention on the server. An intentional reprint should be authorized and recorded as a separate operation.

### Does a completed print job prove the customer received the document?

No. A completed job is a printing workflow signal, not proof that a person collected the paper. Physical output handling, printer-specific reporting, and staff recovery procedures remain important.
