> ## 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 Single Staff Salary Components

GET https://api.salaryboxapp.com/v2/customer/v1/payroll/salary-components

Lists the incentive or reimbursement entries recorded for one staff member between two dates, newest first. Needs Payroll on your plan.

- `salarybox_id`, `component_type`, `start_date` and `end_date` are required. Both dates are inclusive, `YYYY-MM-DD`, the range is at most 366 days and `end_date` must be on or after `start_date`.
- `results` are the same objects that `POST /payroll/salary-components` returns in `data`.
- Use this to check whether an entry is already recorded before sending `POST /payroll/salary-components` again.


Reference: https://docs.salarybox.in/api-reference/payroll/salary-components-list

## Authentication

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

## Request

### Query parameters

- `salarybox_id` (string, required) — SalaryBox ID of an active staff member.
- `component_type` (enum, required) — Which kind of entry to list.
  - Allowed values: `incentive`, `reimbursement`
- `start_date` (date, required) — First day to include, `YYYY-MM-DD`.
- `end_date` (date, required) — Last day to include, `YYYY-MM-DD`. On or after `start_date`, at most 366 days after it.
- `page` (integer, optional) — Page number to fetch. Defaults to 1.
- `page_size` (integer, optional) — Number of results per page (max 500). Defaults to 500.

## Response

### 200

The entries in the range.

- `message` (string, optional)
- `status` (boolean, optional)
- `data` (list of PayrollSalaryComponentEntry, optional)
- `count` (integer, optional)
- `prev` (string, optional, nullable)
- `next` (string, optional, nullable)

## Errors

### 400 Bad Request Error

A parameter is missing or invalid, the date range is wrong, or the staff member is inactive.

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

### 403 Forbidden Error

Your plan does not include payroll.

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

### 404 Not Found Error

No eligible active staff member with this `salarybox_id` exists in your company.

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

## Types

### PayrollSalaryComponentEntry

- `salarybox_id` (string, optional)
- `component_type` (enum, optional)
  - Allowed values: `incentive`, `reimbursement`
- `date` (date, optional)
- `amount` (double, optional)
- `notes` (string, optional)
- `incentive_type` (string, optional) — Present for an incentive.
- `status` (string, optional) — Present for a reimbursement. `approved`, or `pending` while it awaits a decision.

## Examples

**Response**

```json
{
  "message": "Success",
  "status": true,
  "data": [
    {
      "salarybox_id": "SBX1234567",
      "component_type": "reimbursement",
      "date": "2026-11-03",
      "amount": 1500,
      "notes": "Client visit travel",
      "status": "pending"
    }
  ],
  "count": 1,
  "prev": null,
  "next": null
}
```

**SDK Code**

```python Example
import requests

url = "https://api.salaryboxapp.com/v2/customer/v1/payroll/salary-components"

querystring = {"component_type":"incentive","end_date":"end_date","salarybox_id":"salarybox_id","start_date":"start_date"}

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

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

print(response.json())
```

```javascript Example
const url = 'https://api.salaryboxapp.com/v2/customer/v1/payroll/salary-components?component_type=incentive&end_date=end_date&salarybox_id=salarybox_id&start_date=start_date';
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/salary-components?component_type=incentive&end_date=end_date&salarybox_id=salarybox_id&start_date=start_date"

	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/salary-components?component_type=incentive&end_date=end_date&salarybox_id=salarybox_id&start_date=start_date")

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/salary-components?component_type=incentive&end_date=end_date&salarybox_id=salarybox_id&start_date=start_date")
  .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/salary-components?component_type=incentive&end_date=end_date&salarybox_id=salarybox_id&start_date=start_date', [
  'headers' => [
    'Authorization' => 'Api-Key  <apiKey>',
  ],
]);

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

```csharp Example
using RestSharp;

var client = new RestClient("https://api.salaryboxapp.com/v2/customer/v1/payroll/salary-components?component_type=incentive&end_date=end_date&salarybox_id=salarybox_id&start_date=start_date");
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/salary-components?component_type=incentive&end_date=end_date&salarybox_id=salarybox_id&start_date=start_date")! 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()
```