Get Return Preference
curl --request POST \
--url https://api.sandbox.co.in/gst/compliance/public/gstrs/preference \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"gstin": "24ABKCS2033B1ZV"
}
'import requests
url = "https://api.sandbox.co.in/gst/compliance/public/gstrs/preference"
payload = { "gstin": "24ABKCS2033B1ZV" }
headers = {
"authorization": "<authorization>",
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
authorization: '<authorization>',
'x-api-key': '<x-api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({gstin: '24ABKCS2033B1ZV'})
};
fetch('https://api.sandbox.co.in/gst/compliance/public/gstrs/preference', 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/public/gstrs/preference",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'gstin' => '24ABKCS2033B1ZV'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.co.in/gst/compliance/public/gstrs/preference"
payload := strings.NewReader("{\n \"gstin\": \"24ABKCS2033B1ZV\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "<authorization>")
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.co.in/gst/compliance/public/gstrs/preference")
.header("authorization", "<authorization>")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"gstin\": \"24ABKCS2033B1ZV\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.co.in/gst/compliance/public/gstrs/preference")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '<authorization>'
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"gstin\": \"24ABKCS2033B1ZV\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"timestamp": 1775825033134,
"data": {
"data": {
"response": [
{
"preference": "M",
"quarter": "Q1"
},
{
"preference": "M",
"quarter": "Q2"
},
{
"preference": "M",
"quarter": "Q3"
},
{
"preference": "M",
"quarter": "Q4"
}
]
},
"status_cd": "1"
},
"transaction_id": "903962ca-bc29-45c5-b879-3e51c7f9887d"
}Get Return Preference
API to get Return preference for taxpayers
POST
/
gst
/
compliance
/
public
/
gstrs
/
preference
Get Return Preference
curl --request POST \
--url https://api.sandbox.co.in/gst/compliance/public/gstrs/preference \
--header 'Content-Type: application/json' \
--header 'authorization: <authorization>' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"gstin": "24ABKCS2033B1ZV"
}
'import requests
url = "https://api.sandbox.co.in/gst/compliance/public/gstrs/preference"
payload = { "gstin": "24ABKCS2033B1ZV" }
headers = {
"authorization": "<authorization>",
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
authorization: '<authorization>',
'x-api-key': '<x-api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({gstin: '24ABKCS2033B1ZV'})
};
fetch('https://api.sandbox.co.in/gst/compliance/public/gstrs/preference', 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/public/gstrs/preference",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'gstin' => '24ABKCS2033B1ZV'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.co.in/gst/compliance/public/gstrs/preference"
payload := strings.NewReader("{\n \"gstin\": \"24ABKCS2033B1ZV\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("authorization", "<authorization>")
req.Header.Add("x-api-key", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.co.in/gst/compliance/public/gstrs/preference")
.header("authorization", "<authorization>")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"gstin\": \"24ABKCS2033B1ZV\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.co.in/gst/compliance/public/gstrs/preference")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '<authorization>'
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"gstin\": \"24ABKCS2033B1ZV\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"timestamp": 1775825033134,
"data": {
"data": {
"response": [
{
"preference": "M",
"quarter": "Q1"
},
{
"preference": "M",
"quarter": "Q2"
},
{
"preference": "M",
"quarter": "Q3"
},
{
"preference": "M",
"quarter": "Q4"
}
]
},
"status_cd": "1"
},
"transaction_id": "903962ca-bc29-45c5-b879-3e51c7f9887d"
}Response schema
For successful responses, these resources describe the GSTN payload atdata.data.
View response JSON schema
View Excel field reference
Headers
JWT authorization token
Pass true to get cached response.
Public key required to authorize API access.
API version
Query Parameters
Financial year for which the return preference is requested
Example:
"FY 2025-26"
Body
application/json
GSTIN for which the return preference is requested
Was this page helpful?
āI