Special Offers

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

Overview

This resource represents Special Offers which are the Rental’s price (as initial_price in Booking) modifiers, making it possible to provide special discounts during certain periods.

Parameters

Name Type Read/Write Description
account Integer Read Account’s ID related to the Special Offer
rental Integer Read Rental’s ID related to the Special Offer
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 Constraints
account Integer Read Account’s ID related to the Special Offer  
rental Integer Read Rental’s ID related to the Special Offer  
id Integer Read Special Offer’s ID.  
discount Float Read/Write Required. Special Offer’s discount in percents. (between 1 and 100) Required, must be between 1 (exclusive) and 100 (inclusive)
name Object Read/Write Special Offer’s name, list of locales described in enums section. Required for Account’s default locale, minimum length: 3, maximum length: 50
created_at Time Read Special Offer’s create time.  
updated_at Time Read Special Offer’s update time.  
start_date Date Read/Write Special Offer’s start date. Required, must be before end_date, cannot be in the past
end_date Date Read/Write Special Offer’s end date. Required, must be after start_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": "2022-03-23T16:56:23Z",
      "updated_at": "2022-03-23T16:56:23Z",
      "start_date": "2022-03-30",
      "end_date": "2022-12-04",
      "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": "2022-03-23T16:56:23Z",
      "updated_at": "2022-03-23T16:56:23Z",
      "start_date": "2022-03-30",
      "end_date": "2022-12-04",
      "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": "2022-03-30",
      "end_date": "2022-12-04"
    }
  ]
}

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": "2022-03-23T16:56:23Z",
      "updated_at": "2022-03-23T16:56:23Z",
      "start_date": "2022-03-30",
      "end_date": "2022-12-04",
      "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": "2022-03-30",
      "end_date": "2022-12-04"
    }
  ]
}

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": "2022-03-23T16:56:23Z",
      "updated_at": "2022-03-23T16:56:23Z",
      "start_date": "2022-03-30",
      "end_date": "2022-12-04",
      "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