---
schema_version: "1"
id: 965b3e26b898fefee37cc2a8878993823b00f0a47543c8d302c6d4c9c1d8fe4b
title: Post Offer Details for an Anonymous User
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/industries/cme/guides/comms-t-post-offer-details-for-an-anonymous-user.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/comms-t-post-offer-details-for-an-anonymous-user.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 0dc4269a37ad4ec3416977d98c555a105a13459f95c28d1736afcdaacb09fd2e
products:
  - Communications, Media, Energy and Utilities APIs (Managed Package)
  - Industries Developer Documentation
---
# Post Offer Details for an Anonymous User

This example demonstrates how to add promotions.

```nolang
POST /v3/catalogs/{catalog_code}/offers/{offer_code}
```

Ensure you have:

- Created a catalog that contains both products and promotions.

- Set the CacheAPIPartialConfigure custom setting to true. Also, ensure you have set the CacheAPIFields custom setting to true. You set custom parameters in Vlocity CMT Administration -> CPQ Configuration Setup.

- Run the appropriate Cacheable API batch jobs. From the Vlocity CMT Administration &gt; Cacheable API Jobs screen, run the Load API Metadata job. Running this job populates metadata to the metadata classes and also some metadata settings.

- Run the Populate API Cache job by clicking **Start**. From the Populate API Cache window, select GetOfferDetails and GetPrices.

You can use the Configure Offer API with a two-step process to easily configure an offer.

1.  Execute the API with a GET method to retrieve the offer details structure. For example:

    ```nolang
    GET
    /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers/{offer_code}
    ```

2.  After receiving a result from the API call, copy the result and use it as the body for the POST call. Before executing the POST call, remove the contextKey from the body, then edit any of the body parameters as appropriate to configure the offer. When finished, execute the call and verify that the result is as expected.

    ```nolang
    POST
    /services/apexrest/vlocity_cmt/v3/catalogs/{catalog_code}/offers/{offer_code}

    Request body (truncated):
    {"result":{"offerDetails":{"offer":{"offerType":"Promotion","childProducts":[{"priceResult":[{"adjustments"...

    ```

3.  The next step applies validation rules, pricing, and updates the response with the PromoDetails structure. In the response from the previous step, under the validateAndPriceAction, you will see the transactionKey REST parameter. Add the transactionKey in the request body to make the request. In the following example, the request body has been truncated for clarity.

    ```nolang
    POST
    /services/apexrest/vlocity_cmt/v3/catalogs/Mobiles/offers/iPhone8Offer?forceinvalidatecache=true

    Request body (truncated):
    {"transactionKey": "on08j8/KOpxKTOTzjndq8F3yoFA7FMYeLyhnYywJt2jok0JZr6Bq3StBYDnoTwYl","result":{"offerDetails":{...
    ```

    **note:** The forceinvalidatecache parameter is used only for debugging purposes. When enabled by a server setting, forceinvalidatecache=true forces a cache refresh.
