This guide is based on the Business Letterhead template in the Gallery.
It explains a practical flow: template HTML structure, matching JSON payload, and API render request.
Step 1 - Template HTML structure
HTML
<div class="letterhead">
<h1>{{company_name}}</h1>
<div class="letterhead-info">
<p>{{address_line1}}</p>
<p>{{address_line2}}</p>
<p>{{phone}} | {{email}}</p>
<p>{{website}}</p>
</div>
</div>
<div class="content">
<p class="date">{{date}}</p>
<p class="greeting">Dear {{recipient_name}},</p>
<p class="body-text">{{body}}</p>
<div class="closing">
<p>{{closing_text}}</p>
<p class="signature">{{sender_name}}<br>
<span style="font-weight:400;font-size:12px;color:#636e72">{{sender_title}}</span>
</p>
</div>
</div>
<div class="footer">{{company_name}} | {{tagline}}</div>
Step 2 - Matching JSON payload
JSON
{
"company_name": "Meridian Corp",
"address_line1": "500 Corporate Drive",
"address_line2": "New York, NY 10001",
"phone": "(212) 555-0100",
"email": "info@meridian.com",
"website": "www.meridian.com",
"date": "March 9, 2026",
"recipient_name": "Mr. Anderson",
"body": "We are pleased to confirm our partnership agreement for the upcoming fiscal year. As discussed in our recent meeting, we believe this collaboration will bring significant value to both organizations. Please find the detailed terms outlined in the attached document.",
"closing_text": "Sincerely,",
"sender_name": "Catherine Wells",
"sender_title": "Chief Executive Officer",
"tagline": "Excellence in Innovation"
}
Step 3 - Final rendered preview in page
Rendered output preview
Template style preview
Preview uses the original Gallery template HTML and CSS with sample payload values.
Step 4 - Key mapping checklist
{{company_name}}->company_name{{address_line1}}->address_line1{{address_line2}}->address_line2{{phone}}->phone
Step 5 - Render request example
BASH
curl -X POST "https://api.hookpdf.com/v1/render" \
-H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" \
-d '{
"template_id": "<gallery-business-letterhead-template_id>",
"payload": {
"company_name": "Meridian Corp",
"address_line1": "500 Corporate Drive",
"address_line2": "New York, NY 10001",
"phone": "(212) 555-0100",
"email": "info@meridian.com",
"website": "www.meridian.com",
"date": "March 9, 2026"
}
}'
Use this template for free now
Start with this template in HookPDF and render your first PDF for free.
Use this template freeRelated reads
Ready to move from prototype to production?
Create your account and generate your first API-driven PDF with HookPDF.
Get your API key