Syntax
bool approveTrialAccount( string api_key, int account_id );
Parameters
api_key
(string)The key required to access the API. See Getting Started for more information.
account_id
(int)The ID of the trial Account to upgrade.
Return Value
Returns true if the sub-Account is successfully upgraded. Returns false if the sub-Account has already been upgraded.
Examples
In the following example, trial Account ID 234 is upgraded to paid status.
$account_id = 234; // can be obtained using searchAccounts()
$api = new Api($url, 'YOURAPIKEY');
$result = $api->invokeMethod('approveTrialAccount', $account_id);
$api = new Api($url, 'YOURAPIKEY');
$result = $api->invokeMethod('approveTrialAccount', $account_id);
{
"id": 1,
"method": "approveTrialAccount",
"params": [
"YOURAPIKEY",
234
]
}
"id": 1,
"method": "approveTrialAccount",
"params": [
"YOURAPIKEY",
234
]
}
{
"id": 1,
"result": true,
"error": null
}
"id": 1,
"result": true,
"error": null
}
Remarks
When the Account is upgraded, the system will send a notification message to the owner User of the upgraded Account.
Error Codes
This method may return the following error codes in addition to the standard error codes:
Code | Error | Description |
---|---|---|
310 |
no Account ID specified | The account_id argument was not provided, or it is not a number. |
321 |
invalid Account ID specified | The Account you specified is not one of your sub-Accounts (check this using searchAccounts). |
328 |
invalid Account ID specified | The Account you specified is not one of your sub-Accounts (check this using searchAccounts). |
329 |
You are logged into a trial Account | You have not upgraded your own Account yet. |