Quote & Receipt PDF API
Generate clean PDF quotations, receipts, orders and simple invoices from JSON, with Vietnamese text, VAT, totals in words and a VietQR code for payment.
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.
Parameters
| Name | In | Type | Required | Default | |
|---|---|---|---|---|---|
type | body | string | no | quote | quote, receipt, order or invoice. |
items | body | array | yes | Lines: {name, unit, quantity, price, discount (%), vat (%)}. | |
seller | body | object | no | {name, address, tax_code, phone, email}. | |
buyer | body | object | no | {name, contact, address, tax_code, phone, email}. | |
number | body | string | no | Document number. | |
date | body | string | no | Date (default: today). | |
vat | body | number | no | 0 | Default VAT rate in % for every line. |
discount | body | number | no | Global discount amount. | |
payment | body | object | no | {bank, account, holder, content}: prints a VietQR code (VND). | |
currency | body | string | no | VND | VND, USD or EUR. |
lang | body | string | no | vi | vi or en. |
color | body | string | no | Accent colour (hex). | |
format | body | string | no | pdf | pdf or json (base64 PDF + totals). |
Example
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);Response
binary application/pdf
Use cases
- Quotations and order confirmations from CRMs and online shops
- Receipts for tuition, rent, memberships and services
- Payment requests with a VietQR code
- Printable documents from no-code tools
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.
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…).
M↓PDFMarkdown to PDF
Convert Markdown to a clean A4 / A5 / Letter PDF: headings, bold / italic, links, nested lists, quotes, code blocks, tables, page numbers, full Vietnamese support.