Vietnamese Document Templates API
45 Vietnamese document templates – labour contracts, probation, power of attorney, leases, sales contracts, minutes, decisions – from JSON to DOCX / PDF.
GET /v1/vn-doc-templates lists the templates (labour and HR: fixed-term and indefinite labour contracts, probation contract, annex, freelance agreement, termination agreement / decision / notice, resignation and leave requests, handover minutes, hiring, raise, appointment and disciplinary decisions, NDA, employment confirmation, training agreement, holiday notice; civil: power of attorney and its contract, residential lease, loan, deposit, equipment rental, cash receipt, undertaking; commercial: sale of goods, services, processing, acceptance and liquidation minutes; administrative: introduction letter, meeting minutes, decision, official letter, proposal memo, request letter; accounting: advance and payment requests, travel policy). ?template=<id> returns its fields, types and legal basis.
POST with template and data fills it: amounts are written in figures and in Vietnamese words, dates as “ngày … tháng … năm …”, list fields become tables, empty optional lines are dropped and missing required fields are reported (or rejected with strict=true). Each template cites its legal basis, and legal checks flag common mistakes: definite-term contracts over 36 months, wages below the regional minimum, probation pay below 85 % or longer than allowed, loan interest above 20 % a year, contract penalties above 8 %, fines used as discipline.
format=json (default) returns the text preview and checks (base64=true adds the DOCX), format=docx a Word file in Times New Roman 13 with A4 margins of Nghị định 30/2020, and format=pdf a PDF. The templates are APIBox’s own reference drafts; have a lawyer review them before signing.
Markdown · OpenAPI · Postman · llms.txt
Parameters
| Name | In | Type | Required | Default | |
|---|---|---|---|---|---|
template | body|query | string | no | Template id (empty: list templates; category, q filter the list). | |
data | body | object | no | Field values; fields may also be sent as top-level parameters. Common fields: doc_no, place, date. | |
format | body|query | string | no | json | json, docx, pdf or fields (field list). |
strict | body|query | boolean | no | false | Reject when required fields are missing. |
base64 | body|query | boolean | no | false | JSON format: include docx_base64. |
no_footer | body|query | boolean | no | false | Omit the reference-template footer. |
lang | query | string | no | vi | Language of field labels (vi or en). |
Example
curl -X POST "https://apibox.io.vn/v1/vn-doc-templates" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"template":"giay-uy-quyen","data":{"principal_name":"Nguyễn Văn An","principal_id_number":"001085000123","principal_address":"Phường Ba Đình, Hà Nội","agent_name":"Trần Thị Bình","agent_id_number":"001195000456","agent_address":"Phường Cầu Giấy, Hà Nội","scope":"Nhận hồ sơ và kết quả thủ tục hành chính tại Trung tâm phục vụ hành chính công.","from_date":"2026-11-11","to_date":"2026-12-31","place":"Hà Nội","date":"2026-11-11"}}'const res = await fetch('https://apibox.io.vn/v1/vn-doc-templates', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"template": "giay-uy-quyen",
"data": {
"principal_name": "Nguyễn Văn An",
"principal_id_number": "001085000123",
"principal_address": "Phường Ba Đình, Hà Nội",
"agent_name": "Trần Thị Bình",
"agent_id_number": "001195000456",
"agent_address": "Phường Cầu Giấy, Hà Nội",
"scope": "Nhận hồ sơ và kết quả thủ tục hành chính tại Trung tâm phục vụ hành chính công.",
"from_date": "2026-11-11",
"to_date": "2026-12-31",
"place": "Hà Nội",
"date": "2026-11-11"
}
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"https://apibox.io.vn/v1/vn-doc-templates",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"template": "giay-uy-quyen", "data": {"principal_name": "Nguyễn Văn An", "principal_id_number": "001085000123", "principal_address": "Phường Ba Đình, Hà Nội", "agent_name": "Trần Thị Bình", "agent_id_number": "001195000456", "agent_address": "Phường Cầu Giấy, Hà Nội", "scope": "Nhận hồ sơ và kết quả thủ tục hành chính tại Trung tâm phục vụ hành chính công.", "from_date": "2026-11-11", "to_date": "2026-12-31", "place": "Hà Nội", "date": "2026-11-11"}},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/vn-doc-templates');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"template":"giay-uy-quyen","data":{"principal_name":"Nguyễn Văn An","principal_id_number":"001085000123","principal_address":"Phường Ba Đình, Hà Nội","agent_name":"Trần Thị Bình","agent_id_number":"001195000456","agent_address":"Phường Cầu Giấy, Hà Nội","scope":"Nhận hồ sơ và kết quả thủ tục hành chính tại Trung tâm phục vụ hành chính công.","from_date":"2026-11-11","to_date":"2026-12-31","place":"Hà Nội","date":"2026-11-11"}}',
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));Response
{
"template": "giay-uy-quyen",
"title_vi": "Giấy uỷ quyền",
"title_en": "Power of attorney (unilateral)",
"legal": "Bộ luật Dân sự 2015, Điều 135, 138–143 (đại diện theo uỷ quyền), Điều 562–569; một số việc phải lập hợp đồng uỷ quyền có công chứng (ví dụ chuyển nhượng bất động sản)",
"missing_fields": [],
"unknown_fields": [],
"warnings": [],
"text": "CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM\nĐộc lập - Tự do - Hạnh phúc\n———————\nHà Nội, ngày 11 tháng 11 năm 2026\nGIẤY UỶ QUYỀN\n- Căn cứ Bộ luật Dân sự số 91/2015/QH13;\nI. Người uỷ quyền\nHọ tên: Nguyễn Văn An\nSố CCCD / hộ chiếu: 001085000123; nơi cư trú: Phường Ba Đình, Hà Nội\nII. Người được uỷ quyền\nHọ tên: Trần Thị Bình\n…\nIV. Thời hạn uỷ quyền\nTừ ngày 11/11/2026 đến ngày 31/12/2026.\n…",
"disclaimer": "Reference template, not legal advice: have a lawyer review it and check the official text before signing or filing."
}
Use cases
- Generate a labour contract automatically when HR software hires someone
- Let a chatbot or no-code flow produce a power of attorney or receipt
- Create leases and sales contracts from a CRM record
- Issue standard decisions and notices with the correct Vietnamese layout
FAQ
Are the templates legally valid?
They follow the current laws cited with each template, but they are reference drafts: adapt them to your case and have a lawyer review them.
Can I use my own Word template instead?
Yes, use /v1/docx-template to fill any .docx with {placeholders}.
Is my data stored?
No. Documents are generated in memory and returned in the response.
Related APIs
Image Metadata & EXIF
Read image dimensions, format, EXIF camera data, capture settings and GPS location from JPEG, PNG, WebP, HEIC, AVIF, GIF and more – upload or URL.
PDFPDF Metadata
Read PDF metadata: page count, title, author, creator, producer, dates, PDF version, encryption, form fields and the size of each page (A4, Letter…).
PDF₫Quote & Receipt PDF
Generate clean PDF quotations, receipts, orders and simple invoices from JSON, with Vietnamese text, VAT, totals in words and a VietQR code for payment.