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

# \_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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.fieldmotion.com/fieldmotion-api-docs/invoices/_list.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
