Importing invoices from Magento automatically

As suspected, the ClientID being supplied to the API is 12345, which isn’t a client on your account.

This should be a ClientID of an existing client. For example, see this post from my colleague:

But this value can also be pulled from another API function and stored if needed. It depends on your setup with the API and your clients.