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

# Add Staff Salary Component

POST https://api.salaryboxapp.com/v2/customer/v1/payroll/salary-components
Content-Type: application/json

Records an incentive or a reimbursement for a staff member in payroll. It records an entry and moves no money. Shared rules: see [Writing data](/conventions#writing-data). Needs Payroll on your plan.

* After a timeout or failure, check `GET /payroll/salary-components` for the same staff member, type and dates before sending again.
* To correct an entry, use Update Staff Salary Component. There is no delete through the API; delete it in the SalaryBox app.
* `component_type` is `incentive` or `reimbursement`.
* `salarybox_id` is an active staff member of the company.
* `date` is `YYYY-MM-DD` and not after the staff member's local today.
* `amount` is a JSON number from 0.01 to 10000000 with up to 2 decimals.
* `notes` is optional, at max 500 characters, trimmed.
* `incentive_type` is optional, the exact name from `GET /payroll/config/incentive-types`, and only with `component_type` `incentive`. With `reimbursement` it is refused with `400` on `incentive_type`.
* For a reimbursement, `status` is `approved` straight away, as when an Admin adds one in the app. Admins cannot raise a reimbursement request for themselves.
* To decide a pending reimbursement, see Approve or Reject Reimbursement Requests (`PUT /payroll/reimbursement/{salarybox_id}/decision`).

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

## Authentication

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

## Request

### Body (application/json)

This endpoint expects a PayrollSalaryComponentCreateRequest.

- `salarybox_id` (string, required) — SalaryBox ID of an active staff member.
- `component_type` (enum, required)
  - Allowed values: `incentive`, `reimbursement`
- `date` (date, required) — `YYYY-MM-DD`. Not after the staff member's local today.
- `amount` (double, required) — Up to 2 decimals. Must be a JSON number.
- `notes` (string, optional)
- `incentive_type` (string, optional) — Exact name from `GET /payroll/config/incentive-types`. Only with `component_type` `incentive`.

## Response

### 201

The entry was recorded.

- `message` (string, optional)
- `status` (boolean, optional)
- `data` (PayrollSalaryComponentEntry, optional)

## Errors

### 400 Bad Request Error

Validation failed, the date is in the future or in a finalised payroll month, the incentive type is unknown, the staff member is inactive, or an Admin tried to raise a reimbursement for themselves.

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

### Incentive

**Request**

```json
{
  "salarybox_id": "SBX1234567",
  "component_type": "incentive",
  "date": "2026-11-03",
  "amount": 2500,
  "notes": "Quarterly sales target",
  "incentive_type": "Sales"
}
```

**Response**

```json
{
  "message": "Salary component added successfully",
  "status": true,
  "data": {
    "salarybox_id": "SBX1234567",
    "component_type": "incentive",
    "date": "2026-11-03",
    "amount": 2500,
    "notes": "Quarterly sales target",
    "incentive_type": "Sales"
  }
}
```

**SDK Code**

```python Incentive
import requests

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

payload = {
    "salarybox_id": "SBX1234567",
    "component_type": "incentive",
    "date": "2026-11-03",
    "amount": 2500,
    "notes": "Quarterly sales target",
    "incentive_type": "Sales"
}
headers = {
    "Authorization": "Api-Key  <apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Incentive
const url = 'https://api.salaryboxapp.com/v2/customer/v1/payroll/salary-components';
const options = {
  method: 'POST',
  headers: {Authorization: 'Api-Key  <apiKey>', 'Content-Type': 'application/json'},
  body: '{"salarybox_id":"SBX1234567","component_type":"incentive","date":"2026-11-03","amount":2500,"notes":"Quarterly sales target","incentive_type":"Sales"}'
};

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

```go Incentive
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"salarybox_id\": \"SBX1234567\",\n  \"component_type\": \"incentive\",\n  \"date\": \"2026-11-03\",\n  \"amount\": 2500,\n  \"notes\": \"Quarterly sales target\",\n  \"incentive_type\": \"Sales\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Api-Key  <apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

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

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

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Api-Key  <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"salarybox_id\": \"SBX1234567\",\n  \"component_type\": \"incentive\",\n  \"date\": \"2026-11-03\",\n  \"amount\": 2500,\n  \"notes\": \"Quarterly sales target\",\n  \"incentive_type\": \"Sales\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.salaryboxapp.com/v2/customer/v1/payroll/salary-components")
  .header("Authorization", "Api-Key  <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"salarybox_id\": \"SBX1234567\",\n  \"component_type\": \"incentive\",\n  \"date\": \"2026-11-03\",\n  \"amount\": 2500,\n  \"notes\": \"Quarterly sales target\",\n  \"incentive_type\": \"Sales\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.salaryboxapp.com/v2/customer/v1/payroll/salary-components', [
  'body' => '{
  "salarybox_id": "SBX1234567",
  "component_type": "incentive",
  "date": "2026-11-03",
  "amount": 2500,
  "notes": "Quarterly sales target",
  "incentive_type": "Sales"
}',
  'headers' => [
    'Authorization' => 'Api-Key  <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Incentive
using RestSharp;

var client = new RestClient("https://api.salaryboxapp.com/v2/customer/v1/payroll/salary-components");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Api-Key  <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"salarybox_id\": \"SBX1234567\",\n  \"component_type\": \"incentive\",\n  \"date\": \"2026-11-03\",\n  \"amount\": 2500,\n  \"notes\": \"Quarterly sales target\",\n  \"incentive_type\": \"Sales\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Incentive
import Foundation

let headers = [
  "Authorization": "Api-Key  <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "salarybox_id": "SBX1234567",
  "component_type": "incentive",
  "date": "2026-11-03",
  "amount": 2500,
  "notes": "Quarterly sales target",
  "incentive_type": "Sales"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.salaryboxapp.com/v2/customer/v1/payroll/salary-components")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```

### Reimbursement

**Request**

```json
{
  "salarybox_id": "SBX1234567",
  "component_type": "reimbursement",
  "date": "2026-11-03",
  "amount": 1500,
  "notes": "Client visit travel"
}
```

**Response**

```json
{
  "message": "Salary component added successfully",
  "status": true,
  "data": {
    "salarybox_id": "SBX1234567",
    "component_type": "reimbursement",
    "date": "2026-11-03",
    "amount": 1500,
    "notes": "Client visit travel",
    "status": "pending"
  }
}
```

**SDK Code**

```python Reimbursement
import requests

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

payload = {
    "salarybox_id": "SBX1234567",
    "component_type": "reimbursement",
    "date": "2026-11-03",
    "amount": 1500,
    "notes": "Client visit travel"
}
headers = {
    "Authorization": "Api-Key  <apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Reimbursement
const url = 'https://api.salaryboxapp.com/v2/customer/v1/payroll/salary-components';
const options = {
  method: 'POST',
  headers: {Authorization: 'Api-Key  <apiKey>', 'Content-Type': 'application/json'},
  body: '{"salarybox_id":"SBX1234567","component_type":"reimbursement","date":"2026-11-03","amount":1500,"notes":"Client visit travel"}'
};

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

```go Reimbursement
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"salarybox_id\": \"SBX1234567\",\n  \"component_type\": \"reimbursement\",\n  \"date\": \"2026-11-03\",\n  \"amount\": 1500,\n  \"notes\": \"Client visit travel\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Api-Key  <apiKey>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

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

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

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Api-Key  <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"salarybox_id\": \"SBX1234567\",\n  \"component_type\": \"reimbursement\",\n  \"date\": \"2026-11-03\",\n  \"amount\": 1500,\n  \"notes\": \"Client visit travel\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.salaryboxapp.com/v2/customer/v1/payroll/salary-components")
  .header("Authorization", "Api-Key  <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"salarybox_id\": \"SBX1234567\",\n  \"component_type\": \"reimbursement\",\n  \"date\": \"2026-11-03\",\n  \"amount\": 1500,\n  \"notes\": \"Client visit travel\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.salaryboxapp.com/v2/customer/v1/payroll/salary-components', [
  'body' => '{
  "salarybox_id": "SBX1234567",
  "component_type": "reimbursement",
  "date": "2026-11-03",
  "amount": 1500,
  "notes": "Client visit travel"
}',
  'headers' => [
    'Authorization' => 'Api-Key  <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Reimbursement
using RestSharp;

var client = new RestClient("https://api.salaryboxapp.com/v2/customer/v1/payroll/salary-components");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Api-Key  <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"salarybox_id\": \"SBX1234567\",\n  \"component_type\": \"reimbursement\",\n  \"date\": \"2026-11-03\",\n  \"amount\": 1500,\n  \"notes\": \"Client visit travel\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Reimbursement
import Foundation

let headers = [
  "Authorization": "Api-Key  <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "salarybox_id": "SBX1234567",
  "component_type": "reimbursement",
  "date": "2026-11-03",
  "amount": 1500,
  "notes": "Client visit travel"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.salaryboxapp.com/v2/customer/v1/payroll/salary-components")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```