> ## Client identification
>
> Requests to this API should include a `Client-Platform` header alongside
> `Authorization`, identifying the application, tool, or model making the
> request. This is used for integration support and analytics.
>
> Use your model or tool name, for example `claude-code` or `chatgpt`.
>
> Example:
>
> ```bash
> curl https://api.salaryboxapp.com/... \
>   -H "Authorization: Api-Key <api-key>" \
>   -H "Client-Platform: claude-code"
> ```

# List Allowances and Deductions

GET https://api.salaryboxapp.com/v2/customer/v1/payroll/config/allowances-deductions

Returns every allowance and deduction your company can use in a salary structure: SalaryBox's built-in ones, the custom allowances your company created and any other names found in your staff's salary structures. Requires Payroll Pro. Not paginated, no parameters.

- `is_selected` is `true` when the item is switched on in your payroll settings.
- `is_custom` is `true` for items your company made, or names found only in staff salary structures.
- `is_fixed` is `true` when the item is paid in full regardless of attendance.
- Basic is not listed.


Reference: https://docs.salarybox.in/api-reference/payroll/config-allowances-deductions-retrieve

## Authentication

- `Authorization` header (required) (prefixed with ` Api-Key   `) — Format: "Api-Key \{api-key}"

## Response

### 200

Allowances, deductions, PF and ESI contributions and variable components.

- `message` (string, required)
- `status` (boolean, required)
- `data` (AllowancesDeductionsResponseData, required)

## Errors

### 403 Forbidden Error

Your plan does not include payroll.

- `message` (string, required)
- `status` (boolean, required)
- `errors` (map from string to any, optional, nullable)

## Types

### AllowancesDeductionsResponseData

- `allowances` (list of PayrollComponentOption, required)
- `deductions` (list of PayrollComponentOption, required)
- `employee_contributions` (list of PayrollContributionOption, required)
- `employer_contributions` (list of PayrollContributionOption, required)
- `variable_components` (list of string, required) — Components PF and ESI can be worked out on that have no fixed amount in the salary structure.

### PayrollComponentOption

- `key` (string, required)
- `name` (string, required)
- `is_selected` (boolean, required) — Switched on in the company's payroll settings.
- `is_custom` (boolean, required) — Made by the company, or found only in staff salary structures.
- `is_fixed` (boolean, required) — Paid in full regardless of attendance.

### PayrollContributionOption

- `key` (string, required)
- `name` (string, required)
- `applicable_on` (list of PayrollContributionOptionApplicableOnItems, required) — The components the contribution is worked out on.

### PayrollContributionOptionApplicableOnItems

- `key` (string, required)
- `name` (string, required)

## Examples

**Response**

```json
{
  "message": "Success",
  "status": true,
  "data": {
    "allowances": [
      {
        "key": "hra",
        "name": "HRA",
        "is_selected": true,
        "is_custom": false,
        "is_fixed": false
      },
      {
        "key": "site_allowance",
        "name": "Site Allowance",
        "is_selected": true,
        "is_custom": true,
        "is_fixed": true
      }
    ],
    "deductions": [
      {
        "key": "professional_tax",
        "name": "Professional Tax",
        "is_selected": true,
        "is_custom": false,
        "is_fixed": true
      },
      {
        "key": "canteen_recovery",
        "name": "Canteen Recovery",
        "is_selected": false,
        "is_custom": true,
        "is_fixed": false
      }
    ],
    "employee_contributions": [
      {
        "key": "employee_pf",
        "name": "Employee PF",
        "applicable_on": [
          {
            "key": "basic",
            "name": "Basic"
          },
          {
            "key": "hra",
            "name": "HRA"
          }
        ]
      }
    ],
    "employer_contributions": [
      {
        "key": "employer_pf",
        "name": "Employer PF",
        "applicable_on": [
          {
            "key": "basic",
            "name": "Basic"
          }
        ]
      }
    ],
    "variable_components": [
      "Overtime",
      "Incentive"
    ]
  }
}
```

**SDK Code**

```python Example
import requests

url = "https://api.salaryboxapp.com/v2/customer/v1/payroll/config/allowances-deductions"

headers = {"Authorization": "Api-Key  <apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Example
const url = 'https://api.salaryboxapp.com/v2/customer/v1/payroll/config/allowances-deductions';
const options = {method: 'GET', headers: {Authorization: 'Api-Key  <apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.salaryboxapp.com/v2/customer/v1/payroll/config/allowances-deductions"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Api-Key  <apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Example
require 'uri'
require 'net/http'

url = URI("https://api.salaryboxapp.com/v2/customer/v1/payroll/config/allowances-deductions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Api-Key  <apiKey>'

response = http.request(request)
puts response.read_body
```

```java Example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.salaryboxapp.com/v2/customer/v1/payroll/config/allowances-deductions")
  .header("Authorization", "Api-Key  <apiKey>")
  .asString();
```

```php Example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.salaryboxapp.com/v2/customer/v1/payroll/config/allowances-deductions', [
  'headers' => [
    'Authorization' => 'Api-Key  <apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Example
using RestSharp;

var client = new RestClient("https://api.salaryboxapp.com/v2/customer/v1/payroll/config/allowances-deductions");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Api-Key  <apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Example
import Foundation

let headers = ["Authorization": "Api-Key  <apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.salaryboxapp.com/v2/customer/v1/payroll/config/allowances-deductions")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```