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

# Fetch Single Staff Late Arriving Fines

GET https://api.salaryboxapp.com/v2/customer/v1/payroll/late-fine

Returns the late arriving fine for each day of one payroll month for one staff member, as payroll counts it now, with the month's total. Needs Payroll on your plan. One staff member per call.

`deduct_for` is how much of the day is fined: hours on an `hourly` fine (the app's Deduct For), `1` (fined) or `0` (not fined) on a `daily` fine (the app's Deduct fine for the day?).

- If an admin has saved the month, `is_saved` is `true` and the saved amounts are shown. Otherwise these are the computed values.
- `fine_type` comes from the staff member's fine settings (`/payroll/config/late-fine`): `hourly` or `daily`.
- `days` is sorted by date and lists only days with a fine counted. It is empty if there were none.
- `waive_off_applied` is `true` when the day is inside the staff member's waive-off days (computed amount 0).
- `attendance_from_date` and `attendance_to_date` are the attendance window payroll uses for the month, which follows your Attendance Cycle (Fetch Payroll Settings).
- Money and hours are strings with 2 decimals.
- How saved totals behave: payroll uses the saved `total_fine` as it was stored. If attendance changes after a save, a day that is no longer late drops out of `days`, but its amount stays in `total_fine`, so the total can differ from the sum of `days`. Saving the month again (`PUT`) works `total_fine` out from the current days.
- `amount` is exact. `deduct_for` and `rate` are rounded to 2 decimals, so `deduct_for` x `rate` can differ from `amount` by a paisa or two on an hourly fine.
- To change days: if `is_saved` is `false`, send them with `POST /payroll/late-fine`; if `true`, with `PUT /payroll/late-fine`.


Reference: https://docs.salarybox.in/api-reference/payroll/late-fine-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`.

## Response

### 200

The month's late arriving fines.

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

## Errors

### 400 Bad Request Error

A parameter is missing or invalid, the staff member has no fine settings or salary structure, 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, or you cannot act on this staff member.

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

### PayrollLateFineMonth

- `salarybox_id` (string, optional)
- `month` (string, optional)
- `attendance_from_date` (date, optional)
- `attendance_to_date` (date, optional)
- `fine_type` (enum, optional)
  - Allowed values: `hourly`, `daily`
- `is_saved` (boolean, optional) — Whether an admin has saved this month. `false` means these are the computed values.
- `total_fine` (string, optional)
- `days` (list of PayrollLateFineDay, optional) — Sorted by date. May be empty.

### PayrollLateFineDay

- `date` (date, optional)
- `late_by_hours` (string, optional) — Hours the staff member was late that day. 2 decimals.
- `waive_off_applied` (boolean, optional) — The day is inside the staff member's waive-off days (computed amount 0).
- `deduct_for` (string, optional) — Hours fined (`hourly`) or `1.00` / `0.00` (`daily`). 2 decimals.
- `rate` (string, optional)
- `amount` (string, optional)

## Examples

**Response**

```json
{
  "message": "Success",
  "status": true,
  "data": {
    "salarybox_id": "SBX1234567",
    "month": "2026-10",
    "attendance_from_date": "2026-10-01",
    "attendance_to_date": "2026-10-31",
    "fine_type": "hourly",
    "is_saved": false,
    "total_fine": "150.00",
    "days": [
      {
        "date": "2026-10-03",
        "late_by_hours": "1.75",
        "waive_off_applied": false,
        "deduct_for": "1.50",
        "rate": "100.00",
        "amount": "150.00"
      }
    ]
  }
}
```

**SDK Code**

```python Example
import requests

url = "https://api.salaryboxapp.com/v2/customer/v1/payroll/late-fine"

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

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/late-fine?month=2026-10&salarybox_id=SBX1234567';
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/late-fine?month=2026-10&salarybox_id=SBX1234567"

	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/late-fine?month=2026-10&salarybox_id=SBX1234567")

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

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

```csharp Example
using RestSharp;

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