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:

FieldDescription
line_numberLine item sequence number (starting from 1)
line_typeLine type: 1 = Normal item, 2 = Promotional item, 3 = Discount
item_codeProduct/service code
item_nameProduct/service name
unitUnit of measure (piece, kg, etc.)
quantityQuantity (decimal string format)
unit_priceUnit price (decimal string format)
total_amountLine total = quantity x unit_price
tax_rateTax rate (%)
tax_amountTax amount for this line

Error Handling

401Unauthorized

Missing or invalid Bearer token. Check the Authorization header.

404Not Found

Invoice not found for the given reference_code. Verify the reference code.

Notes

Important Notes
  • The invoice_number value is "0" when the invoice is in draft status (status: "draft")
  • Numeric values in the items array are returned as strings ("2.00", "100000.00") to ensure precision
  • xml_url may be null if 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:

  1. Download Invoice - Use the reference_code to download the PDF or XML file of the invoice
  2. Invoice List - Return to the list to query other invoices