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: _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_1sString[]Source document reference field 1
hdr_generic_doc_hdr_server_doc_2sString[]Source document reference field 2
hdr_generic_doc_hdr_server_doc_3sString[]Source document reference field 3
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

Custom Client Reference Fields

ParameterTypeDescription
client_doc_1sString[]Client-defined reference field 1
client_doc_2sString[]Client-defined reference field 2
client_doc_3sString[]Client-defined reference field 3
client_doc_4sString[]Client-defined reference field 4
client_doc_5sString[]Client-defined reference field 5

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
pageNoInteger1Page number (1-based)
pageSizeIntegersystem defaultNumber of results per page
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&pageNo=1&pageSize=20

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 full response schema mirrors the bl_fi_my_einvoice_to_irb_hdr internal table. Key fields include: guid, hdr_irb_doc_unique_ref_no, hdr_supplier_name, hdr_buyer_name, hdr_submission_status, hdr_einvoice_code_no, hdr_total_payable_amount, hdr_einvoice_datetime, hdr_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: _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 (hdr_irb_doc_unique_ref_no) and long ID
  • 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
hdr_irb_doc_unique_ref_noLHDN unique reference number
hdr_einvoice_code_noE-invoice code number
hdr_submission_statusLHDN submission status (Valid, Invalid, Submitted, Pending, etc.)
hdr_einvoice_datetimeISO 8601 e-invoice issue datetime
hdr_validation_datetimeISO 8601 LHDN validation datetime
hdr_supplier_nameSupplier name
hdr_supplier_tinSupplier TIN
hdr_buyer_nameBuyer name
hdr_buyer_tinBuyer TIN
hdr_total_excluding_taxTotal before tax
hdr_total_include_taxTotal including tax
hdr_total_payable_amountFinal payable amount
hdr_invoice_currency_codeCurrency code
hdr_einvoice_typeE-invoice type code

Error Responses

HTTP StatusDescription
400Invalid GUID format
403Insufficient permissions
404No record found for the given GUID