Item Event/Discount Edit

This webhook is triggered whenever any item events or discounts are altered on your account. Because of their similarities, Item Events and Discounts are both called “rates”. When fields have specific meanings for either Item Events or Discounts, those differences are defined in the Description column.

A JSON, XML, or x-www-form-urlencoded object containing the following export fields can be found in directly in the raw body of the POST request to your server:

rate

Field Type Description
rate_id integer A unique code used to refer to this rate
name string The name of this rate
type string Item Events: “SP” for “Special” events, “SE” for “Seasonal” events. Discounts: “DC” for “Discount”
start_date integer The date (yyyymmdd) when this rate starts to apply
end_date integer The date (yyyymmdd) when this rate stops applying (0 if the rate has no end date)
span integer The “Force item length to the above start and end dates” option (1 if selected, 0 if not selected)
price_src string If applicable, the type of price modification for this rate (“Base Price” is “B”, “Create new Price Point” is “N”, “Dynamic” is “D”, “Yield” is “Yield”)
dynamic_rate decimal If this event is a “Dynamic” price rate (price_src is “D”), this value holds the rate’s percent change or fixed amount price.
dynamic_type string Dynamic Price rates: “P” for percent, “F” for fixed amount
status string Item Events: whether this is an available (“A”) or unavailable (“U”) event. Discounts: always available (“A”)
repeat_id string If the rate is not recurring, this value is blank. Weekly recurring events are “W”, “Always” recurring events are “*”.
enabled integer If the rate is enabled, 1, otherwise 0 when disabled.
rule_set_id integer The ruleset id applying to this event. The default ruleset id is 1.
vouchers integer Discounts: the number of vouchers attached to this discount.
details object See rate.details below.
repeat object See rate.repeat below.
apply_to object See rate.apply_to below.

rate.details

Field Type Description
thresholds object If this is rate has a “Yield” price_src, this element will contain a list of objects containing a level and rate pair for each threshold. See rate.details.thresholds below

rate.details.thresholds

Field Type Description
threshold object This contains a pair of level and rate values for a threshold. See rate.details.thresholds.threshold below

rate.details.thresholds.threshold

Field Type Description
level integer The inventory threshold at which this Yield priced rate applies
rate decimal The percentage price multiplier for this threshold

rate.repeat

Field Type Description
days object If set, this rate repeats on specific days of the week. See rate.repeat.days below.

rate.repeat.days

Field Type Description
<day of week abbreviation> (e.g., mon, tue,…) integer The rate repeats for this day of the week.

rate.apply_to

Field Type Description
items / categories object This object contains a list of the items or categories which this rate applies to. See rate.apply_to.items below.

rate.apply_to.items

Field Type Description
id integer An item_id which this rate applies to

rate.apply_to.categories

Field Type Description
id integer This contains a category_id which this rate has completely selected. This rate will apply to any new items that are added to this category.

Sample Rate Notification

JSON

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
    "version": "3.11.0.0",
    "host": "test.checkfront.com",
    "type": "rate",
    "action": "update",
    "rate": {
        "rate_id": 8,
        "name": "Max 3 Days",
        "start_date": 20161221,
        "end_date": 0,
        "span": 0,
        "price_src": "Yield",
        "dynamic_rate": 10,
        "status": "A",
        "type": "SP",
        "repeat_id": "W",
        "enabled": 1,
        "details": {
            "thresholds": [
                {
                    "threshold": {
                        "level": 5,
                        "rate": 150.5
                    }
                },
                {
                    "threshold": {
                        "level": 2,
                        "rate": 200
                    }
                }
            ]
        },
        "repeat": {
            "days": {
                "tue": 1,
                "sat": 1
            }
        },
        "rule_set_id": 1,
        "dynamic_type": "P",
        "apply_to": {
            "items": [
                {
                    "id": 14
                },
                {
                    "id": 16
                },
                {
                    "id": 35
                },
                {
                    "id": 36
                },
                {
                    "id": 37
                }
            ],
            "categories": [
                {
                    "id": 3
                },
                {
                    "id": 5
                }
            ]
        }
    }
}

XML

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?xml version="1.0" encoding="utf-8"?>
<checkfront-notify version="3.11.0.0" host="test.checkfront.com">
    <type>rate</type>
    <action>update</action>
    <rate>
        <rate_id>8</rate_id>
        <name>Max 3 Days</name>
        <start_date>20161221</start_date>
        <end_date>0</end_date>
        <span>0</span>
        <price_src>Yield</price_src>
        <dynamic_rate>10</dynamic_rate>
        <status>A</status>
        <type>SP</type>
        <repeat_id>W</repeat_id>
        <enabled>1</enabled>
        <details>
            <thresholds>
                <threshold>
                    <level>5</level>
                    <rate>150.5</rate>
                </threshold>
                <threshold>
                    <level>2</level>
                    <rate>200</rate>
                </threshold>
            </thresholds>
        </details>
        <repeat>
            <days>
                <tue>1</tue>
                <sat>1</sat>
            </days>
        </repeat>
        <rule_set_id>1</rule_set_id>
        <dynamic_type>P</dynamic_type>
        <apply_to>
            <items>
                <id>14</id>
                <id>16</id>
                <id>35</id>
                <id>36</id>
                <id>37</id>
            </items>
            <categories>
                <id>3</id>
                <id>5</id>
            </categories>
        </apply_to>
    </rate>
</checkfront-notify>