---
title: GST Calculator
description: Calculate GST amounts including SGST, CGST, and IGST based on cost, profit, and GST rate.
---

This api is for calculating GST(Goods and Services Tax) . We have to pass cost , profit , gst and same_state flag in request. If the request have valid data we will get a success response.

#### POST

```
https://kraken.airpay.co.in/airpay/ms/baas/api/gst-calculator
```

## Header

| Parameter | Type Value | Description | Value Like |
| --- | --- | --- | --- |
| affiliate  required | Text | Will be provided by airpay | `91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps` |
| checksum  required | Text | $string = $param.self::$secret_key; sha256(<concate all values+SECRET KEY>); (required) | `91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps` |
| api-key  required | Text | Will be provided by airpay | `91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps` |
| processor-key  required | Text | Will be provided by airpay | `91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps` |

## Request Body

| Parameter | Type Value | Description | Value Like |
| --- | --- | --- | --- |
| cost  required | Text  <br>(10) | Cost of production | `10000` |
| profit  required | Text  <br>(3) | Profit Margin value | `500` |
| gst  required | Text  <br>(3) | Goods and Services Tax | `100.50` |
| same_state  required | Text | same state falg(Y/N) | `Y` |

## Success 200

| Parameter | Type Value | Description | Value Like |
| --- | --- | --- | --- |
| status  required | Numeric<br>(`3`) | 400- fail,200-success | `200,400` |
| message  required | Text | success, fail | `sucess,fail` |
| data  required | Text | { "cost": { "amount": "10000.00", "gst": { "sgst": "5025.00", "cgst": "5025.00", "igst": "" } }, "profit": { "amount": "50000.00", "gst": { "sgst": "25125.00", "cgst": "25125.00", "igst": "" } }, "total_gst": "60300.00", "total_amount": "120300.00" } |

## Request Example

```
 curl --location --request POST 'https://kraken.airpay.co.in/airpay/ms/baas/api/gst-calculator' \
--header 'api-key: 91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps' \
--header 'affiliate: 91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps' \
--header 'checksum: 91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps' \
--header 'processor-key: 91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'cost=10000' \
--data-urlencode 'profit=500' \
--data-urlencode 'gst=100.50' \
--data-urlencode 'same_state=Y'
```

### Success Response

```
{
    "status": 200,
    "message": "success",
    "data": {
        "cost": {
            "amount": "10000.00",
            "gst": {
                "sgst": "5025.00",
                "cgst": "5025.00",
                "igst": ""
            }
        },
        "profit": {
            "amount": "50000.00",
            "gst": {
                "sgst": "25125.00",
                "cgst": "25125.00",
                "igst": ""
            }
        },
        "total_gst": "60300.00",
        "total_amount": "120300.00"
    }
}
```

### Error Response

```
{
    "status": "400",
    "message": "Failed",
    "data": ""
}
```