_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 which allows extra data about the Customers to also be returned:

  • street_address1

  • cdate

  • last_edited

  • is_flagged

  • is_active

  • account_number

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"}]

Last updated