Custom Python functions are a valuable tool within your pricing process that allows you to create a custom-made logic for your product that will take place before, during, or after the pricing cycle.
There are five types of custom functions:
Custom pricing rule - Used to create custom rules to be used in a strategy.
Cost function - Used to calculate the cost of a product. check our guide here
Custom rule condition - Used to create custom conditions to be used in a strategy
Before pricing pre processor - Used for calculations that need to be done before the actual pricing cycle
After pricing Post processor - Used for calculations that need to be done after the actual pricing cycle
For full details please see the technical documentation.
Function Variables
Add one or more variables using the following example, replacing the value of "field" with the name of your variable.
A variable of kind "competitors" will result in a multiple-selection widget with your competitor names
A variable of kind "attrs" will result in an auto-complete widget for the attribute specified in the "attr" field
A variable of kind "strategy" will result in a single-selection widget with your strategies names (the variable value is the strategy id)
A variable of kind "date_time" will result in a datetime-picker widget, the value format is 'YYYY-MM-DDTHH:mm'
[
{
"field": "text_variable",
"kind": "text",
"placeholder": "enter text here", // optional
"default": "default value" // optional
},
{
"field": "numeric_variable",
"kind": "number",
"placeholder": "1.5", // optional
"default": 5 // optional
},
{
"field": "selection_variable",
"kind": "select",
"options": ["opt a", "opt b", "opt c"],
"multiple": false,
"default": "opt a" // optional
},
{
"field": "multiple_selection_variable",
"kind": "select",
"options": ["opt a", "opt b", "opt c"],
"multiple": true,
"default": ["opt a", "opt c"] // optional
},
{
"field": "my_competitors",
"kind": "competitors",
"default": ["comp1", "comp2"] // optional
},
{
"field": "brand",
"kind": "attrs",
"attr": "brand",
"default": ["apple"] // optional
},
{
"field": "my_strategy",
"kind": "strategy",
"default": strategy_id // optional
},
{
"field": "date_variable",
"kind": "date_time",
"default": "2022-09-29T13:03" // optional
}
]
Comments
0 comments
Please sign in to leave a comment.