Get Product List by Filter crm.product.list

Choose a tool for developing with an AI agent:

  • use Alaio Vibecode to build an app for Bitrix24 from a task description without knowing any programming language. The agent writes the code and deploys the app to a server, with no manual hosting setup
  • use the MCP server to develop a REST API integration in your own project. The agent refers to the official REST documentation

Scope: crm

Who can execute the method: any user

DEPRECATED

Development of this method has been halted. Please use catalog.product.list.

The method crm.product.list returns a list of products based on the filter.

Method Parameters

See the description of list methods.

Code Examples

How to Use Examples in Documentation

curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{"order":{"NAME":"ASC"},"filter":{"CATALOG_ID":"your_catalog_id"},"select":["ID","NAME","CURRENCY_ID","PRICE"]}' \
        https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/crm.product.list
        
curl -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -d '{"order":{"NAME":"ASC"},"filter":{"CATALOG_ID":"your_catalog_id"},"select":["ID","NAME","CURRENCY_ID","PRICE"],"auth":"**put_access_token_here**"}' \
        https://**put_your_bitrix24_address**/rest/crm.product.list
        
// callListMethod: Retrieves all data at once. Use only for small selections (< 1000 items) due to high memory load.
        
        var catalogId = prompt("Enter catalog ID");
        try {
          const response = await $b24.callListMethod(
            'crm.product.list',
            {
              order: { "NAME": "ASC" },
              filter: { "CATALOG_ID": catalogId },
              select: [ "ID", "NAME", "CURRENCY_ID", "PRICE" ]
            },
            (progress) => { console.log('Progress:', progress) }
          )
          const items = response.getData() || []
          for (const entity of items) { console.log('Entity:', entity) }
        } catch (error) {
          console.error('Request failed', error)
        }
        
        // fetchListMethod: Retrieves data in parts using an iterator. Use for large volumes of data for efficient memory consumption.
        
        var catalogId = prompt("Enter catalog ID");
        try {
          const generator = $b24.fetchListMethod('crm.product.list', {
            order: { "NAME": "ASC" },
            filter: { "CATALOG_ID": catalogId },
            select: [ "ID", "NAME", "CURRENCY_ID", "PRICE" ]
          }, 'ID')
          for await (const page of generator) {
            for (const entity of page) { console.log('Entity:', entity) }
          }
        } catch (error) {
          console.error('Request failed', error)
        }
        
        // callMethod: Manual control of pagination through the start parameter. Use for precise control over request batches. Less efficient for large data than fetchListMethod.
        
        var catalogId = prompt("Enter catalog ID");
        try {
          const response = await $b24.callMethod('crm.product.list', {
            order: { "NAME": "ASC" },
            filter: { "CATALOG_ID": catalogId },
            select: [ "ID", "NAME", "CURRENCY_ID", "PRICE" ]
          }, 0)
          const result = response.getData().result || []
          for (const entity of result) { console.log('Entity:', entity) }
        } catch (error) {
          console.error('Request failed', error)
        }
        
try {
            $order = []; // Define your order array
            $filter = []; // Define your filter array
            $select = ['ID', 'CATALOG_ID', 'PRICE', 'CURRENCY_ID', 'NAME', 'CODE', 'DESCRIPTION', 'DESCRIPTION_TYPE', 'ACTIVE', 'SECTION_ID', 'SORT', 'VAT_ID', 'VAT_INCLUDED', 'MEASURE', 'XML_ID', 'PREVIEW_PICTURE', 'DETAIL_PICTURE', 'DATE_CREATE', 'TIMESTAMP_X', 'MODIFIED_BY', 'CREATED_BY'];
            $startItem = 0; // Define your start item
            $result = $serviceBuilder
                ->getCRMScope()
                ->product()
                ->list($order, $filter, $select, $startItem);
            foreach ($result->getProducts() as $product) {
                print("ID: {$product->ID}\n");
                print("Catalog ID: {$product->CATALOG_ID}\n");
                print("Price: {$product->PRICE}\n");
                print("Currency ID: {$product->CURRENCY_ID}\n");
                print("Name: {$product->NAME}\n");
                print("Code: {$product->CODE}\n");
                print("Description: {$product->DESCRIPTION}\n");
                print("Description Type: {$product->DESCRIPTION_TYPE}\n");
                print("Active: {$product->ACTIVE}\n");
                print("Section ID: {$product->SECTION_ID}\n");
                print("Sort: {$product->SORT}\n");
                print("VAT ID: {$product->VAT_ID}\n");
                print("VAT Included: {$product->VAT_INCLUDED}\n");
                print("Measure: {$product->MEASURE}\n");
                print("XML ID: {$product->XML_ID}\n");
                print("Preview Picture: {$product->PREVIEW_PICTURE}\n");
                print("Detail Picture: {$product->DETAIL_PICTURE}\n");
                print("Date Create: " . (new DateTime($product->DATE_CREATE))->format(DateTime::ATOM) . "\n");
                print("Timestamp X: " . (new DateTime($product->TIMESTAMP_X))->format(DateTime::ATOM) . "\n");
                print("Modified By: {$product->MODIFIED_BY}\n");
                print("Created By: {$product->CREATED_BY}\n");
            }
        } catch (Throwable $e) {
            print("Error: " . $e->getMessage());
        }
        
var catalogId = prompt("Enter catalog ID");
        BX24.callMethod(
            "crm.product.list",
            {
                order: { "NAME": "ASC" },
                filter: { "CATALOG_ID": catalogId },
                select: [ "ID", "NAME", "CURRENCY_ID", "PRICE" ]
            },
            function(result)
            {
                if(result.error())
                    console.error(result.error());
                else
                {
                    console.dir(result.data());
                    if(result.more())
                        result.next();
                }
            }
        );
        

To retrieve product properties, you need to specify PROPERTY_* in select.

$arFields['select'] = array('*', 'PROPERTY_*');
        
require_once('crest.php');
        
        $catalogId = 'your_catalog_id'; // Replace 'your_catalog_id' with the actual catalog ID
        
        $result = CRest::call(
            'crm.product.list',
            [
                'order' => ['NAME' => 'ASC'],
                'filter' => ['CATALOG_ID' => $catalogId],
                'select' => ['ID', 'NAME', 'CURRENCY_ID', 'PRICE']
            ]
        );
        
        echo '<PRE>';
        print_r($result);
        echo '</PRE>';
        
// client and ctx are already created — see the Go SDK section
        res, err := client.Core().Call(ctx, "crm.product.list", b24.Params{
        	"order": b24.Params{
        		"NAME": "ASC",
        	},
        	"filter": b24.Params{
        		"CATALOG_ID": "your_catalog_id",
        	},
        	"select": []string{"ID", "NAME", "CURRENCY_ID", "PRICE"},
        }, b24.WithIdempotent())
        if err != nil {
        	return fmt.Errorf("crm.product.list: %w", err)
        }
        
        // The response arrives as json.RawMessage — unmarshal it
        // into a struct matching the response shape shown below on this page.
        fmt.Printf("%s\n", res.Result)