The REST URL you posted is working when the invoices don't have a lot of items. You are getting "Internal Error" because internally some invoices are returning the error "Allowed memory size of 402653184 bytes exhausted (tried to allocate 131072 bytes)", this when is added
orderItem[id,order[id,userRecord[username]]]
I got the same error with just one invoice, on my case the invoice have more than 1500 items, this is a lot of items.
Your mask is very big in depth and there are a lot of data to retrieve, for that reason Ruber recommends here Softlayer rest call giving multiple entries for invoice in json response when object filter is applied to relational properties use some programming language in order to retrieve all data you required:
Basically you need to do the following:
Step 1:
Get all invoices by using SoftLayer_Account::getInvoices, based on you requirements it should be something like this:
https://api.softlayer.com/rest/v3/SoftLayer_Account/getInvoices?objectFilter={"invoices":{"createDate":{"operation":"betweenDate","options":[{"name":"startDate","value":["03/25/2017 00:00:00"]},{"name":"endDate","value": ["04/24/2017 23:59:59"]}]},"typeCode":{"operation":"RECURRING"}}}&objectMask=mask[id,createDate]
This will return the ID of all invoices, you will need this in the following step
Step 2:
For each retrieved invoice use the method SoftLayer_Billing_Invoice::getItems, use resultLimits and your mask as following.
https://api.softlayer.com/rest/v3/SoftLayer_Billing_Invoice/[invoiceId]/getItems?resultLimit=100,0&objectMask=mask[id,recurringFee,recurringTaxAmount,oneTimeFee,oneTimeTaxAmount,description,hostName,domainName,hourlyRecurringFee,laborFee,laborTaxAmount,setupFee,setupTaxAmount,category[name],location[longName],billingItem[id,activeFlag,hourlyFlag,allowCancellationFlag,cancellationDate,orderItem[id,order[id,userRecord[id,username]]]]]
Change [invoiceId] by each ID you retrieved in the step 1.
On this case you need to use loops, the first loop to call SoftLayer_Billing_Invoice::getItems for each invoice and the second loop to retrieve items 100 by 100.(Instead of 100 you can set another value in resultLimit parameter)
If you set resultLimit=100,1 it will return all items between 101 to 200. I suggest to review https://sldn.softlayer.com/article/using-result-limits-softlayer-api
I recommend to use languajes like Python, Java, Go, Ruby, etc. You can see the list here https://sldn.softlayer.com/article/softlayer-api-overview.
Note: Unfortunately the object-filters feature is not supported by SoftLayer Java API.
I hope this help you.
Regards,