Get E-Invoice HSN Summary
curl --request GET \
--url https://api.sandbox.co.in/gst/compliance/tax-payer/e-invoices/hsn/{year}/{month} \
--header 'authorization: <authorization>' \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.sandbox.co.in/gst/compliance/tax-payer/e-invoices/hsn/{year}/{month}"
headers = {
"authorization": "<authorization>",
"x-api-key": "<x-api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {authorization: '<authorization>', 'x-api-key': '<x-api-key>'}
};
fetch('https://api.sandbox.co.in/gst/compliance/tax-payer/e-invoices/hsn/{year}/{month}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.co.in/gst/compliance/tax-payer/e-invoices/hsn/{year}/{month}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: <authorization>",
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.co.in/gst/compliance/tax-payer/e-invoices/hsn/{year}/{month}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("authorization", "<authorization>")
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.co.in/gst/compliance/tax-payer/e-invoices/hsn/{year}/{month}")
.header("authorization", "<authorization>")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.co.in/gst/compliance/tax-payer/e-invoices/hsn/{year}/{month}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["authorization"] = '<authorization>'
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"status_cd": "1",
"data": {
"gstin": "01AABCE2207R1Z5",
"fp": "052020",
"hsn": {
"hsn_b2b": [
{
"num": 1,
"hsn_sc": "2101",
"desc": "MISCELLANEOUS EDIBLE PREPARATIONS~Extracts, essences and concentrates, of coffee, tea or mate and preparations with a basis of these products or with a basis of coffee, tea or mate; roasted chicory and other roasted coffee substitutes, and extracts, essences and concentrates thereof",
"user_desc": "Taxpayer Description",
"uqc": "BDL",
"qty": 12,
"rt": 0.1,
"txval": 1212,
"iamt": 3342,
"camt": 343,
"samt": 24,
"csamt": 423,
"chksum": "fasdflkjwhrkfjshdfua"
}
],
"hsn_b2c": [
{
"num": 1,
"hsn_sc": "1102",
"desc": "CEREAL FLOURS OTHER THAN THAT OF WHEAT OR MESLIN",
"user_desc": "Taxpayer Description",
"uqc": "BDL",
"qty": 10,
"rt": 0.1,
"txval": 4312,
"iamt": 242,
"camt": 643,
"samt": 24,
"csamt": 423,
"chksum": "bnsfsfskfsifi"
}
]
}
}
},
"timestamp": 1763446641000,
"transaction_id": "5fc1acb2-1fd0-49e8-b6f3-19b60e67009d"
}Get E-Invoice HSN Summary
Get E-Invoice HSN summary for a return period for an authenticated taxpayer.
GET
/
gst
/
compliance
/
tax-payer
/
e-invoices
/
hsn
/
{year}
/
{month}
Get E-Invoice HSN Summary
curl --request GET \
--url https://api.sandbox.co.in/gst/compliance/tax-payer/e-invoices/hsn/{year}/{month} \
--header 'authorization: <authorization>' \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.sandbox.co.in/gst/compliance/tax-payer/e-invoices/hsn/{year}/{month}"
headers = {
"authorization": "<authorization>",
"x-api-key": "<x-api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {authorization: '<authorization>', 'x-api-key': '<x-api-key>'}
};
fetch('https://api.sandbox.co.in/gst/compliance/tax-payer/e-invoices/hsn/{year}/{month}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.co.in/gst/compliance/tax-payer/e-invoices/hsn/{year}/{month}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: <authorization>",
"x-api-key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.co.in/gst/compliance/tax-payer/e-invoices/hsn/{year}/{month}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("authorization", "<authorization>")
req.Header.Add("x-api-key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.co.in/gst/compliance/tax-payer/e-invoices/hsn/{year}/{month}")
.header("authorization", "<authorization>")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.co.in/gst/compliance/tax-payer/e-invoices/hsn/{year}/{month}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["authorization"] = '<authorization>'
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"status_cd": "1",
"data": {
"gstin": "01AABCE2207R1Z5",
"fp": "052020",
"hsn": {
"hsn_b2b": [
{
"num": 1,
"hsn_sc": "2101",
"desc": "MISCELLANEOUS EDIBLE PREPARATIONS~Extracts, essences and concentrates, of coffee, tea or mate and preparations with a basis of these products or with a basis of coffee, tea or mate; roasted chicory and other roasted coffee substitutes, and extracts, essences and concentrates thereof",
"user_desc": "Taxpayer Description",
"uqc": "BDL",
"qty": 12,
"rt": 0.1,
"txval": 1212,
"iamt": 3342,
"camt": 343,
"samt": 24,
"csamt": 423,
"chksum": "fasdflkjwhrkfjshdfua"
}
],
"hsn_b2c": [
{
"num": 1,
"hsn_sc": "1102",
"desc": "CEREAL FLOURS OTHER THAN THAT OF WHEAT OR MESLIN",
"user_desc": "Taxpayer Description",
"uqc": "BDL",
"qty": 10,
"rt": 0.1,
"txval": 4312,
"iamt": 242,
"camt": 643,
"samt": 24,
"csamt": 423,
"chksum": "bnsfsfskfsifi"
}
]
}
}
},
"timestamp": 1763446641000,
"transaction_id": "5fc1acb2-1fd0-49e8-b6f3-19b60e67009d"
}Response body schema
View response body schema
Response schema
For successful responses, this reference describes the GSTN payload atdata.data.
View Excel field reference
Headers
GST taxpayer access token.
API version.
API key for identification.
Path Parameters
Return period year.
Example:
"2024"
Return period month.
Example:
"05"
Response
200 - application/json
200 Success. The GST portal marks this source API as unencrypted, but the sandbox response is still wrapped in the standard code/data/timestamp/transaction_id envelope.
- Option 1
- Option 2
A GSTN success or GSTN business-failure response. Both variants use HTTP 200.
The HTTP status code reported in the response body.
Available options:
200 Example:
200
The response timestamp in Unix epoch milliseconds.
Example:
1763446641000
The transaction identifier used to trace the request.
Example:
"41bb8041-fb83-4654-8d75-85a19f329158"
The GSTN success wrapper.
Show child attributes
Show child attributes
Was this page helpful?