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.
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 | Special Offer’s name, list of locales described in enums section. | |
name_locale | String | Write | Special Offer’s name, used in write operations. Replace the locale with one of the locales described in enums section (e.g. name_en ). Multiple of these attributes could be passed in the same operation, as long as they each have a unique locale (e.g name_en and name_fr ) |
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 all special offers for a given account(s).
GET /special_offers
{
"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": "2023-12-11T08:26:28Z",
"updated_at": "2023-12-11T08:26:28Z",
"start_date": "2023-12-18",
"end_date": "2024-08-23",
"links": {
"rental": 1
}
}
]
}
Returns a single special offer identified by ID.
GET /special_offers/:special_offer_id
{
"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": "2023-12-11T08:26:28Z",
"updated_at": "2023-12-11T08:26:28Z",
"start_date": "2023-12-18",
"end_date": "2024-08-23",
"links": {
"rental": 1
}
}
]
}
Creates a special offer for given rental.
POST /rentals/:rental_id/special_offers
{
"special_offers": [
{
"discount": 10,
"name_en": "Special offer for 1",
"start_date": "2023-12-18",
"end_date": "2024-08-23"
}
]
}
{
"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": "2023-12-11T08:26:28Z",
"updated_at": "2023-12-11T08:26:28Z",
"start_date": "2023-12-18",
"end_date": "2024-08-23",
"links": {
"rental": 1
}
}
]
}
Returns an updated special offer identified by ID.
PUT /special_offers/:special_offer
{
"special_offers": [
{
"discount": 10,
"name_en": "Special offer for 1",
"start_date": "2023-12-18",
"end_date": "2024-08-23"
}
]
}
{
"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": "2023-12-11T08:26:28Z",
"updated_at": "2023-12-11T08:26:28Z",
"start_date": "2023-12-18",
"end_date": "2024-08-23",
"links": {
"rental": 1
}
}
]
}
Required OAuth scope: :rates_write
Returns empty response with ‘204 No Content’ status code on success.
DELETE /special_offers/:special_offer_id