> ## 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 Salary Templates

GET https://api.salaryboxapp.com/v2/customer/v1/payroll/config/templates

Returns the salary structure templates offered when setting up a staff member's salary: SalaryBox's built-in templates first, then your company's own, each oldest first. Requires Payroll Pro.


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

## Authentication

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

## Request

### Query parameters

- `page` (integer, optional) — Page number, starting at 1.
- `page_size` (integer, optional) — Results per page. Default and maximum 50.

## Response

### 200

Salary templates, SalaryBox's own first.

- `data` (list of SalaryTemplate, required)
- `message` (string, optional)
- `status` (boolean, optional)
- `count` (integer, optional) — Total number of results across all pages.
- `prev` (string, optional, nullable) — URL of the previous page, or null.
- `next` (string, optional, nullable) — URL of the next page, or null.

## 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

### SalaryTemplate

A salary structure template.

- `id` (integer, required)
- `name` (string, required)
- `is_system_template` (boolean, required) — `true` if built into SalaryBox, `false` if your company made it.
- `basic_percentage` (string, required) — Basic salary as a percentage of CTC, with 2 decimals.
- `allowances` (list of SalaryTemplateComponent, required)
- `deductions` (list of SalaryTemplateComponent, required)
- `created_on` (datetime, required) — When the template was created.
- `employee_pf` (string, optional, nullable) — How the employee's PF is worked out: `none`, `hybrid` (capped at 1,800 rupees when PF wage is above 15,000), `percentage`, `absolute` (older data) or `hybrid_3000` (capped at 3,000 rupees when PF wage is above 25,000).
- `employer_pf` (string, optional, nullable) — How the employer's PF is worked out. Same values as `employee_pf`.
- `employee_pf_applicable_on` (map from string to any, optional) — Which salary components the employee's PF is worked out on, as stored.
- `employer_pf_applicable_on` (map from string to any, optional) — Which salary components the employer's PF is worked out on, as stored.
- `pf_charges_is_applicable` (boolean, optional) — Whether PF admin charges apply.
- `employee_esi` (string, optional, nullable) — How the employee's ESI is worked out: `none`, `percentage` or `absolute`.
- `employer_esi` (string, optional, nullable) — How the employer's ESI is worked out. Same values as `employee_esi`.
- `employee_esi_applicable_on` (map from string to any, optional) — Which salary components the employee's ESI is worked out on, as stored.
- `employer_esi_applicable_on` (map from string to any, optional) — Which salary components the employer's ESI is worked out on, as stored.
- `state` (string, optional, nullable) — State used for professional tax and labour welfare fund.
- `pt_is_applicable` (boolean, optional) — Whether professional tax applies.
- `pt_amount` (string, optional, nullable) — Fixed professional tax amount, if set.
- `pt_rule_category` (string, optional, nullable) — Professional tax rule category, if set.
- `lwf_is_applicable` (boolean, optional) — Whether labour welfare fund applies.
- `lwf_rule_category` (string, optional, nullable) — Labour welfare fund rule category, if set.
- `updated_on` (datetime, optional, nullable) — When the template was last changed, or null.

### SalaryTemplateComponent

One allowance or deduction in a salary template.

- `name` (string, optional) — Name of the component.
- `value` (string, optional) — Amount or percentage, with 2 decimals.
- `value_type` (string, optional) — How `value` is read, as stored, for example `PERCENT` or `CONSTANT`.
- `type` (string, optional) — Component type, as stored, for example `regular` or `absolute`.

## Examples

**Response**

```json
{
  "data": [
    {
      "id": 1,
      "name": "Standard CTC",
      "is_system_template": true,
      "basic_percentage": "50.00",
      "allowances": [
        {
          "name": "HRA",
          "value": "40.00",
          "value_type": "PERCENT",
          "type": "regular"
        }
      ],
      "deductions": [],
      "created_on": "2025-01-10T09:30:00+05:30",
      "employee_pf": "hybrid",
      "employer_pf": "hybrid",
      "employee_pf_applicable_on": {
        "basic": true
      },
      "employer_pf_applicable_on": {
        "basic": true
      },
      "pf_charges_is_applicable": true,
      "employee_esi": "none",
      "employer_esi": "none",
      "employee_esi_applicable_on": {},
      "employer_esi_applicable_on": {},
      "state": "Maharashtra",
      "pt_is_applicable": true,
      "pt_amount": null,
      "pt_rule_category": null,
      "lwf_is_applicable": false,
      "lwf_rule_category": null,
      "updated_on": null
    }
  ],
  "message": "Success",
  "status": true,
  "count": 1,
  "prev": null,
  "next": null
}
```

**SDK Code**

```python Example
import requests

url = "https://api.salaryboxapp.com/v2/customer/v1/payroll/config/templates"

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/templates';
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/templates"

	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/templates")

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/templates")
  .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/templates', [
  '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/templates");
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/templates")! 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()
```