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

# Compute Payroll

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

Returns each staff member's computed salary for the month: earnings, deductions and net pay. Needs Payroll on your plan. Budget one call per payroll month.

Staff who left during the month are included, so their final settlement is returned. Staff who left before the month's attendance period began, or who join after it ends, are not.


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

## Authentication

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

## Request

### Query parameters

- `month` (string, required) — Month, `YYYY-MM`. Always the full calendar month.
- `salarybox_ids` (list of string, optional) — Repeatable. Limits the result to these staff members, for example `salarybox_ids=SBK7Q2M9TX&salarybox_ids=SBK3H8D1LP`.
- `page` (integer, optional) — Page number, starting at 1.
- `page_size` (integer, optional) — Results per page. Default and maximum 50.

## Response

### 200

Payroll for the month is computed; the page is returned.

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

## Types

### EmployeeSalaryBreakdown

- `salarybox_id` (string, required)
- `employee_id` (string, required)
- `name` (string, required)
- `branches` (list of any, required)
- `departments` (list of any, required)
- `period` (SalaryBreakdownPeriod, required)
- `earnings` (SalaryBreakdownEarnings, required)
- `deductions` (SalaryBreakdownDeductions, required)
- `employer_pf` (string, required)
- `employer_esi` (string, required)
- `employer_labour_welfare_fund` (string, required)
- `total_earnings` (string, required)
- `total_deductions` (string, required)
- `gross_salary` (string, required)
- `net_salary` (string, required)

### SalaryBreakdownPeriod

- `from_date` (date, required)
- `to_date` (date, required)

### SalaryBreakdownEarnings

- `basic_salary` (string, required)
- `fixed_allowances` (string, required)
- `allowance` (string, required)
- `bonus` (string, required)
- `overtime` (string, required)
- `workbasis` (string, required)
- `incentive` (string, required)
- `reimbursement` (string, required)

### SalaryBreakdownDeductions

- `employee_pf` (string, required)
- `employee_esi` (string, required)
- `professional_tax` (string, required)
- `labour_welfare_fund` (string, required)
- `admin_edli_deduction` (string, required)
- `fixed_deductions` (string, required)
- `total_tds` (string, required)
- `penalty` (string, required)
- `late_fine` (string, required)
- `early_fine` (string, required)
- `loan_debit` (string, required)

## Examples

**Response**

```json
{
  "data": [
    {
      "salarybox_id": "EMP001",
      "employee_id": "CMP-001",
      "name": "Jane Doe",
      "branches": [
        "HQ"
      ],
      "departments": [
        "Engineering"
      ],
      "period": {
        "from_date": "2026-01-01",
        "to_date": "2026-01-31"
      },
      "earnings": {
        "basic_salary": "25000.00",
        "fixed_allowances": "12500.00",
        "allowance": "0.00",
        "bonus": "0.00",
        "overtime": "0.00",
        "workbasis": "0.00",
        "incentive": "0.00",
        "reimbursement": "0.00"
      },
      "deductions": {
        "employee_pf": "1800.00",
        "employee_esi": "0.00",
        "professional_tax": "200.00",
        "labour_welfare_fund": "0.00",
        "admin_edli_deduction": "0.00",
        "fixed_deductions": "0.00",
        "total_tds": "0.00",
        "penalty": "0.00",
        "late_fine": "0.00",
        "early_fine": "0.00",
        "loan_debit": "0.00"
      },
      "employer_pf": "1800.00",
      "employer_esi": "0.00",
      "employer_labour_welfare_fund": "0.00",
      "total_earnings": "37500.00",
      "total_deductions": "2000.00",
      "gross_salary": "37500.00",
      "net_salary": "35500.00"
    }
  ],
  "message": "Success",
  "status": true,
  "count": 40,
  "prev": null,
  "next": "https://.../compute?page=2",
  "rate_limit": [
    "0/1 requests remaining per 2 seconds",
    "29/30 requests remaining per 5 minutes",
    "99/100 requests remaining per 1 hour"
  ]
}
```

**SDK Code**

```python Example
import requests

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

querystring = {"month":"month"}

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/compute?month=month';
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/compute?month=month"

	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/compute?month=month")

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/compute?month=month")
  .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/compute?month=month', [
  'headers' => [
    'Authorization' => 'Api-Key  <apiKey>',
  ],
]);

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

```csharp Example
using RestSharp;

var client = new RestClient("https://api.salaryboxapp.com/v2/customer/v1/payroll/compute?month=month");
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/compute?month=month")! 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()
```