November 23, 2017


 * Get the recurring cost of a single server or all servers on your account.
 * Get a list of servers on a SoftLayer account along with their recurring
 * monthly costs. We can get that by calling getHardware() in the
 * SoftLayer_Account API service with an object mask to retrieve cost.
 * Important manual pages
 * License: http:'
 * Author: SoftLayer Technologies, Inc. <>
require_once ('C:/scripst/getdetails/SoftLayer/SoapClient.class.php');

// Your SoftLayer API username and key.
$apiUsername = 'set me';
$apiKey = 'set me';

 * Method one: Getting the cost for every server on your account.
 * Create a connection to the SoftLayer_Account API service and call the
 * getHardware() method to get a list of hardware on our account. Put an object
 * mask in the API call to retrieve the cost associated with hardware to get
 * every server's cost along with our hardware records.
$client = Softlayer_SoapClient::getClient('SoftLayer_Account', null, $apiUsername, $apiKey);

// Adding the object mask to the call.
$objectMask = new SoftLayer_ObjectMask();

try {
    // Retrieving our account's hardware records.
    $hardware = $client->getHardware();
} catch (Exception $e) {
    die('Unable to retrieve hardware list: ' . $e->getMessage());



If this article contains any error, or leaves any of your questions unanswered, please help us out by opening up a github issue.
Open an issue