Skip to content

Module Parameters

The module parameters are the data/values passed into each function when called. Every provisioning module function receives the same parameters. These parameters provide information about the specific product/service the module command runs for. The parameters also contains the settings from the product itself.

Variable NameDescription
serviceidThe unique ID of the service.
Database Field: tblhosting.id
useridThe unique ID of the account that owns the service.
Database Field: tblclients.id
This variable uses naming conventions that originated prior to WHMCS 8.0.
pidThe product ID for the service.
Database Field: tblproducts.id
serveridThe assigned server ID for the service.
Database Field: tblservers.id
domainThe domain entered by the customer when ordering.
Database Field: tblhosting.domain
usernameUsername generated for the service. (defaults to first 8 letters of the domain)
Database Field: tblhosting.username
passwordPassword generated for the service. (10 char generated on first creation consisting of letters & numbers, both upper & lowercase).
Database Field: tblhosting.password
producttypeThe product type which can be one of hostingaccount, reselleraccount, server or other.
moduletypeThe module name (will match filename of module).
configoptionXwith X being from 1 to 24.
These fields contain the module settings for the product defined in the ConfigOptions function.
clientsdetailsContains an array of all client details service owner. This contains things like firstname, lastname, email, address1, country, etc…
customfieldsContains an array of all custom fields defined on the product.
The key is the custom field name - $params['customfields']['Field Name'].
configoptionsContains an array of all the configurable options defined on the product.
Again the key being the option name in this case - $params['configoptions']['Option Name Here'].
servertrue/false - Is the product assigned to a server.
serveripThe IP Address of the selected server.
serverhostnameThe Hostname of the selected server.
serverusernameThe Username of the selected server.
serverpasswordThe Password of the selected server.
serveraccesshashThe Access Hash of the selected server.
serversecuretrue/false - Is an SSL connection enabled in the Server Configuration.
serverportThe server port if module supports override with custom port

Config Options

Config Options (do not confuse with Configurable Options) are the module's settings. These are defined in the ConfigOptions function of the module. Config Options are set on a per product basis. Supplied as a numbered list: $params[‘configoption1’], $params[‘configoption2’], etc. Defined by the order specified in the ConfigOptions function of the module.

Note: Every module function except the _ConfigOptions function receives the $params array. The _ConfigOptions function is unique because it is the only function that is not called in relation to a specific client instance of a product or service.

Custom Fields & Configurable Options

Values from any custom fields & configurable options are passed into modules as parameters. Passed as an array with the key being the name of the field or option.

For example for a custom field called “Username”, would become $params[‘customfields’][‘Username’]. Likewise, a configurable option named “Disk Space”, would become $params[‘configoptions’][‘Disk Space’].