K
K
katiet42021-03-20 12:36:40
Bitrix24
katiet4, 2021-03-20 12:36:40

When creating an order through the rest api in Bitrix24, an extra company and contact are created for the specified companyId, what could be the problem?

Order creation code:
$params_add_sale = ['fields' => ['lid' => 's1',
'personTypeId' => 4,
'UserId' => 2,
'currency' => 'RUB',
'dateInsert' => $lastday,
'statusId' => 'N',
'companyId' => 819,
'responsibleId' => 20,
'userDescription'=> $number_dogovor.','.$date_dogovor,
'additionalInfo' => $k ['ID']]];

$method_add_sale = '/sale.order.add';
$data_add_sale = $bx->call($method_add_sale, $params_add_sale);

Answer:
Array
(
[result] => Array
(
[order] => Array
(
[accountNumber] => 3824
[additionalInfo] => 1377
[canceled] => N
[clients] => Array
(
[0] => Array
(
[entityId] = > 1573
[entityTypeId] => 3
[id] => 4627
[isPrimary] => Y
[orderId] => 3824
)

[1] => Array
(
[entityId] => 1055
[entityTypeId] => 4
[id] => 4628
[isPrimary] => Y
[orderId] => 3824
)

)

[companyId] => 819
[currency] = > RUB
[dateInsert] => 2021-09-09T00:00:00+03:00
[dateStatus] => 2021-03-20T12:00:15+03:00
[dateUpdate] => 2021-03-20T12:00:15+03:00
[deducted] => N
[empStatusId] => 20
[id] => 3824
[lid] => s1
[payed] => N
[personTypeId ] => 4
[personTypeXmlId] =>
[propertyValues] => Array
(
...
)

[requisiteLink] => Array
(
...
)

[responsibleId] => 8
[statusId] => N
[statusXmlId] =>
[updated1c] => N
[userDescription] => 131К-01\20.01.02.2020
[userId] => 2
[xmlId] => bx_6055b99f37929
)

)

)

the clients field says about that a new company and contact has been created.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Nikolaev, 2021-03-20
@gromdron

This is a bug (or feature of behavior) that needs to be reported to technical support.
As far as I know, at the moment the connection between the order and the contacts/company via the rest api is not debugged.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question