After a customer uploads documents withDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/hxmz-axfn07/qr-printing-sfw/llms.txt
Use this file to discover all available pages before exploring further.
POST /api/orders, staff can view or download each file via the /files/:doc_id endpoint. The server looks up the document UUID in the database, resolves the stored filename in the uploads/ directory, and streams the binary content back with the correct MIME type and the original filename.
GET /files/:doc_id
X-Admin-Token header or ?token= query parameter.
Path Parameter
The UUID of the document, taken from the
id field of any entry in an order’s documents array. UUIDs are assigned at submission time and never change.Response — 200 OK
Binary file content streamed directly from disk. The response headers are:| Header | Value |
|---|---|
Content-Type | Original MIME type detected at upload time, e.g. application/pdf, image/jpeg. Falls back to application/octet-stream if unknown. |
Content-Disposition | inline; filename="<original_name>" — browsers open PDFs and images inline rather than forcing a download. |
Content-Length | Size of the file in bytes. |
Error Cases
| Status | Condition |
|---|---|
404 Not Found | No document with doc_id exists in any order ({"error": "Not found"}) |
404 Not Found | Document record exists in the database but the physical file is missing from uploads/ |
401 Unauthorized | Missing or invalid admin token ({"error": "Admin token required"}) |
URL Format Used by the Admin Dashboard
The admin dashboard (dashboard.js) constructs document links by appending the token as a query parameter so that clicking the link in a browser tab opens the file without needing a custom header:
href in <a target="_blank"> tags since the browser automatically sends the URL including the query string.
Download Example
Files are stored on disk under the
uploads/ directory using the naming convention <order_id>_<doc_id>.<ext> — for example 550e8400-..._doc-uuid.pdf. The /files/:doc_id endpoint resolves the correct stored filename from the database using the doc_id alone; you never need to construct the stored filename manually.