Test printing over the Internet
Enter the Link code shown by PosPrinterDriver. The terminal must have the web service enabled and printer number 1 configured and available.
CLOUD CAFE--------------------------------1 Coffee without cables 1.50 EUR1 Cloud-shaped croissant 2.00 EUR1 Extra smile 0.00 EUR--------------------------------TOTAL 3.50 EURFrom the web to your printer.If you can read this on paper,your receipt has landed!Thank you for testing PosPrinterDriver.
Complete workflow
- 01
1. Configure and test printer 1
The documented remote queue prints to the main printer. Confirm its built-in test works.
- 02
2. Enable the web service
Enable the corresponding service in PosPrinterDriver and allow it to run in the background.
- 03
3. Register the device
Obtain or enter the linkcode displayed by the app. Treat it as a credential.
- 04
4. Send from your backend
Make an HTTPS GET or POST request with linkcode and data to the documented endpoint.
- 05
5. Receive the notification and print
The server stores the ticket and notifies the terminal through Action Cable. Android retrieves the job, reports its status and sends it to printer number 1. An OK response means the server accepted the job; also check the physical paper output.
Recommended POST example
curl -X POST 'https://gestion.posprinterdriver.com/api/v1/api/senddatatoprinter' \ --data-urlencode 'linkcode=YOUR_LINKCODE' \ --data-urlencode 'data=Order #123Total: 12,50 €'- For automated integration, make the call from your server. This page's test uses a POST form with the code you enter.
- Do not record the full linkcode in logs, analytics or error reporting tools.
GET example
Use only if your environment does not support POST, and encode every parameter.
https://gestion.posprinterdriver.com/api/v1/api/senddatatoprinter ?linkcode=YOUR_LINKCODE &data=ENCODED_CONTENTPer-job tracking
The tracking API returns job_id, status_token, status_url, status and expires_at when accepting a ticket. The test checks that reference automatically for about two minutes and lets you check again without reprinting.
Available after updating the server and Android to a tracking-enabled version (20.31). Older terminals can only report removal from the queue, not confirmed delivery to the printer.
Check status without changing the queue
curl 'https://gestion.posprinterdriver.com/api/v1/api/jobs/JOB_ID' -H 'Authorization: Bearer STATUS_TOKEN'- Use the status_token returned when creating the job. You do not need to expose the Link code in the URL.
- A 404 means the job does not exist or has expired. Checking status never prints again.
What each status means
| Status | Meaning |
|---|---|
| queued | The server has stored the ticket. |
| dispatched | The server reserved the job; Android receipt confirmation is still pending. |
| received | Android has retrieved the job. |
| sending | Android is starting delivery to the printer. |
| retry_wait | Waiting for printer: the connection failed before writing. Android 20.33 or later retries automatically when connectivity returns, until the job expires. |
| sent_to_printer | Data delivery finished without a detected error; this does not confirm physical paper output. |
| failed | A failure was detected. Partial output is possible; check before sending again. |
| unknown | Confirmation is missing. The job is not reprinted automatically. |
| legacy_completed | An older app removed the job from the queue without detailed confirmation. |
Receive status updates in your backend
Include returned_url in the request to receive a JSON POST for each change. The URL must use HTTPS and be reachable over the Internet.
{ "job_id": "job-identifier", "event_id": "event-identifier", "status": "sent_to_printer", "error_code": null, "physical_print_confirmed": false}- Respond with HTTP 2xx. Notifications are retried: deduplicate using event_id and use occurred_at because they can arrive out of order.
- returned_url receives status updates; callbackurl preserves the legacy posprintedriver=ok notification when the queue item is removed or delivery completes.
- Protect your receiver with a secret URL and validate its parameters. If a domain allowlist is configured, request that the receiver's domain be included.
Expiry and duplicates
History and pending jobs expire after 7 days by default, configurable by the administrator. expires_at gives each job's deadline. Ticket content is deleted when the job ends successfully, fails or has an unknown result. Expired history is removed by the next automatic cleanup, which runs every five minutes.
Send idempotency_key to identify an attempt. Repeating the same key and data returns the same job_id during retention. Reusing it with different content creates a conflict. Deduplication is not guaranteed after expiry.
If terminal confirmation does not arrive within ten minutes, maintenance marks the result unknown. If the printer connection fails before writing, Android 20.33 or later reports retry_wait and tries again. If delivery may already have started, it is not repeated. A callback failure only retries that notification.
Verified parameters
| Parameter | Required | Purpose |
|---|---|---|
| linkcode | Yes | Identifies the registered device; keep it private |
| data | Yes | Text and commands, up to 60,000 bytes |
| returned_url | No | HTTPS URL for receiving status changes |
| idempotency_key | Recommended | Attempt key, up to 128 characters, to prevent duplicates |
| pn | Do not use for selection | The reviewed backend does not apply it; the remote queue uses printer 1 |
Reliable operation
- Add your own job identifier to prevent duplicates in your system.
- Apply size limits and sanitise content before sending it.
- Distinguish request acceptance from confirmed physical printing.
- If Android is offline, check pending jobs before manually sending again.
- Keep the device charged and exempt the app from battery restrictions where appropriate.