---
schema_version: "1"
id: 84d0333a2c170a383f774fdd17900aa401f593c3b2b66b4960b4ec0f4b12153b
title: Get Featured Offers API
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/industries/cme/guides/comms-t-get-featured-offers-api.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-featured-offers-api.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: c5056c28cc332f2c8144513d151c3c9be85f053d28e0ccd3e334493a604788ea
products:
  - Communications, Media, Energy and Utilities APIs (Managed Package)
  - Industries Developer Documentation
---
# Get Featured Offers API

The Get Featured Offers API provides the ability to retrieve a list of offers (products or promotions) that are modeled within the shared catalog which are sorted by a specified Catalog Product Relationship field. The specified catalog_code identifies the catalog that contains the offers. Offer eligibility can be determined by API parameters that support both anonymous and known user journeys.

This API supports 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. Also see [Digital Commerce REST API](https://developer.salesforce.com/docs/industries/cme/references/dc-rest1?meta=Summary).

## Rules Supported

- [Context Eligibility Rules with Digital Commerce](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

- The Catalog should have the CatalogCode**c field populated. No spaces are permitted in CatalogCode**c.

- Products should have ProductCode populated. No spaces are permitted 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.

- Catalog should be attached to a default price list through DefaultPriceList**c field on Catalog**c object.Pricelist entries should exist for all the products attached to the catalog.

- All products present under associated promotions ( for a catalog ), must also have a relationship with catalog. Products should be added to Catalog, before adding them to any promotion associated with the catalog.

- A record should be created under the Vlocity API Metadata object for getOffers API. This can be populated by running a batch job named as LOAD API METADATA which is present under CMT Administration > Cacheable API Jobs.

- Optional: To cache records that are associated with the getOffers API you can optionally run the Populate API Cache batch job (located in CMT Administration > Cacheable API Jobs). After populating, context eligibility and pricing records, you can also run the batch job using the following statement:

  `database.executeBatch(new BatchCacheProcessor('getOffers'));`

- The Interface Implementation under ProductAvailability and ProductEligibiltiy is ignored. You must use Context Eligibility Rules to determine eligibility of Products. PricingRule and Tightest match for prices are not supported; however, base prices, adjustments, and override prices are supported.

## Parameters

For detailed API response descriptions, see [Digital Commerce REST API](https://developer.salesforce.com/docs/industries/cme/references/dc-rest1?meta=Summary).

## Response

For detailed API response descriptions, see [Digital Commerce REST API](https://developer.salesforce.com/docs/industries/cme/references/dc-rest1?meta=Summary).

## Get Featured Offers for an Anonymous User

You can return featured offers using the getOffersByCatalog API with the **sortby** parameter. First, populate the **Sequence Number** field for products and promotions in the catalog. Then make an API call similar to the following:

```nolang
GET /v3/catalogs/{catalog_code}/offers
```

```nolang
Method:
GET

API:
/services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers?sortby={namespace}__SequenceNumber__c_ASC
```

## Get Featured Offers for a Logged In User

You can return featured offers using the getOffersByCatalog API for a logged in user with the sortby parameter. First, populate the **Sequence Number** field for products and promotions in the Catalog. Then make an API call similar to the following:

```nolang
GET /v3/catalogs/{catalog_code}/offers?context={"accountId":"{account number}"}&loggedIn=true
```

```nolang
Method:
GET

API:
/services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers?sortby=vlocity_cmt__SequenceNumber__c_ASC&context={"accountId":"{0016A0000053kHN"}&loggedIn=true
```
