Seasons

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

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": "2017-11-09T09:08:18Z",
      "updated_at": "2017-11-09T09:08:18Z",
      "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": "2017-11-09T09:08:18Z",
      "updated_at": "2017-11-09T09:08:18Z",
      "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": "2017-11-09T09:08:18Z",
      "updated_at": "2017-11-09T09:08:18Z",
      "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": "2017-11-09T09:08:18Z",
      "updated_at": "2017-11-09T09:08:18Z",
      "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