> ## 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 a specific model identifier if you know it; otherwise use the name
> of the agent or product issuing the request.
>
> Examples:
>
> | Client | Value |
> |---|---|
> | GPT-5.6 Sol | `Client-Platform: gpt-5.6-sol` |
> | GPT-5.6 Luna | `Client-Platform: gpt-5.6-luna` |
> | GPT-5.6 Pro | `Client-Platform: gpt-5.6-pro` |
> | Claude Opus 4.6 | `Client-Platform: claude-opus-4.6` |
> | Claude Sonnet 4.6 | `Client-Platform: claude-sonnet-4.6` |
> | Gemini 3.1 Pro | `Client-Platform: gemini-3.1-pro` |
> | ChatGPT | `Client-Platform: chatgpt` |
> | Claude Code | `Client-Platform: claude-code` |
> | Codex | `Client-Platform: codex` |
> | Other | `Client-Platform: <your-tool-or-model-name>` |
>
> Example:
>
> ```bash
> curl https://api.salaryboxapp.com/... \
>   -H "Authorization: Api-Key <api-key>" \
>   -H "Client-Platform: claude-code"
> ```

# Payroll summary

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

Computes and returns the payroll summary for the given month.

Rate limited to 1 request per 10 seconds, 3 per 5 minutes, and 10 per hour, on top of the shared 5000/day API key limit — computing this response can be expensive, so budget one call per payroll month.

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

## Authentication

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

## Request

### Body (application/json)

This endpoint expects an Input.

- `month_from_date` (date, required)

## Response

### 200

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

## Types

### PayrollSummaryData

- `ctc_not_defined_employee_count` (integer, required)
- `cards` (map from string to any, required)
- `loan_details` (map from string to any, required)

## Examples

**Request**

```json
{
  "month_from_date": "2023-01-15"
}
```

**Response**

```json
{
  "message": "Data retrieved successfully",
  "status": true,
  "data": {
    "ctc_not_defined_employee_count": 0,
    "cards": [
      {
        "items": [
          {
            "action": "open_run_payroll",
            "amount": {
              "label": "₹ 148,007.55"
            },
            "count": {
              "label": "3 Staff"
            },
            "data": {
              "ctc_status": {
                "selected_value": "added"
              },
              "show_inactive": {
                "selected_value": true
              }
            },
            "title": {
              "infotip": "Staff with salary details added for month",
              "label": "Total Payroll"
            }
          },
          {
            "action": "open_run_payroll",
            "amount": {
              "label": "₹ 0.00"
            },
            "count": {
              "label": "0 Staff"
            },
            "data": {
              "salary_paid": {
                "selected_value": [
                  "partially_paid",
                  "paid_in_full"
                ]
              },
              "show_inactive": {
                "selected_value": true
              }
            },
            "title": {
              "infotip": "Fully or partially paid staff",
              "label": "Paid"
            }
          },
          {
            "action": "open_run_payroll",
            "amount": {
              "label": "₹ 301,585.52"
            },
            "count": {
              "label": "1 Staff"
            },
            "data": {
              "remaining_balance": {
                "selected_amount": 1,
                "selected_value": "remaining_balance_greater_than"
              },
              "show_inactive": {
                "selected_value": true
              }
            },
            "title": {
              "infotip": "Staff with pending salary dues",
              "label": "Pending"
            }
          }
        ],
        "title": null
      },
      {
        "items": [
          {
            "amount": {
              "label": "₹ 0.00"
            },
            "count": {
              "label": "0 Staff"
            },
            "title": {
              "label": "Work Basis Payment"
            }
          },
          {
            "amount": {
              "label": "₹ 0.00"
            },
            "count": {
              "label": "0 Staff"
            },
            "title": {
              "label": "Incentives"
            }
          },
          {
            "amount": {
              "label": "₹ 0.00"
            },
            "count": {
              "label": "0 Staff"
            },
            "title": {
              "label": "Reimbursement"
            }
          },
          {
            "amount": {
              "label": "₹ 0.00"
            },
            "count": {
              "label": "0 Staff"
            },
            "title": {
              "label": "Bonus"
            }
          },
          {
            "amount": {
              "label": "₹ 0.00"
            },
            "count": {
              "label": "0 Staff"
            },
            "title": {
              "label": "Overtime Pay"
            }
          },
          {
            "amount": {
              "label": "₹ 0.00"
            },
            "count": {
              "label": "0 Staff"
            },
            "title": {
              "label": "Other Earnings"
            }
          }
        ],
        "title": "Earning Details"
      },
      {
        "items": [
          {
            "amount": {
              "label": "₹ 3,750.00"
            },
            "count": {
              "label": "1 Staff"
            },
            "sub_items": [
              {
                "amount": {
                  "label": "₹ 1,800.00"
                },
                "title": {
                  "label": "Employer Contribution"
                }
              },
              {
                "amount": {
                  "label": "₹ 1,800.00"
                },
                "title": {
                  "label": "Employee Contribution"
                }
              },
              {
                "amount": {
                  "label": "₹ 150.00"
                },
                "title": {
                  "label": "EDLI & Admin Charges"
                }
              }
            ],
            "title": {
              "label": "Total Provident Fund"
            }
          },
          {
            "amount": {
              "label": "₹ 2,800.00"
            },
            "count": {
              "label": "1 Staff"
            },
            "sub_items": [
              {
                "amount": {
                  "label": "₹ 2,275.00"
                },
                "title": {
                  "label": "Employer Contribution"
                }
              },
              {
                "amount": {
                  "label": "₹ 525.00"
                },
                "title": {
                  "label": "Employee Contribution"
                }
              }
            ],
            "title": {
              "label": "Total Employees' State Insurance"
            }
          },
          {
            "amount": {
              "label": "₹ 5.00"
            },
            "count": {
              "label": "1 Staff"
            },
            "sub_items": [
              {
                "amount": {
                  "label": "₹ 3.33"
                },
                "title": {
                  "label": "Employer Contribution"
                }
              },
              {
                "amount": {
                  "label": "₹ 1.67"
                },
                "title": {
                  "label": "Employee Contribution"
                }
              }
            ],
            "title": {
              "label": "Total Labour Welfare Fund Tax"
            }
          },
          {
            "amount": {
              "label": "₹ 200.00"
            },
            "count": {
              "label": "1 Staff"
            },
            "title": {
              "label": "Total Professional Tax"
            }
          },
          {
            "amount": {
              "label": "₹ 408,026.09"
            },
            "count": {
              "label": "2 Staff"
            },
            "title": {
              "infotip": "This feature is available only with SB Payroll Pro Module",
              "label": "Total Tax Deducted at Source"
            }
          }
        ],
        "title": "Statutory Compliance Details"
      }
    ],
    "loan_details": {
      "loan_given": {
        "count": "1 Staff",
        "formatted_amount": "₹ 2,000,000.0",
        "title": "Given"
      },
      "loan_received": {
        "count": "0 Staff",
        "formatted_amount": "₹ 0.00",
        "title": "Received"
      },
      "pending": {
        "count": "1 Staff",
        "formatted_amount": "₹ 2,000,000.0",
        "title": "Pending Loan Amount"
      },
      "title": "Total Loan Amount"
    }
  },
  "rate_limit": [
    "0/1 requests remaining per 10 seconds",
    "2/3 requests remaining per 5 minutes",
    "9/10 requests remaining per 1 hour"
  ]
}
```

**SDK Code**

```python Example
import requests

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

payload = { "month_from_date": "2023-01-15" }
headers = {
    "Authorization": "Api-Key  <apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Example
const url = 'https://api.salaryboxapp.com/v2/customer/v1/payroll/summary';
const options = {
  method: 'POST',
  headers: {Authorization: 'Api-Key  <apiKey>', 'Content-Type': 'application/json'},
  body: '{"month_from_date":"2023-01-15"}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

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

	payload := strings.NewReader("{\n  \"month_from_date\": \"2023-01-15\"\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 Example
require 'uri'
require 'net/http'

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

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  \"month_from_date\": \"2023-01-15\"\n}"

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.post("https://api.salaryboxapp.com/v2/customer/v1/payroll/summary")
  .header("Authorization", "Api-Key  <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"month_from_date\": \"2023-01-15\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.salaryboxapp.com/v2/customer/v1/payroll/summary', [
  'body' => '{
  "month_from_date": "2023-01-15"
}',
  'headers' => [
    'Authorization' => 'Api-Key  <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Example
using RestSharp;

var client = new RestClient("https://api.salaryboxapp.com/v2/customer/v1/payroll/summary");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Api-Key  <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"month_from_date\": \"2023-01-15\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Example
import Foundation

let headers = [
  "Authorization": "Api-Key  <apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["month_from_date": "2023-01-15"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.salaryboxapp.com/v2/customer/v1/payroll/summary")! 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()
```