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:
NameTypeRequiredDescription
reference_code
stringNot required
The unit reference code must be unique.
template_code
stringRequired
Invoice template code.
invoice_series
stringRequired
Invoice series.
issued_date
stringRequired
Issue datetime (yyyy-MM-dd HH:mm:ss).(Cannot be greater than the current date)
currency
stringRequired
Currency code, e.g., VND.
provider_account_id
stringRequired
Provided account ID
buyer
objectRequired
Buyer info.
items
arrayRequired
Line items.
seller_store_code
stringNot required
Seller's store code
seller_store_name
stringNot required
Seller's store name
notes
stringNot required
Invoice notes.
is_draft
booleanRequired
Draft (true) or issue (false).
Tax rate information
  • tax_rate is only required when used for companies (not required for sales invoices).
  • The tax_rate field in items should 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, set is_draft=true (draft invoices are not counted toward your eInvoice quota).
  • provider_account_id is provided by the eInvoice Account List API.
  • After successfully submitting an invoice issuance request, use the endpoint provided in tracking_url to 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.