Skip to content

Feature Request: Add GST Tax Rates, UOM, and Enhanced Fields to HSN Data #2

Description

@karthi-21

Hi @karthi-21,

First of all, thank you for building and recently updating hsn-code-package (v2.0.0 with data as of 2026-06-01). It’s one of the cleanest, fastest, and most up-to-date HSN lookup libraries available for Node.js/TypeScript right now.

The current API and data structure are excellent for lookups and validation. However, for real-world GST invoicing, billing, ERP, or compliance tools, one major piece is missing — GST tax rates and related metadata.

Proposed Enhancement

Enhance the dataset to include the following fields per HSN entry (where available):

interface HsnEntry {
  code: string;                    // e.g. "52010011"
  description: string;
  
  // === NEW FIELDS ===
  igst?: number;                   // e.g. 5, 12, 18, 28
  cgst?: number;                   // usually igst/2
  sgst?: number;                   // usually igst/2
  cess?: number;                   // e.g. 0, 15, 25 (for specific items)
  
  unit?: string;                   // e.g. "KGS", "NOS", "LTR", "MTR", "PCS"
  
  chapter?: string;                // already partially available
  section?: string;
  effectiveFrom?: string;          // e.g. "2025-04-01"
  isNilRated?: boolean;
  isExempted?: boolean;
  notificationRef?: string;        // e.g. "Notification No. 01/2025"
}

Why This Would Make the Package "Golden"

  • Most developers need HSN → Auto Tax Calculation in one place.
  • Reduces need for multiple packages or manual mapping.
  • Greatly improves usability for:
    • Invoice generation
    • E-invoicing / E-way bill
    • Product catalog management
    • GST return filing tools

Example Data (Desired Output)

{
  "code": "10019910",
  "description": "Wheat and meslin - Wheat - Other",
  "igst": 5,
  "cgst": 2.5,
  "sgst": 2.5,
  "cess": 0,
  "unit": "KGS",
  "chapter": "10",
  "effectiveFrom": "2025-04-01"
}

Another example (higher rate + cess):

{
  "code": "24022090",
  "description": "Cigarettes containing tobacco - Other",
  "igst": 28,
  "cgst": 14,
  "sgst": 14,
  "cess": 25,
  "unit": "NOS",
  "chapter": "24"
}

Implementation Suggestions

  1. Keep it optional — Existing users should not be broken. Maybe:

    • Add a new getAllHsnWithRates() or keep rates in a separate rates.json that can be merged.
    • Or add a flag: includeRates: true in config.
  2. Build Process — Since you already have a great build script (scripts/build-data.js + code_list.xlsx), you can extend it to merge data from official CBIC rate tables.

  3. Data Sources (for reference):

  4. Bonus Features (lower priority):

    • SAC codes for services (optional separate dataset)
    • getTaxDetailsByHsn(code) helper function
    • getHsnByRate(rate) reverse lookup

Benefits Summary

  • Makes the package a single source of truth for most GST use cases.
  • Increases adoption significantly (many projects currently combine 2–3 packages).
  • Maintains the current lightweight & zero-dependency nature.

Would you be open to this enhancement? I (and probably many others) would be happy to help test or contribute data/merging logic if needed.


Thanks again for the great work!


Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions