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

XML

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