Expand Items

Retrieves the next level of children of product in a bundle (in cart). The intent of this API is to improve performance when refreshing big product bundles in carts by returning child items when parent items are clicked.

GET /v2/cpq/carts/{cart_ID}/items/{item_ID}/expand

Remote Method

getExpandedItems

Handlers

REST Endpoint: APIExpandItemCartsCpqv2.cls
Implementation: CpqExpandCartItemActionV2.cls

Apex remote service

CpqAppHandler

Apex remote input map

{
  methodName: getExpandedItems
  productHierarchyPath:"01t36000004hM92AAE<01t36000004hM8xAAE"
  itemId: 80236000009E2InAAK
  cartId: 80136000000OXQvAAO
}

Package

Communication (vlocity_cmt)

API Parameters and Response Format

For API parameter names and descriptions, see Cart-Based API Swagger Reference.

Resource Information

Response Format JSON
Resource URL /services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/items/{item_ID}/expand

Example Request

GET 			/services/apexrest/vlocity_cmt/v2/cpq/carts/80146000000iwCx/items/80236000009E2InAAK/expand?productHierarchyPath=01t36000004hM92AAE<01t36000004hM8xAAE

Example Result

{
  "totalSize": 1,
  "messages": [],
  "records": [{
    "messages": [],
    "actions": {
      "expanditems": {
        "rest": {
          "params": {},
          "method": "GET",
          "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80136000000OXQvAAO/items/80236000009E2InAAK/expand?cartId=80136000000OXQvAAO&itemId=80236000009E2InAAK&productHierarchyPath=01t36000004hM92AAE<01t36000004hM8xAAE"
        },
        "remote": {
          "params": {
            "methodName": "getExpandedItems",
            "productHierarchyPath": "01t36000004hM92AAE<01t36000004hM8xAAE",
            "itemId": "80236000009E2InAAK",
            "cartId": "80136000000OXQvAAO"
          }
        },
        "client": {
          "params": {}
        }
      }
    },
    "displaySequence": -1,
    "Id": {
      "label": "Price Book Entry ID",
      "value": "01u36000009qFdRAAU"
    },
    "Pricebook2Id": {
      "label": "Price Book ID",
      "value": "01s36000006iLkuAAE"
    },
    "Product2Id": {
      "label": "Product ID",
      "value": "01t36000004hM8xAAE"
    },
    "ProductCode": {
      "label": "Product Code",
      "value": "es-aug-vhcild1"
    },
    "UnitPrice": {
      "label": "List Price",
      "value": null
    },
    "Name": {
      "label": "Product Name",
      "value": "es-aug-vhcild1"
    },
    "vlocity_cmt__RecurringPrice__c": {
      "label": "Recurring Price",
      "value": null
    },
    "IsActive": {
      "label": "Active",
      "value": true
    },
    "Product2": {
      "attributes": {
        "type": "Product2",
        "url": "/services/data/v41.0/sobjects/Product2/01t36000004hM8xAAE"
      },
      "Description": "es-aug-vhcild1",
      "Name": "es-aug-vhcild1",
      "vlocity_cmt__IsConfigurable__c": false,
      "vlocity_cmt__Type__c": "None",
      "vlocity_cmt__SubType__c": "None",
      "Id": "01t36000004hM8xAAE",
      "vlocity_cmt__JSONAttribute__c": null
    },
    "productId": "01t36000004hM8xAAE",
    "defaultQuantity": 1.0,
    "minQuantity": 0.0,
    "maxQuantity": 99999.0,
    "groupMinQuantity": 0,
    "groupMaxQuantity": 99999,
    "sequenceNumber": 1.00,
    "productChildItemId": "a1x36000002sB2zAAE",
    "productChildItemDefinition": {
      "attributes": {
        "type": "vlocity_cmt__ProductChildItem__c",
        "url": "/services/data/v41.0/sobjects/vlocity_cmt__ProductChildItem__c/a1x36000002sB2zAAE"
      },
      "vlocity_cmt__IsVirtualItem__c": true,
      "vlocity_cmt__ChildLineNumber__c": "1",
      "Name": "a1x36000002sB2z",
      "vlocity_cmt__SeqNumber__c": 1.00,
      "Id": "a1x36000002sB2zAAE",
      "vlocity_cmt__ChildProductId__r": {
        "attributes": {
          "type": "Product2",
          "url": "/services/data/v41.0/sobjects/Product2/01t36000004hM8xAAE"
        },
        "Name": "es-aug-vhcild1",
        "Id": "01t36000004hM8xAAE"
      },
      "vlocity_cmt__Quantity__c": 1,
      "vlocity_cmt__ParentProductId__c": "01t36000004hM92AAE",
      "vlocity_cmt__MinimumChildItemQuantity__c": 0,
      "vlocity_cmt__MaxQuantity__c": 99999,
      "vlocity_cmt__MaximumChildItemQuantity__c": 99999,
      "vlocity_cmt__IsRootProductChildItem__c": false,
      "vlocity_cmt__MinQuantity__c": 0,
      "vlocity_cmt__CollapseHierarchy__c": false,
      "vlocity_cmt__ParentProductId__r": {
        "attributes": {
          "type": "Product2",
          "url": "/services/data/v41.0/sobjects/Product2/01t36000004hM92AAE"
        },
        "Name": "es-aug-bundle",
        "Id": "01t36000004hM92AAE"
      },
      "vlocity_cmt__ChildProductId__c": "01t36000004hM8xAAE",
      "vlocity_cmt__IsOverride__c": false
    },
    "productHierarchyPath": "01t36000004hM92AAE<01t36000004hM8xAAE",
    "isVirtualItem": true,
    "attributeValues": {},
    "hasChildren": true,
    "itemType": "productGroup",
    "parentLineItemId": "80236000009E2InAAK",
    "productCategories": {
      "totalSize": 0,
      "messages": []
    },
    "childProducts": {
      "totalSize": 0,
      "messages": [],
      "records": [{
        "messages": [],
        "actions": {
          "addtocart": {
            "rest": {
              "params": {
                "items": [{
                  "parentId": "80236000009E2InAAK",
                  "parentHierarchyPath": "01t36000004hM92AAE<01t36000004hM8xAAE",
                  "itemId": "01u36000009qFeFAAU"
                }],
                "cartId": "80136000000OXQvAAO",
                "price": true,
                "validate": true,
                "includeAttachment": false,
                "pagesize": 20,
                "lastRecordId": null,
                "query": null
              },
              "method": "POST",
              "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80136000000OXQvAAO/items"
            },
            "remote": {
              "params": {
                "methodName": "postCartsItems",
                "items": [{
                  "parentId": "80236000009E2InAAK",
                  "parentHierarchyPath": "01t36000004hM92AAE<01t36000004hM8xAAE",
                  "itemId": "01u36000009qFeFAAU"
                }],
                "cartId": "80136000000OXQvAAO",
                "price": true,
                "validate": true,
                "includeAttachment": false,
                "pagesize": 20,
                "lastRecordId": null,
                "query": null
              }
            },
            "client": {
              "params": {}
            }
          },
          "getproductbyid": {
            "rest": {
              "params": {},
              "method": "GET",
              "link": "/services/apexrest/vlocity_cmt/v2/cpq/carts/80136000000OXQvAAO/products?cartId=80136000000OXQvAAO&id=01u36000009qFeFAAU"
            },
            "remote": {
              "params": {
                "methodName": "getCartsProductsById",
                "id": "01u36000009qFeFAAU",
                "cartId": "80136000000OXQvAAO"
              }
            },
            "client": {
              "params": {
                "cartId": "80136000000OXQvAAO",
                "id": "01u36000009qFeFAAU",
                "methodName": "getCartsProductsById"
              }
            }
          }
        },
        "displaySequence": -1,
        "Id": {
          "label": "Price Book Entry ID",
          "value": "01u36000009qFeFAAU"
        },
        "Pricebook2Id": {
          "label": "Price Book ID",
          "value": "01s36000006iLkuAAE"
        },
        "Product2Id": {
          "label": "Product ID",
          "value": "01t36000004hM97AAE"
        },
        "ProductCode": {
          "label": "Product Code",
          "value": "es-aug-addon1"
        },
        "UnitPrice": {
          "label": "List Price",
          "value": null
        },
        "Name": {
          "label": "Product Name",
          "value": "es-aug-addon1"
        },
        "vlocity_cmt__RecurringPrice__c": {
          "label": "Recurring Price",
          "value": null
        },
        "IsActive": {
          "label": "Active",
          "value": true
        },
        "Product2": {
          "attributes": {
            "type": "Product2",
            "url": "/services/data/v41.0/sobjects/Product2/01t36000004hM97AAE"
          },
          "Description": "es-aug-addon1",
          "Name": "es-aug-addon1",
          "vlocity_cmt__IsConfigurable__c": false,
          "vlocity_cmt__Type__c": "None",
          "vlocity_cmt__SubType__c": "None",
          "Id": "01t36000004hM97AAE",
          "vlocity_cmt__JSONAttribute__c": null
        },
        "productId": "01t36000004hM97AAE",
        "defaultQuantity": 0.0,
        "minQuantity": 0.0,
        "maxQuantity": 5.0,
        "groupMinQuantity": 0,
        "groupMaxQuantity": 99999,
        "sequenceNumber": 1.00,
        "productChildItemId": "a1x36000002sB39AAE",
        "productChildItemDefinition": {
          "attributes": {
            "type": "vlocity_cmt__ProductChildItem__c",
            "url": "/services/data/v41.0/sobjects/vlocity_cmt__ProductChildItem__c/a1x36000002sB39AAE"
          },
          "vlocity_cmt__IsVirtualItem__c": false,
          "vlocity_cmt__ChildLineNumber__c": "1",
          "Name": "a1x36000002sB39",
          "vlocity_cmt__SeqNumber__c": 1.00,
          "Id": "a1x36000002sB39AAE",
          "vlocity_cmt__ChildProductId__r": {
            "attributes": {
              "type": "Product2",
              "url": "/services/data/v41.0/sobjects/Product2/01t36000004hM97AAE"
            },
            "Name": "es-aug-addon1",
            "Id": "01t36000004hM97AAE"
          },
          "vlocity_cmt__Quantity__c": 0,
          "vlocity_cmt__ParentProductId__c": "01t36000004hM8xAAE",
          "vlocity_cmt__MinimumChildItemQuantity__c": 0,
          "vlocity_cmt__MaxQuantity__c": 5,
          "vlocity_cmt__MaximumChildItemQuantity__c": 99999,
          "vlocity_cmt__IsRootProductChildItem__c": false,
          "vlocity_cmt__MinQuantity__c": 0,
          "vlocity_cmt__CollapseHierarchy__c": false,
          "vlocity_cmt__ParentProductId__r": {
            "attributes": {
              "type": "Product2",
              "url": "/services/data/v41.0/sobjects/Product2/01t36000004hM8xAAE"
            },
            "Name": "es-aug-vhcild1",
            "Id": "01t36000004hM8xAAE"
          },
          "vlocity_cmt__ChildProductId__c": "01t36000004hM97AAE",
          "vlocity_cmt__IsOverride__c": false
        },
        "productHierarchyPath": "01t36000004hM92AAE<01t36000004hM8xAAE<01t36000004hM97AAE",
        "isVirtualItem": false,
        "attributeValues": {},
        "hasChildren": false,
        "itemType": "childProduct",
        "productCategories": {
          "totalSize": 0,
          "messages": []
        }
      }]
    }
  }]
}