# \_deleteByIds

Delete a range of Stock items by their IDs.

### Parameters

#### ids

The range of IDs for the stock items to be deleted, in the form of xxx-yyy.

### Example

```
FM_api('Stock_deletebyIDs', ['ids'=>'123-456']);
```

### Result

#### On Success

The amount of stock that was deleted. For example:

```
{"ok":1,'deleted':56}
```

#### On Failure

If the user is not logged in:

```
{'error':'not logged in'}
```

If the user is not the main account user:

```
{'error':'only the main account user can delete by IDs'}
```

If the range of IDs are not given or are in the wrong format:

```
{'error':'IDs not in 123-456 format'}
```

If there are no stocks within the given range of IDs:

```
{'error':'no stock in the database has IDs in that range'}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fieldmotion.com/fieldmotion-api-docs/stock/_deletebyids.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
