Create eInvoice
API to create an e-invoice, sign and submit to tax, returning a lookup/tracking code.
POST
https://einvoice-api-sandbox.sepay.vn/v1/invoices/create-H "Authorization: Bearer <ACCESS_TOKEN>" \ -H "Content-Type: application/json"
- Payload:
| Name | Type | Required | Description |
|---|---|---|---|
reference_code | string | Not required | The unit reference code must be unique. |
template_code | string | Required | Invoice template code. |
invoice_series | string | Required | Invoice series. |
issued_date | string | Required | Issue datetime (yyyy-MM-dd HH:mm:ss).(Cannot be greater than the current date) |
currency | string | Required | Currency code, e.g., VND. |
provider_account_id | string | Required | Provided account ID |
buyer | object | Required | Buyer info. |
items | array | Required | Line items. |
seller_store_code | string | Not required | Seller's store code |
seller_store_name | string | Not required | Seller's store name |
notes | string | Not required | Invoice notes. |
is_draft | boolean | Required | Draft (true) or issue (false). |
Tax rate information
tax_rateis only required when used for companies (not required for sales invoices).- The
tax_ratefield initemsshould be provided with one of the following values:-2(Not subject to tax)-1(Not declared, VAT not calculated or payable)0(0% tax rate)5(5% tax rate)8(8% tax rate)10(10% tax rate)
Note
- To issue an invoice, set
is_draft=false. To save a draft for preview only, setis_draft=true(draft invoices are not counted toward your eInvoice quota). provider_account_idis provided by the eInvoice Account List API.- After successfully submitting an invoice issuance request, use the endpoint provided in
tracking_urlto call the Invoice Issuance Status Tracking API.
Template parameters for invoice types
Sales invoice template
{
"template_code": "2",
"invoice_series": "C25HTV",
"issued_date": "2025-12-11 08:00:00",
"currency": "VND",
"provider_account_id": "0aea3134-da40-11f0-aef4-52c7e9b4f41b",
"buyer": {
"name": "Công ty ABC",
"tax_code": "0101234567",
"address": "123 Đường A, Quận B, Hà Nội",
"email": "buyer@example.com",
"phone": "0900000000"
},
"items": [
{
"line_number": 1,
"line_type": 1,
"item_code": "SP001",
"item_name": "Sản phẩm A",
"unit": "cái",
"quantity": 1,
"unit_price": 4500000
}
],
"notes": "Ghi chú hóa đơn",
"is_draft": true
}Sample sales invoice with discount on total order
{
"template_code": "2",
"invoice_series": "C25HTV",
"issued_date": "2025-12-11 08:00:00",
"currency": "VND",
"provider_account_id": "0aea3134-da40-11f0-aef4-52c7e9b4f41b",
"buyer": {
"name": "Công ty ABC",
"tax_code": "0101234567",
"address": "123 Đường A, Quận B, Hà Nội",
"email": "buyer@example.com",
"phone": "0900000000"
},
"items": [
{
"line_number": 1,
"line_type": 1,
"item_code": "SP001",
"item_name": "Sản phẩm A",
"unit": "cái",
"quantity": 1,
"unit_price": 4500000
},
{
"line_number": 2,
"line_type": 3,
"item_name": "Chiết khấu thương mại",
"amount": 4500000
}
],
"notes": "Ghi chú hóa đơn",
"is_draft": true
}Sample sales invoice with product discount
{
"template_code": "2",
"invoice_series": "C25HTV",
"issued_date": "2025-12-11 08:00:00",
"currency": "VND",
"provider_account_id": "0aea3134-da40-11f0-aef4-52c7e9b4f41b",
"buyer": {
"name": "Công ty ABC",
"tax_code": "0101234567",
"address": "123 Đường A, Quận B, Hà Nội",
"email": "buyer@example.com",
"phone": "0900000000"
},
"items": [
{
"line_number": 1,
"line_type": 1,
"item_code": "SP001",
"item_name": "Sản phẩm A",
"unit": "cái",
"quantity": 1,
"unit_price": 4500000,
"discount_tax": 2
}
],
"notes": "Giảm giá 2%",
"is_draft": true
}Sample sales invoice with promotions
{
"template_code": "2",
"invoice_series": "C25HTV",
"issued_date": "2025-12-11 08:00:00",
"currency": "VND",
"provider_account_id": "0aea3134-da40-11f0-aef4-52c7e9b4f41b",
"buyer": {
"name": "Công ty ABC",
"tax_code": "0101234567",
"address": "123 Đường A, Quận B, Hà Nội",
"email": "buyer@example.com",
"phone": "0900000000"
},
"items": [
{
"line_number": 1,
"line_type": 1,
"item_code": "SP001",
"item_name": "Sản phẩm A",
"unit": "cái",
"quantity": 1,
"unit_price": 4500000
},
{
"line_number": 2,
"line_type": 2,
"item_code": "KM001",
"item_name": "Hàng KM",
"unit": "cái",
"quantity": 1,
"unit_price": 0
}
],
"notes": "Ghi chú hóa đơn",
"is_draft": true
}Value-added tax invoice template
{
"template_code": "5",
"invoice_series": "C25HTV",
"issued_date": "2025-12-11 08:00:00",
"currency": "VND",
"provider_account_id": "0aea3134-da40-11f0-aef4-52c7e9b4f41b",
"buyer": {
"name": "Công ty ABC",
"tax_code": "0101234567",
"address": "123 Đường A, Quận B, Hà Nội",
"email": "buyer@example.com",
"phone": "0900000000"
},
"items": [
{
"line_number": 1,
"line_type": 1,
"item_code": "SP001",
"item_name": "Sản phẩm A",
"unit": "cái",
"quantity": 1,
"unit_price": 4500000,
"tax_rate": 0
}
],
"notes": "Ghi chú hóa đơn",
"is_draft": true
}Sample value-added tax invoice with discount on the total order
{
"template_code": "5",
"invoice_series": "C25HTV",
"issued_date": "2025-12-11 08:00:00",
"currency": "VND",
"provider_account_id": "0aea3134-da40-11f0-aef4-52c7e9b4f41b",
"buyer": {
"name": "Công ty ABC",
"tax_code": "0101234567",
"address": "123 Đường A, Quận B, Hà Nội",
"email": "buyer@example.com",
"phone": "0900000000"
},
"items": [
{
"line_number": 1,
"line_type": 1,
"item_code": "SP001",
"item_name": "Sản phẩm A",
"unit": "cái",
"quantity": 1,
"unit_price": 4500000,
"tax_rate": 10
},
{
"line_number": 1,
"line_type": 3,
"item_name": "Chieest khau thuong mai",
"tax_rate": 10
}
],
"notes": "Ghi chú hóa đơn",
"is_draft": true
}Sample value-added tax invoice with product discount
{
"template_code": "5",
"invoice_series": "C25HTV",
"issued_date": "2025-12-11 08:00:00",
"currency": "VND",
"provider_account_id": "0aea3134-da40-11f0-aef4-52c7e9b4f41b",
"buyer": {
"name": "Công ty ABC",
"tax_code": "0101234567",
"address": "123 Đường A, Quận B, Hà Nội",
"email": "buyer@example.com",
"phone": "0900000000"
},
"items": [
{
"line_number": 1,
"line_type": 1,
"item_code": "SP001",
"item_name": "Sản phẩm A",
"unit": "cái",
"quantity": 1,
"unit_price": 4500000,
"tax_rate": 0,
"discount_tax": 2
}
],
"notes": "Ghi chú hóa đơn",
"is_draft": true
}Sample value-added tax invoice with product discount
{
"template_code": "5",
"invoice_series": "C25HTV",
"issued_date": "2025-12-11 08:00:00",
"currency": "VND",
"provider_account_id": "0aea3134-da40-11f0-aef4-52c7e9b4f41b",
"buyer": {
"name": "Công ty ABC",
"tax_code": "0101234567",
"address": "123 Đường A, Quận B, Hà Nội",
"email": "buyer@example.com",
"phone": "0900000000"
},
"items": [
{
"line_number": 1,
"line_type": 1,
"item_code": "SP001",
"item_name": "Sản phẩm A",
"unit": "cái",
"quantity": 1,
"unit_price": 4500000,
"tax_rate": 0
},
{
"line_number": 1,
"line_type": 2,
"item_code": "KM001",
"item_name": "Sản phẩm B",
"unit": "cái",
"quantity": 1,
"tax_rate": 0
}
],
"notes": "Ghi chú hóa đơn",
"is_draft": true
}| 400 | Bad Request Missing or invalid required fields. | — |
| 401 | Unauthorized Missing or invalid Bearer token. | — |
| 500 | Internal Server Error System error while signing/submitting. | — |