E-Invoice Document Query APIs
APIs for searching and retrieving internal e-invoice records (to_irb records) stored in BigLedger. These represent e-invoices that have been generated and submitted (or are pending submission) to the LHDN MyInvois system.
Base URL: https://api.akaun.com/core2/tnt/dm/erp/fi/e-invoice/to-irbs
Required Permissions: API_TNT_DM_ERP_MY_E_INVOICE_TO_IRB_OWNER or API_TNT_DM_ERP_MY_E_INVOICE_TO_IRB_ADMIN
API 1 — Search Documents
Search and filter internal e-invoice (to_irb) records. Supports extensive filtering across header fields, party information, dates, amounts, and statuses. Returns a paginated list of matching documents.
Endpoint
GET /backoffice-ep/queryRequired Permission: API_TNT_DM_ERP_MY_E_INVOICE_TO_IRB_READ
Query Parameters
All parameters are optional. Parameters accepting sets/arrays can be provided multiple times (repeated query params) or as comma-separated values.
Identity & Reference Filters
| Parameter | Type | Description |
|---|---|---|
hdr_guids | UUID[] | Filter by one or more internal to_irb header GUIDs |
hdr_irb_doc_unique_ref_nos | String[] | LHDN unique reference numbers assigned to the document |
hdr_einvoice_code_nos | String[] | E-invoice code numbers |
hdr_original_einvoice_ref_nos | String[] | Original e-invoice reference numbers (for credit/debit notes) |
to_irb_running_nos | String[] | Internal running numbers |
doc_references | String[] | Generic document references |
generic_doc_pin_codes | String[] | PIN codes associated with the document |
Party Filters — Supplier
| Parameter | Type | Description |
|---|---|---|
hdr_supplier_names | String[] | Supplier company names |
hdr_supplier_tax_ids | String[] | Supplier TIN numbers |
hdr_supplier_id_nos | String[] | Supplier identification numbers |
hdr_supplier_sales_service_tax_ids | String[] | Supplier SST registration numbers |
hdr_supplier_tourism_tax_ids | String[] | Supplier tourism tax registration numbers |
hdr_supplier_standard_indu_class_codes | String[] | Supplier MSIC (industry classification) codes |
hdr_supplier_business_activity_descs | String[] | Supplier business activity descriptions |
hdr_supplier_emails | String[] | Supplier email addresses |
hdr_supplier_addresses | String[] | Supplier addresses |
hdr_supplier_contact_nos | String[] | Supplier contact numbers |
hdr_supplier_digital_signatures | String[] | Supplier digital signatures |
Party Filters — Buyer
| Parameter | Type | Description |
|---|---|---|
hdr_buyer_names | String[] | Buyer company names |
hdr_buyer_tax_ids | String[] | Buyer TIN numbers |
hdr_buyer_id_nos | String[] | Buyer identification numbers |
hdr_buyer_sales_service_tax_ids | String[] | Buyer SST registration numbers |
hdr_buyer_emails | String[] | Buyer email addresses |
hdr_buyer_addresses | String[] | Buyer addresses |
hdr_buyer_contact_nos | String[] | Buyer contact numbers |
Document Type & Status Filters
| Parameter | Type | Description |
|---|---|---|
hdr_einvoice_types | String[] | E-invoice type codes (e.g. 01 = Invoice, 02 = Credit Note, 03 = Debit Note, 04 = Refund) |
hdr_einvoice_vers | String[] | E-invoice format version (e.g. 1.0) |
hdr_submission_statuses | String[] | LHDN submission status (e.g. Valid, Invalid, Submitted, Pending) |
hdr_einvoice_document_statuses | String[] | Internal document status |
hdr_posting_status | String[] | Accounting posting status |
hdr_einvoice_submission_types | String[] | Submission type (e.g. individual, bulk) |
hdr_invoice_currency_codes | String[] | Currency codes (e.g. MYR) |
hdr_billing_frequencies | String[] | Billing frequency (for consolidated invoices) |
Company & Branch Filters
| Parameter | Type | Description |
|---|---|---|
code_companies | String[] | Company codes |
hdr_branch_guids | UUID[] | Branch GUIDs |
hdr_branch_codes | String[] | Branch codes |
Related Record Filters
| Parameter | Type | Description |
|---|---|---|
hdr_generic_doc_hdr_guids | UUID[] | Source generic document header GUIDs |
hdr_generic_doc_hdr_server_doc_types | String[] | Source document server types |
hdr_generic_doc_hdr_server_doc_1s / _2s / _3s | String[] | The source document’s tenant, company and branch running numbers — the generic document |
hdr_einvoice_buyer_entity_hdr_guids | UUID[] | Buyer entity header GUIDs |
hdr_einvoice_delivery_entity_hdr_guids | UUID[] | Delivery entity header GUIDs |
line_irb_hdr_guids | UUID[] | Line-level to_irb header GUIDs |
| client_doc_1s … client_doc_5s | String[] | The numbers another system gave the document — the generic document |
Date Range Filters
All date fields accept ISO 8601 format with timezone (e.g. 2024-01-01T00:00:00+08:00).
| Parameter | Type | Description |
|---|---|---|
hdr_einvoice_datetime_from | DateTime | E-invoice issue date start |
hdr_einvoice_datetime_to | DateTime | E-invoice issue date end |
hdr_validation_datetime_from | DateTime | LHDN validation date start |
hdr_validation_datetime_to | DateTime | LHDN validation date end |
hdr_actual_submission_date_from | DateTime | Actual LHDN submission date start |
hdr_actual_submission_date_to | DateTime | Actual LHDN submission date end |
hdr_created_date_from | DateTime | Record creation date start |
hdr_created_date_to | DateTime | Record creation date end |
hdr_updated_date_from | DateTime | Record last updated date start |
hdr_updated_date_to | DateTime | Record last updated date end |
hdr_einvoice_billing_period_start_from | DateTime | Billing period start lower bound |
hdr_einvoice_billing_period_start_to | DateTime | Billing period start upper bound |
hdr_einvoice_billing_period_end_from | DateTime | Billing period end lower bound |
hdr_einvoice_billing_period_end_to | DateTime | Billing period end upper bound |
date_txn_from | DateTime | Transaction date start |
date_txn_to | DateTime | Transaction date end |
Amount Filters
| Parameter | Type | Description |
|---|---|---|
hdr_currency_rate | Decimal | Filter by exchange rate |
hdr_tax_exemption_amount | Decimal | Filter by header-level tax exemption amount |
hdr_sub_total | Decimal | Filter by subtotal |
hdr_total_exclude_tax | Decimal | Filter by total excluding tax |
hdr_total_include_tax | Decimal | Filter by total including tax |
hdr_txn_amount | Decimal | Filter by transaction amount |
Line-Level Filters
| Parameter | Type | Description |
|---|---|---|
line_classifications | String[] | Line item classification codes |
line_item_names | String[] | Line item descriptions |
line_tax_types | String[] | Tax type codes |
line_tax_exemption_details | String[] | Tax exemption detail descriptions |
line_uoms | String[] | Unit of measure codes |
line_settlement_methods | String[] | Settlement method (e.g. cash, credit) |
line_settlement_types | String[] | Settlement type |
line_payment_terms | String[] | Payment terms |
line_payment_reference_numbers | String[] | Payment reference numbers |
line_bill_reference_numbers | String[] | Bill reference numbers |
line_unit_price | Decimal | Unit price filter |
line_tax_rate | Decimal | Tax rate filter |
line_tax_amount | Decimal | Tax amount filter |
line_qty | Decimal | Quantity filter |
line_discount_rate | Decimal | Discount rate filter |
line_discount_amount | Decimal | Discount amount per line |
line_payment_amount | Decimal | Payment amount per line |
line_payment_date_from | DateTime | Line payment date start |
line_payment_date_to | DateTime | Line payment date end |
Pagination & Logic
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | Integer | 100 | Maximum records returned |
offset | Integer | 0 | Records to skip (page 3 of 20 is offset=40&limit=20) |
orderBy | String | — | Column to sort by |
order | String | ASC | ASC or DESC |
calcTotalRecords | Boolean | false | When true, totalRecords in the envelope is populated at the cost of a second count query |
applyOrLogicToQueryEntity | Boolean | false | When true, applies OR logic across entity filter conditions |
Example Request
GET /backoffice-ep/query?hdr_submission_statuses=Valid&hdr_einvoice_datetime_from=2024-01-01T00:00:00%2B08:00&hdr_einvoice_datetime_to=2024-01-31T23:59:59%2B08:00&limit=20&offset=0Response Body
The response returns a paginated list of to_irb header records. Each record includes complete e-invoice header data, LHDN submission status, party information, and linked document references.
The response is the paged envelope (
totalRecords,offset,limit,code,message,data) and each item indatacarries the columns ofbl_fi_my_einvoice_to_irb_hdr. Note that the record’s columns carry nohdr_prefix — that prefix belongs to the query filters above. Key columns:guid,irb_doc_unique_ref_no,supplier_name,buyer_name,submission_status,einvoice_code_no,total_payable_amount,einvoice_datetime,validation_datetime.
API 2 — Get Document Details
Retrieves the full details of a single internal e-invoice record by its unique GUID.
Endpoint
GET /backoffice-ep/{guid}Required Permission: API_TNT_DM_ERP_MY_E_INVOICE_TO_IRB_READ
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
guid | UUID | Yes | The GUID of the to_irb header record (bl_fi_my_einvoice_to_irb_hdr.guid) |
Example Request
GET /backoffice-ep/3fa85f64-5717-4562-b3fc-2c963f66afa6Response Body
Returns the full to_irb header record including:
- Complete supplier and buyer party information (name, TIN, ID, address, contact)
- E-invoice type, version, and status
- LHDN submission status and validation datetime
- LHDN unique reference number (
irb_doc_unique_ref_no) and the LHDN document GUID (lhdn_document_guid) - Financial summary (subtotal, tax, total payable amount)
- Original document references (linked generic document GUIDs)
- Line-level items with classification codes, amounts, tax details
- Audit fields: created date, updated date, created by user
Common Response Fields
| Field | Description |
|---|---|
guid | Internal record GUID |
irb_doc_unique_ref_no | LHDN unique reference number |
einvoice_code_no | E-invoice code number |
submission_status | LHDN submission status |
einvoice_document_status | LHDN document status |
einvoice_datetime | ISO 8601 e-invoice issue datetime |
validation_datetime | ISO 8601 LHDN validation datetime |
supplier_name | Supplier name |
supplier_tax_id | Supplier TIN |
buyer_name | Buyer name |
buyer_tax_id | Buyer TIN |
total_exclude_tax | Total before tax |
total_include_tax | Total including tax |
total_payable_amount | Final payable amount |
invoice_currency_code | Currency code |
einvoice_type | E-invoice type code |
The column names are those of bl_fi_my_einvoice_to_irb_hdr; they carry no hdr_ prefix (the prefix belongs to the query filters of API 1). A single-record response is wrapped in the plain envelope { "code": "OK_RESPONSE", "data": { … }, "message": "" }.
Error Responses
| HTTP Status | Description |
|---|---|
400 | Invalid GUID format |
403 | Insufficient permissions |
404 | No record found for the given GUID |