Invoice Details
API to get invoice details by reference code, including buyer info, line items, and download links
API Endpoint
GET
https://einvoice-api-sandbox.sepay.vn/v1/invoices/{reference_code}API Request
reference_codestringrequired
Invoice reference code
Where to get reference_code?
reference_code is the unique identifier for an invoice. You can obtain it from:
- Create Invoice API - Returned in the status check response (
/v1/invoices/create/check/{tracking_code}) - Issue Invoice API - Returned in the status check response (
/v1/invoices/issue/check/{tracking_code}) - List Invoices API - Each invoice in the list includes its
reference_code(/v1/invoices)
API Response
Success Response (200)
{
"success": true,
"data": {
"reference_code": "084e179d-d95a-11f0-aef4-52c7e9b4f41b",
"invoice_number": "589",
"issued_date": "2025-12-15",
"pdf_url": "https://beta-portalv2.mifi.vn/DownloadPDFCA.aspx?...",
"xml_url": null,
"status": "issued",
"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"
},
"total_before_tax": 200000,
"tax_amount": 20000,
"total_amount": 220000,
"notes": "Ghi chú hóa đơn",
"items": [
{
"line_number": 1,
"line_type": 1,
"item_code": "SP001",
"item_name": "Sản phẩm A",
"unit": "cái",
"quantity": "2.00",
"unit_price": "100000.00",
"total_amount": "200000.00",
"tax_rate": "10.00",
"tax_amount": "20000.00"
}
]
}
}successboolean
dataobject
About the items array
The items array contains line items (products/services) on the invoice with the following fields:
| Field | Description |
|---|---|
line_number | Line item sequence number (starting from 1) |
line_type | Line type: 1 = Normal item, 2 = Promotional item, 3 = Discount |
item_code | Product/service code |
item_name | Product/service name |
unit | Unit of measure (piece, kg, etc.) |
quantity | Quantity (decimal string format) |
unit_price | Unit price (decimal string format) |
total_amount | Line total = quantity x unit_price |
tax_rate | Tax rate (%) |
tax_amount | Tax amount for this line |
Error Handling
401UnauthorizedMissing or invalid Bearer token. Check the Authorization header.
404Not FoundInvoice not found for the given reference_code. Verify the reference code.
Notes
Important Notes
- The
invoice_numbervalue is"0"when the invoice is in draft status (status: "draft") - Numeric values in the
itemsarray are returned as strings ("2.00","100000.00") to ensure precision xml_urlmay benullif the invoice doesn't have an XML file or the provider doesn't support it
Code Examples
>
>
>
curl --request GET \--url https://einvoice-api-sandbox.sepay.vn/v1/invoices/084e179d-d95a-11f0-aef4-52c7e9b4f41b \--header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
Next Steps
After getting the invoice details:
- Download Invoice - Use the
reference_codeto download the PDF or XML file of the invoice - Invoice List - Return to the list to query other invoices