AI agent that prepares LHDN e-Filing submissions STP, ETB, and tax form data aggregation.
import requests, json, xml.etree.ElementTree as ET
API_STP = "https://api.lhdn.gov.my/stp"
API_ETB = "https://api.lhdn.gov.my/etb"
def fetch_tax_data(form_type):
resp = requests.get(f"https://api.lhdn.gov.my/{form_type}")
return resp.json()
def validate_tax_fields(data):
required = ["tin", "period", "amount"]
return all(k in data for k in required)
def generate_irb_xml(data, form_type):
root = ET.Element(f"{form_type}_submission")
ET.SubElement(root, "tin").text = data["tin"]
ET.SubElement(root, "period").text = data["period"]
ET.SubElement(root, "amount").text = str(data["amount"])
return ET.tostring(root, encoding="unicode")
forms = ["STP", "ETB", "Tax-Ezt", "Form-E"]
for f in forms:
data = fetch_tax_data(f)
if validate_tax_fields(data):
xml = generate_irb_xml(data, f)
print(f"{f}: {xml}")
Basic Package
Special SME traction programme by AINNA.
Limited starter website offer. AI usage, hosting, maintenance and custom integrations depend on the confirmed scope.
View SME Offer β
Ask about AINNA pages, services and articles.
AINNA website sources only Β· answers up to 5 lines
No section data available yet.
Sites with documented sections will appear here.
We value your privacy
We use browser storage to remember your choice. Optional analytics runs only after you allow it; your choice is recorded with an anonymous ID. Privacy Policy