November 23, 2017
Determine Required items
Each Package is aware of a list of ItemCategories that make sense for that Package.
This list is called the Packages "Configuration". Within the configuration,
the Package may identify certain categories that are required, meaning you must include
an ItemPrice from that category in any order you make against that Package

Important manual pages:
@Author: SoftLayer Technologies, Inc. <>
import SoftLayer

API_USERNAME = 'set-me'
API_KEY = 'set-me'
package = 46

client = SoftLayer.Client(username=API_USERNAME, api_key=API_KEY)
Only retrieve the boolean to determine if this category
is required and the category name and ID
categoryObjectMask = "mask[isRequired, itemCategory[id, name]]"

# Retrieve a list of category configurations associated with our chosen package
configurations = client['Product_Package'].getConfiguration(mask=categoryObjectMask, id=package)
For each price we only want the id, the ID of the category(ies) it is a member of,
and the item description
pricesObjectMask = "mask[id;item.description;]"

# Get all itemPrices for this package
prices = client['SoftLayer_Product_Package'].getItemPrices(mask=pricesObjectMask, id=package)

# Text format for our prettified output
headerFormat = '%s - %s:'
priceFormat = '    %s -- %s'

for configuration in configurations:
    We are only concerned with required categories...
    skip it if we do not need it!
    if not configuration['isRequired']:
    print(headerFormat % (configuration['itemCategory']['name'],
    for price in prices:
        if 'categories' not in price:
        l = list(filter(lambda x: x.get('id') == configuration['itemCategory']['id'], price['categories']))
        if len(l):
            print(priceFormat % (price['id'], price['item']['description']))


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