Pricing And Terms Modification

This endpoint is used to update pricing and terms of a given room. The pricing attributes include the currency code, basic pricing (nightly price, weekend price), long-term pricing (monthly price), additional costs (additional guests fee, cleaning fee and security fee), the number of standard guests, the maximum and minimum days of staying. The term attributes include the cancellation policy (Flexible or Moderate), check-in/check-out time and the booking policy (Instant Book or Request To Book).

For currency parameters, the format should follow some simple rules:

  • The value shouldn't contain the currency symbol, you should pass currency via currency_code attribute. For example, use 150 rather than $150.
  • You can use a simple number, number with decimal places or number with thousand and decimal places. You should use , for thousand places and . for decimal places. Decimal places shouldn't be used for VND currency.
VND: 150000 / 150,000
USD: 1234 / 1234.56 / 1,234.56
1
2
  • The value shouldn't be a negative number (!?) with the minimum of 0 (if allowed).

The currency parameters include:

  • nightly_price
  • weekend_price
  • monthly_price
  • additional_guests_fee
  • cleaning_fee
  • security_fee

Endpoint

Method URI Headers
POST /api/rooms/{room}/pricing Authorization: Bearer <token>
Accept: application/json

Data Params

Param Description Type Required
nightly_price The basic price for a single night.
The minimum value should be 1.
This price is applied from Monday through Thursday.
Numeric (currency) Yes
weekend_price The basic price for weekend.
The minimum value should be 0.
This price is applied for Friday, Saturday and Sunday.
Numeric (currency) Yes
monthly_price The monthly price.
The minimum value should be 0.
This price is applied when booking duration exceeds 30 days.
Numeric (currency) Yes
additional_guests_fee The price for additional guests compared to booking point.
The minimum value should be 0.
Numeric (currency) Yes
cleaning_fee The cleaning fee.
The minimum value should be 0.
Numeric (currency) Yes
security_fee The security fee.
The minimum value should be 0.
Numeric (currency) Yes
standard_guests The number of standard guests. Integer Yes
minimum_stay The minimum number of nights of staying. Integer Yes
maximum_stay The maximum number of nights of staying.
It should be greater than the minimum_stay.
Integer No
currency_code The currency code. Can be VND or USD. String Yes
cancellation_policy The booking cancellation policy. Can be Flexible or Moderate. String Yes
booking_type The booking type. Can be instant_book or request_to_book. String Yes

Route Params

Param Description Type Required
{room} The ID of a given room. Integer Yes

Request & Response Examples

Successful Response

200

Example request

curl \
  --request POST \
  --url https://api.luxstay.com/api/rooms/10000/pricing \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer <token>' \
  --form 'nightly_price=650,000' \
  --form 'monthly_price=550,000' \
  --form weekend_price=0 \
  --form 'cleaning_fee=250,000' \
  --form 'security_fee=150,000' \
  --form 'additional_guests_fee=200,000' \
  --form standard_guests=5 \
  --form cancellation_policy=Flexible \
  --form booking_type=instant_book \
  --form minimum_stay=5 \
  --form maximum_stay=12 \
  --form currency_code=VND
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

Example response

{
    "data": {
        "room_id": 10000,
        "nightly_price": 650000,
        "monthly_price": 550000,
        "weekend_price": 650000,
        "cleaning_fee": 250000,
        "security_fee": 150000,
        "additional_guests_fee": 200000,
        "currency_code": "VND",
        "standard_guests": 5,
        "cancellation_policy": "Flexible",
        "booking_type": "instant_book",
        "checkin_time": "2:0 PM",
        "checkout_time": "12:00 PM",
        "minimum_stay": "5",
        "maximum_stay": "12"
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

Error Response

401

Reason invalid access token

Example response

{
    "message": "Unauthenticated."
}
1
2
3

403

Reason unauthorized to update pricing information of a room

Example response

{
    "message": "You are not allowed to access or change information associated with this room."
}
1
2
3

404

Reason cannot find the given room

Example response

{
    "message": "Cannot find the given room"
}
1
2
3

422

Reason validation errors

Example response

{
    "message": "The given data was invalid.",
    "errors": {
        "nightly_price": [
            "The nightly price must be at least 1."
        ]
    }
}
1
2
3
4
5
6
7
8
{
    "message": "The given data was invalid.",
    "errors": {
        "maximum_stay": [
            "The maximum stay must be greater than or equal 5."
        ]
    }
}
1
2
3
4
5
6
7
8
{
    "message": "The given data was invalid.",
    "errors": {
        "booking_type": [
            "The selected booking type is invalid."
        ]
    }
}
1
2
3
4
5
6
7
8
{
    "message": "The given data was invalid.",
    "errors": {
        "cancellation_policy": [
            "The selected cancellation policy is invalid."
        ]
    }
}
1
2
3
4
5
6
7
8
Last Updated: 11/18/2018, 9:11:26 AM