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

# \_list

Lists all Customers, can use given parameters as filters for returned results.

### Parameters

#### last\_edited

A filter which removes Customers that were last edited outside the range between the date given and when this function is run.

#### is\_active

An optional filter based on if Customers are active or not:\
0 => Only inactive Customers\
1 => Only Active Customers

#### check\_parent

An optional filter which checks the **parent-customer-selection** Setting , if this parameter is set to 1 and **parent-customer-selection** is set to 1, Parent Customers are not included in the results.

#### fields

A JSON-encoded array naming the fields which are to be returned. Valid values are:

account\_number, id, name, notes, email, last\_edited, industry, street\_address1, street\_address2, town, county, postcode, landline, mobile, contact\_name, changes, edited\_uuid, appId, cdate, appointments\_open, appointments\_closed, custom\_values, callback, account\_manager, meta, callback\_notes, lead\_acc, parent\_id, latitude, longitude, is\_active, country, created\_by, files, department\_id, city, state, last\_edited\_all, is\_flagged, contacts, has\_invoices, type, price\_band, accounts\_name, accounts\_number, credit\_terms, area\_id

### Examples

Without the "fields" parameter:

```
FM_api('Customers_list',[
    'last_edited'=> date('Y-m-d H:i:s', strtotime("yesterday")),
    'is_active'=>'1',
    'check_parent'=>'1'
  ]
);
```

With the "fields" parameter:

```
FM_api('Customers_list',[
    'last_edited'=> date('Y-m-d H:i:s', strtotime("yesterday")),
    'is_active'=>'1',
    'check_parent'=>'1',
    'fields'=>json_encode(
      [
        'is_active',
        'cdate'
      ]
    )
  ]
);
```

### Results

Without the "fields" parameter:

```
[{"id":"683138","name":"A Test Customer","is_active":"1"},{"id":"683139","name":"A Test Customer2","is_active":"1"}]
```

With the "fields" parameter, including the **is\_active** and **cdate** fields.

```
[{"id":"683136","name":"A Test Customer","is_active":"1","cdate":"2023-12-10 12:46:32"},{"id":"683137","name":"A Test Customer2","is_active":"1","cdate":"2023-12-10 12:46:32"}]
```
