---
schema_version: "1"
id: 9059fd1a8bf93b28384e6663ceb6d8b381b4a6f3e7ad16ace8b1e3bcc52450c8
title: "SDK Example: getCatalogOffers with the contains parameter (Fall '19)"
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/industries/cme/guides/comms-t-sdk-examplegetcatalogoffers-with-the-contains-parameterfall19-.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/comms-t-sdk-examplegetcatalogoffers-with-the-contains-parameterfall19-.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: bc12dba34a96bb5d22aca1fb86e6d8185ee422906e46256e70d0d81af94e7341
products:
  - Communications, Media, Energy and Utilities APIs (Managed Package)
  - Industries Developer Documentation
---
# SDK Example: getCatalogOffers with the `contains` parameter (Fall '19)

Use the example SDK code in this topic to get catalog offers with the `contains` parameter.

```nolang
// Instantiate the input object for getOffers 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.contains = "iPhone8"; // find all offers that CONTAIN "iPhone8" - optional
input.customFields = ["customAttribute__c"]; // optional field which returns custom fields for given keys

// Invoke GetContainsProducts API via method getOffers()
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."

"GetOffersContainsInput::getAPIPath() should not have both sortBy and contains."

"GetOffersInput::getAnonymousRestUrl() must have catalogCode."

"GetOffersContainsInput::getAnonymousRestUrl() should not have both sortBy and contains."
