Defining Context Eligibility Rules

The instructions in this topics explain how to apply context eligibility rules when configuring an offer or a basket. In this case, you have a product bundle with a child product where you can override the product pricing, including the child item price, and apply context eligibility rules.

Before You Begin

  1. Create a product offering within the product designer

  2. Create an account for SLA_GOLD.

  3. Create an account for SLA_PLATINUM.

  4. Create a catalog relationship.

To apply context eligibility rules while configuring an offer:

  1. From the Product Console, under the Product Management category, search for and select the product you want to configure.

  2. Click the Pricing facet.

  3. Click the pencil icon to edit the recurring price.

  4. Under Recurring Price, apply a context rule: Click the Context Rules tab.

  5. Click Add Rule Set.

    Add a Rule Set

  6. In the Vlocity Rule Lookup dialog, search for and apply a context rule.

  7. Add a pricing adjustment with a context rule for your product:

    1. From the Product Console or Product Designer, under the Product Management category, search for and select the promotion you want to configure. Alternatively, you can create a promotion.

    2. Click the Product Adjustments facet.

    3. Click the desired row in the Product Adjustments table.

    4. Click the Product Pricing tab.

    5. Click the Adjustments tab.

      Promotion Adjustments

    6. Click New.

    7. Add information for Price List Entry, then click Save.

      Price List Entry

    8. Click the pencil icon, click the Context Rules tab, and click Add Rule Set.

    9. Search for and add the rule set for SLA_GOLD, then click Save.

      If the context rule for SLA_GOLD exists, then the pricing adjustment applies. For pricing charges (under the Charges tab), the discount applies only when the account is SLA_GOLD.

  8. From Vlocity CMT Administration:

    • Click CPQ Configuration Setup and ensure ContextRuleEnabled is set to true.

    • Run the Product Hierarchy Maintenance job.

    • Run the Clear Managed Platform Cache job.

    • Run Populate API Cache jobs.

  9. In your API platform, set the HTTP method to GET and run the Offers API:

    • For logged-in users, use the following example as a guide:

      /services/apexrest/ckg_integ_cme/v3/catalogs/CATALOG-CODE-5269/offers/Product?context={"accountId":"0015e00000VXR5D"}&isloggedin=true

    • For anonymous users, use the following example as a guide:

      /services/apexrest/ckg_integ_cme/v3/catalogs/CATALOG-CODE-5269/offers/Product?context={"AccountStatus":"Active"}

    The accountId is the deciding factor to ensure which context rules qualify for this API. Running the Get Offers API for SLA=GOLD with the adjustment applied produces the original base price and the new override price.

  10. Obtain the response body of the Offers API, which contains the response of the getOfferDeatails API. You can configure the response by changing the attribute values or the quantity of the offers.

  11. In your API platform, set the HTTP method to POST and enter the Configure Offers API:

    • For logged-in users, use the following example as a guide:

      /services/apexrest/ckg_integ_cme/v3/catalogs/CATALOG-CODE-5269/offers/Product?context={"accountId":"0015e00000VXR5N"}&isloggedin=true

    • For anonymous users, use the following example as a guide:

      /services/apexrest/ckg_integ_cme/v3/catalogs/CATALOG-CODE-5269/offers/Product?context={"AccountStatus":"Active"}

  12. Add the response body of the Offers API to the Configure Offers API request body and run the API.