# Sample API

### Base URL

```
{{HOST}}/gsp
```

### Authentication

All requests require the user authentication token in the request header.

```
X-CT-Auth-Token: <YOUR-AUTH-TOKEN-HERE>
```

To generate an authentication token, please contact [ClearTax GST Sales](mailto:gst-sales@cleartax.in).

{% hint style="info" %}
For all new users, you DO NOT have to add `clientid` and `client-secret` to the request headers.
{% endhint %}

### Sample Request&#xD;

```bash
curl --location --request POST 'https://api.clear.in/gsp/api/taxpayerapi/v0.2/authenticate' \
--header 'Content-Type: application/json' \
--header 'appkey: 48Kw7zR3L9nsbBJI3BJBmg8K0cx/XoGzR6uJaksufhaksfochguhJk1DTvvHYQqQwaU0yhOqfZHgalD9sGMikaEBmY7Y1YcjP5drvwhmmcqQmCLK3D1FE18ditvlqV4DWou5feLM07QwWTj/i8mDwc5YgWz0cYnr6r7wnd2nlbmMxdHOYbKjOP6SxOdD2Gb6GZDI5+RFkkfGSPKwtvXR9NfZQaLaTIY1w8O0X0NI56C9oqjcqT5+FgdpTnLYc3rodHJuEFVgqfeTpWSk3QfAcnQg9P1N9Azcx2OI+AXbLLhcLLbSpfveelhaK02uEdUDYgGHfztr//9RPfqOzg==' \
--header 'X-CT-Auth-Token: a2ceb341-asf12-1234-a54f-59d934acasaa' \
--header 'state-cd: 33' \
--header 'ip-usr: 123.456.789.100' \
--header 'txn: txn123' \
--header 'gstin: gstinNumber' \
--header 'username: username' \
--data-raw '{"action":"OTPREQUEST","app_key":"48Kw7zR3L9nsbBJI3BJBmg8K0cx/XoGzR6uJaksufhaksfochguhJk1DTvvHYQqQwaU0yhOqfZHgalD9sGMikaEBmY7Y1YcjP5drvwhmmcqQmCLK3D1FE18ditvlqV4DWou5feLM07QwWTj/i8mDwc5YgWz0cYnr6r7wnd2nlbmMxdHOYbKjOP6SxOdD2Gb6GZDI5+RFkkfGSPKwtvXR9NfZQaLaTIY1w8O0X0NI56C9oqjcqT5+FgdpTnLYc3rodHJuEFVgqfeTpWSk3QfAcnQg9P1N9Azcx2OI+AXbLLhcLLbSpfveelhaK02uEdUDYgGHfztr//9RPfqOzg==","username":"yourusername"}'
```

For further information on different endpoints like returns, ledger, payment, etc, please refer to the GSTN documentation at <https://developer.gst.gov.in/apiportal/>

### Error Codes

In case you have received an error code from GSTN, you can check the description of the code in the respective API page here: <https://developer.gst.gov.in/apiportal/>
