-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documented the item event / discount edit webhook
- Loading branch information
Kevin Jackson
committed
Dec 22, 2016
1 parent
e93873e
commit 3e34cc1
Showing
6 changed files
with
330 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,176 @@ | ||
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 :ref:`note-rate-details` below. | | ||
+---------------------------+---------------+------------------------------------------------------+ | ||
| **repeat** | *object* | See :ref:`note-rate-repeat` below. | | ||
+---------------------------+---------------+------------------------------------------------------+ | ||
| **apply_to** | *object* | See :ref:`note-rate-apply-to` below. | | ||
+---------------------------+---------------+------------------------------------------------------+ | ||
|
||
.. _note-rate-details: | ||
|
||
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 :ref:`note-rate-details-thresholds` below | | ||
+---------------------------+---------------+------------------------------------------------------+ | ||
|
||
.. _note-rate-details-thresholds: | ||
|
||
rate.details.thresholds | ||
----------------------- | ||
+---------------------------+---------------+------------------------------------------------------+ | ||
| Field | Type | Description | | ||
+===========================+===============+======================================================+ | ||
| **threshold** | *object* | This contains a pair of level and rate values for a | | ||
| | | threshold. | | ||
| | | See :ref:`note-rate-details-threshold-pair` below | | ||
+---------------------------+---------------+------------------------------------------------------+ | ||
|
||
.. _note-rate-details-threshold-pair: | ||
|
||
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 | | ||
+---------------------------+---------------+------------------------------------------------------+ | ||
|
||
.. _note-rate-repeat: | ||
|
||
rate.repeat | ||
----------- | ||
+---------------------------+---------------+------------------------------------------------------+ | ||
| Field | Type | Description | | ||
+===========================+===============+======================================================+ | ||
| **days** | *object* | If set, this rate repeats on specific days of the | | ||
| | | week. See :ref:`note-rate-repeat-days` below. | | ||
+---------------------------+---------------+------------------------------------------------------+ | ||
|
||
.. _note-rate-repeat-days: | ||
|
||
rate.repeat.days | ||
---------------- | ||
+---------------------------+---------------+------------------------------------------------------+ | ||
| Field | Type | Description | | ||
+===========================+===============+======================================================+ | ||
| **<day of week | *integer* | The rate repeats for this day of the week. | | ||
| abbreviation>** | | | | ||
| (e.g., mon, tue,...) | | | | ||
+---------------------------+---------------+------------------------------------------------------+ | ||
|
||
.. _note-rate-apply-to: | ||
|
||
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 :ref:`note-rate-apply-to-values` below. | | ||
+---------------------------+---------------+------------------------------------------------------+ | ||
|
||
.. _note-rate-apply-to-values: | ||
|
||
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 | ||
~~~~ | ||
.. literalinclude:: ../../examples/response/webhook-item-event-edit.json | ||
:language: json | ||
:linenos: | ||
|
||
XML | ||
~~~ | ||
.. literalinclude:: ../../examples/response/webhook-item-event-edit.xml | ||
:language: xml | ||
:linenos: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters