get_items_by_class_m Sample Call and Response
This example returns the inventory items belonging to one item class. It is based on the get_items_by_class_m method as defined in plsql_m_r73.yml.
This example covers the single required filter and a representative set of item attributes. It does not cover every optional attribute that an inventory item can carry.
Sample call
{
"rest_call": "get_items_by_class_m",
"output_format": "json",
"client_no": 100234,
"auth_key": "8f3d2a19c6b74e0a9d1f5c6e7a8b9c0d",
"filter_class_no": 4021
}
The filter_class_no field is the only argument this method accepts beyond client_no and auth_key, and it is required; there is no alternative client-defined identifier for the item class in this method. In this example, filter_class_no 4021 identifies the "Electronics Accessories" item class. The rest_call and output_format fields are added by the REST layer and are not part of the method's own argument list.
Sample response
{
"error_code": 0,
"error_msg": "OK",
"class_items": [
{
"item_no": 90441,
"item_label": "USB-C Charging Cable, 2m",
"service_no": 3301,
"service_desc": "Inventory Item Fulfillment",
"client_sku": "ACC-USBC-2M",
"price": 14.99,
"item_plan": 6601,
"item_months": 0,
"currency_cd": "usd",
"class_no": 4021,
"class_label": "Electronics Accessories",
"stock_level": 482.0,
"avg_ratings": 4,
"num_ratings": 118,
"num_reviews": 42,
"image_url": "https://cdn.acmewidgets.com/items/90441.png",
"image_text": "USB-C charging cable",
"client_service_id": "SVC-FULFILL",
"client_item_plan_id": "ACC-PLAN-01"
},
{
"item_no": 90442,
"item_label": "Wireless Earbuds, Black",
"service_no": 3301,
"service_desc": "Inventory Item Fulfillment",
"client_sku": "ACC-EARBUD-BLK",
"price": 59.99,
"item_plan": 6601,
"item_months": 0,
"currency_cd": "usd",
"class_no": 4021,
"class_label": "Electronics Accessories",
"stock_level": 137.0,
"avg_ratings": 5,
"num_ratings": 76,
"num_reviews": 29,
"image_url": "https://cdn.acmewidgets.com/items/90442.png",
"image_text": "Wireless earbuds in black",
"client_service_id": "SVC-FULFILL",
"client_item_plan_id": "ACC-PLAN-01"
},
{
"item_no": 90443,
"item_label": "Protective Phone Case",
"service_no": 3301,
"service_desc": "Inventory Item Fulfillment",
"client_sku": "ACC-CASE-STD",
"price": 19.99,
"item_plan": 6601,
"item_months": 0,
"currency_cd": "usd",
"class_no": 4021,
"class_label": "Electronics Accessories",
"stock_level": 310.0,
"avg_ratings": 4,
"num_ratings": 54,
"num_reviews": 18,
"image_url": "https://cdn.acmewidgets.com/items/90443.png",
"image_text": "Protective phone case",
"client_service_id": "SVC-FULFILL",
"client_item_plan_id": "ACC-PLAN-01"
}
]
}
An error_code of zero, paired with an error_msg of "OK", indicates the call succeeded. The class_items array shown here contains three representative items belonging to item class 4021; a class with a larger catalog could return many more entries. The error_details field is left out of this response entirely because it is a nonpublic field not exposed to callers. The client_item_id field is also left out, because it is deprecated as of version forty-three.