Seasons

  1. Overview
  2. List seasons
  3. Get a single season
  4. Create a new season
  5. Update a season
  6. Destroy a season

Overview

This resource represents Seasons which together with Periods define the time when the Rates Rules or Rentals Fees are applicable and provide a way to define seasonal pricing for the Rentals (impacting price via ratio_percentage and minimum length of stay via minimum_stay).

Parameters

Name Type Read/Write Description
rates_table Integer Read Rates Table’s ID related to the Season
account Integer Read Account’s ID related to the Season
rates_rules Array Read Rates Rules’ IDs related to the Season
periods Array Read Periods’ IDs related to the Season
id Integer Read Season’s ID.
color_ratio Decimal Read Season’s color_ratio.
color String Read Season’s color (hexadecimal).
minimum_stay Integer Read Season’s minimum stay in days.
name Object Read Season’s name, list of locales described in enums section.
ratio_percentage Decimal Read Season’s ratio expressed in percentage.
created_at Time Read Season’s create time.
updated_at Time Read Season’s update time.
Name Type Read/Write Description Constraints
rates_table Integer Read Rates Table’s ID related to the Season  
account Integer Read Account’s ID related to the Season  
rates_rules Array Read Rates Rules’ IDs related to the Season  
periods Array Read Periods’ IDs related to the Season  
id Integer Read Season’s ID.  
color_ratio Decimal Read Season’s color_ratio.  
color String Read Season’s color (hexadecimal)  
minimum_stay Integer Read/Write Season’s minimum stay in days. Required, must be greater than: 0
name Object Read/Write Season’s name. Required for Account’s default locale, maximum length: 50, must not contain non-printing characters
ratio_percentage Decimal Read/Write Season’s ratio expressed in percentage. Required, must be greater than: 0
created_at Time Read Season’s create time.  
updated_at Time Read Season’s update time.  

List seasons

List all seasons for a given account.

GET /seasons

Response

{
  "links": {
    "seasons.periods": "https://www.bookingsync.com/api/v3/periods/{seasons.periods}",
    "seasons.rates_rules": "https://www.bookingsync.com/api/v3/rates_rules/{seasons.rates_rules}",
    "seasons.rates_table": "https://www.bookingsync.com/api/v3/rates_tables/{seasons.rates_table}"
  },
  "seasons": [
    {
      "id": 12,
      "color_ratio": "1.0",
      "minimum_stay": 7,
      "name": {
        "en": "Season 2"
      },
      "ratio_percentage": "100",
      "created_at": "2023-12-11T08:26:28Z",
      "updated_at": "2023-12-11T08:26:28Z",
      "links": {
        "periods": [
          4,
          5,
          6
        ],
        "rates_rules": [

        ],
        "rates_table": 1
      }
    }
  ]
}

Get a single season

Returns a single season identified by ID.

GET /seasons/:season_id

Response

{
  "links": {
    "seasons.periods": "https://www.bookingsync.com/api/v3/periods/{seasons.periods}",
    "seasons.rates_rules": "https://www.bookingsync.com/api/v3/rates_rules/{seasons.rates_rules}",
    "seasons.rates_table": "https://www.bookingsync.com/api/v3/rates_tables/{seasons.rates_table}"
  },
  "seasons": [
    {
      "id": 12,
      "color_ratio": "1.0",
      "minimum_stay": 7,
      "name": {
        "en": "Season 2"
      },
      "ratio_percentage": "100",
      "created_at": "2023-12-11T08:26:28Z",
      "updated_at": "2023-12-11T08:26:28Z",
      "links": {
        "periods": [
          4,
          5,
          6
        ],
        "rates_rules": [

        ],
        "rates_table": 1
      }
    }
  ]
}

Create a new season

Creates a season for given rates table.

POST /rates_tables/:rates_table_id/seasons

Example JSON request

{
  "seasons": [
    {
      "minimum_stay": 7,
      "name": "Season 2",
      "ratio_percentage": "100"
    }
  ]
}

Response

{
  "links": {
    "seasons.periods": "https://www.bookingsync.com/api/v3/periods/{seasons.periods}",
    "seasons.rates_rules": "https://www.bookingsync.com/api/v3/rates_rules/{seasons.rates_rules}",
    "seasons.rates_table": "https://www.bookingsync.com/api/v3/rates_tables/{seasons.rates_table}"
  },
  "seasons": [
    {
      "id": 12,
      "color_ratio": "1.0",
      "minimum_stay": 7,
      "name": {
        "en": "Season 2"
      },
      "ratio_percentage": "100",
      "created_at": "2023-12-11T08:26:28Z",
      "updated_at": "2023-12-11T08:26:28Z",
      "links": {
        "periods": [
          4,
          5,
          6
        ],
        "rates_rules": [

        ],
        "rates_table": 1
      }
    }
  ]
}

Update a season

Returns an updated season identified by ID.

PUT /seasons/:season_id

Example JSON request

{
  "seasons": [
    {
      "minimum_stay": 7,
      "name": "Season 2",
      "ratio_percentage": "100"
    }
  ]
}

Response

{
  "links": {
    "seasons.periods": "https://www.bookingsync.com/api/v3/periods/{seasons.periods}",
    "seasons.rates_rules": "https://www.bookingsync.com/api/v3/rates_rules/{seasons.rates_rules}",
    "seasons.rates_table": "https://www.bookingsync.com/api/v3/rates_tables/{seasons.rates_table}"
  },
  "seasons": [
    {
      "id": 12,
      "color_ratio": "1.0",
      "minimum_stay": 7,
      "name": {
        "en": "Season 2"
      },
      "ratio_percentage": "100",
      "created_at": "2023-12-11T08:26:28Z",
      "updated_at": "2023-12-11T08:26:28Z",
      "links": {
        "periods": [
          4,
          5,
          6
        ],
        "rates_rules": [

        ],
        "rates_table": 1
      }
    }
  ]
}

Destroy a season

Required OAuth scope: :rates_write

Returns empty response with ‘204 No Content’ status code on success.

DELETE /seasons/:season_id