Seasons

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

Note

From 1st of August 2018, Seasons and Periods will no longer be a reliable source for rates and minimum stays for Rentals with rates managed by a third party through Nightly Rate Maps, as we'll stop generating them from the maps. We advise you to start using the Nightly Rates Maps endpoint instead. Rates Rules and Rentals Fees will keep using Seasons and Periods. If you need any further assistance, please reach out to apisupport@bookingsync.com.

Parameters

Name Type Read/Write Description
id Integer Read Season’s id.
color_ratio Decimal Read Season’s color_ratio.
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
id Integer Read Season’s id.
color_ratio Decimal Read Season’s color_ratio.
minimum_stay Integer Read/Write Required. Season’s minimum stay in days. (greater than 0)
name String Read/Write Required. Season’s name. (50 max characters)
ratio_percentage Decimal Read/Write Required. Season’s ratio expressed in percentage. (between 1 and 1000)
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": "2018-07-02T13:54:03Z",
      "updated_at": "2018-07-02T13:54:03Z",
      "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": "2018-07-02T13:54:03Z",
      "updated_at": "2018-07-02T13:54:03Z",
      "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": "2018-07-02T13:54:03Z",
      "updated_at": "2018-07-02T13:54:03Z",
      "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": "2018-07-02T13:54:03Z",
      "updated_at": "2018-07-02T13:54:03Z",
      "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