← Back to directory
Finance & Accounting Medium to set up Automation Extract to Structured

Batch Retrieve Malaysia TIN for SSM or NRIC

Source reviewed Updated 2026-07-07

Upload a list of SSM or NRICs to fetch matching Malaysia TINs in one batch for e-invoicing prep.

What it does

Prepare your internal database for e-invoicing by automatically fetching Tax Identification Numbers (TIN) for a list of Business Registration numbers or NRICs. You simply upload your list to Google Sheets, and the workflow loops through each entry to call the LHDN API and collect the matching tax IDs in one go.

Step by step

  1. Configure a Google Sheets trigger to watch for new rows in the input range.
  2. Set up an HTTP Request node with the LHDN API endpoint and authentication headers.
  3. Add a loop that iterates through each row, maps fields to JSON variables, and updates the output sheet.

Where the LLM does the work

  • Generate robust error handling logic to distinguish between temporary network failures and permanent invalid TIN responses.
  • Draft a mapping strategy for edge cases where business names in the source differ significantly from LHDN records.
  • Create a summary report template that explains why specific entries failed retrieval without exposing sensitive data.

Watch out for

Malaysia TINs are case-sensitive and often include spaces, so normalize the input string before sending it to the API.
Some legacy NRIC numbers lack a valid TIN in the system, so ensure your update logic skips these rows instead of failing the whole batch.
API responses may return partial data for dormant companies, so validate that every returned field matches expected formats before saving.

Tools that fit

Google Sheets Service stores list of SSM and NRIC numbers
HTTP Request API calls LHDN API to fetch tax ID data
Code Service loops through multiple records for batch processing

The agent brief

Everything your agent needs, including the gotchas. Copy it and go.
agent-brief.md
You are helping me build the following AI agent workflow.

## Goal
Batch Retrieve Malaysia TIN for SSM or NRIC: Upload a list of SSM or NRICs to fetch matching Malaysia TINs in one batch for e-invoicing prep.

## Specification
- What it does: Prepare your internal database for e-invoicing by automatically fetching Tax Identification Numbers (TIN) for a list of Business Registration numbers or NRICs. You simply upload your list to Google Sheets, and the workflow loops through each entry to call the LHDN API and collect the matching tax IDs in one go.
- Trigger: Run manually (Manual · on demand)
- Autonomy: Fully hands-off
- Expected setup effort: about an afternoon
- Tools/services involved:
  - Google Sheets: stores list of SSM and NRIC numbers
  - HTTP Request: calls LHDN API to fetch tax ID data
  - Code: loops through multiple records for batch processing

## Known pitfalls, handle each one explicitly in your implementation
1. Malaysia TINs are case-sensitive and often include spaces, so normalize the input string before sending it to the API.
2. Some legacy NRIC numbers lack a valid TIN in the system, so ensure your update logic skips these rows instead of failing the whole batch.
3. API responses may return partial data for dormant companies, so validate that every returned field matches expected formats before saving.

## Reference implementation
https://n8n.io/workflows/4781 (workflow template)
Fetch and inspect this before building. If it matches my stack, adapt it;
if not, rebuild the pattern with my tools.

## Process requirements
1. Before building: ask me which of the listed tools I actually use and
   what my platform is (n8n / Make / code / other). Do not assume.
2. Adapt the pattern to my answers; do not force the reference stack.
3. Address every pitfall above; tell me how you handled each.
4. Provide a test plan I can run before letting this touch real data.
5. Ask before any step that sends messages, modifies data, or spends money.

Source: https://usecasesforagents.com/use-case/batch-retrieve-malaysia-tin-for-ssm-or-nric/ via usecasesforagents.com

Frequently asked questions

Can I use a different Spreadsheet than Google Sheets?

Yes. Google Sheets is only the example spreadsheet in this recipe. The same flow works with Airtable, Baserow and Excel. Swap the spreadsheet connection and keep the rest of the setup as written.

Want this running in your business?

This is what I do. I design and build AI agents like this one, and keep them running. If you want it set up for your team instead of doing it yourself, get in touch.
Get in touch →

Who it's for

Built for founders and execs who need finance & accounting handled without hiring for it.

Also fits E-commerce Operator.

Seen in the wild

← Back to directory