How to Create Custom Rules in Recommendation?

Modified on Mon, 22 Sep at 8:24 PM

In some cases, brands may need custom logic for courier allocation that isn’t directly covered by the standard recommendation payload keys.

Example Scenario

If a brand wants specific orders always to be allocated as Express Delivery, they can pass a unique identifier in the recommendation payload under the additional (custom) field. A corresponding custom rule can then be configured on the dashboard to ensure those orders are allocated correctly.

Steps to Configure a Custom Rule

  1. Navigate to Rule Setup

    • Go to Filters or Ordered List.

    • Create a new rule or edit an existing one by clicking on the 3-dots under Action.

  2. Select Rule Type

    • Choose Enterprise Custom as the Rule Type.

  3. Configure Rule Fields

    • Field Name → Enter the key defined in the additional payload.

      • Example: "shipping_speed"

    • Field Type → Select based on how the value is passed (String, Float, Integer).

    • Field Operator → Choose the operator (EQ for equals, IN for multiple values).

    • Field Value → Enter the value from the additional payload.

      • Example: "Express"

Sample Payload:


"additional": {

    "custom_fields": [

        {

            "key": "shipping_speed",

            "value": "Express"

        }

    ]

}


In this example:

  • shipping_speed is the custom field key.

  • Express is the value used to trigger allocation through the custom rule.

By setting up custom rules, brands gain the flexibility to handle unique business requirements without disrupting the standard recommendation flow.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article