When there is an account which doesn't require any documents the API returns an empty string instead of an array or null. The SDK assumes its always an array which will throw an exception:

$accounts['documents'] is in this case an empty string instead of an array.