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

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

Returns one staff member's overtime for one payroll month, day by day: hours or days, rate and amount, plus the month's totals. The figures are the ones payroll pays. Requires Payroll Pro. One staff member per call; inactive staff can be fetched.

- The period is the payroll month's attendance period (`attendance_from_date` to `attendance_to_date`), which follows your salary cycle.
- `overtime_type` is `HOUR` for time worked beyond the shift on a normal day, or `DAY` for working on a week off or public holiday (1 day, or 0.5 for a half day).
- Hour-wise overtime within the grace period in Overtime Settings is not paid (it shows `0.00`).
- A day an admin edited in payroll (`is_saved_by_admin`) uses the admin's value; `actual_overtime_hours` shows the hours from attendance.
- For a finalized month (`is_finalized: true`), the rates saved with that payroll are used.
- `days` lists only days with overtime.

**Errors**
- `400` `"month cannot be in the future"`.
- `400` `"No salary structure (CTC) is set for this employee"`.
- `400` `"Payroll settings are not set up for this company"`.
- `404` `"Employee not found"`.


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

## Authentication

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

## Request

### Query parameters

- `salarybox_id` (string, required) — SalaryBox ID of the staff member. One ID per request.
- `month` (string, required) — Payroll month, `YYYY-MM`. Not later than the current month.

## Response

### 200

The staff member's overtime for the month.

- `message` (string, required)
- `status` (boolean, required)
- `data` (EmployeeOvertime, required)

## Errors

### 400 Bad Request Error

A parameter is missing or invalid, the month is in the future, or salary or payroll settings are not set up.

- `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 staff member with this SalaryBox ID can be fetched in your company.

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

## Types

### EmployeeOvertime

- `salarybox_id` (string, required) — The staff member's SalaryBox ID.
- `employee_id` (string, required, nullable) — Your company's own employee ID for this person. `null` or an empty string when not set.
- `name` (string, required) — Full name from the staff profile.
- `attendance_from_date` (date, required) — First date of the attendance period counted for this payroll month, `YYYY-MM-DD`. The 1st of the month, or the start of your salary cycle when it does not start on the 1st.
- `attendance_to_date` (date, required) — Last date counted, `YYYY-MM-DD`. The end of the month or cycle, or today when the period has not ended yet.
- `is_finalized` (boolean, required) — True when this month's payroll has been finalized. Rates and amounts then use the overtime settings saved with the finalized payroll, not the current ones.
- `total_amount` (string, required) — Total overtime pay for the period, the sum of `amount` over `days`, as a 2-decimal string.
- `total_overtime_hours` (string, required) — Sum of `payable_overtime_hours` over `HOUR` days, as a 2-decimal string. Hours within the grace period are not included.
- `total_overtime_days` (string, required) — Sum of `payable_overtime_days` over `DAY` days, as a 2-decimal string.
- `overtime_days_on_holidays` (string, required) — The part of `total_overtime_days` earned on public holidays.
- `overtime_days_on_week_offs` (string, required) — The part of `total_overtime_days` earned on week offs.
- `days` (list of EmployeeOvertimeDay, required) — Days with overtime, in date order. Days with no overtime are left out.

### EmployeeOvertimeDay

Overtime on one date.

- `date` (date, required) — The attendance date, `YYYY-MM-DD`.
- `overtime_type` (enum, required, nullable) — - `HOUR`: hour-wise overtime on a normal day, paid per hour. - `DAY`: day-wise overtime for working on a week off or public holiday, paid per day. Can be `null` on some days saved by an admin long ago, before the overtime type was recorded.
  - Allowed values: `HOUR`, `DAY`
- `day_status` (enum, required) — What the day was before any overtime: `public_holiday` for one of your company's holidays, `non_working_day` for the person's week off, otherwise the attendance status of the day (`present`, `double_present`, `half_day`, or `absent` when nothing was marked).
  - Allowed values: `non_working_day`, `public_holiday`, `present`, `double_present`, `half_day`, `absent`
- `actual_overtime_hours` (string, required) — Overtime hours worked out from attendance, before the grace period, as a 2-decimal string. `"0.00"` on `DAY` days, where hours are not counted.
- `payable_overtime_hours` (string, required, nullable) — Overtime hours that are paid, as a 2-decimal string. For `HOUR` days: `actual_overtime_hours` when it is more than the grace period, otherwise `"0.00"`; for an admin-saved day, the hours the admin saved. `"0.00"` on `DAY` days. `null` on some days saved by an admin long ago.
- `payable_overtime_days` (string, required, nullable) — Overtime days that are paid, as a 2-decimal string. For `DAY` days: `"1.00"` when present or double present, `"0.50"` for a half day; for an admin-saved day, the days the admin saved. `"0.00"` on `HOUR` days. `null` on some days saved by an admin long ago.
- `rate` (string, required) — Money per payable hour (`HOUR`) or per payable day (`DAY`), as a 2-decimal string, from the person's current settings in List Overtime Settings. `"0.00"` when they have none.
- `amount` (string, required) — Overtime pay for the day, as a 2-decimal string. Payable hours or days multiplied by `rate`.
- `is_saved_by_admin` (boolean, required) — True when an admin has saved this day's overtime in payroll. The saved value then replaces the computed payable hours or days.

## Examples

**Response**

```json
{
  "message": "Success",
  "status": true,
  "data": {
    "salarybox_id": "SBK7Q2M9TX",
    "employee_id": "EMP-0042",
    "name": "Aarav Sharma",
    "attendance_from_date": "2026-10-01",
    "attendance_to_date": "2026-10-31",
    "is_finalized": false,
    "total_amount": "1987.50",
    "total_overtime_hours": "3.25",
    "total_overtime_days": "1.00",
    "overtime_days_on_holidays": "0.00",
    "overtime_days_on_week_offs": "1.00",
    "days": [
      {
        "date": "2026-10-07",
        "overtime_type": "HOUR",
        "day_status": "present",
        "actual_overtime_hours": "1.25",
        "payable_overtime_hours": "1.25",
        "payable_overtime_days": "0.00",
        "rate": "150.00",
        "amount": "187.50",
        "is_saved_by_admin": false
      },
      {
        "date": "2026-10-09",
        "overtime_type": "HOUR",
        "day_status": "present",
        "actual_overtime_hours": "0.40",
        "payable_overtime_hours": "0.00",
        "payable_overtime_days": "0.00",
        "rate": "150.00",
        "amount": "0.00",
        "is_saved_by_admin": false
      },
      {
        "date": "2026-10-11",
        "overtime_type": "DAY",
        "day_status": "non_working_day",
        "actual_overtime_hours": "0.00",
        "payable_overtime_hours": "0.00",
        "payable_overtime_days": "1.00",
        "rate": "1500.00",
        "amount": "1500.00",
        "is_saved_by_admin": false
      },
      {
        "date": "2026-10-21",
        "overtime_type": "HOUR",
        "day_status": "present",
        "actual_overtime_hours": "2.10",
        "payable_overtime_hours": "2.00",
        "payable_overtime_days": "0.00",
        "rate": "150.00",
        "amount": "300.00",
        "is_saved_by_admin": true
      }
    ]
  }
}
```

**SDK Code**

```python Example
import requests

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

querystring = {"month":"2026-10","salarybox_id":"SBK7Q2M9TX"}

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/overtime?month=2026-10&salarybox_id=SBK7Q2M9TX';
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/overtime?month=2026-10&salarybox_id=SBK7Q2M9TX"

	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/overtime?month=2026-10&salarybox_id=SBK7Q2M9TX")

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/overtime?month=2026-10&salarybox_id=SBK7Q2M9TX")
  .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/overtime?month=2026-10&salarybox_id=SBK7Q2M9TX', [
  'headers' => [
    'Authorization' => 'Api-Key  <apiKey>',
  ],
]);

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

```csharp Example
using RestSharp;

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