Bundle Wrapper API

The Bundle Wrapper API takes the catalog code and offerId and populates the bundle wrapper in the cache, which consists of the in-memory order line item objects used during basket operations. You must execute this API for each product offerId that you received in the response from the Catalog Profile API.

You can obtain the offerId required in the URI of this API from the result of the apiResponse.data.catalogProductRelationDetails.Product node in the response body of the Catalog Profile API.

Precondition

You must first run the Catalog Profile API to obtain the offerId required in the request body of this API.

URI

/services/apexrest/{namespace}/v3/admin/catalogs/{catalogCode}/offers/{offerId}/bundlewrapper

HTTP Method

POST

No parameters need to be passed in the POST body.

URI Parameters

If you specify just one of these two parameters, it follows the behavior described in the table below and accepts your defined time for the parameter you specified. If you are using one or both parameters, you must specify them with the same values for all of the Populate Cache APIs in this sequence.

Parameter Example Default Optional/Required Notes
effectiveStartTime 2001-07-04T12:08:56 Current date and time Optional effectiveStartTime is the time that you want your cached catalog entries to be effective. It should be in the UTC date-time format. Your effectiveStartTime must occur after the current time for which you are executing the Populate Cache APIs or you will receive an error message.
expirationTime 2001-07-04T12:08:56 effectiveStartTime + TimeToLive Optional expirationTime is the time that you want your cached catalog entries to expire. It should also be in the UTC date-time format. Your expirationTime must occur after your effectiveStartTime or you receive an error message. TimeToLive is a custom setting created in CPQ Configuration Setup. It has a default value of 30 days.

Here is an example of how to pass the URI parameters:

GET /services/apexrest/vlocity_cmt/v3/admin/catalogs/AS-Test-Catalog/bundlewrapper?effectiveStartTime=2021-07-04T12:08:56&expirationTime=2021-08-04T12:08:56

Remote API

This is an example of how you invoke the API using Apex:

String methodName;
Map<String, Object> input = new Map<String, Object>();
Map<String, Object> output = new Map<String, Object>();
Map<String, Object> options = new Map<String, Object>();
// Setting remote parameters

methodName = 'getOfferDetailsToBundle';
String body = '{}' ;

input.put('apiName', 'CMBundleWrapper');   // required
input.put('methodName', methodName);       // required
input.put('catalogCode', 'mobiles');       // required
input.put('offers', '01t4W00000BgaKvQAJ'); // required
input.put('effectiveStartTime', null);     // optional
input.put('expirationTime', null);         // optional
input.put('requestBody',body);
input.put('requestURL', '/v3/admin/catalogs/mobiles/offers/01t4W00000BgaKvQAJ/bundlewrapper'); // required

//remote action invocation
vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler();
appHandler.invokeMethod(methodName, input, output, options);

Parallel Invocation

You can run this API in parallel for multiple offers. For example, if there are 10 catalogs (Catalog1, Catalog2..Catalog 10) and each catalog has 100 offers, you can run this API for all 1,000 offers in parallel threads.

THREAD1 -  GET /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/offers/offer1/bundlewrapper
THREAD2 -  GET /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/offers/offer2/bundlewrapper
......
THREAD10 -  GET /services/apexrest/{namespace}/v3/admin/catalogs/catalog1/offers/offer10/bundlewrapper
THREAD11 -  GET /services/apexrest/{namespace}/v3/admin/catalogs/catalog2/offers/offer11/bundlewrapper
......
THREAD1000 -  GET /services/apexrest/{namespace}/v3/admin/catalogs/catalog10/offers/offer/bundlewrapper

HTTP Headers

Header Description
Content-Type application/json

Response Body

This example shows the catalog code, offer Id, and other details.

{
  "cacheKey": "7d61d12269ad083e59e84a80a7c846aa",
  "apiResponse": {
    "assetRefIdToItemIdMap": {},
    "bundleContextKey": null,
    "idToXLIMap": {
      "8024W00000BMysKQAT": {
        "Id": "8024W00000BMysKQAT",
        "vlocity_cmt__AssetReferenceId__c": "3cc84430-b88e-4d5f-aebf-a058bdaf0324",
        "vlocity_cmt__CurrencyPaymentMode__c": "currency",
        "vlocity_cmt__Action__c": "Add",
        "vlocity_cmt__ProvisioningStatus__c": "New",
        "UnitPrice": 0,
        "OrderId": "8014W00000468jiQAA",
        "Product2Id": "01t4W00000BgaKvQAJ",
        "vlocity_cmt__Product2Id__c": "01t4W00000BgaKvQAJ",
        "vlocity_cmt__LineNumber__c": "0001",
        "vlocity_cmt__ProductHierarchyPath__c": "01t4W00000BgaKvQAJ",
        "PricebookEntryId": "01u4W00000A0GdgQAF",
        "Quantity": 1,
        "attributes": {
          "url": "/services/data/v51.0/sobjects/OrderItem/8024W00000BMysKQAT",
          "type": "OrderItem"
        }
      }
    },
    "lineItemskeyMap": {},
    "lineItemType": "OrderItem",
    "lineKeyToAttributeShapeMap": null,
    "lineKeyToBundleShapeMap": null,
    "lineKeyToPromoShapeMap": null,
    "parentLineKeyToChildLinekeys": null,
    "promoCodeToItemIds": {},
    "rootItemId": null,
    "rootLineKey": null,
    "xliIdToAppliedPromotionItemsMap": {},
    "xliIdToPriceAdjustmentsMap": {}
  },
  "catalogCode": "mobiles",
  "errorCode": "INVOKE-200",
  "error": "OK"
}

HTTP Response Codes

Code Description
200 OK
500 Internal Server Error