Skip to main content
Glama

Simpler.Asia

myinvois_invoice_generate

Mint a sealed LHDN e-invoice in ONE call: invoice_type, line_items (unit_price_cents in integer CENTS, tax_rate_bps in basis points), and a buyer as customer_id or an inline buyer object. Refuses until myinvois_settings_save is done; invoice_type 02/03/04 also needs original_invoice_id naming a type-01 invoice with a recorded LHDN UUID, checked BEFORE the number is claimed, so a rejected note never burns a number. The result is immutable and carries portal_field_sheet; Simpler never submits it to LHDN. NEXT: the owner keys the field sheet into the MyInvois portal form, then myinvois_invoice_record_submission with the UUID the portal assigns.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
buyerNoInline one-off buyer party — {name, tin, brn?, address?, city?, state_code?, postal_code?, country_code?, email?, contact_number?}. Required when customer_id is not given; ignored when it is.
notesNoFree-text notes printed on the generated e-invoice; optional.
statusNo
currencyNo
buyer_tinNo
lhdn_uuidNo
tax_centsNo
buyer_nameNo
issue_dateNo
line_itemsYesLine items: [{description, quantity, unit_price_cents, tax_rate_bps?, tax_type?, classification_code?, unit_code?}]. Money is integer CENTS, tax_rate_bps is basis points (600 = 6%); tax_type/classification_code/unit_code default when omitted and validate against the LHDN code tables (GET /api/myinvois/codes).
customer_idNo
total_centsNo
invoice_dataNo
invoice_typeNo
lhdn_long_idNo
payment_termsNoPayment terms text for this document; defaults to the supplier profile's default_payment_terms when omitted.
billing_periodNoOptional LHDN billing period {start_date, end_date, frequency?}: dates as YYYY-MM-DD, end on or after start, frequency up to 50 characters (for example Monthly). Leave it out when the invoice covers no period; the e-invoice then carries none.
invoice_numberNo
subtotal_centsNo
lhdn_submitted_atNo
original_invoice_idNoThe type-01 original this note references — required for invoice_type 02, 03 or 04, refused for 01. Must already carry an LHDN UUID (myinvois_invoice_record_submission).
reference_invoice_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources