HSN/SAC Code Validator
-
HTTP Method URL https://my.gstzen.in/api/hsn-code-validator-api/ Content Type application/json Authentication Type Token -
Headers
Token f15da0e8-e4d0-11ed-b5ea-0242ac120002 You can find your GSTZen API key at bottom of your profile page.
Note: Maximum 10 HSN/SAC codes allowed per request. You need a valid GSTIN Validator API subscription to use this endpoint.
-
Request Payload
{ "hsn_codes": [1021020, 12345678] }You can also use
"text"instead of"hsn_codes"as the field name. Only numeric HSN/SAC codes are accepted. Maximum 10 codes per request.Accepted formats:
// As an array of numbers (recommended) {"hsn_codes": [1021020, 12345678]} // As a single number {"hsn_codes": 1021020} -
Response Payload
-
With Valid HSN Codes
{ "status": 1, "results": [ { "input": "01021020", "valid": true, "name": "Live animals" }, { "input": "12345678", "valid": false, "name": "" } ], "num_errors": 1, "total_count": 2 } -
With Missing Field
{ "status": 0, "message": "HSN/SAC codes are missing. Please provide 'hsn_codes' or 'text' field." } -
With More Than 10 Codes
{ "status": 0, "message": "Maximum 10 HSN/SAC codes allowed per request. You provided 15 codes." } -
With No Subscription
{ "status": 0, "message": "Your GSTZen account does not have valid subscription to HSN Code Validator API. Please contact GSTZen support for further assistance. CODE: 40100" } -
With Subscription Limit Exhausted
{ "status": 0, "message": "Your GSTZen HSN Code Validator Subscription has exhausted. Current available credits: 0, Total Subscription Package: 10000. Please contact GSTZen support for further assistance. CODE: 40101" } -
With Subscription Expired
{ "status": 0, "message": "Your GSTZen HSN Code Validator API Subscription has expired on 31-Dec-2023. Please contact GSTZen support for further assistance. CODE: 40102" } -
With Invalid HSN Code Format
{ "status": 0, "message": "Invalid HSN/SAC code: 'ABC12345'. Only numeric codes are allowed." } -
With Invalid JSON
{ "status": 0, "message": "Invalid JSON payload: Expecting value: line 1 column 1 (char 0)" }
-
-
Response Fields
Field Type Description statusinteger 1 for success, 0 for error resultsarray Array of validation results for each HSN/SAC code results[].inputstring The HSN/SAC code that was validated results[].validboolean Whether the HSN/SAC code is valid results[].namestring The name/description of the HSN/SAC code (empty if invalid) num_errorsinteger Number of invalid HSN/SAC codes total_countinteger Total number of HSN/SAC codes validated messagestring Error message (only present when status is 0)