Create a Quotation PDF in Vietnamese
Generate clean PDF quotations, receipts, orders and simple invoices from JSON, with Vietnamese text, VAT, totals in words and a VietQR code for payment.
Result
Press “Run” to see the result.
The invoice PDF API turns a JSON document into a print-ready A4 PDF: seller and buyer blocks, a table of items (name, unit, quantity, unit price, optional discount and VAT rate per line), subtotal, discount, VAT and total, the amount written in Vietnamese words (“Mười ba triệu không trăm lẻ tám nghìn đồng”), payment details, notes and signature boxes. Long item names wrap and long documents continue on new pages with page numbers.
Text uses the Be Vietnam Pro typeface (SIL Open Font License), embedded as a subset so every Vietnamese character prints correctly and files stay small (about 30 KB). With payment.bank and payment.account a VietQR code with the exact amount and reference is printed, so customers pay by scanning it with any banking app.
Types: quote (Báo giá), receipt (Phiếu thu), order (Đơn đặt hàng) and invoice (Hoá đơn bán hàng), in Vietnamese or English, with your accent colour. These are commercial documents: they do not replace the e-invoices required by Decree 123/2020/NĐ-CP, which must be issued through a licensed e-invoice provider.
Use this in your code
curl -X POST "https://apibox.io.vn/v1/invoice-pdf" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"type":"quote","number":"BG-2026-0012","vat":10,"seller":{"name":"Công ty TNHH ABC","tax_code":"0312345678"},"buyer":{"name":"Công ty CP An Phát"},"items":[{"name":"Gói API Pro – 12 tháng","unit":"gói","quantity":1,"price":2400000}],"payment":{"bank":"VCB","account":"0123456789","holder":"CONG TY ABC"}}' \
-o outputconst res = await fetch('https://apibox.io.vn/v1/invoice-pdf', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"type": "quote",
"number": "BG-2026-0012",
"vat": 10,
"seller": {
"name": "Công ty TNHH ABC",
"tax_code": "0312345678"
},
"buyer": {
"name": "Công ty CP An Phát"
},
"items": [
{
"name": "Gói API Pro – 12 tháng",
"unit": "gói",
"quantity": 1,
"price": 2400000
}
],
"payment": {
"bank": "VCB",
"account": "0123456789",
"holder": "CONG TY ABC"
}
}),
});
const blob = await res.blob();import requests
res = requests.post(
"https://apibox.io.vn/v1/invoice-pdf",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"type": "quote", "number": "BG-2026-0012", "vat": 10, "seller": {"name": "Công ty TNHH ABC", "tax_code": "0312345678"}, "buyer": {"name": "Công ty CP An Phát"}, "items": [{"name": "Gói API Pro – 12 tháng", "unit": "gói", "quantity": 1, "price": 2400000}], "payment": {"bank": "VCB", "account": "0123456789", "holder": "CONG TY ABC"}},
timeout=30,
)
open("output", "wb").write(res.content)<?php
$ch = curl_init('https://apibox.io.vn/v1/invoice-pdf');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"type":"quote","number":"BG-2026-0012","vat":10,"seller":{"name":"Công ty TNHH ABC","tax_code":"0312345678"},"buyer":{"name":"Công ty CP An Phát"},"items":[{"name":"Gói API Pro – 12 tháng","unit":"gói","quantity":1,"price":2400000}],"payment":{"bank":"VCB","account":"0123456789","holder":"CONG TY ABC"}}',
]);
$response = curl_exec($ch);
file_put_contents('output', $response);API documentation → Get a free API key
FAQ
Is this a legal e-invoice?
No. Vietnamese VAT e-invoices must be issued through a licensed provider and coded by the tax authority. Use this for quotations, receipts, orders and internal documents.
Can the customer pay from the PDF?
Yes: with payment.bank (VCB, MB, TCB…) and payment.account, the PDF contains a VietQR code with the total and the reference, readable by all Vietnamese banking apps.
How are VAT and discounts computed?
Per line: amount = quantity × price − discount %, VAT = amount × rate. A global discount is subtracted before the total and VAT is reduced proportionally.