Rates Tables

Overview

This resource represents Rates Tables - a resource for grouping price-related resources (such as Rates Rules, Seasons, Periods) for Rentals. Rates Tables can be shared between Rentals to make pricing setup between rentals reusable.

Rates Tables cannot be updated or swapped to a different one if they have:

  • private status (shared as false)
  • corresponding rental has external rates management configured (nightly_rates_managed_externally as true)

Parameters

Name Type Read/Write Description
account Integer Read Account’s ID related to the Rates Table
seasons Array Read Seasons’ IDs related to the Rates Table
rates_rules Array Read Rates Rules’ IDs related to the Rates Table
periods Array Read Periods’ IDs related to the Rates Table
rentals Array Read Rentals’ IDs related to the Rates Table
id Integer Read Rates Table’s ID.
name String Read Rates Table’s name.
shared Boolean Read Rates Table’s shared (between Rentals) status.
public_notes String Read Rates Table’s public notes.
created_at Time Read Rate’s create time.
updated_at Time Read Rate’s update time.
Name Type Read/Write Description  
account Integer Read Account’s ID related to the Rates Table  
seasons Array Read Seasons’ IDs related to the Rates Table  
rates_rules Array Read Rates Rules’ IDs related to the Rates Table  
periods Array Read Periods’ IDs related to the Rates Table  
rentals Array Read Rentals’ IDs related to the Rates Table  
id Integer Read Rates Table’s ID.  
name String Read/Write Rates Table’s name. Required, Maximum length: 50, cannot contain non-printing characters
shared Boolean Read Rates Table’s shared (between Rentals) status. (Rates Table is always marked as shared when creating or updating through API)  
public_notes String Read Rates Table’s public notes.  
created_at Time Read Rate’s create time.  
updated_at Time Read Rate’s update time.  

List rates tables

List all rates tables for a given account.

GET /rates_tables

Response

{
  "links": {
    "rates_tables.account": "https://www.bookingsync.com/api/v3/accounts/{rates_tables.account}",
    "rates_tables.periods": "https://www.bookingsync.com/api/v3/periods/{rates_tables.periods}",
    "rates_tables.rates_rules": "https://www.bookingsync.com/api/v3/rates_rules/{rates_tables.rates_rules}",
    "rates_tables.seasons": "https://www.bookingsync.com/api/v3/seasons/{rates_tables.seasons}"
  },
  "rates_tables": [
    {
      "id": 2,
      "name": "Rates Table 2",
      "shared": true,
      "created_at": "2023-12-11T08:26:28Z",
      "updated_at": "2023-12-11T08:26:28Z",
      "links": {
        "account": 5,
        "periods": [
          2,
          3
        ],
        "rates_rules": [
          3,
          7
        ],
        "seasons": [
          2,
          34
        ]
      }
    }
  ]
}

Get a single rates table

Returns a single rates table identified by ID.

GET /rates_tables/:rates_table_id

Response

{
  "links": {
    "rates_tables.account": "https://www.bookingsync.com/api/v3/accounts/{rates_tables.account}",
    "rates_tables.periods": "https://www.bookingsync.com/api/v3/periods/{rates_tables.periods}",
    "rates_tables.rates_rules": "https://www.bookingsync.com/api/v3/rates_rules/{rates_tables.rates_rules}",
    "rates_tables.seasons": "https://www.bookingsync.com/api/v3/seasons/{rates_tables.seasons}"
  },
  "rates_tables": [
    {
      "id": 2,
      "name": "Rates Table 2",
      "shared": true,
      "created_at": "2023-12-11T08:26:28Z",
      "updated_at": "2023-12-11T08:26:28Z",
      "links": {
        "account": 5,
        "periods": [
          2,
          3
        ],
        "rates_rules": [
          3,
          7
        ],
        "seasons": [
          2,
          34
        ]
      }
    }
  ]
}

Create a new rates table

Cloning a rates table

To clone an existing rates table, pass "clone_from": "ID" parameter with ID of the source.

Returns a newly created rates table.

POST /rates_tables

Example JSON request

{
  "rates_tables": [
    {
      "name": "Rates Table 2"
    }
  ]
}

Response

{
  "links": {
    "rates_tables.account": "https://www.bookingsync.com/api/v3/accounts/{rates_tables.account}",
    "rates_tables.periods": "https://www.bookingsync.com/api/v3/periods/{rates_tables.periods}",
    "rates_tables.rates_rules": "https://www.bookingsync.com/api/v3/rates_rules/{rates_tables.rates_rules}",
    "rates_tables.seasons": "https://www.bookingsync.com/api/v3/seasons/{rates_tables.seasons}"
  },
  "rates_tables": [
    {
      "id": 2,
      "name": "Rates Table 2",
      "shared": true,
      "created_at": "2023-12-11T08:26:28Z",
      "updated_at": "2023-12-11T08:26:28Z",
      "links": {
        "account": 5,
        "periods": [
          2,
          3
        ],
        "rates_rules": [
          3,
          7
        ],
        "seasons": [
          2,
          34
        ]
      }
    }
  ]
}

Update a rates table

Returns an updated rates table identified by ID.

PUT /rates_tables/:rates_table_id

Example JSON request

{
  "rates_tables": [
    {
      "name": "Rates Table 2"
    }
  ]
}

Response

{
  "links": {
    "rates_tables.account": "https://www.bookingsync.com/api/v3/accounts/{rates_tables.account}",
    "rates_tables.periods": "https://www.bookingsync.com/api/v3/periods/{rates_tables.periods}",
    "rates_tables.rates_rules": "https://www.bookingsync.com/api/v3/rates_rules/{rates_tables.rates_rules}",
    "rates_tables.seasons": "https://www.bookingsync.com/api/v3/seasons/{rates_tables.seasons}"
  },
  "rates_tables": [
    {
      "id": 2,
      "name": "Rates Table 2",
      "shared": true,
      "created_at": "2023-12-11T08:26:28Z",
      "updated_at": "2023-12-11T08:26:28Z",
      "links": {
        "account": 5,
        "periods": [
          2,
          3
        ],
        "rates_rules": [
          3,
          7
        ],
        "seasons": [
          2,
          34
        ]
      }
    }
  ]
}

Destroy a rates table

Required OAuth scope: :rates_write

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

DELETE /rates_tables/:rates_table_id