Getting Started
Quickstart
From a new account to your first PDF rendered through the API: connect, query, design, publish, render.
This guide takes you from a new account to an invoice PDF rendered through the API. You need an Oracle or PostgreSQL database you can reach and about fifteen minutes. The same steps apply to any other document: delivery notes, labels, certificates, reports.
Create an account
Create an account, open the verification link we email you, then sign in. Your workspace starts with a development environment, where you can experiment freely.
Connect a database
In Data sources, choose New data source, then Oracle (or PostgreSQL). Enter host, port and service name (the database name for PostgreSQL), and the credentials of a user that can read the tables your documents need. Use Test connection before saving.
Oracle · recommended read-only user-- A dedicated, read-only user for PryntCREATE USER prynt_reader IDENTIFIED BY "<a strong password>";GRANT CREATE SESSION TO prynt_reader;GRANT SELECT ON erp.invoices TO prynt_reader;GRANT SELECT ON erp.invoice_lines TO prynt_reader;GRANT SELECT ON erp.customers TO prynt_reader;Credentials stay protected
Passwords are encrypted at rest and never sent back to the browser. Datasets can only read: statements that modify data are refused.Create a template
In Templates, choose New template, format Document (PDF), code
invoiceand page size A4. The code is how your application refers to the template, so keep it short and stable.Add a dataset
Open the Dataset panel and write the query of the document. Every bind variable becomes a template parameter: here
:invoiceIdcreates the parameterinvoiceId. Give it a test value and run the query to see its fields.Dataset INVOICESELECT i.invoice_no, i.issue_date, c.name AS customer_name, l.description, l.quantity, l.amount FROM erp.invoices i JOIN erp.customers c ON c.id = i.customer_id JOIN erp.invoice_lines l ON l.invoice_id = i.id WHERE i.id = :invoiceId ORDER BY l.line_noDesign the layout
Drag fields from the Data panel onto the page: header fields into the page header, line fields into a table in the body. Add totals, a logo and a barcode with the invoice number. Press
F5at any time for a real PDF preview with the test values.Publish
Publish validates the template and creates version 1, which can no longer change. Your draft stays editable for the next version. Promote the version to the environment your application uses.
Create an API key
In Developers → API keys, create a key for the environment. The full key is shown once: store it as a secret in your application's configuration, never in browser code or in source control.
Render the document
Call the render endpoint with the template code and its parameters. The response body is the PDF.
Terminalcurl -X POST https://api.prynt.it/api/v1/render \ -H "Authorization: Bearer prynt_live_..." \ -H "Content-Type: application/json" \ -d '{ "template": "invoice", "environment": "production", "parameters": { "invoiceId": 18425 } }' \ -o invoice-18425.pdfA successful call answers
200 OKwithContent-Type: application/pdf. Failures answer with a problem document; see errors.
Next steps
- Read the API overview for authentication, responses and error codes.
- Learn how environments keep development and production apart.
- Keep your database private with the Gateway, outbound only, or read the security overview.