The DeleteAccount service allows an agency to delete an existing sub-account.
SOAP Action: DeleteAccount
SOAP Return Object:DeleteAccountResp
The following table describes the parameters used for calling the DeleteAccount service.
Parameter | Mandatory | Type | Description |
---|---|---|---|
header | Y | APIRequestHeader | Header for authentication |
The following table describes the parameters returned from the DeleteAccount service.
Parameter | Mandatory | Type | Description |
---|---|---|---|
header | / | APIResponseHeader | Header containing authentication information |
errorCode | / | Integer | Numerical value of the error |
errorMessage | / | String | Short literal description of the error |
0 | No error |
---|---|
220 | Authentication error, see header object for detailed information |
221 | Account does not exist |
Delete agency sub-account with userId 888
<?php // create header object $header = new stdClass(); $header->userId = USER_ID; $header->userToken = USER_TOKEN; // create account object $account = new stdClass(); $account->userId = 888; $request = new stdClass(); $request->header = $header; $request->accountType = $account; $response = $SoapClient->__soapCall("DeleteAccount", array($request)); if ($response->errorCode == 0) { echo "Account delete"; } else { echo Account deletion failed: " . $response->errorMessage; } ?>