---
schema_version: "1"
id: f70909c5a25fba9bb9ad13b9b5d231e5306a9a46ebde231e124dc0c2687d8da6
title: Get Contains Products API
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/industries/cme/guides/comms-t-get-contains-products-api.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-contains-products-api.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 769bbc422e82f8e6a8ef73a20b9420f01e0588caf31311441f6cc5f697c14259
products:
  - Communications, Media, Energy and Utilities APIs (Managed Package)
  - Industries Developer Documentation
---
# Get Contains Products API

This API retrieves offers for the specified product code. This API is a variation of the [Get Offers by Catalog API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offers-by-catalog-api.md). The response includes orderable offers (promotions and products) that contain the specified product. A cart ID is not required.

A promotion includes all the products associated with the promotion, including the root-level product.

This API support a flag called isloggedin to indicate whether a user is logged in or anonymous. If the isloggedin parameter is true, it indicates a logged-in user, and an accountId must be specified in the context parameter of the API call. If the isloggedin flag is false, it indicates that the user is anonymous.

See [Get Offer Details API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offer-details-api.md) for more information and examples. See [Digital Commerce REST API](https://developer.salesforce.com/docs/industries/cme/references/dc-rest1?meta=Summary).

## Rules supported

- [Context Eligibility Rules for Products and Promotions](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-context-eligibility-rules.md)

- Response contains Base Prices only (see [Product Pricing in EPC](https://help.salesforce.com/s/articleView?id=ind.comms_product_pricing_in_epc.htm))

- [Using Context Rules with Digital Commerce APIs](https://help.salesforce.com/s/articleView?id=ind.comms_using_context_rules_with_digital_commerce_apis.htm)

- No advanced rules are supported.

## Prerequisites

- Catalog should have CatalogCode**c populated and no space is allowed in CatalogCode**c.

- Products should have ProductCode populated and no space is allowed in ProductCode.

- Promotions should have Code**c populated and no space is allowed in Code**c.

- Catalog should be present with products and promotions attached to it as records under CatalogProductRelationship\_\_c object.

- The catalog should be attached to a default price list through DefaultPriceList**c field on Catalog**c object.

- Price list entries should exist for all products attached to the catalog.

- The [Product Hierarchy Maintenance](https://help.salesforce.com/s/articleView?id=ind.comms_product_hierarchy_maintenance.htm) job should be run before executing this API.

## Parameters

For API parameter names and descriptions, see [Digital Commerce REST API](https://developer.salesforce.com/docs/industries/cme/references/dc-rest1?meta=Summary).

## Response

A response code of 201 indicates a successful call while 400 indicates a failed response.

For detailed API response descriptions, see [Digital Commerce REST API](https://developer.salesforce.com/docs/industries/cme/references/dc-rest1?meta=Summary).

## Get Contains Products for an Anonymous User

Example: Retrieve an offer with a specific product code for an anonymous user:

```nolang
Method: GET
/v3/catalogs/{catalog_code}/offers?contains={product_code}
```

```nolang
GET /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers?contains={offer_code}
```

## Get Contains Products for a logged-in User

Example: Retrieve an offer with a specific product code for a logged-in user:

```nolang
Method: GET
/v3/catalogs/{catalog_code}/offers?contains={product_code}&context={"accountId":"{account_ID}"}&loggedIn=true
```

```nolang
GET /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers?contains={offer_code}?context={"accountId":"{account_ID}"}&loggedIn=true
```
