When creating an electronic invoice (EN), I get two errors:
1) ContactSender not selected
2) Sender's contact person is not full! You must specify the Sender completely. This contact person will receive a money transfer.
This is due to the fact that I in the request do not pass the identifier of the contacts of the sender, for the reason that I do not know where to get the same identifier.
For work, I use this library .
My request:
include "api2.php"; $np = new Api2('мой ключ'); $senderInfo = $np->getCounterparties('Sender', 1, '', ''); $sender = $senderInfo['data'][0]; $senderWarehouses = $np->getWarehouses($sender['City']); $result = $np->newInternetDocument([ // Данные отправителя 'FirstName' => $sender['FirstName'], 'MiddleName' => $sender['MiddleName'], 'LastName' => $sender['LastName'], 'Description' => $sender['Description'], 'Phone' => '0487447747', 'CitySender' => $sender['City'], 'SenderAddress' => $senderWarehouses['data'][0]['Ref'], 'ContactSender' => ?????????????????????? ], [ // Данные получателя 'FirstName' => 'Сидор', 'MiddleName' => 'Сидорович', 'LastName' => 'Сиродов', 'Phone' => '0509998877', 'City' => 'Киев', 'Region' => 'Киевская', 'Warehouse' => 'Отделение №3: ул. Калачевская, 13 (Старая Дарница)', ], [ 'DateTime' => date('dmY'), 'ServiceType' => 'WarehouseWarehouse', 'PaymentMethod' => 'Cash', 'PayerType' => 'Recipient', 'Cost' => '500', 'SeatsAmount' => '1', 'Description' => 'Кастрюля', 'CargoType' => 'Cargo', 'Weight' => '10', 'VolumeGeneral' => '0.5', 'BackwardDeliveryData' => [ [ 'PayerType' => 'Recipient', 'CargoType' => 'Money', 'RedeliveryString' => 4552, ] ] ] ); Well, the question itself, how to get the identifier of the sender's contacts?