GST
Validate GSTIN
Validate a GSTIN number and retrieve associated business details.
POST
/
v1
/
settings
/
gst
/
validate
Validate a GSTIN
curl --request POST \
--url https://billing.example.com/v1/settings/gst/validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"gstin": "<string>"
}
'import requests
url = "https://billing.example.com/v1/settings/gst/validate"
payload = { "gstin": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({gstin: '<string>'})
};
fetch('https://billing.example.com/v1/settings/gst/validate', 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://billing.example.com/v1/settings/gst/validate",
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' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://billing.example.com/v1/settings/gst/validate"
payload := strings.NewReader("{\n \"gstin\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://billing.example.com/v1/settings/gst/validate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"gstin\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/settings/gst/validate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"gstin\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"valid": true,
"state_code": "<string>",
"state_name": "<string>",
"pan": "<string>",
"message": "<string>"
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
gstin | string | Yes | The 15-character GST Identification Number to validate. |
Example Request
curl -X POST https://api.recurso.dev/v1/settings/gst/validate \
-H "Authorization: Bearer rsk_live_7f3a9b2c1d4e8f0a" \
-H "Content-Type: application/json" \
-d '{
"gstin": "29ABCDE1234F1Z5"
}'
Response
{
"valid": true,
"gstin": "29ABCDE1234F1Z5",
"legal_name": "Recurso Technologies Pvt Ltd",
"trade_name": "Recurso",
"state_code": "29",
"status": "Active"
}
Response Fields
| Field | Type | Description |
|---|---|---|
valid | boolean | Whether the GSTIN is a valid, registered number. |
gstin | string | The GSTIN that was validated. |
legal_name | string | The registered legal name of the business. |
trade_name | string | The trade or brand name associated with the GSTIN. |
state_code | string | The two-digit state code derived from the GSTIN. |
status | string | Registration status. One of Active, Inactive, Cancelled, or Suspended. |
Notes
- If the GSTIN format is invalid, the response returns
valid: falsewith a400status code. - This endpoint queries the GST Network (GSTN) portal in real-time. Responses may take 2-3 seconds during peak hours.
Use this endpoint to validate customer GSTINs before saving them to avoid incorrect tax calculations on invoices.
Authorizations
Tenant API key obtained from POST /auth/register or POST /v1/developer/keys.
Body
application/json
Required string length:
15⌘I
Validate a GSTIN
curl --request POST \
--url https://billing.example.com/v1/settings/gst/validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"gstin": "<string>"
}
'import requests
url = "https://billing.example.com/v1/settings/gst/validate"
payload = { "gstin": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({gstin: '<string>'})
};
fetch('https://billing.example.com/v1/settings/gst/validate', 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://billing.example.com/v1/settings/gst/validate",
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' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://billing.example.com/v1/settings/gst/validate"
payload := strings.NewReader("{\n \"gstin\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://billing.example.com/v1/settings/gst/validate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"gstin\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/settings/gst/validate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"gstin\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"valid": true,
"state_code": "<string>",
"state_name": "<string>",
"pan": "<string>",
"message": "<string>"
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}