Get Product Fields crm.product.fields
Scope:
crmWho can execute the method: any user
Method development has been halted
The method crm.product.fields continues to function, but there are more relevant alternatives catalog.product.*.
The method crm.product.fields returns the description of product fields.
Without parameters.
Code Examples
How to Use Examples in Documentation
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/crm.product.fields
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/crm.product.fields
try
{
const response = await $b24.callMethod(
"crm.product.fields",
{}
);
const result = response.getData().result;
if(result.error())
{
console.error(result.error());
}
else
{
console.dir(result);
}
}
catch(error)
{
console.error('Error:', error);
}
try {
$fieldsResult = $serviceBuilder->getCRMScope()->product()->fields();
$fieldsDescription = $fieldsResult->getFieldsDescription();
foreach ($fieldsDescription as $field) {
if (isset($field['DATE_CREATE'])) {
$field['DATE_CREATE'] = (new DateTime($field['DATE_CREATE']))->format(DateTime::ATOM);
}
if (isset($field['TIMESTAMP_X'])) {
$field['TIMESTAMP_X'] = (new DateTime($field['TIMESTAMP_X']))->format(DateTime::ATOM);
}
print($field['ID'] . ': ' . $field['NAME'] . PHP_EOL);
}
} catch (Throwable $e) {
print('Error: ' . $e->getMessage() . PHP_EOL);
}
BX24.callMethod(
"crm.product.fields",
{},
function(result)
{
if(result.error())
console.error(result.error());
else
console.dir(result.data());
}
);
require_once('crest.php');
$result = CRest::call(
'crm.product.fields',
[]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
Returned Data
Required parameters are marked with *
|
Name |
Description |
|
ACTIVE |
Active |
|
CATALOG_ID |
Catalog identifier |
|
CREATED_BY |
Created by |
|
CURRENCY_ID |
Currency identifier |
|
DATE_CREATE |
Product creation date |
|
DESCRIPTION |
Description |
|
DESCRIPTION_TYPE |
Description type |
|
DETAIL_PICTURE |
Detailed picture, field available in the old product card |
|
ID |
Product identifier |
|
MEASURE |
Unit of measurement |
|
MODIFIED_BY |
Modified by |
|
NAME* |
Name |
|
PREVIEW_PICTURE |
Preview picture, field available in the old product card |
|
PRICE |
Price |
|
SECTION_ID |
Section identifier |
|
SORT |
Sorting |
|
TIMESTAMP_X |
Product modification date |
|
VAT_ID |
VAT rate identifier |
|
VAT_INCLUDED |
VAT included in price |
|
XML_ID |
External code |