Skip to main content

Booking Discount Codes

Overview

This resource represents Discount Codes which are used to provide a flexible discount that can be applied to rental. Upon applying the Discount Code Usage gets created.

Parameters

NameTypeRead/WriteDescription
idString[UUID]ReadDiscount Code's id.
discount_codeStringReadDiscount Code itself.
currencyStringReadDiscount Code's currency.
fixed_amountFloatReadFixed amount of discount.
percentageintegerReadDiscount percentage.
all_rentalsBooleanReadFlag, that indicates that this discount is applicable to all rentals with provided currency.
number_of_timesIntegerReadNumber of times the Discount Code can be applied.
minimum_nights_bookedintegerReadMinimum number of nights that must be booked in order to apply Discount Code.
minimum_spendFloatReadMinimum amount that must be spent in order to apply Discount Code.
start_dateDateReadThe start date from which the Discount Code will be applicable.
end_dateDateReadThe expiration date of the Discount Code.
created_atTimeReadDiscount Code create time
updated_atTimeReadDiscount Code update time
canceled_atTimeReadDiscount Code soft delete time

List Discount Codes

Returns all Discount Codes for current account.

GET /booking/discount_codes
response.json
{
"links": {
"discount_codes.account": "http://www.bookingsync.com/api/v3/accounts/{discount_codes.account}",
"discount_codes.rentals": "http://www.bookingsync.com/api/v3/rentals/{discount_codes.rentals}",
"discount_codes.bookings": "http://www.bookingsync.com/api/v3/bookings/{discount_codes.bookings}"
},
"discount_codes": [
{
"links": {
"account": 6,
"bookings": [],
"rentals": [
42,
103
]
},
"id": "db6c0845-6122-4de6-a9ab-7a685e2a17f0",
"discount_code": "PROMO123",
"currency": "EUR",
"percentage": null,
"all_rentals": false,
"minimum_nights_booked": 5,
"number_of_times": 10,
"start_date": "2025-04-07",
"end_date": "2025-04-14",
"fixed_amount": "100.00",
"minimum_spend": null,
"created_at": "2025-03-17T22:18:28.780Z",
"updated_at": "2025-03-24T22:18:28.780Z",
"canceled_at": null
}
],
"meta": {}
}

Get a single Discount Code

Returns a single Discount Code identified by ID.

GET /booking/discount_codes/:discount_code_id
response.json
{
"links": {
"discount_codes.account": "http://www.bookingsync.com/api/v3/accounts/{discount_codes.account}",
"discount_codes.rentals": "http://www.bookingsync.com/api/v3/rentals/{discount_codes.rentals}",
"discount_codes.bookings": "http://www.bookingsync.com/api/v3/bookings/{discount_codes.bookings}"
},
"discount_codes": [
{
"links": {
"account": 6,
"bookings": [],
"rentals": [
42,
103
]
},
"id": "db6c0845-6122-4de6-a9ab-7a685e2a17f0",
"discount_code": "PROMO123",
"currency": "EUR",
"percentage": null,
"all_rentals": false,
"minimum_nights_booked": 5,
"number_of_times": 10,
"start_date": "2025-04-07",
"end_date": "2025-04-14",
"fixed_amount": "100.00",
"minimum_spend": null,
"created_at": "2025-03-17T22:18:28.783Z",
"updated_at": "2025-03-24T22:18:28.783Z",
"canceled_at": null
}
],
"meta": {}
}

Create a new Discount Code

Creates a Discount Code and renders it.

POST /booking/discount_codes
request.json
{
"discount_codes": [
{
"rentals_eligibility": "specific_rentals",
"minimum_requirements": "minimum_nights_booked",
"minimum_nights_booked": 5,
"usage_limit": "number_of_times",
"number_of_times": 10,
"currency": "EUR",
"discount_code": "PROMO123",
"discount_value_type": "fixed_amount",
"fixed_amount": 100,
"start_date": "2025-04-07",
"end_date": "2025-04-14",
"rental_ids": [
42,
103
]
}
]
}
response.json
{
"links": {
"discount_codes.account": "http://www.bookingsync.com/api/v3/accounts/{discount_codes.account}",
"discount_codes.rentals": "http://www.bookingsync.com/api/v3/rentals/{discount_codes.rentals}",
"discount_codes.bookings": "http://www.bookingsync.com/api/v3/bookings/{discount_codes.bookings}"
},
"discount_codes": [
{
"links": {
"account": 6,
"bookings": [],
"rentals": [
42,
103
]
},
"id": "db6c0845-6122-4de6-a9ab-7a685e2a17f0",
"discount_code": "PROMO123",
"currency": "EUR",
"percentage": null,
"all_rentals": false,
"minimum_nights_booked": 5,
"number_of_times": 10,
"start_date": "2025-04-07",
"end_date": "2025-04-14",
"fixed_amount": "100.00",
"minimum_spend": null,
"created_at": "2025-03-17T22:18:28.787Z",
"updated_at": "2025-03-24T22:18:28.787Z",
"canceled_at": null
}
],
"meta": {}
}

Update a Discount Code

Updated the Discount Code identified by ID and renders it.

PUT /booking/discount_codes/:discount_code_id
request.json
{
"discount_codes": [
{
"rentals_eligibility": "specific_rentals",
"minimum_requirements": "minimum_nights_booked",
"minimum_nights_booked": 5,
"usage_limit": "number_of_times",
"number_of_times": 10,
"currency": "EUR",
"discount_code": "PROMO123",
"discount_value_type": "fixed_amount",
"fixed_amount": 100,
"start_date": "Mon, 07 Apr 2025 22:18:28.392265926 UTC +00:00",
"end_date": "Mon, 14 Apr 2025 22:18:28.669825452 UTC +00:00",
"rental_ids": [
42,
103
]
}
]
}
response.json
{
"links": {
"discount_codes.account": "http://www.bookingsync.com/api/v3/accounts/{discount_codes.account}",
"discount_codes.rentals": "http://www.bookingsync.com/api/v3/rentals/{discount_codes.rentals}",
"discount_codes.bookings": "http://www.bookingsync.com/api/v3/bookings/{discount_codes.bookings}"
},
"discount_codes": [
{
"links": {
"account": 6,
"bookings": [],
"rentals": [
42,
103
]
},
"id": "db6c0845-6122-4de6-a9ab-7a685e2a17f0",
"discount_code": "PROMO123",
"currency": "EUR",
"percentage": null,
"all_rentals": false,
"minimum_nights_booked": 5,
"number_of_times": 10,
"start_date": "2025-04-07",
"end_date": "2025-04-14",
"fixed_amount": "100.00",
"minimum_spend": null,
"created_at": "2025-03-17T22:18:28.791Z",
"updated_at": "2025-03-24T22:18:28.791Z",
"canceled_at": null
}
],
"meta": {}
}

Delete a Discount Code

Deletes Discount Code identified by ID.

DELETE /booking/discount_codes/:discount_code_id

Returns 204 on success or 404 on error.