Special Offers

  1. List special offers
  2. Get a single special offer
  3. Create a new special offer
  4. Update a special offer
  5. Destroy a special offer

Parameters

Name Type Read/Write Description
id Integer Read Special Offer’s id.
discount Float Read Special Offer’s discount in percents.
name Object Read Special Offer’s name, list of locales described in enums section.
created_at Time Read Special Offer’s create time.
updated_at Time Read Special Offer’s update time.
start_date Date Read Special Offer’s start date.
end_date Date Read Special Offer’s end date.
Name Type Read/Write Description
id Integer Read Special Offer’s id.
discount Float Read/Write Required. Special Offer’s discount in percents. (between 1 and 100)
name Object Read/Write Required. Special Offer’s name, list of locales described in enums section. (50 characters max)
created_at Time Read Special Offer’s create time.
updated_at Time Read Special Offer’s update time.
start_date Date Read/Write Required. Special Offer’s start date.
end_date Date Read/Write Required. Special Offer’s end date.

List special offers

List all special offers for a given account(s).

GET /special_offers

Response

{
  "links": {
    "special_offers.rental": "https://www.bookingsync.com/api/v3/rentals/{special_offers.rental}"
  },
  "special_offers": [
    {
      "id": 1,
      "discount": 10.0,
      "name": {
        "en": "Special offer for 1"
      },
      "created_at": "2017-11-09T09:08:18Z",
      "updated_at": "2017-11-09T09:08:18Z",
      "start_date": "2017-11-16",
      "end_date": "2018-07-23",
      "links": {
        "rental": 1
      }
    }
  ]
}

Get a single special offer

Returns a single special offer identified by ID.

GET /special_offers/:special_offer_id

Response

{
  "links": {
    "special_offers.rental": "https://www.bookingsync.com/api/v3/rentals/{special_offers.rental}"
  },
  "special_offers": [
    {
      "id": 1,
      "discount": 10.0,
      "name": {
        "en": "Special offer for 1"
      },
      "created_at": "2017-11-09T09:08:18Z",
      "updated_at": "2017-11-09T09:08:18Z",
      "start_date": "2017-11-16",
      "end_date": "2018-07-23",
      "links": {
        "rental": 1
      }
    }
  ]
}

Create a new special offer

Creates a special offer for given rental.

POST /rentals/:rental_id/special_offers

Example JSON request

{
  "special_offers": [
    {
      "discount": 10,
      "name": {
        "en": "Special offer for 1"
      },
      "start_date": "2017-11-16",
      "end_date": "2018-07-23"
    }
  ]
}

Response

{
  "links": {
    "special_offers.rental": "https://www.bookingsync.com/api/v3/rentals/{special_offers.rental}"
  },
  "special_offers": [
    {
      "id": 1,
      "discount": 10.0,
      "name": {
        "en": "Special offer for 1"
      },
      "created_at": "2017-11-09T09:08:18Z",
      "updated_at": "2017-11-09T09:08:18Z",
      "start_date": "2017-11-16",
      "end_date": "2018-07-23",
      "links": {
        "rental": 1
      }
    }
  ]
}

Update a special offer

Returns an updated special offer identified by ID.

PUT /special_offers/:special_offer

Example JSON request

{
  "special_offers": [
    {
      "discount": 10,
      "name": {
        "en": "Special offer for 1"
      },
      "start_date": "2017-11-16",
      "end_date": "2018-07-23"
    }
  ]
}

Response

{
  "links": {
    "special_offers.rental": "https://www.bookingsync.com/api/v3/rentals/{special_offers.rental}"
  },
  "special_offers": [
    {
      "id": 1,
      "discount": 10.0,
      "name": {
        "en": "Special offer for 1"
      },
      "created_at": "2017-11-09T09:08:18Z",
      "updated_at": "2017-11-09T09:08:18Z",
      "start_date": "2017-11-16",
      "end_date": "2018-07-23",
      "links": {
        "rental": 1
      }
    }
  ]
}

Destroy a special offer

Required OAuth scope: :rates_write

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

DELETE /special_offers/:special_offer_id