Generate invoice PDFs from your app or an AI agent
How do I generate invoice PDFs automatically from code or an AI agent?
Send the customer, line items and tax rate to POST /v1/documents with type invoice. Platemark adds up every line in exact cents, applies the discount and tax, subtracts anything already paid, and returns a clean PDF plus the totals as JSON, so your records and the PDF always match.
AI agents can do the same through the render_invoice MCP tool. Agents are unreliable at arithmetic and page layout, so the tool takes both off their hands: the agent passes quantities and prices, and Platemark does the math.
curl https://platemark.rowhousesoftware.com/v1/documents -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
-d '{"type": "invoice", "response": "json", "from": {"name": "Harbor Design Co."}, "to": {"name": "Ledgerline, Inc."},
"items": [{"description": "Website design", "quantity": 24, "unit_price": 65}], "tax": {"percent": 6}, "due_days": 30}'
Questions
Which currencies work?
Any ISO currency code, formatted for the locale you pass, like EUR with de-DE.
Can it make quotes and receipts too?
Yes. Use type quote or receipt with the same fields.