I am trying to pull the user information from a billing item using PHP - just like in this example: https://knowledgelayer.softlayer.com/procedure/how-extract-user-billing-information-using-softlayers-api.
My code:
?php
require_once __DIR__.'/vendor/autoload.php';
.
.
.
$client = \SoftLayer\SoapClient::getClient('SoftLayer_Account', null, $apiUsername, $apiKey);
$mask = "mask[id,orderItem[id,order[userRecordId,userRecord[username]]],invoiceItem[id,totalRecurringAmount]]";
$client->setObjectMask($mask);
$userBill = $client->getNextInvoiceTopLevelBillingItems();
?>
However, I get this error if invoiceItem included in the mask.
PHP Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Server] Internal Error in /opt/devices/vendor/softlayer/softlayer-api-php-client/src/SoapClient.php:200
Stack trace:
#0 /opt/devices/vendor/softlayer/softlayer-api-php-client/src/SoapClient.php(200): SoapClient->__call('getNextInvoiceT...', Array, NULL, Array, Array)
#1 /opt/devices/invoiceProd3.php(17): SoftLayer\SoapClient->__call('getNextInvoiceT...', Array)
#2 /opt/devices/invoiceProd3.php(17): SoftLayer\SoapClient->getNextInvoiceTopLevelBillingItems()
#3 {main}
thrown in /opt/devices/vendor/softlayer/softlayer-api-php-client/src/SoapClient.php on line 200
When the mask is limited to orderItem, all is good. That is, this mask works just fine.
$mask = "mask[id,orderItem[id,order[userRecordId,userRecord[username]]]];
However, no luck with invoiceItem.
"mask[id,invoiceItem[id,totalRecurringAmount]]";
I'm using the 9/25/2015 soap client.