API Reference
Data Models
Data models and types used by the E-Invoice API
Data Models
This page documents the data structures used across the API.
Enums
InvoiceType
| Value | Description |
|---|---|
INVOICE | Standard invoice |
SELF_BILLED_INVOICE | Self-billed invoice |
PENDING_FINALIZE_INVOICE | Pending finalization invoice |
PENDING_FINALIZE_SELF_BILLED_INVOICE | Pending finalization self-billed invoice |
AdjustmentNoteType
| Value | Description |
|---|---|
CREDIT_NOTE | Credit note |
DEBIT_NOTE | Debit note |
REFUND_NOTE | Refund note |
ConsolidatedInvoiceType
| Value | Description |
|---|---|
CONSOLIDATED_INVOICE | Consolidated invoice |
CONSOLIDATED_SELF_BILLED_INVOICE | Consolidated self-billed invoice |
PartyType
| Value | Description |
|---|---|
LOCAL_INDIVIDUAL | Malaysian individual |
LOCAL_EXEMPTED_ENTITY | Locally exempted entity |
LOCAL_BUSINESS_AGENT_DEALER_DISTRIBUTOR | Local business / agent / dealer / distributor |
FOREIGNER_BUSINESS | Foreign business |
FOREIGNER_INDIVIDUAL | Foreign individual |
RegistrationType
| Value | Description |
|---|---|
NRIC | National Registration Identity Card |
BRN | Business Registration Number |
PASSPORT | Passport number |
ARMY | Army number |
Core Models
Address
| Field | Type | Description |
|---|---|---|
addressLine0 | string | Primary address line |
addressLine1 | string? | Address line 2 |
addressLine2 | string? | Address line 3 |
postalZone | string? | Postal/ZIP code |
cityName | string | City name |
state | string | State code (Malaysian state codes) |
country | string | Country code (ISO 3166-1 alpha-3, e.g., MYS) |
Buyer
| Field | Type | Description |
|---|---|---|
name | string | Buyer name |
tin | string | Tax identification number |
partyType | PartyType | Type of party |
registrationType | RegistrationType? | Registration type |
registrationNumber | string? | Registration number |
sstRegistrationNumber | string? | SST registration number |
email | string? | Email address |
contactNumber | string? | Contact phone number |
address | Address? | Buyer address |
Supplier
Extends the Buyer model with additional required fields:
| Field | Type | Description |
|---|---|---|
contactNumber | string | Contact phone number (required) |
address | Address | Supplier address (required) |
msic | string | MSIC code |
businessActivityDescription | string | Business activity description |
tourismTaxRegistrationNumber | string? | Tourism tax registration number |
bankAccount | string? | Bank account number |
exporterCertifiedNumber | string? | Exporter certified number |
LineItem
| Field | Type | Description |
|---|---|---|
id | string | Unique line item identifier |
description | string | Item description |
classifications | string[] | Classification codes |
unit.price | number | Unit price |
unit.count | number | Quantity |
unit.code | string? | Unit code (e.g., EA) |
taxAmount | number | Total tax amount |
taxDetails | TaxDetail[] | Tax breakdown |
taxExemption | TaxExemption? | Tax exemption details |
allowanceCharges | AllowanceCharge[]? | Discounts/charges |
originCountry | string | Country of origin (ISO 3166-1 alpha-3) |
tarriffCode | string? | Tariff code |
TaxDetail
| Field | Type | Description |
|---|---|---|
taxType | string | Tax type code (e.g., 01 for SST) |
taxRate.percentage | number? | Tax rate percentage |
taxRate.ratePerUnit | number? | Tax rate per unit |
taxableAmount | number | Taxable amount |
taxAmount | number | Calculated tax amount |
LegalMonetaryTotal
| Field | Type | Description |
|---|---|---|
excludingTax | number | Total excluding tax |
includingTax | number | Total including tax |
payableAmount | number | Total payable amount |
netAmount | number? | Net amount |
discountValue | number? | Discount value |
feeAmount | number? | Fee amount |
payableRoundingAmount | number? | Rounding amount |
Document Models
Invoice
| Field | Type | Description |
|---|---|---|
id | number | Invoice ID |
company_id | number | Company ID |
user_id | number | User ID |
consolidated_invoice_id | number? | Consolidated invoice ID (if part of one) |
is_submitted_to_lhdn | boolean | Whether submitted to LHDN |
is_ready | boolean | Whether ready for submission |
invoice_code | string | Invoice code |
external_id | string? | External reference ID |
type | InvoiceType | Invoice type |
buyer | Buyer | Buyer information |
supplier | Supplier | Supplier information |
line_items | LineItem[] | Line items |
legal_monetary_total | LegalMonetaryTotal | Monetary totals |
status | string | Draft, Pending, Submitted, Cancelled, Valid, Invalid |
final_adjusted_amount | number | Final amount after adjustments |
created_at | string | ISO 8601 datetime |
updated_at | string | ISO 8601 datetime |
AdjustmentNote
| Field | Type | Description |
|---|---|---|
id | number | Adjustment note ID |
company_id | number | Company ID |
invoice_id | number? | Related invoice ID |
consolidated_invoice_id | number? | Related consolidated invoice ID |
code | number | Adjustment note code |
type | AdjustmentNoteType | CREDIT_NOTE, DEBIT_NOTE, or REFUND_NOTE |
line_items | LineItem[] | Line items |
issue_date | string | Issue date |
legal_monetary_total | LegalMonetaryTotal | Monetary totals |
status | string | Pending, Submitted, Cancelled, Valid, Invalid |
created_at | string | ISO 8601 datetime |
updated_at | string | ISO 8601 datetime |
ConsolidatedInvoice
| Field | Type | Description |
|---|---|---|
id | number | Consolidated invoice ID |
company_id | number | Company ID |
invoice_code | number | Invoice code |
external_id | string? | External reference ID |
type | ConsolidatedInvoiceType | Consolidated invoice type |
buyer | Buyer | Buyer information |
supplier | Supplier | Supplier information |
line_items | LineItem[] | Line items |
legal_monetary_total | LegalMonetaryTotal | Monetary totals |
status | string | AWAIT_SUBMISSION_TO_LHDN, Submitted, Cancelled, Valid, Invalid |
created_at | string | ISO 8601 datetime |
updated_at | string | ISO 8601 datetime |
EinvoiceRequest
| Field | Type | Description |
|---|---|---|
id | number | Request ID |
company_id | number | Company ID |
invoice_code | string | Invoice code |
document_details | object | Contains buyer, supplier, and invoiceCode (populated from the flat create request fields) |
status | string | Pending, Reject, Approve |
created_at | string | ISO 8601 datetime |
updated_at | string | ISO 8601 datetime |
SubmittedDocument
| Field | Type | Description |
|---|---|---|
id | number | Document ID |
document_submission_id | number | Submission batch ID |
invoice_id | number? | Related invoice ID |
consolidated_invoice_id | number? | Related consolidated invoice ID |
adjustment_note_id | number? | Related adjustment note ID |
company_id | number | Company ID |
user_id | number | User ID |
code | string | Document code |
uuid | string? | MyInvois UUID |
status | string | Submitted, Cancelled, Valid, Invalid |
fail_reason | string? | Failure reason |
fail_details | any? | Detailed failure info |
document_details | object | Snapshot of the UBL XML JSON value submitted to LHDN. This is a large nested object following the OASIS UBL schema — treat as opaque JSON. |
type | string | Document type (e.g., INVOICE, CREDIT_NOTE) |
cancel_reason | string? | Cancellation reason |
long_id | string? | MyInvois long ID |
created_at | string | ISO 8601 datetime |
updated_at | string | ISO 8601 datetime |
Company
| Field | Type | Description |
|---|---|---|
id | number | Company ID |
name | string | Company name |
tin_code | string | Tax identification number |
registration_number | string | Registration number |
registration_type | RegistrationType | Registration type |
sst_registration_number | string? | SST registration number |
tourism_tax_registration_number | string? | Tourism tax registration number |
business_activity_description | string | Business activity description |
msic_code | string | MSIC code |
country | string | Country name |
state | string | State name |
zip_code | string | Postal code |
city | string | City |
address | string | Address |
phone | string | Phone number |
email | string | Email address |
bank_account | string? | Bank account number |
exporter_certified_number | string? | Exporter certified number |
setting | object | Company settings (prefixes, auto-submit config) |
default_tax_types_and_rates | object[] | Default tax types and rates |
is_company_ready | boolean | Whether company setup is complete for e-invoicing |
as_buyer | object | Pre-formatted buyer representation of the company |
as_supplier | object | Pre-formatted supplier representation of the company |
created_at | string | ISO 8601 datetime |
updated_at | string | ISO 8601 datetime |
Pagination
All list endpoints return paginated responses:
{
"meta": {
"total": 50,
"per_page": 10,
"current_page": 1,
"last_page": 5,
"first_page": 1,
"first_page_url": "/?page=1",
"last_page_url": "/?page=5",
"next_page_url": "/?page=2",
"previous_page_url": null
},
"data": []
}Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | number | 1 | Page number |
per_page | number | 10 | Items per page |
Common Reference Values
Tax Types
| Code | Description |
|---|---|
01 | Sales Tax |
02 | Service Tax |
03 | Tourism Tax |
04 | High-Value Goods Tax |
05 | Sales Tax on Low Value Goods |
06 | Not Applicable |
E | Tax Exemption |
Malaysian State Codes
| Code | State |
|---|---|
01 | Johor |
02 | Kedah |
03 | Kelantan |
04 | Melaka |
05 | Negeri Sembilan |
06 | Pahang |
07 | Perak |
08 | Perlis |
09 | Pulau Pinang |
10 | Sabah |
11 | Sarawak |
12 | Selangor |
13 | Terengganu |
14 | Kuala Lumpur |
15 | Labuan |
16 | Putrajaya |