Rates Tables

  1. List rates tables
  2. Get a single rates table
  3. Create a new rates table
  4. Update a rates table
  5. Destroy a rates table

Parameters

Name Type Read/Write Description
id Integer Read Rates Table’s id.
name String Read Rates Table’s name.
shared Boolean Read Rates Table’s shared status.
created_at Time Read Rate’s create time.
updated_at Time Read Rate’s update time.
Name Type Read/Write Description
id Integer Read Rates Table’s id.
name String Read/Write Required. Rates Table’s name. (50 characters max)
shared Boolean Read Rates Table’s shared status. (Rates Table is made shared when creating or updating through api)
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": "2017-11-09T09:08:17Z",
      "updated_at": "2017-11-09T09:08:17Z",
      "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": "2017-11-09T09:08:17Z",
      "updated_at": "2017-11-09T09:08:17Z",
      "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": "2017-11-09T09:08:17Z",
      "updated_at": "2017-11-09T09:08:17Z",
      "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": "2017-11-09T09:08:17Z",
      "updated_at": "2017-11-09T09:08:17Z",
      "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