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

# Get Payroll Settings

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

Returns your company's payroll settings: the salary cycle, whether week offs and public holidays are paid, and the tax declaration deadline. Requires Payroll Pro. Not paginated. If settings were never saved, `is_configured` is `false` and SalaryBox's defaults are shown.


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

## Authentication

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

## Response

### 200

The company's payroll settings.

- `message` (string, required)
- `status` (boolean, required)
- `data` (PayrollConfig, 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

### PayrollConfig

- `is_configured` (boolean, required) — False means the company never saved payroll settings, and the values shown are SalaryBox's defaults, which payroll uses.
- `salary_cycle` (PayrollSalaryCycle, required) — How the company's payroll month is defined.
- `is_week_off_paid` (boolean, required) — Whether week offs are paid days. This matters for staff whose salary is divided by calendar days.
- `is_holiday_paid` (boolean, required) — Whether public holidays are paid days. This matters for staff whose salary is divided by calendar days.
- `tax_declaration_deadline` (date, required) — Last date for staff to submit tax declarations.

### PayrollSalaryCycle

How the company's payroll month is defined.

- `type` (enum, required) — - `calendar_month`: the 1st to the end of the month. - `variable`: a cycle that starts on a set day. For example, with `starts_on_day` 26, 26 Oct to 25 Nov counts as November.
  - Allowed values: `calendar_month`, `variable`
- `starts_on_day` (integer, required) — Day of the month the cycle starts on. Always 1 for `calendar_month`.

## Examples

**Response**

```json
{
  "message": "Success",
  "status": true,
  "data": {
    "is_configured": true,
    "salary_cycle": {
      "type": "variable",
      "starts_on_day": 26
    },
    "is_week_off_paid": true,
    "is_holiday_paid": true,
    "tax_declaration_deadline": "2027-01-31"
  }
}
```

**SDK Code**

```python Example
import requests

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

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

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

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