> For the complete documentation index, see [llms.txt](https://docs.fieldmotion.com/fieldmotion-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fieldmotion.com/fieldmotion-api-docs/department/_setcustomertypes.md).

# \_setCustomerTypes

### Parameters

#### id

The id of the edited Department

#### val

An array with the IDs of the chosen Customer Types

### Example

```
FM_api(
    'Department_setCustomerTypes',[
        'id' => '337119',
        'val' => json_encode(['60020','60021'])
    ]
);
```

### Results

#### On Success

```
{"ok":1}
```

#### On Failure

If no 'id' parameter value is given

```
{"error":"no id supplied"}
```

If no 'val' parameter value is given

```
{"error":"no val supplied"}
```

If the 'val' parameter is not in the correct format

```
{"error":"val should be a JSON-encoded array of intergers"}
```

If there is no Department matching the given 'id'

```
{"error":"department does not exist"}
```
