Print API reference
The current print origin is https://print.tigasatutiga.com. Local Laravel normally uses http://localhost:3000. Paths have no /api prefix.
Health and templates
| Method | Path | Input/output |
|---|---|---|
| GET | /up | Laravel application health |
| GET | /browser/list | Template metadata |
| POST | /browser/upload | Multipart DOCX field named file |
| GET | /browser/download?path=invoice.docx | Stored template download |
| DELETE | /browser/delete?path=invoice.docx | Delete a template |
Template names must be relative paths within the configured storage root. File-browser access should be protected by the deployment's access controls.
Generation
| Method | Path | Behaviour |
|---|---|---|
| GET | /generate/download | Render the bundled DOCX example |
| POST | /generate/invoice/{filename} | Invoice payload to a PDF download |
| POST | /generate/batch-invoice?async=1 | Accept durable batch work, HTTP 202 |
Single-invoice generation requires a string INVOICE_NO; invoiceItems is an array when supplied and SUB_TOTAL is numeric when supplied. Batch input is a JSON list and has a configured maximum of 200 invoices.
A synchronous batch call also uses persisted work and may return 202 if additional bounded processing is needed. Do not equate an accepted response with confirmed delivery.
Batch status and control
| Method | Path | Purpose |
|---|---|---|
| GET | /generate/batches/{id} | Status, counters, and review entries |
| POST | /generate/batches/process-pending | Claim a pending batch and process bounded work |
| POST | /generate/batches/{id}/process | Process a specific batch |
| POST | /generate/batches/{id}/retry | Retry rendering/configuration failures |
| POST | /generate/batches/{id}/resolve-delivery | Acknowledge or authorize retry of uncertain sends |
Worker/control calls use the shared X-Print-Worker-Token header; a bearer token is also supported where not reserved for infrastructure authentication. Batch submissions include the stable Idempotency-Key header.
A submission without the configured shared token is rejected. A wrong or missing token can explain a 403 even when /up works.
Telegram
POST /telegram/webhook accepts Telegram callbacks and queues processing. Configure TELEGRAM_WEBHOOK_SECRET to validate Telegram's secret header.
Webhook registration is performed using Laravel's telegram:webhook command. It is not a route that documentation readers need to call during a local preview.
See Durable invoice delivery for the state model and retry decisions.