WHMCS currently doesn't expose any Plesk related info on either server credentials or the subscription ID, which makes the automation of Plesk API methods very hard and some even impossible. I would like to propose two ideas to make the automation of Plesk servers more convinient when using an automation server that is outside of WHMCS.
1. Expose a field like "externalid" for a WHMCS subscription, that stores the Plesk subscription/site ID.
Right now there is no such field exposed in any WHMCS API endpoint (like "GetClientsProducts"). This makes all Plesk API calls that need the site ID impossible to call from an automatic process, as Plesk itself doesn't give the site ID for a known domain name (which is also not failproof). I don't know about cPanel, but this seems like it should be available with all server modules, so we can automate the corresponding APIs for a known WHMCS subscription.
2. Make Plesk API calls possible from the WHMCS API
Variant A: Expose the Plesk Module API credentials from the server configuration panel in the "GetServers" endpoint.
As of now there is no way of getting the allready defined API credentials that WHMCS uses to create a subscription in Plesk. This in turn means that we must configure those in another environment with some relation ID (like WHMCS server ID). "GetServers" should provide that information. If exposing credentials is to risky, if have another idea:
Variant B: Expose a pass through method to call Plesk API methods from the WHMCS API.
As a variant for the previous idea an endpoint could be added that passes data to the Plesk API and sets the credentials by itself. Desireably you would provide the server ID and a data package for the target API (plesk in this case). WHMCS would then construct an internal call to the target API and set the allready defined API credentials. This would be alot harder to develop than variant A, but more secure as credentials are not populated over an endpoint.
Let me know what you think.