> ## 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 Payslip

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

Returns one staff member's payslip PDF for a month. Needs Payroll and Payroll and Compliance Reports on your plan. It is the same payslip the app downloads, and is generated during the call, so it can take several seconds. For every staff member at once, use Create Company Payslips.

Payslips exist only once the month's payment is saved for the staff member, same as in the app. Staff who have since left can still get their payslip for a month they were paid. The file also appears in the app under Reports > Downloads for the person whose key made the call.

**Errors**
- `400` `"Invalid Data"` with `errors.month` for a bad month, or `errors.salarybox_id` when it is missing.
- `400` `"Payment for this month is not saved for this staff member. Save the payment in SalaryBox first, then generate the payslip."`
- `400` `"No payroll for this staff member in this month: their salary structure is missing or their PF settings need attention. Fix it in the SalaryBox app, then generate the payslip."` with `errors.month`.
- `403` `"Payroll reports are not included in your plan. Contact us."`
- `404` `"Staff not found."`
- `502` `"The payslip could not be generated right now, please try again"`. Retry later.


Reference: https://docs.salarybox.in/api-reference/payroll/payslip-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) — Month, `YYYY-MM`. Always the full calendar month.

## Response

### 200

- `message` (string, required)
- `status` (boolean, required)
- `data` (PayslipResponseData, required)
- `rate_limit` (list of string, optional)

## Types

### PayslipResponseData

- `salarybox_id` (string, required)
- `month` (string, required) — `YYYY-MM`.
- `file_url` (string, required) — Link to the payslip PDF.

## Examples

**Response**

```json
{
  "message": "Payslip generated successfully",
  "status": true,
  "data": {
    "salarybox_id": "SBK7Q2M9TX",
    "month": "2026-10",
    "file_url": "https://cdn.example.com/payslip.pdf"
  },
  "rate_limit": [
    "0/1 requests remaining per 2 seconds",
    "9/10 requests remaining per 10 minutes",
    "99/100 requests remaining per 1 day"
  ]
}
```

**SDK Code**

```python Example
import requests

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

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/payslip?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/payslip?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/payslip?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/payslip?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/payslip?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/payslip?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/payslip?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()
```