get_inventory_items_m Sample Call and Response
This example lists every inventory item configured for a client, based on the get_inventory_items_m definition in methods_m_r73.yml. Inventory items represent non-subscription offerings, such as physical devices, resource items, and one-time fees, that can be purchased alongside or independently of a plan.
This example shows the full request, which accepts no filtering arguments, and a representative subset of the inventory items a client might have configured, covering three different item types. It does not cover the full field set for any single item; that detail is returned by the related get_inventory_item_details_m method, described separately.
Sample call
{
"rest_call": "get_inventory_items_m",
"output_format": "json",
"client_no": 12345,
"auth_key": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6"
}
The rest_call and output_format fields are envelope fields added by the REST layer rather than arguments defined in the yml file. Client_no and auth_key are the only two required arguments; get_inventory_items_m always returns every inventory item configured for the client. This example omits the optional locale_no, locale_name, and include_translations arguments, since it does not request translated field values.
Sample response
{
"error_code": 0,
"error_msg": "OK",
"inventory_items": [
{
"item_no": 30021,
"item_name": "5G Home Router - Model X200",
"item_type": 0,
"client_sku": "RTR-X200",
"active_ind": 1,
"purchase_scope": 1,
"stock_level": 482.0,
"installment_terms": [
{
"installment_term_no": 4521,
"client_installment_term_id": "12MO-DEVICE-FIN",
"installment_term_name": "12-Month Device Financing",
"is_default": 1
}
]
},
{
"item_no": 30022,
"item_name": "Wireless Signal Booster",
"item_type": 0,
"client_sku": "BST-100",
"active_ind": 1,
"purchase_scope": 0,
"stock_level": 1350.0
},
{
"item_no": 30090,
"item_name": "Early Termination Fee",
"item_type": 3,
"client_sku": "ETF-STD",
"active_ind": 1,
"purchase_scope": 0
}
]
}
An error_code of 0 with error_msg of "OK" indicates the lookup succeeded. Item_type distinguishes the kind of inventory item: a value of 0 means a standard inventory item, and a value of 3 means a fee, as shown on item 30090; the yml file also defines 1 for months to stack and 2 for resource item, neither of which appears in this example. Purchase_scope of 1 on item 30021 means that item can be purchased only with a qualifying plan, while a value of 0 means no purchase restriction applies. The stock_level field is present only for the two physical items, 30021 and 30022, and is omitted for the fee item, 30090, since stock tracking does not apply to fees. Installment_terms is shown only for item 30021 to illustrate a device that offers financing; the other two items in this example have no installment terms configured. The inventory_items array would normally list every inventory item defined for the client; this example shows three representative entries rather than an exhaustive list. This example omits the optional item_translations array, since the request does not set include_translations to request translated values, and it omits client_item_id, which the yml file marks with a deprecate_version and therefore excludes from this example entirely.