SDK Example: getCatalogOffers without the contains parameter (Fall '19)

Use the example SDK code in this topic to get catalog offers without the contains parameter.

// Instantiate the input object for getCatalogOffers to specify parameters
const input = digitalCommerce.createGetOffersInput();
input.catalogCode = "Phones"; // use your Catalog Code
input.offset = 0; // use for pagination - optional
input.pageSize = 5; // use for pagination - optional
input.isLoggedIn = true; // use to fetch offers based on given accountId - optional
input.context = '{"accountId":"ACCOUNT ID", "contractId":"CONTRACT ID"}'; // use to fetch offers based on context params - optional
input.includeAttributes = ["ishidden__c", "customAttribute__c"]; //includeExtraOfferAttributes as part of the query string of the API which includes extra passed attributes with default attributes in Offer - optional
input.customFields = ["customAttribute__c"]; // optional field which returns custom fields for given keys

// Invoke GetOffersByCatalog API via method getCatalogOffers()
digitalCommerce
  .getOffers(input)
  .then(result => {
    Logger.info("vlocity get offers anonymous user rest call" + result);
  })
  .catch(error => {
    Logger.info("get offers anonymous user rest call failed" + error);
  });

Possible error conditions:

"GetOffersInput::getAPIPath() must have catalogCode."

"GetOffersInput::getAnonymousRestUrl() must have catalogCode."