# Timed Events

Timed Events are used when you want to adjust your menu prices or availability for a limited period of time. Timed events affect the product’s original price and are applied before all discounts.

# The Timed Event Object

# Sample

{
  "id": "8f7b960b",
  "name": "Price Reduction",
  "name_localized": null,
  "type": 2,
  "value": 10,
  "priority": 7,
  "order_types": [
    1,
    2
  ],
  "from_date": "2019-04-17",
  "to_date": "2019-04-20",
  "from_time": 9,
  "to_time": 14,
  "is_sat": true,
  "is_sun": false,
  "is_mon": false,
  "is_tue": true,
  "is_wed": true,
  "is_thu": true,
  "is_fri": true,
  "is_active": true,
  "branches": [
    {
      "id": "8f7ab00a"
    },
    {
      "id": "8f7ab00a",
      "pivot": {
        "timed_event_id": "8f7b960b",
        "category_id": "8f7bd4b9"
      }
    }
  ],
  "tags": [
    {
      "id": "8f7b9527",
      "pivot": {
        "timed_event_id": "8f7b960b",
        "tag_id": "8f7b9527"
      }
    }
  ],
  "combos": [
    {
      "id": "8f7be85a",
      "pivot": {
        "timed_event_id": "8f7b960b",
        "combo_id": "8f7be85a"
      }
    }
  ],
  "products": [
    {
      "id": "8f7abbb1",
      "pivot": {
        "timed_event_id": "8f7b960b",
        "product_id": "8f7abbb1"
      }
    }
  ],
  "created_at": "2019-02-20 18:21:56",
  "updated_at": "2019-02-20 18:21:56",
  "deleted_at": null
}

# Attributes

Field Type Rule Description
id string Unique identifier for the timed event.
name* string updatable Name of the timed event
name_localized string nullable updatable Localized name of the timed event.
type* integer updatable The Timed Event Type.
value* double updatable The Timed Event Value.
priority integer updatable
is_active boolean updatable True if the timed event is active.
from_date* string updatable The starting date YYYY-MM-DD of the timed event.
to_date* string updatable The end date YYYY-MM-DD of the timed event.
from_time* string updatable The starting time of the timed event each day.
to_time* string updatable The ending time of the timed event each day.
is_sat boolean updatable True if the timed event can be used on Saturday.
is_sun boolean updatable True if the timed event can be used on Sunday.
is_mon boolean updatable True if the timed event can be used on Monday.
is_tue boolean updatable True if the timed event can be used on Tuesday.
is_wed boolean updatable True if the timed event can be used on Wednesday.
is_thu boolean updatable True if the timed event can be used on Thursday.
is_fri boolean updatable True if the timed event can be used on Friday.
order_types* array updatable List of Order Type where the timed event can be applied.
products array updatable includable List of Prodcut objects attached to the timed event.
combos array updatable includable List of Combo objects attached to the timed event.
branches array updatable includable List of Branch objects attached to the timed event.
tags array updatable includable List of Tag objects attached to the timed event.
categories array updatable includable List of Category objects attached to the timed event.
price_tag array updatable includable List of Price tags objects attached to the timed event.
customer_tags array updatable List of Tag objects attached to the timed event.
created_at string sortable Time YYYY-MM-DD HH-MM-SS in UTC at which the object was created.
updated_at string sortable Time YYYY-MM-DD HH-MM-SS in UTC at which the object was updated.
deleted_at string nullable Time YYYY-MM-DD HH-MM-SS in UTC at which the object was deleted.

# Timed Event Types

Type Details
1 Apply a fixed price.
2 Apply a reduction in price.
3 Apply a reduction in price by percentage.
4 Apply an increase in price.
5 Apply an increase in price by percentage.
6 Active the products.
7 Deactivate the products.

# Timed Event Values

The value attribute depends on the event type:

  • For events that apply a fixed price, the value must not be less than 0.
  • For events that apply an increase or decrease of price, the value must be more than 0.
  • For events that apply an increase or decrease percentage of price, the value must be more than 0 and less than 100.

# List Timed Events

GET /timed_events

# Scope

general.read

# Filters

  • id
  • name
  • name_localized
  • is_active
  • type
  • products.id
  • tags.id
  • category.id
  • branches.id
  • price_tag_id
  • updated_after
  • is_deleted
  • created_on
  • updated_on
  • deleted_on

# Response

{
  "data": [
    {
      "id": "8f7b960b",
      "name": "Price Reduction",
      "name_localized": null,
      "type": 2,
      "value": 10,
      "priority": 7,
      "order_types": [
        1,
        2
      ],
      "from_date": "2019-04-17",
      "to_date": "2019-04-20",
      "from_time": 9,
      "to_time": 14,
      "is_sat": true,
      "is_sun": false,
      "is_mon": false,
      "is_tue": true,
      "is_wed": true,
      "is_thu": true,
      "is_fri": true,
      "is_active": true,
      "branches": [
        {
          "id": "8f7ab00a"
        },
        {
          "id": "8f7ab00a",
          "pivot": {
            "timed_event_id": "8f7b960b",
            "category_id": "8f7bd4b9"
          }
        }
      ],
      "tags": [
        {
          "id": "8f7b9527",
          "pivot": {
            "timed_event_id": "8f7b960b",
            "tag_id": "8f7b9527"
          }
        }
      ],
      "combos": [
        {
          "id": "8f7be85a",
          "pivot": {
            "timed_event_id": "8f7b960b",
            "combo_id": "8f7be85a"
          }
        }
      ],
      "products": [
        {
          "id": "8f7abbb1",
          "pivot": {
            "timed_event_id": "8f7b960b",
            "product_id": "8f7abbb1"
          }
        }
      ],
      "created_at": "2019-02-20 18:21:56",
      "updated_at": "2019-02-20 18:21:56",
      "deleted_at": null
    }
  ]
}

# Get Timed Event

GET /timed_events/{timedEventId}

# Scope

general.read

# Response

{
  "data": {
    "id": "8f7b960b",
    "name": "Price Reduction",
    "name_localized": null,
    "type": 2,
    "value": 10,
    "priority": 7,
    "order_types": [
      1,
      2
    ],
    "from_date": "2019-04-17",
    "to_date": "2019-04-20",
    "from_time": 9,
    "to_time": 14,
    "is_sat": true,
    "is_sun": false,
    "is_mon": false,
    "is_tue": true,
    "is_wed": true,
    "is_thu": true,
    "is_fri": true,
    "is_active": true,
    "branches": [
      {
        "id": "8f7ab00a"
      },
      {
        "id": "8f7ab00a",
        "pivot": {
          "timed_event_id": "8f7b960b",
          "category_id": "8f7bd4b9"
        }
      }
    ],
    "tags": [
      {
        "id": "8f7b9527",
        "pivot": {
          "timed_event_id": "8f7b960b",
          "tag_id": "8f7b9527"
        }
      }
    ],
    "combos": [
      {
        "id": "8f7be85a",
        "pivot": {
          "timed_event_id": "8f7b960b",
          "combo_id": "8f7be85a"
        }
      }
    ],
    "products": [
      {
        "id": "8f7abbb1",
        "pivot": {
          "timed_event_id": "8f7b960b",
          "product_id": "8f7abbb1"
        }
      }
    ],
    "created_at": "2019-02-20 18:21:56",
    "updated_at": "2019-02-20 18:21:56",
    "deleted_at": null
  }
}

# Create Timed Event

POST /timed_events

# Scope

admin.write

# Request

{
    "name": "Price Reduction",
    "name_localized": null,
    "type": 2,
    "value": 10,
    "priority": 7,
    "order_types": [
        1,
        2
    ],
    "from_date": "2019-04-17",
    "to_date": "2019-04-20",
    "from_time": 9,
    "to_time": 14,
    "is_sat": true,
    "is_sun": false,
    "is_mon": false,
    "is_tue": true,
    "is_wed": true,
    "is_thu": true,
    "is_fri": true,
    "is_active": true,
    "branches": [
        {
            "id": "8d08be48"
        }
    ],
    "products": [
        {
            "id": "8d08be48"
        }
    ],
    "combos": [
        {
            "id": "8d08be48"
        }
    ],
    "tags": [
        {
            "id": "8d08be48"
        }
    ],
    "categories": [
        {
            "id": "8d08be48"
        }
    ]
}

# Response

{
  "data": {
    "id": "8f7b960b",
    "name": "Price Reduction",
    "name_localized": null,
    "type": 2,
    "value": 10,
    "priority": 7,
    "order_types": [
      1,
      2
    ],
    "from_date": "2019-04-17",
    "to_date": "2019-04-20",
    "from_time": 9,
    "to_time": 14,
    "is_sat": true,
    "is_sun": false,
    "is_mon": false,
    "is_tue": true,
    "is_wed": true,
    "is_thu": true,
    "is_fri": true,
    "is_active": true,
    "branches": [
      {
        "id": "8f7ab00a"
      },
      {
        "id": "8f7ab00a",
        "pivot": {
          "timed_event_id": "8f7b960b",
          "category_id": "8f7bd4b9"
        }
      }
    ],
    "tags": [
      {
        "id": "8f7b9527",
        "pivot": {
          "timed_event_id": "8f7b960b",
          "tag_id": "8f7b9527"
        }
      }
    ],
    "combos": [
      {
        "id": "8f7be85a",
        "pivot": {
          "timed_event_id": "8f7b960b",
          "combo_id": "8f7be85a"
        }
      }
    ],
    "products": [
      {
        "id": "8f7abbb1",
        "pivot": {
          "timed_event_id": "8f7b960b",
          "product_id": "8f7abbb1"
        }
      }
    ],
    "created_at": "2019-02-20 18:21:56",
    "updated_at": "2019-02-20 18:21:56",
    "deleted_at": null
  }
}

# Update Timed Event

PUT /timed_events/{timedEventId}

# Scope

admin.write

# Request

{
    "name": "Price Reduction",
    "name_localized": null,
    "type": 2,
    "value": 10,
    "priority": 7,
    "order_types": [
        1,
        2
    ],
    "from_date": "2019-04-17",
    "to_date": "2019-04-20",
    "from_time": 9,
    "to_time": 14,
    "is_sat": true,
    "is_sun": false,
    "is_mon": false,
    "is_tue": true,
    "is_wed": true,
    "is_thu": true,
    "is_fri": true,
    "is_active": true,
    "branches": [
        {
            "id": "8d08be48"
        }
    ],
    "products": [
        {
            "id": "8d08be48"
        }
    ],
    "combos": [
        {
            "id": "8d08be48"
        }
    ],
    "tags": [
        {
            "id": "8d08be48"
        }
    ],
    "categories": [
        {
            "id": "8d08be48"
        }
    ]
}

# Response

{
  "data": {
    "id": "8f7b960b",
    "name": "Price Reduction",
    "name_localized": null,
    "type": 2,
    "value": 10,
    "priority": 7,
    "order_types": [
      1,
      2
    ],
    "from_date": "2019-04-17",
    "to_date": "2019-04-20",
    "from_time": 9,
    "to_time": 14,
    "is_sat": true,
    "is_sun": false,
    "is_mon": false,
    "is_tue": true,
    "is_wed": true,
    "is_thu": true,
    "is_fri": true,
    "is_active": true,
    "branches": [
      {
        "id": "8f7ab00a"
      },
      {
        "id": "8f7ab00a",
        "pivot": {
          "timed_event_id": "8f7b960b",
          "category_id": "8f7bd4b9"
        }
      }
    ],
    "tags": [
      {
        "id": "8f7b9527",
        "pivot": {
          "timed_event_id": "8f7b960b",
          "tag_id": "8f7b9527"
        }
      }
    ],
    "combos": [
      {
        "id": "8f7be85a",
        "pivot": {
          "timed_event_id": "8f7b960b",
          "combo_id": "8f7be85a"
        }
      }
    ],
    "products": [
      {
        "id": "8f7abbb1",
        "pivot": {
          "timed_event_id": "8f7b960b",
          "product_id": "8f7abbb1"
        }
      }
    ],
    "created_at": "2019-02-20 18:21:56",
    "updated_at": "2019-02-20 18:21:56",
    "deleted_at": null
  }
}

# Delete Timed Event

DELETE /timed_events/{timedEventId}

# Scope

admin.write

The API will respond with 200 indicating that the timed events has been deleted.

# Restore Timed Event

PUT /timed_events/{timedEventId}/restore

# Scope

admin.restore

The API will respond with 200 indicating that the timed events has been restored.

Last Updated: 26/9/2023, 1:33:19 PM