Invalid Client Error
If you're getting the following error when authenticating with the Xero API:
{ "error": "invalid_client" }
according to the Xero OAuth 2.0 Troubleshooting Guide you will get this error if the client_id or client_secret you pass in are incorrect. They recommend that you make sure you have the correct credentials for your app and to double check your client id in My Apps and try generating a new secret if required.
The Xero API Token Management: Best Practices and Troubleshooting guide also has a lot of useful information.