Update of client via PHP-SDK deletes contact

I’m using your PHP-SDK and InvoiceNinja v5.4.9 to change the group and some custom values of a client with this code:

$client = $ninja->clients->update(“123”,[“group_settings_id” => “456”]);
$client = $ninja->clients->update(“123”,[“custom_value2” => “a”, “custom_value3” => “b”, “custom_value4” => “c”]);

That almost works as expected. But when doing this, the contact of this client gets deleted. Below shown contact fields are empty after running my code.


Obviously I’m doing something wrong. Can you give me a hint?

@meisterkeks

We expect all the contacts to be pushed back with the client, so if you include the contacts array, you’ll get what you expect :slight_smile:

1 Like

Thank you for your fast response!