Starting with the Account service and calling getNextInvoiceTopLevelBillingItems
, you can fetch all the active Billing Items, including those just recently ordered in the current billing cycle.
Tacking on an object mask that contains invoiceItems[createDate,hostName,domainName,resourceTableId,notes]
will allow you to fetch the associated invoice items, including the invoice line for something just recently ordered within the cycle. This will let you get an object ID that you can pull virtual guest or bare metal details with (among other things).
However, resourceTableId
is blank (null) for newly created services. The other fields are filled out properly, but just the id of the system or service is missing. Everything else created outside the billing cycle will have the resourceTableId returned.
Is there some alternative way to resolve the resourceTableId
from the Billing Items returned by getNextInvoiceTopLevelBillingItems
?
Unfortunately, there no exists an alternative way to resolve the "resourceTableId", because this item invoice which has a null value is generated for the new order, in that moment the resources have yet to be determined or assigned (hardwareId) to item invoice.
Updated
1: {
"allowCancellationFlag": 1
"cancellationDate": null
"categoryCode": "server"
"createDate": "2016-04-05T12:48:12-03:00"
"cycleStartDate": "2016-04-05T12:48:12-03:00"
"description": "Single Intel Xeon E3-1250 v2 (4 Cores, 3.60 GHz)"
"domainName": "example.com"
"hostName": "test"
"id": 90120222
"laborFee": "0"
"laborFeeTaxRate": "0"
"lastBillDate": "2016-04-05T12:48:12-03:00"
"modifyDate": "2016-04-05T15:21:30-03:00"
"nextBillDate": "2016-05-04T02:00:00-03:00"
"oneTimeFee": "0"
"oneTimeFeeTaxRate": "0"
"orderItemId": 114652123
"parentId": null
"recurringFee": "0"
"recurringFeeTaxRate": "0"
"recurringMonths": 1
"serviceProviderId": 1
"setupFee": "0"
"setupFeeTaxRate": "0"
"invoiceItems": [1]
0: {
"createDate": "2016-04-05T12:48:12-03:00"
"domainName": "example.com"
"hostName": "test"
"resourceTableId": null
"invoice": {
"typeCode": "NEW"
}-
}-
-
"resourceTableId": 123123
}
I got this: "resourceTableId": 123123