> 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/stockcategory/_addstock.md).

# \_addStock

Adds a Stock item to a Stock Category.

### Parameters

#### stock\_id

The stock item ID add to the category.

#### cat\_id

The stock category ID which the stock item will be added to..

### Example

```
FM_api('StockCategory_addStock', ['stock_id' => '5', 'cat_id' => '7' ])
```

### Result

#### On Success

```
{'ok':1}
```

#### On failure

If the cat\_id is not provided in the parameters. {'error':'no cat\_id'}

If the stock\_id is not provided in the parameters. {'error':'no stock\_id'}

If the stock category does not exist. {'error':'stock category does not exist'}
