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

# Update Company Profile

PUT https://api.salaryboxapp.com/v2/customer/v1/company/
Content-Type: application/json

Changes your company's profile. Send only the fields you want to change; anything left out stays as it is. Shared rules: see [Writing data](/conventions#writing-data).

* The body is closed: an unknown field is refused with `400` `"Unknown field."` Counts toward your write budget.
* At least one field is required: otherwise `400` `"Send at least one field to change."`
* `name` is at most 255 characters. `address` is at most 1000 characters and is saved on both the company and its billing details, which `GET /company/` reads.
* `gst_number` is a 15-character GSTIN in capital letters. Setting it switches the company to GST invoices. Unlike the SalaryBox app, the API does not overwrite the address or state from the GST registry, so they stay as you sent them.
* The first two digits of `gst_number` must be a valid GST state code, otherwise `400` on `gst_number`: `"Must start with a valid two-digit GST state code, e.g. 29 for Karnataka."`
* The GSTIN's state and `state` must agree, because invoices take the place of supply from the state. This is checked whenever `gst_number` or `state` is sent, using the saved value for the one you did not send. If they disagree, `400` with the error on `state` if you sent it, otherwise on `gst_number`: `"The GSTIN {gst_number} is registered in {gst_state}, but the state is {state}. Send the state that matches the GSTIN."`
* `pincode` is 6 digits and does not start with 0. `state` is an Indian state name from the GST state list.
* There is no delete.

Reference: https://docs.salarybox.in/api-reference/company/update

## Authentication

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

## Request

### Body (application/json)

This endpoint expects a CompanyUpdateRequest.

- `name` (string, optional) — Company name.
- `address` (string, optional) — Address. Saved on both the company and its billing details.
- `gst_number` (string, optional) — 15-character GSTIN in capital letters. Switches the company to GST invoices.
- `pincode` (string, optional) — 6-digit pincode, not starting with 0.
- `state` (string, optional) — Indian state name from the GST state list.

## Response

### 200

The company profile was updated.

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

## Errors

### 400 Bad Request Error

Validation failed.

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

### 403 Forbidden Error

The requester is not an Admin, or your company has no active subscription.

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

## Types

### CompanyUpdateResponseData

- `name` (string, optional) — Company name.
- `address` (string, optional, nullable) — Address.
- `gst_number` (string, optional, nullable) — GST number, or `null`.
- `pincode` (string, optional, nullable) — Pincode, or `null`.
- `state` (string, optional, nullable) — State, or `null`.

## Examples

### Example

**Response**

```json
{
  "message": "Company details updated successfully",
  "status": true,
  "data": {
    "name": "Acme Inc",
    "address": "3rd Floor, Prestige Tech Park, Outer Ring Road, Bengaluru",
    "gst_number": "29ABCDE1234F1Z5",
    "pincode": "560103",
    "state": "Karnataka"
  }
}
```

**SDK Code**

```python Example
import requests

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

headers = {"Authorization": "Api-Key  <apiKey>"}

response = requests.put(url, headers=headers)

print(response.json())
```

```javascript Example
const url = 'https://api.salaryboxapp.com/v2/customer/v1/company/';
const options = {method: 'PUT', 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/company/"

	req, _ := http.NewRequest("PUT", 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/company/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.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.put("https://api.salaryboxapp.com/v2/customer/v1/company/")
  .header("Authorization", "Api-Key  <apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.salaryboxapp.com/v2/customer/v1/company/', [
  'headers' => [
    'Authorization' => 'Api-Key  <apiKey>',
  ],
]);

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

```csharp Example
using RestSharp;

var client = new RestClient("https://api.salaryboxapp.com/v2/customer/v1/company/");
var request = new RestRequest(Method.PUT);
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/company/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```

### Change the address and pincode

**Request**

```json
{
  "address": "3rd Floor, Prestige Tech Park, Outer Ring Road, Bengaluru",
  "pincode": "560103"
}
```

**Response**

```json
{
  "message": "Company details updated successfully",
  "status": true,
  "data": {
    "name": "Acme Inc",
    "address": "3rd Floor, Prestige Tech Park, Outer Ring Road, Bengaluru",
    "gst_number": "29ABCDE1234F1Z5",
    "pincode": "560103",
    "state": "Karnataka"
  }
}
```

**SDK Code**

```python Change the address and pincode
import requests

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

payload = {
    "address": "3rd Floor, Prestige Tech Park, Outer Ring Road, Bengaluru",
    "pincode": "560103"
}
headers = {
    "Authorization": "Api-Key  <apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Change the address and pincode
const url = 'https://api.salaryboxapp.com/v2/customer/v1/company/';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Api-Key  <apiKey>', 'Content-Type': 'application/json'},
  body: '{"address":"3rd Floor, Prestige Tech Park, Outer Ring Road, Bengaluru","pincode":"560103"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Change the address and pincode
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

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

	payload := strings.NewReader("{\n  \"address\": \"3rd Floor, Prestige Tech Park, Outer Ring Road, Bengaluru\",\n  \"pincode\": \"560103\"\n}")

	req, _ := http.NewRequest("PUT", 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 Change the address and pincode
require 'uri'
require 'net/http'

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

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Api-Key  <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"address\": \"3rd Floor, Prestige Tech Park, Outer Ring Road, Bengaluru\",\n  \"pincode\": \"560103\"\n}"

response = http.request(request)
puts response.read_body
```

```java Change the address and pincode
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.salaryboxapp.com/v2/customer/v1/company/")
  .header("Authorization", "Api-Key  <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"address\": \"3rd Floor, Prestige Tech Park, Outer Ring Road, Bengaluru\",\n  \"pincode\": \"560103\"\n}")
  .asString();
```

```php Change the address and pincode
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.salaryboxapp.com/v2/customer/v1/company/', [
  'body' => '{
  "address": "3rd Floor, Prestige Tech Park, Outer Ring Road, Bengaluru",
  "pincode": "560103"
}',
  'headers' => [
    'Authorization' => 'Api-Key  <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Change the address and pincode
using RestSharp;

var client = new RestClient("https://api.salaryboxapp.com/v2/customer/v1/company/");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Api-Key  <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"address\": \"3rd Floor, Prestige Tech Park, Outer Ring Road, Bengaluru\",\n  \"pincode\": \"560103\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Change the address and pincode
import Foundation

let headers = [
  "Authorization": "Api-Key  <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "address": "3rd Floor, Prestige Tech Park, Outer Ring Road, Bengaluru",
  "pincode": "560103"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.salaryboxapp.com/v2/customer/v1/company/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```

### Set the GST number

**Request**

```json
{
  "gst_number": "29ABCDE1234F1Z5",
  "state": "Karnataka"
}
```

**Response**

```json
{
  "message": "Company details updated successfully",
  "status": true,
  "data": {
    "name": "Acme Inc",
    "address": "3rd Floor, Prestige Tech Park, Outer Ring Road, Bengaluru",
    "gst_number": "29ABCDE1234F1Z5",
    "pincode": "560103",
    "state": "Karnataka"
  }
}
```

**SDK Code**

```python Set the GST number
import requests

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

payload = {
    "gst_number": "29ABCDE1234F1Z5",
    "state": "Karnataka"
}
headers = {
    "Authorization": "Api-Key  <apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Set the GST number
const url = 'https://api.salaryboxapp.com/v2/customer/v1/company/';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Api-Key  <apiKey>', 'Content-Type': 'application/json'},
  body: '{"gst_number":"29ABCDE1234F1Z5","state":"Karnataka"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Set the GST number
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

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

	payload := strings.NewReader("{\n  \"gst_number\": \"29ABCDE1234F1Z5\",\n  \"state\": \"Karnataka\"\n}")

	req, _ := http.NewRequest("PUT", 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 Set the GST number
require 'uri'
require 'net/http'

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

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Api-Key  <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"gst_number\": \"29ABCDE1234F1Z5\",\n  \"state\": \"Karnataka\"\n}"

response = http.request(request)
puts response.read_body
```

```java Set the GST number
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.salaryboxapp.com/v2/customer/v1/company/")
  .header("Authorization", "Api-Key  <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"gst_number\": \"29ABCDE1234F1Z5\",\n  \"state\": \"Karnataka\"\n}")
  .asString();
```

```php Set the GST number
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.salaryboxapp.com/v2/customer/v1/company/', [
  'body' => '{
  "gst_number": "29ABCDE1234F1Z5",
  "state": "Karnataka"
}',
  'headers' => [
    'Authorization' => 'Api-Key  <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Set the GST number
using RestSharp;

var client = new RestClient("https://api.salaryboxapp.com/v2/customer/v1/company/");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Api-Key  <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"gst_number\": \"29ABCDE1234F1Z5\",\n  \"state\": \"Karnataka\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Set the GST number
import Foundation

let headers = [
  "Authorization": "Api-Key  <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "gst_number": "29ABCDE1234F1Z5",
  "state": "Karnataka"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.salaryboxapp.com/v2/customer/v1/company/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```