Name | Add Property Rate |
---|---|
Description | Add a rate to a property |
Method | POST |
URL | /properties/{property}/rates |
Example | /api/properties/11111111/rates | Access | OWNER, MANAGER |
Authorization | eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXUyJ9... |
---|---|
Fields | Type | Required | Description |
---|---|---|---|
property | number | yes | Property id. |
rates_type | number | yes | 1 - Seasonal, 2 - Holiday. |
period_name | text | yes | Name to identify the period. |
start_date | date | yes | Date when start the period. |
end_date | date | yes | Date when end the period. |
minimum_stay | number | yes | Minimum number of days. If rates_type is different to holiday, this field is required. |
nightly | number | yes | Price per night. If rates_type is different to holiday, this field is required. |
weekly | number | no | Price per week. If rates_type is different to holiday, you will can fill this field. |
monthly | number | no | Price per month. If rates_type is different to holiday, you will can fill this field. |
holiday_price | number | no | If rates_type is holiday, this field is required. |
weekend_nights_charge | bool | no | If rates_type is different to holiday, it is can accept value. |
weekend_nights_price | number | no | If weekend_nights_charge is true, you need to specified the value. |
weekend_days | array | no | Only required when rates_type is different to holiday and weekend_nights_carge is true. |
guest_fee | bool | no | If rates_type is different to holiday, you will can fill this field. |
guest_fee_price | number | no | If guest_fee is true, this field is required. |
guests_quantity | number | no | If guest_fee is true, this field is required. |
notes | text | no | Additional notes to specified any things. |
Fields | Type | Required | Description |
---|---|---|---|
[thursday] | bool | yes | If charge applied Thursday. |
[friday] | bool | yes | If charge applied Friday. |
[saturday] | bool | yes | If charge applied Saturday. |
[sunday] | bool | yes | If charge applied Sunday. |
{
"code": R111,
"message": "Success"
}
Code | Message | Cause | Possible Frontend Message [Behavior] |
---|---|---|---|
EC000 |
Internal error in API |
Internal error connecting the database | "Oops! Looks like we hit a snag. Try closing the app and reopening it." |
EC001 |
User not found |
Token user id doesn't match our records | "Sorry, We couldn't find your information!" |
EC002 |
Property not found |
Property id doesn't match our records | "Sorry, We couldn't find that property!" |
EC014 |
Property doesn't belong to that user |
The user logged in is not the property's owner | "Sorry, you do not have access to that property!" |
EC024 |
Range of date not valid |
The range of date is not valid | Please enter valid dates |
R000 |
Fail |
The rate wasn't created | |
R111 |
Success |
The operation was successful | |
SC006 |
User no authorization |
The token role is not valid for using the API services | "You have been logged out." - [Take the user to the login screen] |
SC014 |
Expired token |
The token has expired | "You have been logged out." - [Take the user to the login screen] |
VID112 |
Invalid input for property |
Property id is not a number | [Call the API again using a valid value for property id] |
VID168 |
Invalid input for rates_type |
Rates_type is not in [1, 2] | [Call the API again using a valid value for rates_type] |
VID169 |
Invalid input for rate minimum stay |
Minimum_stay is not a number between 0-180 | "Please select an item from the list" |
VID170 |
Invalid input for rate price nightly |
Nightly is not a number | Nightly must be a number |
VID171 |
Invalid input for rate price weekly |
Weekly is not a number | Weekly must be a number |
VID172 |
Invalid input for rate price monthly |
Monthly is not a number | Monthly must be a number |
VID173 |
Invalid input for rate weekend_charge |
Weekend_charge is not in [0, 1] | [Call the API again using a valid value for weekend_charge] |
VID174 |
Invalid input for rate weekend_price |
Weekend_price is not a number | Weekend nights price must be a number |
VID175 |
Invalid input for rate weekend_days |
Weekend_days is not an array of 4 item or some items are not in [0, 1] | [Call the API again using a valid value for weekend_days] |
VID176 |
Invalid input for rate guest_fee |
Guest_fee is not in [0, 1] | [Call the API again using a valid value for guest_fee] |
VID177 |
Invalid input for guest_price |
Guest_price is not a number | Guest fee must be a number |
VID178 |
Invalid input for guest_quantity |
Guest_quantity is not a number | "Please select an item from the list" |
VID179 |
Invalid input for period name |
Period name is empty or it has only characters not allowed(" ", ', ’, ‘, ’, ", &, \, <, >, --) | "Please enter a valid text for Period Name" |
VID180 |
Invalid input for start date |
Start date doesn't meet the date's format | "Please enter a valid Start date" |
VID181 |
Invalid input for end date |
End date doesn't meet the date's format | "Please enter a valid End date" |
VID182 |
Invalid input for holiday_price |
Holiday_price is not a number | Holiday price must be a number |
VID183 |
Invalid input for notes |
Notes has only characters not allowed(" ", ', ’, ‘, ’, ", &, \, <, >, --) | "Please enter a valid text for Notes" |