# Vietnamese Document Templates API

> 45 Vietnamese document templates – labour contracts, probation, power of attorney, leases, sales contracts, minutes, decisions – from JSON to DOCX / PDF.

- Endpoint: `GET | POST https://apibox.io.vn/v1/vn-doc-templates`
- Category: Files
- HTML docs: https://apibox.io.vn/docs/vn-doc-templates/ (Vietnamese: https://apibox.io.vn/vi/docs/vn-doc-templates/)
- Online tool: https://apibox.io.vn/tools/vn-doc-templates/
- Authentication: `Authorization: Bearer <API key>` or `X-API-Key: <API key>` (free key: https://apibox.io.vn/dashboard/#signup)

`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.

## Parameters

| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
| `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 request

```bash
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"}}'
```

## Example response

```json
{
  "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.
