{"openapi":"3.1.0","info":{"title":"Printmint API","version":"1.0.0","description":"HTML and templates to PDF, from one API call. Send HTML, or a template and JSON data, and get back a print-ready PDF or image: invoices, receipts, certificates, reports and labels, printed by Chromium.","contact":{"email":"support@printmint.plxi.us","url":"https://printmint.plxi.us/contact"},"termsOfService":"https://printmint.plxi.us/terms"},"externalDocs":{"url":"https://printmint.plxi.us/docs"},"servers":[{"url":"https://api-printmint.plxi.us"}],"security":[{"apiKey":[]}],"paths":{"/v1/pdf/merge":{"post":{"operationId":"pdfMerge","summary":"Merge PDFs","description":"Join PDFs into one document, in the order given: a cover page and a report, or a batch of invoices. Send `sources`, 2 to 20 items, each `{\"file_url\": \"https://...\"}` (a public link to a PDF), `{\"file_id\": \"...\"}` (uploaded with POST /v1/files) or `{\"pdf_base64\": \"...\"}`, each up to 10 MB. Encrypted PDFs are refused. Returns `pages` and a download link (`file`), or `pdf_base64` with `\"inline\": true`. Bookmarks and form fields are not carried over.","x-credits":1,"externalDocs":{"url":"https://printmint.plxi.us/docs#op-pdf-merge"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"inline":{"description":"Return the file in the response as base64 (up to 5 MB) instead of a download link.","type":"boolean"},"sources":{"description":"The PDFs, in order.","items":{"additionalProperties":false,"maxProperties":1,"minProperties":1,"properties":{"file_id":{"description":"A file uploaded with POST /v1/files.","maxLength":100,"type":"string"},"file_url":{"description":"A public link to the PDF.","format":"uri","maxLength":2000,"type":"string"},"pdf_base64":{"description":"The PDF itself, base64-encoded.","maxLength":14000000,"type":"string"}},"type":"object"},"maxItems":20,"minItems":2,"type":"array"}},"required":["sources"],"type":"object"},"example":{"inline":true,"sources":[{"pdf_base64":"JVBERi0xLjcKJbutwN4KMSAwIG9iago8PC9UeXBlL1BhZ2VzL0tpZHNbNSAwIFJdL0NvdW50IDEvUmVzb3VyY2VzIDMgMCBSL01lZGlhQm94WzAgMCA2MTIgNzkyXT4+CmVuZG9iagoyIDAgb2JqCjw8L1R5cGUvRm9udC9TdWJ0eXBlL1R5cGUxL0Jhc2VGb250L0hlbHZldGljYT4+CmVuZG9iagozIDAgb2JqCjw8L0ZvbnQ8PC9GMSAyIDAgUj4+Pj4KZW5kb2JqCjQgMCBvYmoKPDwvTGVuZ3RoIDQzPj5zdHJlYW0KQlQKL0YxIDI0IFRmCjcyIDcyMCBUZAooQ292ZXIgcGFnZSAxKSBUagpFVAplbmRzdHJlYW0gCmVuZG9iago1IDAgb2JqCjw8L1R5cGUvUGFnZS9QYXJlbnQgMSAwIFIvQ29udGVudHMgNCAwIFI+PgplbmRvYmoKNiAwIG9iago8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMSAwIFI+PgplbmRvYmoKNyAwIG9iago8PC9Sb290IDYgMCBSL1R5cGUvWFJlZi9TaXplIDgvV1sxIDQgMl0vSW5kZXhbMSA3XS9MZW5ndGggNDk+PnN0cmVhbQoBAAAADwAAAQAAAGgAAAEAAACnAAABAAAAzQAAAQAAASgAAAEAAAFiAAABAAABjwAACmVuZHN0cmVhbSAKZW5kb2JqCgpzdGFydHhyZWYKMzk5CiUlRU9G"},{"pdf_base64":"JVBERi0xLjcKJbutwN4KMSAwIG9iago8PC9UeXBlL1BhZ2VzL0tpZHNbNSAwIFJdL0NvdW50IDEvUmVzb3VyY2VzIDMgMCBSL01lZGlhQm94WzAgMCA2MTIgNzkyXT4+CmVuZG9iagoyIDAgb2JqCjw8L1R5cGUvRm9udC9TdWJ0eXBlL1R5cGUxL0Jhc2VGb250L0hlbHZldGljYT4+CmVuZG9iagozIDAgb2JqCjw8L0ZvbnQ8PC9GMSAyIDAgUj4+Pj4KZW5kb2JqCjQgMCBvYmoKPDwvTGVuZ3RoIDQzPj5zdHJlYW0KQlQKL0YxIDI0IFRmCjcyIDcyMCBUZAooVGVybXMgcGFnZSAxKSBUagpFVAplbmRzdHJlYW0gCmVuZG9iago1IDAgb2JqCjw8L1R5cGUvUGFnZS9QYXJlbnQgMSAwIFIvQ29udGVudHMgNCAwIFI+PgplbmRvYmoKNiAwIG9iago8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMSAwIFI+PgplbmRvYmoKNyAwIG9iago8PC9Sb290IDYgMCBSL1R5cGUvWFJlZi9TaXplIDgvV1sxIDQgMl0vSW5kZXhbMSA3XS9MZW5ndGggNDk+PnN0cmVhbQoBAAAADwAAAQAAAGgAAAEAAACnAAABAAAAzQAAAQAAASgAAAEAAAFiAAABAAABjwAACmVuZHN0cmVhbSAKZW5kb2JqCgpzdGFydHhyZWYKMzk5CiUlRU9G"}]}}}},"responses":{"200":{"description":"Success. The body includes the credits charged.","content":{"application/json":{"schema":{"properties":{"bytes":{"description":"Size of the PDF.","type":"integer"},"content_type":{"const":"application/pdf","type":"string"},"credits":{"description":"Credits this call was charged.","type":"integer"},"file":{"description":"The download link, when the app stores files.","properties":{"bytes":{"type":"integer"},"content_type":{"type":"string"},"expires_at":{"type":"string"},"sha256":{"type":"string"},"url":{"type":"string"}},"required":["url","expires_at","bytes","sha256","content_type"],"type":"object"},"pages":{"description":"Pages in the PDF.","type":"integer"},"pdf_base64":{"description":"The PDF, when it is returned inline.","type":"string"}},"required":["pages","bytes","content_type","credits"],"type":"object"},"example":{"bytes":1024,"content_type":"application/pdf","credits":1,"pages":2,"pdf_base64":"JVBERi0xLjcKJcfsj6IKNSAwIG9iago8PC9MZW5ndGggNiAwIFIvRmlsdGVyIC9GbGF0ZURlY29kZT4+..."}}}},"400":{"description":"Invalid JSON or input. Not charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit, concurrency limit or monthly quota reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable. Retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/pdf/render":{"post":{"operationId":"pdfRender","summary":"HTML to PDF","description":"Print an HTML document to a PDF with Chromium, as a browser prints it: CSS, web fonts, images and print styles (`@page`, `break-before`) all apply. Send `html` (up to 2 MB) and optionally `css`, `base_url` for relative links and images, and `pdf` for the page size (A4 by default, or width and height), margins, landscape, and `header_html`/`footer_html` with page numbers. Up to 50 pages. Returns `pages` and a download link (`file`), or `pdf_base64` with `\"inline\": true`. For an invoice, receipt, certificate, report or label, `render_template_pdf` fills in a ready-made template from JSON instead.","x-credits":1,"externalDocs":{"url":"https://printmint.plxi.us/docs#op-pdf-render"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"base_url":{"description":"Where relative links, images and stylesheets in the HTML resolve from.","format":"uri","maxLength":2000,"type":"string"},"css":{"description":"CSS added to the document's head.","maxLength":200000,"type":"string"},"delay_ms":{"description":"Then wait this many milliseconds more.","maximum":10000,"minimum":0,"type":"integer"},"html":{"description":"The HTML document to print.","maxLength":2097152,"minLength":1,"type":"string"},"inline":{"description":"Return the file in the response as base64 (up to 5 MB) instead of a download link.","type":"boolean"},"javascript":{"description":"Run the page's scripts (on by default), for charts and other HTML built by script.","type":"boolean"},"offline":{"description":"Load nothing from the network: images and fonts must be in the HTML (data: URLs). Off by default.","type":"boolean"},"pdf":{"additionalProperties":false,"description":"How the PDF is laid out. Every field is optional.","properties":{"footer_html":{"description":"Like header_html, at the bottom of each page.","maxLength":50000,"type":"string"},"header_html":{"description":"HTML repeated at the top of each page, inside the top margin. Elements with class pageNumber, totalPages, date and title are filled in. Use inline styles; it loads nothing.","maxLength":50000,"type":"string"},"height":{"description":"Page height, with width.","maximum":10000,"minimum":0,"pattern":"^\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm)$","type":["string","number"]},"landscape":{"description":"Landscape instead of portrait.","type":"boolean"},"margin":{"additionalProperties":false,"description":"Page margins; each side defaults to 0.","properties":{"bottom":{"description":"A length: \"12mm\", \"0.5in\", \"1cm\", \"40px\", or a number of pixels.","maximum":10000,"minimum":0,"pattern":"^\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm)$","type":["string","number"]},"left":{"description":"A length: \"12mm\", \"0.5in\", \"1cm\", \"40px\", or a number of pixels.","maximum":10000,"minimum":0,"pattern":"^\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm)$","type":["string","number"]},"right":{"description":"A length: \"12mm\", \"0.5in\", \"1cm\", \"40px\", or a number of pixels.","maximum":10000,"minimum":0,"pattern":"^\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm)$","type":["string","number"]},"top":{"description":"A length: \"12mm\", \"0.5in\", \"1cm\", \"40px\", or a number of pixels.","maximum":10000,"minimum":0,"pattern":"^\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm)$","type":["string","number"]}},"type":"object"},"outline":{"description":"Add bookmarks made from the headings.","type":"boolean"},"page_ranges":{"description":"Only these pages, e.g. \"1-3, 5\".","maxLength":100,"pattern":"^\\s*\\d{1,4}(\\s*-\\s*\\d{1,4})?(\\s*,\\s*\\d{1,4}(\\s*-\\s*\\d{1,4})?)*\\s*$","type":"string"},"page_size":{"description":"Paper size; A4 by default. Or give width and height.","enum":["A4","Letter","Legal","Tabloid","Ledger","A0","A1","A2","A3","A5","A6"],"type":"string"},"prefer_css_page_size":{"description":"Use the page size in the HTML's CSS @page rule.","type":"boolean"},"print_background":{"description":"Print background colours and images (on by default).","type":"boolean"},"scale":{"description":"Zoom, 0.1 to 2 (default 1).","maximum":2,"minimum":0.1,"type":"number"},"tagged":{"description":"Make a tagged (accessible) PDF.","type":"boolean"},"width":{"description":"Page width, with height, for a custom size such as a 4in x 6in label.","maximum":10000,"minimum":0,"pattern":"^\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm)$","type":["string","number"]}},"type":"object"},"wait":{"description":"When the page is ready to print: load (default), domcontentloaded, or networkidle (no requests for half a second).","enum":["load","domcontentloaded","networkidle"],"type":"string"},"wait_for_selector":{"description":"Also wait until an element matching this CSS selector appears.","maxLength":400,"type":"string"}},"required":["html"],"type":"object"},"example":{"css":"body { font-family: Inter, Arial, sans-serif; padding: 20mm; } h1 { color: #10b981; }","html":"<html><head><title>Hello</title></head><body><h1>Hello from Printmint</h1><p>This page was printed from HTML.</p></body></html>","inline":true,"pdf":{"footer_html":"<div style=\"width:100%;font-size:8px;text-align:center\"><span class=\"pageNumber\"></span> / <span class=\"totalPages\"></span></div>","margin":{"bottom":"15mm"},"page_size":"A4"}}}}},"responses":{"200":{"description":"Success. The body includes the credits charged.","content":{"application/json":{"schema":{"properties":{"bytes":{"description":"Size of the PDF.","type":"integer"},"content_type":{"const":"application/pdf","type":"string"},"credits":{"description":"Credits this call was charged.","type":"integer"},"file":{"description":"The download link, when the app stores files.","properties":{"bytes":{"type":"integer"},"content_type":{"type":"string"},"expires_at":{"type":"string"},"sha256":{"type":"string"},"url":{"type":"string"}},"required":["url","expires_at","bytes","sha256","content_type"],"type":"object"},"pages":{"description":"Pages in the PDF.","type":"integer"},"pdf_base64":{"description":"The PDF, when it is returned inline.","type":"string"}},"required":["pages","bytes","content_type","credits"],"type":"object"},"example":{"bytes":18342,"content_type":"application/pdf","credits":1,"pages":1,"pdf_base64":"JVBERi0xLjcKJcfsj6IKNSAwIG9iago8PC9MZW5ndGggNiAwIFIvRmlsdGVyIC9GbGF0ZURlY29kZT4+..."}}}},"400":{"description":"Invalid JSON or input. Not charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit, concurrency limit or monthly quota reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable. Retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/pdf/template":{"post":{"operationId":"pdfFromTemplate","summary":"Template to PDF","description":"Make a PDF from a template and JSON data: a built-in template (`invoice`, `receipt`, `certificate`, `report`, `shipping_label`) or one of your own (made in the dashboard or with templates.create). Send `template` (a built-in name or your template's id) and `data`. Call `list_templates` first to see each template's fields and sample data. Values are escaped, so data shows as text. A field the template needs but `data` lacks is a 400 naming the line. `pdf` overrides the template's page size and margins. Templates load nothing from the network unless `\"offline\": false`. Returns `pages` and a download link (`file`), or `pdf_base64` with `\"inline\": true`.","x-credits":1,"externalDocs":{"url":"https://printmint.plxi.us/docs#op-pdf-from-template"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"base_url":{"description":"Where relative links, images and stylesheets in the HTML resolve from.","format":"uri","maxLength":2000,"type":"string"},"css":{"description":"CSS added to the document's head.","maxLength":200000,"type":"string"},"data":{"description":"The values the template fills in. list_templates shows each template's fields and a sample.","type":"object"},"delay_ms":{"description":"Then wait this many milliseconds more.","maximum":10000,"minimum":0,"type":"integer"},"inline":{"description":"Return the file in the response as base64 (up to 5 MB) instead of a download link.","type":"boolean"},"javascript":{"description":"Run the page's scripts (on by default), for charts and other HTML built by script.","type":"boolean"},"offline":{"description":"Load nothing from the network: images and fonts must be in the HTML (data: URLs). On by default for templates.","type":"boolean"},"pdf":{"additionalProperties":false,"description":"How the PDF is laid out. Every field is optional.","properties":{"footer_html":{"description":"Like header_html, at the bottom of each page.","maxLength":50000,"type":"string"},"header_html":{"description":"HTML repeated at the top of each page, inside the top margin. Elements with class pageNumber, totalPages, date and title are filled in. Use inline styles; it loads nothing.","maxLength":50000,"type":"string"},"height":{"description":"Page height, with width.","maximum":10000,"minimum":0,"pattern":"^\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm)$","type":["string","number"]},"landscape":{"description":"Landscape instead of portrait.","type":"boolean"},"margin":{"additionalProperties":false,"description":"Page margins; each side defaults to 0.","properties":{"bottom":{"description":"A length: \"12mm\", \"0.5in\", \"1cm\", \"40px\", or a number of pixels.","maximum":10000,"minimum":0,"pattern":"^\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm)$","type":["string","number"]},"left":{"description":"A length: \"12mm\", \"0.5in\", \"1cm\", \"40px\", or a number of pixels.","maximum":10000,"minimum":0,"pattern":"^\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm)$","type":["string","number"]},"right":{"description":"A length: \"12mm\", \"0.5in\", \"1cm\", \"40px\", or a number of pixels.","maximum":10000,"minimum":0,"pattern":"^\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm)$","type":["string","number"]},"top":{"description":"A length: \"12mm\", \"0.5in\", \"1cm\", \"40px\", or a number of pixels.","maximum":10000,"minimum":0,"pattern":"^\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm)$","type":["string","number"]}},"type":"object"},"outline":{"description":"Add bookmarks made from the headings.","type":"boolean"},"page_ranges":{"description":"Only these pages, e.g. \"1-3, 5\".","maxLength":100,"pattern":"^\\s*\\d{1,4}(\\s*-\\s*\\d{1,4})?(\\s*,\\s*\\d{1,4}(\\s*-\\s*\\d{1,4})?)*\\s*$","type":"string"},"page_size":{"description":"Paper size; A4 by default. Or give width and height.","enum":["A4","Letter","Legal","Tabloid","Ledger","A0","A1","A2","A3","A5","A6"],"type":"string"},"prefer_css_page_size":{"description":"Use the page size in the HTML's CSS @page rule.","type":"boolean"},"print_background":{"description":"Print background colours and images (on by default).","type":"boolean"},"scale":{"description":"Zoom, 0.1 to 2 (default 1).","maximum":2,"minimum":0.1,"type":"number"},"tagged":{"description":"Make a tagged (accessible) PDF.","type":"boolean"},"width":{"description":"Page width, with height, for a custom size such as a 4in x 6in label.","maximum":10000,"minimum":0,"pattern":"^\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm)$","type":["string","number"]}},"type":"object"},"template":{"description":"A built-in template (invoice, receipt, certificate, report, shipping_label) or the id of one of your own.","maxLength":64,"minLength":1,"pattern":"^([a-z][a-z0-9_]*|[0-9a-fA-F-]{36})$","type":"string"},"wait":{"description":"When the page is ready to print: load (default), domcontentloaded, or networkidle (no requests for half a second).","enum":["load","domcontentloaded","networkidle"],"type":"string"},"wait_for_selector":{"description":"Also wait until an element matching this CSS selector appears.","maxLength":400,"type":"string"}},"required":["template"],"type":"object"},"example":{"data":{"currency":"USD","customer":{"address":["400 Market Street, Suite 12","San Francisco, CA 94105"],"email":"accounts@acme.example","name":"Acme Robotics Inc."},"due":"2026-11-30","issued":"2026-10-31","items":[{"description":"Website redesign: discovery and wireframes","quantity":1,"unit_price":2400},{"description":"Design system components","quantity":12,"unit_price":150},{"description":"Hosting, October","quantity":1,"unit_price":49.5}],"notes":"Thank you for your business. Please pay by bank transfer within 30 days and quote the invoice number.","number":"INV-2026-0142","payment":[{"label":"Bank","value":"First National Bank"},{"label":"Account name","value":"Northwind Studio LLC"},{"label":"Account","value":"1234 5678"},{"label":"Routing","value":"021000021"}],"seller":{"address":["18 Harbour Street","Portland, OR 97204","United States"],"email":"billing@northwind.example","name":"Northwind Studio","tax_id":"12-3456789"},"tax_rate":0.0875},"inline":true,"template":"invoice"}}}},"responses":{"200":{"description":"Success. The body includes the credits charged.","content":{"application/json":{"schema":{"properties":{"bytes":{"description":"Size of the PDF.","type":"integer"},"content_type":{"const":"application/pdf","type":"string"},"credits":{"description":"Credits this call was charged.","type":"integer"},"file":{"description":"The download link, when the app stores files.","properties":{"bytes":{"type":"integer"},"content_type":{"type":"string"},"expires_at":{"type":"string"},"sha256":{"type":"string"},"url":{"type":"string"}},"required":["url","expires_at","bytes","sha256","content_type"],"type":"object"},"pages":{"description":"Pages in the PDF.","type":"integer"},"pdf_base64":{"description":"The PDF, when it is returned inline.","type":"string"},"template":{"description":"The template used.","type":"string"}},"required":["pages","bytes","content_type","credits","template"],"type":"object"},"example":{"bytes":41207,"content_type":"application/pdf","credits":1,"pages":1,"pdf_base64":"JVBERi0xLjcKJcfsj6IKNSAwIG9iago8PC9MZW5ndGggNiAwIFIvRmlsdGVyIC9GbGF0ZURlY29kZT4+...","template":"invoice"}}}},"400":{"description":"Invalid JSON or input. Not charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit, concurrency limit or monthly quota reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable. Retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/image/render":{"post":{"operationId":"imageRender","summary":"HTML to image","description":"Draw HTML, or a template filled in with `data`, as an image: a social card, a badge, a certificate as a PNG. Send `html` or `template` (+ `data`), and optionally `width` and `height` (1200 x 630 by default), `scale` (2 for retina), `format` (png, jpeg or webp), `full_page`, or `selector` to capture one element. Returns `width`, `height` and a download link (`file`), or `image_base64` with `\"inline\": true`.","x-credits":1,"externalDocs":{"url":"https://printmint.plxi.us/docs#op-image-render"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"oneOf":[{"not":{"required":["template"]},"required":["html"]},{"not":{"required":["html"]},"required":["template"]}],"properties":{"base_url":{"description":"Where relative links, images and stylesheets in the HTML resolve from.","format":"uri","maxLength":2000,"type":"string"},"css":{"description":"CSS added to the document's head.","maxLength":200000,"type":"string"},"dark_mode":{"description":"Prefer the page's dark colour scheme.","type":"boolean"},"data":{"description":"The values the template fills in. list_templates shows each template's fields and a sample.","type":"object"},"delay_ms":{"description":"Then wait this many milliseconds more.","maximum":10000,"minimum":0,"type":"integer"},"format":{"description":"Image format (default png).","enum":["png","jpeg","webp"],"type":"string"},"full_page":{"description":"The whole page, not just the viewport (up to 16,000 px tall).","type":"boolean"},"height":{"description":"Viewport height in CSS pixels (default 630).","maximum":2160,"minimum":100,"type":"integer"},"html":{"description":"The HTML to draw.","maxLength":2097152,"minLength":1,"type":"string"},"inline":{"description":"Return the file in the response as base64 (up to 5 MB) instead of a download link.","type":"boolean"},"javascript":{"description":"Run the page's scripts (on by default), for charts and other HTML built by script.","type":"boolean"},"offline":{"description":"Load nothing from the network: images and fonts must be in the HTML (data: URLs). Off by default.","type":"boolean"},"quality":{"description":"JPEG or WebP quality (default 85).","maximum":100,"minimum":1,"type":"integer"},"scale":{"description":"Device pixel ratio, 1 to 3.","maximum":3,"minimum":1,"type":"integer"},"selector":{"description":"Capture only the first element matching this CSS selector.","maxLength":400,"type":"string"},"template":{"description":"A built-in template (invoice, receipt, certificate, report, shipping_label) or the id of one of your own.","maxLength":64,"minLength":1,"pattern":"^([a-z][a-z0-9_]*|[0-9a-fA-F-]{36})$","type":"string"},"wait":{"description":"When the page is ready to print: load (default), domcontentloaded, or networkidle (no requests for half a second).","enum":["load","domcontentloaded","networkidle"],"type":"string"},"wait_for_selector":{"description":"Also wait until an element matching this CSS selector appears.","maxLength":400,"type":"string"},"width":{"description":"Viewport width in CSS pixels (default 1200).","maximum":3840,"minimum":100,"type":"integer"}},"type":"object"},"example":{"format":"png","height":630,"html":"<body style=\"margin:0;display:flex;align-items:center;justify-content:center;height:100vh;background:#10b981;color:#fff;font:700 64px Inter,Arial,sans-serif\">Printmint</body>","inline":true,"width":1200}}}},"responses":{"200":{"description":"Success. The body includes the credits charged.","content":{"application/json":{"schema":{"properties":{"bytes":{"type":"integer"},"content_type":{"type":"string"},"credits":{"type":"integer"},"file":{"description":"The download link, when the app stores files.","properties":{"bytes":{"type":"integer"},"content_type":{"type":"string"},"expires_at":{"type":"string"},"sha256":{"type":"string"},"url":{"type":"string"}},"required":["url","expires_at","bytes","sha256","content_type"],"type":"object"},"height":{"type":"integer"},"image_base64":{"description":"The image, when returned inline.","type":"string"},"template":{"type":"string"},"width":{"type":"integer"}},"required":["width","height","bytes","content_type","credits"],"type":"object"},"example":{"bytes":21877,"content_type":"image/png","credits":1,"height":630,"image_base64":"iVBORw0KGgoAAAANSUhEUgAABLAAAAJ2CAIAAAD...","width":1200}}}},"400":{"description":"Invalid JSON or input. Not charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit, concurrency limit or monthly quota reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable. Retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/templates/list":{"post":{"operationId":"templatesList","summary":"List templates","description":"List the templates `render_template_pdf` and `html_to_image` can fill in: the built-in ones (invoice, receipt, certificate, report, shipping_label), each with its fields, default page setup and sample data, and the ones saved on this account. Free. Set `include_html` to get each template's source too.","x-credits":0,"externalDocs":{"url":"https://printmint.plxi.us/docs#op-templates-list"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"include_html":{"description":"Include each template's HTML.","type":"boolean"}},"type":"object"},"example":{}}}},"responses":{"200":{"description":"Success. The body includes the credits charged.","content":{"application/json":{"schema":{"properties":{"credits":{"type":"integer"},"starters":{"items":{"type":"object"},"type":"array"},"templates":{"items":{"type":"object"},"type":"array"}},"required":["starters","templates","credits"],"type":"object"},"example":{"credits":0,"starters":[{"description":"An itemised invoice…","fields":{"number":"Invoice number"},"name":"invoice","pdf":{"page_size":"A4"},"sample":{"number":"INV-2026-0142"},"title":"Invoice"}],"templates":[]}}}},"400":{"description":"Invalid JSON or input. Not charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit, concurrency limit or monthly quota reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable. Retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/templates/create":{"post":{"operationId":"templatesCreate","summary":"Save a template","description":"Save a template for this account (and its team): `name`, `html` in Jinja syntax (`{{ customer.name }}`, `{% for item in items %}`), and optionally `css`, `description`, `sample` (data to try it with) and `pdf` (its default page setup). It is checked when saved: a syntax error, or a sample that doesn't fill it in, is a 400 naming the line. Filters `money`, `number` and `date` format amounts and dates. Free.","x-credits":0,"externalDocs":{"url":"https://printmint.plxi.us/docs#op-templates-create"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"css":{"description":"CSS added to its head.","maxLength":200000,"type":"string"},"description":{"maxLength":500,"type":"string"},"html":{"description":"The template: HTML with Jinja tags.","maxLength":524288,"minLength":1,"type":"string"},"name":{"description":"A name for the template.","maxLength":80,"minLength":1,"type":"string"},"pdf":{"additionalProperties":false,"description":"How the PDF is laid out. Every field is optional.","properties":{"footer_html":{"description":"Like header_html, at the bottom of each page.","maxLength":50000,"type":"string"},"header_html":{"description":"HTML repeated at the top of each page, inside the top margin. Elements with class pageNumber, totalPages, date and title are filled in. Use inline styles; it loads nothing.","maxLength":50000,"type":"string"},"height":{"description":"Page height, with width.","maximum":10000,"minimum":0,"pattern":"^\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm)$","type":["string","number"]},"landscape":{"description":"Landscape instead of portrait.","type":"boolean"},"margin":{"additionalProperties":false,"description":"Page margins; each side defaults to 0.","properties":{"bottom":{"description":"A length: \"12mm\", \"0.5in\", \"1cm\", \"40px\", or a number of pixels.","maximum":10000,"minimum":0,"pattern":"^\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm)$","type":["string","number"]},"left":{"description":"A length: \"12mm\", \"0.5in\", \"1cm\", \"40px\", or a number of pixels.","maximum":10000,"minimum":0,"pattern":"^\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm)$","type":["string","number"]},"right":{"description":"A length: \"12mm\", \"0.5in\", \"1cm\", \"40px\", or a number of pixels.","maximum":10000,"minimum":0,"pattern":"^\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm)$","type":["string","number"]},"top":{"description":"A length: \"12mm\", \"0.5in\", \"1cm\", \"40px\", or a number of pixels.","maximum":10000,"minimum":0,"pattern":"^\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm)$","type":["string","number"]}},"type":"object"},"outline":{"description":"Add bookmarks made from the headings.","type":"boolean"},"page_ranges":{"description":"Only these pages, e.g. \"1-3, 5\".","maxLength":100,"pattern":"^\\s*\\d{1,4}(\\s*-\\s*\\d{1,4})?(\\s*,\\s*\\d{1,4}(\\s*-\\s*\\d{1,4})?)*\\s*$","type":"string"},"page_size":{"description":"Paper size; A4 by default. Or give width and height.","enum":["A4","Letter","Legal","Tabloid","Ledger","A0","A1","A2","A3","A5","A6"],"type":"string"},"prefer_css_page_size":{"description":"Use the page size in the HTML's CSS @page rule.","type":"boolean"},"print_background":{"description":"Print background colours and images (on by default).","type":"boolean"},"scale":{"description":"Zoom, 0.1 to 2 (default 1).","maximum":2,"minimum":0.1,"type":"number"},"tagged":{"description":"Make a tagged (accessible) PDF.","type":"boolean"},"width":{"description":"Page width, with height, for a custom size such as a 4in x 6in label.","maximum":10000,"minimum":0,"pattern":"^\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm)$","type":["string","number"]}},"type":"object"},"sample":{"description":"Data to fill it in with in the Playground, and to check it with now.","type":"object"}},"required":["name","html"],"type":"object"},"example":{"css":"body { font-family: Inter, Arial, sans-serif; padding: 25mm; }","html":"<h1>Thank you, {{ name }}!</h1><p>Your order {{ order }} is on its way.</p>","name":"Thank-you note","pdf":{"page_size":"A5"},"sample":{"name":"Sam","order":"#1042"}}}}},"responses":{"200":{"description":"Success. The body includes the credits charged.","content":{"application/json":{"schema":{"properties":{"created_at":{"type":"string"},"credits":{"type":"integer"},"description":{"type":["string","null"]},"id":{"type":"string"},"name":{"type":"string"},"pdf":{"type":["object","null"]},"sample":{"type":["object","null"]},"updated_at":{"type":"string"}},"required":["id","name","created_at","updated_at","credits"],"type":"object"},"example":{"created_at":"2026-10-31T12:00:00Z","credits":0,"description":null,"id":"0b8f6a4e-3c2d-4c1a-9f0e-6d5b4a3c2b1a","name":"Thank-you note","pdf":{"page_size":"A5"},"sample":{"name":"Sam","order":"#1042"},"updated_at":"2026-10-31T12:00:00Z"}}}},"400":{"description":"Invalid JSON or input. Not charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit, concurrency limit or monthly quota reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable. Retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/templates/update":{"post":{"operationId":"templatesUpdate","summary":"Change a template","description":"Change one of this account's templates by `id`: any of `name`, `description`, `html`, `css`, `sample` and `pdf`. Fields you leave out keep their values; null clears an optional one. Checked like templates.create. Free.","x-credits":0,"externalDocs":{"url":"https://printmint.plxi.us/docs#op-templates-update"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"css":{"maxLength":200000,"type":["string","null"]},"description":{"maxLength":500,"type":["string","null"]},"html":{"maxLength":524288,"minLength":1,"type":"string"},"id":{"description":"The template's id.","pattern":"^[0-9a-fA-F-]{36}$","type":"string"},"name":{"maxLength":80,"minLength":1,"type":"string"},"pdf":{"anyOf":[{"additionalProperties":false,"description":"How the PDF is laid out. Every field is optional.","properties":{"footer_html":{"description":"Like header_html, at the bottom of each page.","maxLength":50000,"type":"string"},"header_html":{"description":"HTML repeated at the top of each page, inside the top margin. Elements with class pageNumber, totalPages, date and title are filled in. Use inline styles; it loads nothing.","maxLength":50000,"type":"string"},"height":{"description":"Page height, with width.","maximum":10000,"minimum":0,"pattern":"^\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm)$","type":["string","number"]},"landscape":{"description":"Landscape instead of portrait.","type":"boolean"},"margin":{"additionalProperties":false,"description":"Page margins; each side defaults to 0.","properties":{"bottom":{"description":"A length: \"12mm\", \"0.5in\", \"1cm\", \"40px\", or a number of pixels.","maximum":10000,"minimum":0,"pattern":"^\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm)$","type":["string","number"]},"left":{"description":"A length: \"12mm\", \"0.5in\", \"1cm\", \"40px\", or a number of pixels.","maximum":10000,"minimum":0,"pattern":"^\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm)$","type":["string","number"]},"right":{"description":"A length: \"12mm\", \"0.5in\", \"1cm\", \"40px\", or a number of pixels.","maximum":10000,"minimum":0,"pattern":"^\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm)$","type":["string","number"]},"top":{"description":"A length: \"12mm\", \"0.5in\", \"1cm\", \"40px\", or a number of pixels.","maximum":10000,"minimum":0,"pattern":"^\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm)$","type":["string","number"]}},"type":"object"},"outline":{"description":"Add bookmarks made from the headings.","type":"boolean"},"page_ranges":{"description":"Only these pages, e.g. \"1-3, 5\".","maxLength":100,"pattern":"^\\s*\\d{1,4}(\\s*-\\s*\\d{1,4})?(\\s*,\\s*\\d{1,4}(\\s*-\\s*\\d{1,4})?)*\\s*$","type":"string"},"page_size":{"description":"Paper size; A4 by default. Or give width and height.","enum":["A4","Letter","Legal","Tabloid","Ledger","A0","A1","A2","A3","A5","A6"],"type":"string"},"prefer_css_page_size":{"description":"Use the page size in the HTML's CSS @page rule.","type":"boolean"},"print_background":{"description":"Print background colours and images (on by default).","type":"boolean"},"scale":{"description":"Zoom, 0.1 to 2 (default 1).","maximum":2,"minimum":0.1,"type":"number"},"tagged":{"description":"Make a tagged (accessible) PDF.","type":"boolean"},"width":{"description":"Page width, with height, for a custom size such as a 4in x 6in label.","maximum":10000,"minimum":0,"pattern":"^\\d{1,4}(\\.\\d{1,3})?(px|in|cm|mm)$","type":["string","number"]}},"type":"object"},{"type":"null"}]},"sample":{"type":["object","null"]}},"required":["id"],"type":"object"},"example":{"id":"00000000-0000-4000-8000-000000000000","name":"Thank-you note (v2)"}}}},"responses":{"200":{"description":"Success. The body includes the credits charged.","content":{"application/json":{"schema":{"properties":{"created_at":{"type":"string"},"credits":{"type":"integer"},"description":{"type":["string","null"]},"id":{"type":"string"},"name":{"type":"string"},"pdf":{"type":["object","null"]},"sample":{"type":["object","null"]},"updated_at":{"type":"string"}},"required":["id","name","created_at","updated_at","credits"],"type":"object"},"example":{"created_at":"2026-10-31T12:00:00Z","credits":0,"description":null,"id":"00000000-0000-4000-8000-000000000000","name":"Thank-you note (v2)","pdf":{"page_size":"A5"},"sample":{"name":"Sam","order":"#1042"},"updated_at":"2026-10-31T12:05:00Z"}}}},"400":{"description":"Invalid JSON or input. Not charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit, concurrency limit or monthly quota reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable. Retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/templates/delete":{"post":{"operationId":"templatesDelete","summary":"Delete a template","description":"Delete one of this account's templates by `id`. Free.","x-credits":0,"externalDocs":{"url":"https://printmint.plxi.us/docs#op-templates-delete"},"requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"id":{"description":"The template's id.","pattern":"^[0-9a-fA-F-]{36}$","type":"string"}},"required":["id"],"type":"object"},"example":{"id":"00000000-0000-4000-8000-000000000000"}}}},"responses":{"200":{"description":"Success. The body includes the credits charged.","content":{"application/json":{"schema":{"properties":{"credits":{"type":"integer"},"deleted":{"type":"boolean"},"id":{"type":"string"}},"required":["id","deleted","credits"],"type":"object"},"example":{"credits":0,"deleted":true,"id":"00000000-0000-4000-8000-000000000000"}}}},"400":{"description":"Invalid JSON or input. Not charged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit, concurrency limit or monthly quota reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Temporarily unavailable. Retry with backoff.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/usage":{"get":{"operationId":"getUsage","summary":"Usage and limits for the current billing period.","responses":{"200":{"description":"Usage summary.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing or invalid API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"X-API-Key"}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Stable error code, listed in the API reference."},"message":{"type":"string"},"reset_at":{"type":"string","format":"date-time"}}}}}}