OrderfeeRule

More info about order fees can be found here.

Fields

FieldDescription
auto

This is required if the order fee type is set to automatic. It is a set of rules that define the order fee.

Example value:[ { "saleschannelids": [ 1 ], "value": 2.000000 } ]
context

This can be set if the order fee type is set to script. It allows adding extra information to the script environment.

Example value:[ { "cacheable": false, "key": "test", "query": "select count(*) as nbr from tm.ticket where orderid={1}" } ]
script
string

This is required if the order fee type is set to script. The javascript needs to return a value.

Example value:"return 1;"

Example

 1{
 2    "auto": [
 3        {
 4            "saleschannelids": [ 1 ],
 5            "value": 2.000000
 6        }
 7    ],
 8    "context": [
 9        {
10            "cacheable": false,
11            "key": "test",
12            "query": "select count(*) as nbr from tm.ticket where orderid={1}"
13        }
14    ],
15    "script": "return 1;"
16}