> This page is for API Reference.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://fiftytwo-demo.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://fiftytwo-demo.ferndocs.com/_mcp/server.

# Get department by ID and chain

GET https://api.fiftytwo.com/masterdata/departments/v1/chain/{chainId}/{departmentId}



Reference: https://fiftytwo-demo.ferndocs.com/api/master-data/reference/departments/get-department-by-id-and-chain

## Request

### Path parameters

- `departmentId` (long, required) — The ID of the department to retrieve
- `chainId` (integer, required) — The ID of the chain

## Response

### 200

Success

- `departments` (list of DepartmentsDepartmentsItems, required)

## Errors

### 400 Bad Request Error

Bad Request

- `string`

## Types

### DepartmentsDepartmentsItems

- `departmentId` (integer, required) — The ID of the department.
- `description` (string, optional) — Short text information about the department.
- `account` (string, optional) — Account to use for on accounting journals relating to the department.
- `vatCode` (integer, optional) — Used for the following purposes:Deduction of VAT for export salesRecalculation of price in case of VAT changesSpecification of VAT for special customersCalculation of gross profit on departments
- `variantIds` (list of integer, optional) — A list of variant groups that this department uses. Each ID refers to a variant such as Color or Size. Adding a variant here makes it available for all articles belonging to this department.
- `modifierIds` (list of integer, optional) — A list of modifier groups available within this department. Modifiers represent optional add-ons—such as gift wrapping or extra components—that can be selected when handling articles in this department.
- `specificationIds` (list of integer, optional) — A list of specification groups relevant to this department. Specifications describe product features or technical attributes, such as display type or performance characteristics.

## Examples

**Response**

```json
{
  "departments": [
    {
      "departmentId": 10,
      "description": "department 10",
      "account": "1234567890",
      "vatCode": 2,
      "variantIds": [
        201,
        202
      ],
      "modifierIds": [
        301,
        302
      ],
      "specificationIds": [
        401
      ]
    },
    {
      "departmentId": 11,
      "description": "department 11",
      "account": "0987654321",
      "vatCode": 3,
      "variantIds": [
        203
      ],
      "modifierIds": [
        303,
        304
      ],
      "specificationIds": [
        402,
        403
      ]
    }
  ]
}
```

**SDK Code**

```python Departments_getDepartmentByIdAndChain_example
import requests

url = "https://api.fiftytwo.com/masterdata/departments/v1/chain/1/1"

response = requests.get(url)

print(response.json())
```

```javascript Departments_getDepartmentByIdAndChain_example
const url = 'https://api.fiftytwo.com/masterdata/departments/v1/chain/1/1';
const options = {method: 'GET'};

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

```go Departments_getDepartmentByIdAndChain_example
package main

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

func main() {

	url := "https://api.fiftytwo.com/masterdata/departments/v1/chain/1/1"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Departments_getDepartmentByIdAndChain_example
require 'uri'
require 'net/http'

url = URI("https://api.fiftytwo.com/masterdata/departments/v1/chain/1/1")

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

request = Net::HTTP::Get.new(url)

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

```java Departments_getDepartmentByIdAndChain_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.fiftytwo.com/masterdata/departments/v1/chain/1/1")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.fiftytwo.com/masterdata/departments/v1/chain/1/1');

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

```csharp Departments_getDepartmentByIdAndChain_example
using RestSharp;

var client = new RestClient("https://api.fiftytwo.com/masterdata/departments/v1/chain/1/1");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift Departments_getDepartmentByIdAndChain_example
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.fiftytwo.com/masterdata/departments/v1/chain/1/1")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

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