<?php
namespace Bitrix24\CRM\Company;
$company = new Bitrix24\CRM\Company();
//Get list of company items.
$start = 0;
$order = { "DATE_CREATE": "ASC" };
$filter = { "INDUSTRY": "MANUFACTURING", "COMPANY_TYPE": "CUSTOMER" };
$select = [ "ID", "TITLE", "CURRENCY_ID", "REVENUE" ];
$result = $company->getList($order, $filter, $select, $start);
$result->data();
//Add a new company to CRM
$fields = {
"TITLE": "Best Coffees LLC",
"COMPANY_TYPE": "CUSTOMER",
"INDUSTRY": "MANUFACTURING",
"EMPLOYEES": "EMPLOYEES_2",
"CURRENCY_ID": "GBP",
"REVENUE" : 3000000,
"LOGO": { "fileData": document.getElementById('logo') },
"OPENED": "Y",
"ASSIGNED_BY_ID": 1,
"PHONE": [ { "VALUE": "555888", "VALUE_TYPE": "WORK" } ]
};
$company->add($fields)->data();
//Updates the specified (existing) company
$company->update($bitrix24CompanyId, $fields);
//Returns a company associated with the specified company ID.
$company->get($bitrix24CompanyId);
//Deletes the specified company and all the associated objects
$company->delete($bitrix24CompanyId);
//Returns the description of the fields available to company.
$company->fields();