Skip to content

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/query

Required 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

ParameterTypeDescription
hdr_guidsUUID[]Filter by one or more internal to_irb header GUIDs
hdr_irb_doc_unique_ref_nosString[]LHDN unique reference numbers assigned to the document
hdr_einvoice_code_nosString[]E-invoice code numbers
hdr_original_einvoice_ref_nosString[]Original e-invoice reference numbers (for credit/debit notes)
to_irb_running_nosString[]Internal running numbers
doc_referencesString[]Generic document references
generic_doc_pin_codesString[]PIN codes associated with the document

Party Filters — Supplier

ParameterTypeDescription
hdr_supplier_namesString[]Supplier company names
hdr_supplier_tax_idsString[]Supplier TIN numbers
hdr_supplier_id_nosString[]Supplier identification numbers
hdr_supplier_sales_service_tax_idsString[]Supplier SST registration numbers
hdr_supplier_tourism_tax_idsString[]Supplier tourism tax registration numbers
hdr_supplier_standard_indu_class_codesString[]Supplier MSIC (industry classification) codes
hdr_supplier_business_activity_descsString[]Supplier business activity descriptions
hdr_supplier_emailsString[]Supplier email addresses
hdr_supplier_addressesString[]Supplier addresses
hdr_supplier_contact_nosString[]Supplier contact numbers
hdr_supplier_digital_signaturesString[]Supplier digital signatures

Party Filters — Buyer

ParameterTypeDescription
hdr_buyer_namesString[]Buyer company names
hdr_buyer_tax_idsString[]Buyer TIN numbers
hdr_buyer_id_nosString[]Buyer identification numbers
hdr_buyer_sales_service_tax_idsString[]Buyer SST registration numbers
hdr_buyer_emailsString[]Buyer email addresses
hdr_buyer_addressesString[]Buyer addresses
hdr_buyer_contact_nosString[]Buyer contact numbers

Document Type & Status Filters

ParameterTypeDescription
hdr_einvoice_typesString[]E-invoice type codes (e.g. 01 = Invoice, 02 = Credit Note, 03 = Debit Note, 04 = Refund)
hdr_einvoice_versString[]E-invoice format version (e.g. 1.0)
hdr_submission_statusesString[]LHDN submission status (e.g. Valid, Invalid, Submitted, Pending)
hdr_einvoice_document_statusesString[]Internal document status
hdr_posting_statusString[]Accounting posting status
hdr_einvoice_submission_typesString[]Submission type (e.g. individual, bulk)
hdr_invoice_currency_codesString[]Currency codes (e.g. MYR)
hdr_billing_frequenciesString[]Billing frequency (for consolidated invoices)

Company & Branch Filters

ParameterTypeDescription
code_companiesString[]Company codes
hdr_branch_guidsUUID[]Branch GUIDs
hdr_branch_codesString[]Branch codes

Related Record Filters

ParameterTypeDescription
hdr_generic_doc_hdr_guidsUUID[]Source generic document header GUIDs
hdr_generic_doc_hdr_server_doc_typesString[]Source document server types
hdr_generic_doc_hdr_server_doc_1s / _2s / _3sString[]The source document’s tenant, company and branch running numbers — the generic document
hdr_einvoice_buyer_entity_hdr_guidsUUID[]Buyer entity header GUIDs
hdr_einvoice_delivery_entity_hdr_guidsUUID[]Delivery entity header GUIDs
line_irb_hdr_guidsUUID[]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).

ParameterTypeDescription
hdr_einvoice_datetime_fromDateTimeE-invoice issue date start
hdr_einvoice_datetime_toDateTimeE-invoice issue date end
hdr_validation_datetime_fromDateTimeLHDN validation date start
hdr_validation_datetime_toDateTimeLHDN validation date end
hdr_actual_submission_date_fromDateTimeActual LHDN submission date start
hdr_actual_submission_date_toDateTimeActual LHDN submission date end
hdr_created_date_fromDateTimeRecord creation date start
hdr_created_date_toDateTimeRecord creation date end
hdr_updated_date_fromDateTimeRecord last updated date start
hdr_updated_date_toDateTimeRecord last updated date end
hdr_einvoice_billing_period_start_fromDateTimeBilling period start lower bound
hdr_einvoice_billing_period_start_toDateTimeBilling period start upper bound
hdr_einvoice_billing_period_end_fromDateTimeBilling period end lower bound
hdr_einvoice_billing_period_end_toDateTimeBilling period end upper bound
date_txn_fromDateTimeTransaction date start
date_txn_toDateTimeTransaction date end

Amount Filters

ParameterTypeDescription
hdr_currency_rateDecimalFilter by exchange rate
hdr_tax_exemption_amountDecimalFilter by header-level tax exemption amount
hdr_sub_totalDecimalFilter by subtotal
hdr_total_exclude_taxDecimalFilter by total excluding tax
hdr_total_include_taxDecimalFilter by total including tax
hdr_txn_amountDecimalFilter by transaction amount

Line-Level Filters

ParameterTypeDescription
line_classificationsString[]Line item classification codes
line_item_namesString[]Line item descriptions
line_tax_typesString[]Tax type codes
line_tax_exemption_detailsString[]Tax exemption detail descriptions
line_uomsString[]Unit of measure codes
line_settlement_methodsString[]Settlement method (e.g. cash, credit)
line_settlement_typesString[]Settlement type
line_payment_termsString[]Payment terms
line_payment_reference_numbersString[]Payment reference numbers
line_bill_reference_numbersString[]Bill reference numbers
line_unit_priceDecimalUnit price filter
line_tax_rateDecimalTax rate filter
line_tax_amountDecimalTax amount filter
line_qtyDecimalQuantity filter
line_discount_rateDecimalDiscount rate filter
line_discount_amountDecimalDiscount amount per line
line_payment_amountDecimalPayment amount per line
line_payment_date_fromDateTimeLine payment date start
line_payment_date_toDateTimeLine payment date end

Pagination & Logic

ParameterTypeDefaultDescription
limitInteger100Maximum records returned
offsetInteger0Records to skip (page 3 of 20 is offset=40&limit=20)
orderByString—Column to sort by
orderStringASCASC or DESC
calcTotalRecordsBooleanfalseWhen true, totalRecords in the envelope is populated at the cost of a second count query
applyOrLogicToQueryEntityBooleanfalseWhen 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=0

Response 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 in data carries the columns of bl_fi_my_einvoice_to_irb_hdr. Note that the record’s columns carry no hdr_ 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

ParameterTypeRequiredDescription
guidUUIDYesThe GUID of the to_irb header record (bl_fi_my_einvoice_to_irb_hdr.guid)

Example Request

GET /backoffice-ep/3fa85f64-5717-4562-b3fc-2c963f66afa6

Response 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

FieldDescription
guidInternal record GUID
irb_doc_unique_ref_noLHDN unique reference number
einvoice_code_noE-invoice code number
submission_statusLHDN submission status
einvoice_document_statusLHDN document status
einvoice_datetimeISO 8601 e-invoice issue datetime
validation_datetimeISO 8601 LHDN validation datetime
supplier_nameSupplier name
supplier_tax_idSupplier TIN
buyer_nameBuyer name
buyer_tax_idBuyer TIN
total_exclude_taxTotal before tax
total_include_taxTotal including tax
total_payable_amountFinal payable amount
invoice_currency_codeCurrency code
einvoice_typeE-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 StatusDescription
400Invalid GUID format
403Insufficient permissions
404No record found for the given GUID
Last updated on