Skip to main content

Invoice Hub

Personal

Business

Easily Create Invoice Hubs – Instant Financial Transparency​

Cas Invoice Hub API enables you to create e-invoices quickly, accurately, and automatically, simplifying accounting processes and ensuring compliance with financial regulations.

You can:

  • Generate invoices directly from transactions or sales data
  • Send e-invoices to buyers via email or shareable links
  • Sync invoice data for tax and accounting reports
  • Ensure transparency and easy reconciliation in all financial operations
View a sample invoice creation payload
{
"invoiceCreationType": "ISSUED",
"invoiceType": "1",
"templateCode": "1/247",
"invoiceSeries": "K24TSA",
"currencyCode": "VND",
"adjustmentType": "1",
"paymentStatus": true,
"invoiceIssuedDate": 1749001176000,
"validation": 0,
"buyerInfo": {
"buyerNotGetInvoice": 0,
"buyerName": "Nguyen Van A",
"buyerLegalName": "CASSO COMPANY LIMITED",
"buyerTaxCode": "0316794479",
"buyerAddressLine": "I.102D, Nha A, Khu Cong Nghe Phan Mem, Duong Noi Bo Dai hoc Quoc Gia Thanh Pho Ho Chi Minh, Khu pho 6, Phuong Linh Trung, Thanh pho Thu Duc, Thanh pho Ho Chi Minh, Viet Nam",
"buyerEmail": "info@casso.vn"
},
"taxBreakdowns": {
"taxPercentage": -2,
},
"items": [
{
"itemTotalAmountWithoutTax": 10000,
"itemName": "payOS Software - Plan ABC",
"unitName": "Plan",
"unitPrice": 10000,
"quantity": 1
}
],
"payments": [
{
"paymentMethod": "3",
"paymentMethodName": "TM/CK"
}
]
}

Steps to Integrate Invoice​

Below are the steps to integrate Invoice into your product.

  1. Create a grant /grant/token with scopes set to invoice.

  2. Open the Cas Link interface using the grantToken returned from the step above. See details

  3. After the user completes authentication, your frontend will receive a publicToken. Use this publicToken to obtain an accessToken for the grant.

  4. You can now call the Create Invoice API.

Call API​

Create grant for Invoice Hub​

curl --location 'https://sandbox.bankhub.dev/grant/token' \
--header 'X-BankHub-Api-Version: 2023-01-01' \
--header 'x-client-id: <CLIENT_ID_HERE>' \
--header 'x-secret-key: <SECRET_KEY_HERE>' \
--header 'Content-Type: application/json' \
--data '{
"scopes": "invoice",
"language": "vi",
"redirectUri": "https://your-domain.vn/link",
}'
info

For detail API, here

Exchange publicToken for accessToken​

  curl --location 'https://sandbox.bankhub.dev/grant/exchange' \
--header 'X-BankHub-Api-Version: 2023-01-01' \
--header 'x-client-id: <CLIENT_ID_HERE>' \
--header 'x-secret-key: <SECRET_KEY_HERE>' \
--header 'Content-Type: application/json' \
--data '{
"publicToken": "bdbde2bad-7685-4f95-987c-71309a4a3"
}'
info

For detail API, here

Creation API​

  curl --location 'https://sandbox.bankhub.dev/invoices' \
--header 'X-BankHub-Api-Version: 2023-01-01' \
--header 'Authorization: <ACCESS_TOKEN_HERE>' \
--header 'x-client-id: <CLIENT_ID_HERE>' \
--header 'x-secret-key: <SECRET_KEY_HERE>'
--data-raw '{
"invoiceCreationType": "ISSUED",
"invoiceType": "1",
"templateCode": "1/247",
"invoiceSeries": "K24TSA",
"currencyCode": "VND",
"adjustmentType": "1",
"paymentStatus": true,
"invoiceIssuedDate": 1749001176000,
"validation": 0,
"buyerInfo": {
"buyerNotGetInvoice": 0,
"buyerName": "Nguyen Van A",
"buyerLegalName": "CASSO COMPANY LIMITED",
"buyerTaxCode": "0316794479",
"buyerAddressLine": "I.102D, Nhà A, Khu Công Nghệ Phần Mềm, Đường Nội Bộ Đại học Quốc Gia Thành Phố Hồ Chí Minh, Khu phố 6, Phường Linh Trung, Thành phố Thủ Đức, Thành phố Hồ Chí Minh, Việt Nam",
"buyerEmail": "info@casso.vn"
},
"taxBreakdowns": {
"taxPercentage": -2,
},
"items": [
{
"itemTotalAmountWithoutTax": 10000,
"itemName": "ABC",
"unitName": "package",
"unitPrice": 10000,
"quantity": 1
}
],
"payments": [
{
"paymentMethod": "3",
"paymentMethodName": "TM/CK"
}
]
}'
info

For detail API, here