Periods

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

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 Period’s id.
created_at Time Read Payment’s create time.
updated_at Time Read Payment’s update time.
start_date Date Read Period’s start date.
end_date Date Read Period’s end date.
Name Type Read/Write Description
id Integer Read Period’s id.
created_at Time Read Payment’s create time.
updated_at Time Read Payment’s update time.
start_date Date Read/Write Required. Period’s start date.
end_date Date Read/Write Required. Period’s end date.

List periods

List all periods for a given account.

GET /periods

Response

{
  "links": {
    "periods.rates_table": "https://www.bookingsync.com/api/v3/rates_tables/{periods.rates_table}",
    "periods.season": "https://www.bookingsync.com/api/v3/seasons/{periods.season}"
  },
  "periods": [
    {
      "id": 232,
      "created_at": "2018-07-02T13:54:01Z",
      "updated_at": "2018-07-02T13:54:01Z",
      "start_date": "2018-07-09",
      "end_date": "2019-03-15",
      "links": {
        "rates_table": 5,
        "season": 12
      }
    }
  ]
}

Get a single period

Returns a single period identified by ID.

GET /periods/:period_id

Response

{
  "links": {
    "periods.rates_table": "https://www.bookingsync.com/api/v3/rates_tables/{periods.rates_table}",
    "periods.season": "https://www.bookingsync.com/api/v3/seasons/{periods.season}"
  },
  "periods": [
    {
      "id": 232,
      "created_at": "2018-07-02T13:54:01Z",
      "updated_at": "2018-07-02T13:54:01Z",
      "start_date": "2018-07-09",
      "end_date": "2019-03-15",
      "links": {
        "rates_table": 5,
        "season": 12
      }
    }
  ]
}

Create a new period

Creates a period for given season.

POST /seasons/:season_id/periods

Example JSON request

{
  "periods": [
    {
      "start_date": "2018-07-09",
      "end_date": "2019-03-15"
    }
  ]
}

Response

{
  "links": {
    "periods.rates_table": "https://www.bookingsync.com/api/v3/rates_tables/{periods.rates_table}",
    "periods.season": "https://www.bookingsync.com/api/v3/seasons/{periods.season}"
  },
  "periods": [
    {
      "id": 232,
      "created_at": "2018-07-02T13:54:01Z",
      "updated_at": "2018-07-02T13:54:01Z",
      "start_date": "2018-07-09",
      "end_date": "2019-03-15",
      "links": {
        "rates_table": 5,
        "season": 12
      }
    }
  ]
}

Update a period

Returns an updated period identified by ID.

PUT /periods/:period_id

Example JSON request

{
  "periods": [
    {
      "start_date": "2018-07-09",
      "end_date": "2019-03-15"
    }
  ]
}

Response

{
  "links": {
    "periods.rates_table": "https://www.bookingsync.com/api/v3/rates_tables/{periods.rates_table}",
    "periods.season": "https://www.bookingsync.com/api/v3/seasons/{periods.season}"
  },
  "periods": [
    {
      "id": 232,
      "created_at": "2018-07-02T13:54:01Z",
      "updated_at": "2018-07-02T13:54:01Z",
      "start_date": "2018-07-09",
      "end_date": "2019-03-15",
      "links": {
        "rates_table": 5,
        "season": 12
      }
    }
  ]
}

Destroy a period

Required OAuth scope: :rates_write

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

DELETE /periods/:period_id