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

# Add Staff Tax Declarations

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

Adds income tax declarations for one staff member for a financial year. Add only: it cannot change an existing declaration. Shared rules: see [Writing data](/conventions#writing-data). Needs Payroll on your plan.

**This can change the staff member's TDS.**
- A declaration added through the API is accepted straight away (`status` `ACCEPTED`) and counts towards tax.
- One added by any other role, including Custom, stays `PENDING` until approved in the SalaryBox app. It doesn't count until then.
- Payroll for the current month is recalculated afterwards unless that month is finalised.
- The staff member gets the usual notification.
- There is no API to change or remove a declaration. Corrections are made in the SalaryBox app.

**Request**
- `salarybox_id` is required, at max 50 characters.
- `financial_year` is a JSON number, the year it starts in: `2026` means April 2026 to March 2027. Only the current or next financial year; otherwise `400` on it.
- `declarations` is required, at max 50 entries. All or nothing: if any entry is refused, none is saved.
- Each entry needs `section` and `amount` (a JSON number, 0 or more, max 12 digits, 2 decimals). For `HRA` the amount is **per month**.
- `period_start` and `period_end` are optional, `YYYY-MM-DD`, both or neither, inside the financial year, start not after end. Left out means the whole financial year. They are **required for `HRA`** ("HRA needs period_start and period_end." under `period_start`).
- `comments` is optional, at max 500 characters, trimmed.
- `HRA` only, optional: `landlord_name` (1-200), `landlord_address` (at max 500), `city` (at max 100), `landlord_pan` (upper case, format `ABCDE1234F`).
- `24B` only, optional: `lender_name` (1-200), `lender_address` (at max 500), `lender_pan` (upper case, format `ABCDE1234F`).
- `LTA` only, optional: `lta_origin`, `lta_destination` (1-200), `lta_claimed` (JSON number, 0 or more, 2 decimals).
- A detail field on the wrong section gives `400` on it, for example "Only used with section HRA."
- Proof documents can't be sent (unknown field `400`); they are added in the SalaryBox app.

**Errors**
- Per-entry errors come back under `declarations` as a list in the order sent. For example a period outside the year gives `period_start`: "The period must be inside the financial year."
- A declaration with the same section, period and amount already on file and not rejected, or repeated in the request, gives `section`: "This declaration is already on file." Repeating a request that succeeded is therefore refused with `400`, which is harmless.
- `500` "The declarations could not be saved, so nothing was changed. Try again." if saving fails.

**Response**
- `declared_amount` is the stored total, the same as `declared_amount` on `GET /payroll/tax-declarations`. For `HRA` it is the monthly amount times the months.
- `status` is `ACCEPTED` or `PENDING`. Third parties' PANs are never returned.


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

## Authentication

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

## Request

### Body (application/json)

This endpoint expects a PayrollTaxDeclarationsCreateRequest.

- `salarybox_id` (string, required) — SalaryBox ID of an active staff member.
- `financial_year` (double, required) — The year the financial year starts in, so `2026` means April 2026 to March 2027. Only the current or next financial year.
- `declarations` (list of PayrollTaxDeclarationInput, required)

## Response

### 201

The declarations were added.

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

## Errors

### 400 Bad Request Error

Validation failed or the staff member is inactive ("Staff is inactive. Reactivate them in the SalaryBox app first."). Nothing was saved.

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

### 500 Internal Server Error

Saving failed, so nothing was changed. Try again.

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

## Types

### PayrollTaxDeclarationInput

One declaration. Detail fields are accepted only on the section they belong to. Proof documents can't be sent.

- `section` (enum, required)
  - Allowed values: `HRA`, `LTA`, `24B`, `80C`, `80CC`, `80CCD(1)`, `80CCD(1B)`, `80CCD(2)`, `80D`, `80DD`, `80DDB`, `80E`, `80EE`, `80EEA`, `80EEB`, `80G`, `80GG`, `80GGA`, `80GGC`, `80TTA`, `80TTB`, `80U`
- `amount` (double, required) — 0 or more, max 12 digits, 2 decimals. Must be a JSON number. For `HRA` this is the amount per month.
- `period_start` (date, optional) — `YYYY-MM-DD`. Send with `period_end` or not at all; inside the financial year, not after `period_end`. Left out means the whole financial year. Required for `HRA`.
- `period_end` (date, optional) — `YYYY-MM-DD`. Send with `period_start` or not at all.
- `comments` (string, optional)
- `landlord_name` (string, optional) — Only with section `HRA`.
- `landlord_address` (string, optional) — Only with section `HRA`.
- `city` (string, optional) — Only with section `HRA`.
- `landlord_pan` (string, optional) — Only with section `HRA`. Upper case, format `ABCDE1234F`. Never returned.
- `lender_name` (string, optional) — Only with section `24B`.
- `lender_address` (string, optional) — Only with section `24B`.
- `lender_pan` (string, optional) — Only with section `24B`. Upper case, format `ABCDE1234F`. Never returned.
- `lta_origin` (string, optional) — Only with section `LTA`.
- `lta_destination` (string, optional) — Only with section `LTA`.
- `lta_claimed` (double, optional) — Only with section `LTA`. 2 decimals. Must be a JSON number.

### PayrollTaxDeclarationsCreateResponseData

- `salarybox_id` (string, optional)
- `financial_year` (integer, optional)
- `declarations` (list of PayrollTaxDeclarationResult, optional)

### PayrollTaxDeclarationResult

- `section` (string, optional)
- `declared_amount` (string, optional) — The stored total, the same as `declared_amount` on `GET /payroll/tax-declarations`. For `HRA` it is the monthly amount times the months.
- `period_start` (date, optional)
- `period_end` (date, optional)
- `status` (enum, optional)
  - Allowed values: `ACCEPTED`, `PENDING`

## Examples

**Request**

```json
{
  "salarybox_id": "SBX1234567",
  "financial_year": 2026,
  "declarations": [
    {
      "section": "80C",
      "amount": 150000,
      "comments": "PPF and ELSS"
    },
    {
      "section": "HRA",
      "amount": 25000,
      "period_start": "2026-04-01",
      "period_end": "2027-03-31",
      "landlord_name": "Suresh Mehta",
      "city": "Mumbai"
    }
  ]
}
```

**Response**

```json
{
  "message": "Tax declarations added successfully",
  "status": true,
  "data": {
    "salarybox_id": "SBX1234567",
    "financial_year": 2026,
    "declarations": [
      {
        "section": "80C",
        "declared_amount": "150000.00",
        "period_start": "2026-04-01",
        "period_end": "2027-03-31",
        "status": "ACCEPTED"
      },
      {
        "section": "HRA",
        "declared_amount": "300000.00",
        "period_start": "2026-04-01",
        "period_end": "2027-03-31",
        "status": "ACCEPTED"
      }
    ]
  }
}
```

**SDK Code**

```python Example
import requests

url = "https://api.salaryboxapp.com/v2/customer/v1/payroll/tax-declarations"

payload = {
    "salarybox_id": "SBX1234567",
    "financial_year": 2026,
    "declarations": [
        {
            "section": "80C",
            "amount": 150000,
            "comments": "PPF and ELSS"
        },
        {
            "section": "HRA",
            "amount": 25000,
            "period_start": "2026-04-01",
            "period_end": "2027-03-31",
            "landlord_name": "Suresh Mehta",
            "city": "Mumbai"
        }
    ]
}
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/tax-declarations';
const options = {
  method: 'POST',
  headers: {Authorization: 'Api-Key  <apiKey>', 'Content-Type': 'application/json'},
  body: '{"salarybox_id":"SBX1234567","financial_year":2026,"declarations":[{"section":"80C","amount":150000,"comments":"PPF and ELSS"},{"section":"HRA","amount":25000,"period_start":"2026-04-01","period_end":"2027-03-31","landlord_name":"Suresh Mehta","city":"Mumbai"}]}'
};

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/tax-declarations"

	payload := strings.NewReader("{\n  \"salarybox_id\": \"SBX1234567\",\n  \"financial_year\": 2026,\n  \"declarations\": [\n    {\n      \"section\": \"80C\",\n      \"amount\": 150000,\n      \"comments\": \"PPF and ELSS\"\n    },\n    {\n      \"section\": \"HRA\",\n      \"amount\": 25000,\n      \"period_start\": \"2026-04-01\",\n      \"period_end\": \"2027-03-31\",\n      \"landlord_name\": \"Suresh Mehta\",\n      \"city\": \"Mumbai\"\n    }\n  ]\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/tax-declarations")

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  \"salarybox_id\": \"SBX1234567\",\n  \"financial_year\": 2026,\n  \"declarations\": [\n    {\n      \"section\": \"80C\",\n      \"amount\": 150000,\n      \"comments\": \"PPF and ELSS\"\n    },\n    {\n      \"section\": \"HRA\",\n      \"amount\": 25000,\n      \"period_start\": \"2026-04-01\",\n      \"period_end\": \"2027-03-31\",\n      \"landlord_name\": \"Suresh Mehta\",\n      \"city\": \"Mumbai\"\n    }\n  ]\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/tax-declarations")
  .header("Authorization", "Api-Key  <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"salarybox_id\": \"SBX1234567\",\n  \"financial_year\": 2026,\n  \"declarations\": [\n    {\n      \"section\": \"80C\",\n      \"amount\": 150000,\n      \"comments\": \"PPF and ELSS\"\n    },\n    {\n      \"section\": \"HRA\",\n      \"amount\": 25000,\n      \"period_start\": \"2026-04-01\",\n      \"period_end\": \"2027-03-31\",\n      \"landlord_name\": \"Suresh Mehta\",\n      \"city\": \"Mumbai\"\n    }\n  ]\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/tax-declarations', [
  'body' => '{
  "salarybox_id": "SBX1234567",
  "financial_year": 2026,
  "declarations": [
    {
      "section": "80C",
      "amount": 150000,
      "comments": "PPF and ELSS"
    },
    {
      "section": "HRA",
      "amount": 25000,
      "period_start": "2026-04-01",
      "period_end": "2027-03-31",
      "landlord_name": "Suresh Mehta",
      "city": "Mumbai"
    }
  ]
}',
  '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/tax-declarations");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Api-Key  <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"salarybox_id\": \"SBX1234567\",\n  \"financial_year\": 2026,\n  \"declarations\": [\n    {\n      \"section\": \"80C\",\n      \"amount\": 150000,\n      \"comments\": \"PPF and ELSS\"\n    },\n    {\n      \"section\": \"HRA\",\n      \"amount\": 25000,\n      \"period_start\": \"2026-04-01\",\n      \"period_end\": \"2027-03-31\",\n      \"landlord_name\": \"Suresh Mehta\",\n      \"city\": \"Mumbai\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Example
import Foundation

let headers = [
  "Authorization": "Api-Key  <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "salarybox_id": "SBX1234567",
  "financial_year": 2026,
  "declarations": [
    [
      "section": "80C",
      "amount": 150000,
      "comments": "PPF and ELSS"
    ],
    [
      "section": "HRA",
      "amount": 25000,
      "period_start": "2026-04-01",
      "period_end": "2027-03-31",
      "landlord_name": "Suresh Mehta",
      "city": "Mumbai"
    ]
  ]
] as [String : Any]

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

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