# \_list

Returns a list of invoice details

### Parameters

all of these parameters are optional

#### fields

JSON-encoded list of fields you want returned along with the default 'id' field. Accepted fields are 'num', 'cdate', 'customer\_id', 'customer\_type', 'last\_edited', 'status'

#### open

If set, this filters the invoices to those that with statuses -1=Draft, 0=Quoted, 1=Invoiced

#### status

Integer. Only invoices with this status will be returned

#### customer\_type, customer\_id

Integers. If both of hese are set, then invoices with the specified customer type and ID will be returned

#### days\_from

Integer. Invoices created in the last $days\_from days will be returned

#### days\_to

Integer. Invoices created up to %days\_to days from now will be returned

#### last\_edited\_from

Integer timestamp. Invoices edited from this time on will be returned

#### last\_edited\_to

Integer timestamp. Invoices edited up to this time will be returned. NOTE: if using this for synchronising purposes, it is best to use a timestamp a few seconds into the past, to make sure you don't miss any updates that happen in the very second you make your request.

#### ids

JSON-encoded list of IDs to return

### Example

```
FM_api('Invoices_list', [
	'fields'=> '["cdate","last_edited","status"]',
	'last_edited_from'=> '1611316345',
	'last_edited_to', '1611316473',
	'status'=> '3',
]);
```

#### On Success

```
[{"id":"698362","cdate":"2021-01-22","last_edited":"1611316345","status":"3"},{"id":"698363","cdate":"2021-01-22","last_edited":"1611316345","status":"3"}]
```


---

# 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/invoices/_list.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.
