HSN Code Search API

Search the 8-digit HSN code master for goods classification. Supports full-text search, 2-8 digit code lookup, and GST-rate retrieval per code.

Get sandbox keys → View OpenAPI docs Talk to sales

What is the HSN Code Search API?

Frequently embedded in invoice-creation flows (auto-suggest HSN from item name), product catalog enrichment, and e-Invoice payload validation (HSN is a mandatory IRP field for B2B above INR 5 lakh).

Quick spec

Code examples

curl Node.jsPythonJava
curl -X GET 'https://apisandbox.whitebooks.in/gst/api/v1/hsn-sac/search' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json'
Node.js
const res = await fetch('https://apisandbox.whitebooks.in/gst/api/v1/hsn-sac/search', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer ' + accessToken,
    'Content-Type': 'application/json',
  },
});
const data = await res.json();
Python
import requests

resp = requests.get(
    'https://apisandbox.whitebooks.in/gst/api/v1/hsn-sac/search',
    headers={'Authorization': f'Bearer {access_token}'},
)
data = resp.json()
Java
HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://apisandbox.whitebooks.in/gst/api/v1/hsn-sac/search"))
    .header("Authorization", "Bearer " + accessToken)
    .header("Content-Type", "application/json")
    .GET()
    .build();
HttpResponse<String> resp = HttpClient.newHttpClient()
    .send(req, BodyHandlers.ofString());

Integrate in 3 steps

  1. Sign up at accounts.whitebooks.in — sandbox credentials issued instantly, no sales gate.
  2. Make your first call against the sandbox base URL using the code example above. Validate against your local model.
  3. Move to production once your tests pass — switch host to https://api.whitebooks.in/gst. Same payload, same response shape.

Frequently asked questions

What's the difference between HSN and SAC?

HSN classifies goods (Harmonized System of Nomenclature); SAC classifies services (Services Accounting Code). Both are covered by the same /api/v1/hsn-sac/search endpoint.

Does the API return the current GST rate per HSN?

Yes — every result includes igst_rate, cgst_rate, sgst_rate, and effective_from date. Historical rates available via query param.

How precise can I make the HSN lookup?

You can search by partial code (2, 4, 6, or 8 digits) or by free-text description. For e-Invoice, use 6 or 8 digit codes.

Is there a rate limit?

1,000 req/min on Starter; unlimited on Enterprise. The full HSN master can be downloaded as a flat file via /api/v1/hsn-sac/dump (recommended for high-volume use).

Explore the full GST API

This is one endpoint inside the WhiteBooks GST API suite. See the full documentation — every endpoint, every parameter, every error code.

Open the GST API page →

Related GST API endpoints

GSTR-1 Filing API → GSTR-2B Fetch API → GSTR-3B Filing API → GSTR-9 Annual Return API →