Skip to content

Instantly share code, notes, and snippets.

@chechuironman
Last active August 29, 2015 14:01
Show Gist options
  • Save chechuironman/d71bf8c5eae846499b33 to your computer and use it in GitHub Desktop.
Save chechuironman/d71bf8c5eae846499b33 to your computer and use it in GitHub Desktop.
Get invoicing details from order id
##################################################################################
# Get invoicing details from order id
# ©Copyright IBM Corporation 2014.
# LICENSE: MIT (http://opensource.org/licenses/MIT)
# modules used:
# pprint, softlayer-api
##################################################################################
import SoftLayer.API
from pprint import pprint as pp
apiUsername = 'xxxx'
apiKey = 'xxxxx'
client = SoftLayer.Client(
username=apiUsername,
api_key=apiKey,
)
billing_order_id = xxxx
object_mask='mask[items[billingItem[hoursUsed,hourlyRecurringFee,description,recurringFee],order[initialInvoice[invoiceTopLevelItems[hostName, domainName]]]]]'
billing_order = client['Billing_Order'].getObject(id=billing_order_id, mask=object_mask)
pp(billing_order)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment