Booking API


GuestSmiles Booking API provide functionality to create booking against properties, retrieved from Listing APIs.
The partners will use the Listing APIs to retrieve property content, rates and availability and use the Bookings API to do availability checks, and create reservations.

To create a booking:
1) Use 'Quotation API' to Check the availability and pricing for the required dates
2) Use details from the 'Quotation API' and create booking using 'Booking API'
3) To check status of any reservation at any time, use 'ReservationStatus' API

Quotation API:

Swagger
Curl
url -X 'POST' \
'{BaseUrl}/booking/quotation' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
    "propertyId": 14311,
    "checkIn": "2021-12-24",
    "checkOut": "2021-12-28",
    "adults": 2,
    "children": 1,
    "babies": 0,
    "pets": 0
}

Child Elements Booking Request

NameDescription
propertyIdProperty Id
Required
Type: string
checkInCheck In Date
Required
Type: date
checkOutCheck Out date
Required
Type: date
adultsnumber of adults
Required
Type: integer
childrennumber of children
Optional
Type: integer
petsnumber of pets
Optional
Type: integer

Response
{
    "hasError": false,
    "errorCode": null,
    "errorMessage": null,
    "content": {
        "available": true,
        "propertyId": string,
        "checkIn": {date},
        "checkOut": {date},
        "stayPrice": {decimal},
        "taxesAndFees": {decimal},
        "totalPrice": {decimal},
        "currency": {currency},
        "fees": [feeitem],
        "taxes": [feeitem],
        "deposit": {
            "dueToday": {boolean},
            "dueDate": {date},
            "name": {string},
            "price": {decimal},
            "refundable": {boolean}
        },
        "paymentMethods": [string],
        "quotationPaymentSplit": {
            "firstPayment": {paymentSplit},
            "secondPayment": {paymentSplit},
            "thirdPayment": {paymentSplit}
        }
    }
}

feeitem: { "code": {string}, "name": {string}, "price": {decimal}, "refundable": {boolean} }
paymentSplit : { "amount": {decimal}, "dueToday": {boolean}, "isRemainder": {boolean}, "dueDate": {date} }

  • "hasError": True if there's any error
  • "errorCode": Error code value, check all the possible values
  • "errorMessage": Error message, when there's any error.

Child Elements content

NameDescription
availablealways true when there isn't any error
checkInCheck In Date
checkOutCheck out Date
stayPriceRent amount
taxesAndFeesTotal of all fees and taxes
totalPriceTotal booking price including rent, fees and taxes
feesfees breakdown collection
taxestaxes breakdown collection
depositdamage deposit if applicable, either refundable or not
currencyUSD
paymentMethodsaccepted payment methods, "creditcard" or "invoice" or both
quotationPaymentSplitpayment split of total booking amount, three splits max

Child Elements feeitem

NameDescription
codeid of the fee
namename of the fee
priceapplicable amount for this reservation
refundableeither refundable or not

Child Elements paymentSplit

NameDescription
amountamount to be paid for current installment
dueTodayeither the fee is due today or not, if true dueDate would be empty, otherwise dueDate is provided
dueDatedate when the payment is due
isRemaindereither the payment is all the remaining amount which is due


Reservation API:

Swagger
Curl
curl -X 'POST' \
  '{BaseUrl}/booking/makebooking' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  {
  "content": {
    "propertyId": 14311,
    "checkIn": "2022-03-11",
    "checkOut": "2022-03-14",
    "price": 1449.54,
    "paymentMethod": {
      "type": "creditCard",
      "creditCard": {
        "nameOnCard": "xyz",
        "number": "4111111111111111",
        "cvc": "373",
        "expYear": "2028",
        "expMonth": "06"
      }
    },
    "customer": {
      "firstName": "xyzFirstName",
      "lastName": "xyzLastName",
      "email": "xyzName@gmail.com",
      "phone": "+923126162662",
      "address": "31h",
      "city": "xyzCity",
      "postCode": "63100",
      "country": US",
      "gender": "male",
      "dob": "1993-06-27",
      "houseNo": "31",
      "street": "xyzStreet",
      "state": "xyzState"
    },
    "adults": 2,
    "children": 0,
    "babies": 0,
    "pets": 0
  }
}
}'

Request Body Details
(M)=Mandatory
(O)=Optional
  • "propertyId"(M) Id of property to be booked.
  • "checkIn"(M) Check in date.
  • "checkOut"(M) Check out date.
  • "price"(M) Price to be charged, this should be same value, received in quotation API, in field "totalPrice"
  • Payment details:
    • "type" (M) must be "creditCard"
    • "creditCard"
      • "nameOnCard" (M) Name written on card
      • "number" (M) Card number
      • "cvc" (M) Card CVC number
      • "expYear" (M) Expiry year. Length should be 4 and format should be YYYY i.e 2028 not 28 or any other
      • "expMonth" (M) Expiry month. Format should be MM Example for july is should be 07 not 7 or any other
  • Customer details:
    • "firstName" (M) Name written on card
    • "lastName" (M) Card number
    • "email" (M) Card CVC number
    • "phone" (M) Expiry year. Length should be 4 and format should be YYYY i.e 2028 not 28 or any other
    • "address" (M) Expiry month. Format should be MM Example for july is should be 07 not 7 or any other
    • "city" (M) Expiry month. Format should be MM Example for july is should be 07 not 7 or any other
    • "postCode" (M) Postal code
    • "country" (M) 2 Character Country Code
    • "gender" (M) Gender
    • "dob" (M) Date of birth
    • "houseNo" (M) House number
    • "street" (M) Street name
    • "state" (M) State name
  • "adults"(M) Number of adults to book for
  • "children"(O) Number of children to book for
  • "babies"(O) Number of babies to book for
  • "pets"(O) Number of pets to book for

Response
{
  "hasError": false,
  "errorCode": null,
  "errorMessage": null,
  "content": {
    "booked": true,
    "bookingStatus": null,
    "bookingId": 5190,
    "rentAmount": 473.5,
    "fees": 401.68,
    "tax": 27,
    "totalBookingAmount": 1449.54,
    "refundableAmount": 500
  }
}

Response Details
  • "hasError" True if there's any error
  • "errorCode": Error code value, when there's any error.
  • "errorMessage": Error message, having error description.
  • (Check all the possible values for 'errorCode' and 'errorMessage' here )
  • "content" Booking details
    • "booked": True if booking was done successfully
    • "bookingStatus": Status of booking (Check all the possible values for 'bookingStatus' under section 'Booking Status Types' here )
    • "bookingId": Booking number in GuestSmiles system,
    • "rentAmount": Rent amount for this booking,
    • "fees": Fees Amount for this booking,
    • "tax": Tax Amount for this booking,
    • "totalBookingAmount": Total amount charged for this booking, including security deposit
    • "refundableAmount": Amount refundable


ReservationStatus API:

Swagger
Curl
curl -X 'GET' \
  '{BaseUrl}/booking/reservationstatus/1256' \
  -H 'accept: application/json' \

Response
{
  "hasError": false,
  "errorCode": null,
  "errorMessage": null,
  "content": {
    "propertyId": 14311,
    "start": "2022-03-11T00:00:00",
    "end": "2022-03-14T00:00:00",
    "totalAMount": 1449.54,
    "currency": "USD",
    "reservationStatus": "reserved",
    "reservationId": 5191
  }
}

Response Details
'Content' is the container for the response, it will be null when there's any error in response.
  • "propertyId" Property ID
  • "reservationId": Reservation ID
  • "start": Start date of booking
  • "end": End date of booking
  • "totalAMount": Total booking amount
  • "currency": Currency booking amount
  • "reservationStatus": Reservation status
    (Check all the possible values for 'reservationStatus' under section 'Booking Status Types' here )