Skip to main content

Dynamic Offers


Dynamic Offers

Dynamic Offers allow you to set up rules to dynamically display product plans, prices, and other elements, such as images, to different groups of end users. You can also define how discounts are applied to the prices. Each time Zephr receives a request, the rule engine will evaluate the input data and return relevant values for each element in the offer. This feature makes it easier to implement a comprehensive product display plan and customised pricing strategy.

  • Dynamic Offers provides an API-based integration that allows you to use Zephr's rules engine to build logic for when and how offers should display. Your frontends can then take the response from the dynamic offers decision API and use it to show the offers to your end users. For more information about different ways to integrate with Zephr, see Integration Methods.
  • The Dynamic Offer Decision Engine Public API is used to send requests to the decision engine. The API examples topic provides examples of the API request and response.
  • To use this feature, you must use Zuora Billing as the payment provider. 

You can define rules for the following types of properties in a dynamic offer: 

  • Product: The products available in your Catalogue. In the Rules Builder, you can create product outputs containing either one or more payment options that are defined in your Catalogue.
  • Price: The price book item associated with each product rate plan charge. Note: The Price property ONLY supports the Zuora Billing integration.

During the execution of a dynamic offer, the product rule will be run first to determine the product output that will be returned. The price rule will then be run against all the prices associated with each product in the output and determine which prices will be returned. For more information about how to work with the Price rules builder, see Price Rule.

  • Tagline: Customised string
  • Discount: Discounts you want to apply to the product in specific conditions
  • Customised Property: Customised string, enum, number values, or Zephr components

You can specify inputs that are needed for your rules. Available options are as follows: 

  • session: Session ID
  • IP: IP address
  • user_agent: The browser that the end user is using to access the page
  • path: The path of the page that is being visited
  • content_id: The unique ID of the content that is being visited

In addition, you can add custom input fields to a dynamic offer. The custom inputs can be used to form the rules.  

How Dynamic Offer Works?

The following flow demonstrates how dynamic offers work:

  1. Create a dynamic offer in the Zephr console
  2. Set up the integration with the dynamic offer API for your website
  3. Each time an end-user visits your website, a request that contains the required data will be sent to the Zephr rule engine, and Zephr will evaluate the data and return results accordingly.
  4. Your website will display elements to the end user based on the returned data.

Note: The tutorial below only covers step 1 in the above flow. To enable the rules to work for your websites, you must make sure step 2 is properly set.

Create a Dynamic Offer

Before creating a dynamic offer, you must make sure that in the Zuora tenant, the products and the associated price books are properly set up. For a detailed explanation of why this is needed and how to complete the setup, see Price Rule.

In the Zephr console, navigate to Products > Dynamic Offers. Take the following steps to create a dynamic offer:

  1. Click Add a Dynamic Offer
  2. On the Add a Dynamic Offer screen, enter a title for the offer. The slug of the offer will be shown under the field. Optionally, enter a description for the offer. Click Save to proceed.
  3. On the configuration screen, locate the Inputs section, where you can define the inputs that you need:
    • You can deselect the default input options.
    • You can also add custom input as needed. You need to specify the title, key, and type of the custom input. Available input types are String, Number and Boolean. Later you can set up rules that contain different branches based on the evaluation of the input values. Note that the custom inputs are optional for the API requests.

    If you are not familiar with the concept of Input in Zephr, see Developer Interface for SDK Features for more information.

    After you have set up the input fields, you can preview the example request in cURL in the Implementation section. To copy the example request, hover over to the upper right corner of the code block and click the Copy icon.

  4. Define rules for the product, price, tagline and discount properties. You need to be familiar with the Zephr Rules Builder feature before configuring the rules.
    1. Product: Click Product Output > Add Product Output to create a product output. A product output could contain one or more products defined in your product Catalogue.
    2. Price: If you use Zuora Billing as the payment provider, you can use the Price property to set up rules to return different prices dynamically. For more information about how to work with the Price rule builder, see Price Rule.
    3. Tagline: You can define different string values using the String Output node.
    4. Discount: Define the discounts that can be dynamically applied to the products or certain prices of a product. For more information, see Discount RuleNote: Discount will not directly be applied to the returned prices.
  5. Under the Custom Properties section, you can add custom properties for your offer based on need, and define rules for the custom properties:
    1. Click Add New Property
    2. Enter a title for the property and specify the output type. Available type options are Component, Enum, String, and Number. Note that if you select Component or Enum as the type, you'll need to add output options.
    3. Define rules for the property using Rules Builder. You can change to a different output type by unlocking the Developer Interface at the bottom of the screen.
    4. Click Save
  6. Preview the API request in the Implementation section at the bottom of the screen.
  7. At the bottom of the configuration page, select how the dynamic offer version is saved. Available options are Save Draft, Save and Stage, and Save and Publish.

After the dynamic offer is published, you can go on to test if the rules engine work as expected, and then start setting up the integration.

On the Dynamic Offers homepage, you can edit an offer by clicking on its title. To delete an offer, click the More icon on the right, and then click Delete.