---
schema_version: "1"
id: 762c4b91220958f9e31ec99e72234a08a4da461ce3ed91bca2bf4508c585a6dd
title: Get Offer Details API
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/industries/cme/guides/comms-t-get-offer-details-api.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offer-details-api.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 49e6c4572c21b082275b5a07c272b06768e2d32a341b7df9fa9805ede230d840
products:
  - Communications, Media, Energy and Utilities APIs (Managed Package)
  - Industries Developer Documentation
---
# Get Offer Details API

This API retrieves detailed information about a specific offer (either product or promotion). The API returns the full hierarchy of a product or promotion as defined in the product catalog.

The API response is created from the pre-cached results present in the sObject (current caching layer). The API also handles cache misses. Along with returning the offer detail, the API caches the data for future requests. Prices, adjustments, and overrides are returned along with offers. The API does not use the Salesforce ID as part of the request and response parameters.

**note:** Get Offer Details API supports cross-catalog basket and cart operations when products belong to different catalogs but have the same price list.

This API supports the **isloggedin** flag to indicate whether a user is logged in or anonymous. If the **isloggedin** flag 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.

When executing the Get Offers Details API for anonymous users, Digital Commerce supports the following:

- Base adjustments, overrides, monthly recurring charges, and non-recurring charges.

- Product context eligibility rules are not supported for anonymous and known users for Get Offer Details.

- Starting in CME Spring '22, Digital Commerce supports retrieving usage-based price. When creating a pricing element for usage-based pricing, the usage quantity is defaulted to 1 and you must specify the associated unit of measure.

When executing the Get Offers Details API for known users, Digital Commerce supports the following:

- Pricing context eligibility rules by tightest match in the API response.

- Base adjustments, overrides, monthly recurring charges, and non-recurring charges.

- Starting in CME Spring '22, Digital Commerce supports retrieving usage-based price. When creating a pricing element for usage-based pricing, the usage quantity is defaulted to 1 and you must specify the associated unit of measure.

See [Get Offer Details API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-get-offer-details-api.md) and [Digital Commerce REST API](https://developer.salesforce.com/docs/industries/cme/references/dc-rest1?meta=Summary).

## Rules Supported

- Anonymous users: Context eligibility rules and qualification rules for products and promotions are not supported.

- Known users: [Context Eligibility Rules](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-context-eligibility-rules.md) rules and [Qualification Rules for Price Lists](https://help.salesforce.com/s/articleView?id=ind.comms_qualification_rules_for_price_lists.htm) are supported.

- 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.

- Catalog should be attached to a default price list through DefaultPriceList**c field on Catalog**c object.

- Price list entries should exist for all the products attached to the catalog.

- A record should be created under Vlocity API Metadata object for getOfferDetails API; this can be populated by running a batch job named as `LOAD API METADATA`, which is present under CMT Administration → Cacheable API Jobs.

- To cache records related to the getOfferDetails API, run the batch job named [Populate API Cache](https://help.salesforce.com/s/articleView?id=ind.comms_populate_api_cache.htm).

  Another way is to run the job is through anonymous block using the following statement (After populating, context eligibility and pricing records): `database.executeBatch(new BatchCacheProcessor('getOfferDetails'));`

- Create a custom setting called [CacheAPIFields](https://help.salesforce.com/s/articleView?id=ind.comms_t_cpq_configuration_settings_reference_148927.htm) with a value of true. CacheAPIFields is not required for CME 103.1.14 and later versions.

## Parameters

For API parameter names and descriptions, see [Digital Commerce REST API](https://developer.salesforce.com/docs/industries/cme/references/dc-rest1?meta=Summary).

For information about returning Product2 or Promotion fields that are not returned by default, see [Retrieving Additional Product2 or Promotion Fields](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-retrieving-additional-product2-or-promotion-fields.md).

## Response

For detailed API response descriptions, see [Digital Commerce REST API](https://developer.salesforce.com/docs/industries/cme/references/dc-rest1?meta=Summary).

## Get Offer Details for an Anonymous User

`GET /v3/catalogs/{catalog_code}/offers/{offer_code}`

In the examples below, substitute your own values for the following parameters:

- myCatalog = Catalog Code

- myOfferCode = Offer Code

- myPromotion = Promotion Code

- account - account_ID

Example: Retrieve a list of offers for a specified product:

```nolang
Method: GET

API:
/services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers/{product_code}
```

Example: Retrieve offer details about a specific promotion:

```nolang
Method: GET

API:
/services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers/{promotion_code}
```

## Get Offer Details for a Logged-In User

Example: Retrieve a list of offers for a specified product:

```nolang
GET /v3/catalogs/{catalog_code}/offers/{offer_code}?context={"accountId":"0016A0000053kHN"}&isloggedIn=true
```

```nolang
Method: GET

API:
/services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers/{product_code}?context={"accountId":"0016A0000053kHN"}&isloggedIn=true
```

Example: Retrieve offer details about a specific promotion:

```nolang
Method: GET

API:
/services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers/{product_code}?context={"accountId":"0016A0000053kHN"}&isloggedIn=true
```

### Cross-Catalog Support for Get Offer Details APIs

Get Offer Details API supports cross-catalog operations when products belong to different catalogs but have the same price list. You can add offers to the baskets from different catalogs having the same price lists. For example, in the following table, there are two catalogs having products belonging to the same price lists. If you make the cross call, the `GetOfferDetails` API returns a successful response, getting the details of the offers when called using different catalogs to which they belong.

| Catalog   | Products  |
| :-------- | :-------- |
| Catalog 1 | Product 1 |
| Catalog 2 | Product 2 |

Full product responses received for GetOfferDetails call to:

- /services/apexrest/vlocity_cmt/v3/catalogs/Catalog1/offers/Product2
- /services/apexrest/vlocity_cmt/v3/catalogs/Catalog2/offers/Product1
