Hotel
Our hotel reservation process can be complex. We recommend following the flow outlined below to streamline your integration.
Step 1 - Searching Hotel
Endpoint:https://api.chainrewardz.net/hotel/guest/v3/serp/hotels
To make a hotel reservation, begin by using our search function to find available hotels in your specified region. Each hotel in the search results will have a unique ID
, which you can then use to obtain individual room prices based on your specific parameters in the next step.
Be sure to include the
residency
of your end-user in the search parameters, as some rooms or hotels may only be available to certain residents. For residency code we use ISO 3166-1 alpha-2 standard.
Example request
If you are using Web2 system replace
smartContractAddress
withmembershipId
Example Response
If you displaying the price for your end-user and you you should use the value from membershipPrice
. This is the price after discount/cashback.
This API has a low rate limit. To ensure the best user experience, we recommend caching your results.
Step 2 - Displaying Room Rates
Endpoint:https://api.chainrewardz.net/hotelBookingMng/customer/v3/hotelBooking/hotelpage
This endpoint should be used exclusively for hotels that your end-user is interested in. It will return real-time room rates for the selected hotel. Each room will have a bookHash
and you will need to use this to create order.
Be sure to include the
residency
of your end-user in the search parameters, as some rooms or hotels may only be available to certain residents. For residency code we use ISO 3166-1 alpha-2 standard.
Example Request
If you are using Web2 system replace
smartContractAddress
withmembershipId
Example Response
Step 3 - Creating Order
Endpoint:https://api.chainrewardz.net/hotelBookingMng/customer/v3/hotelBooking/create
Use the bookHash
of the selected room type to get the Order ID. This will be used in Step 5 to pay for the order.
Example Request
Example Response
The id
447 in the response is used in Step 5 to pay for the order.
Step 4 - Submit User Information
Endpoint:https://api.chainrewardz.net/hotelBookingMng/customer/v3/hotelBooking/finish
After placing an order, you will need to provide the details of the customer who will be checking in. We will store this information in our system until the order is paid, at which point we will process the booking.
Example Request
Step 5 - Paying For Order
Endpoint: https://api.chainrewardz.net/crypto/v3/payment/:service/pay
Our system will return the wallet address and the amount to be paid for the specified order and the amount in payment currency.
Example Request
In this request, the partner must specify the orderId
and payment coin
.
For a list of payment method IDs, please visit here.
Example Response
In the response, the payAmount
is the total amount of the payCurrency
that needs to be paid. In the case below 11.34921 NEAR tokens need to be sent to the payAddress
complete the booking.
Step 6 - Checking Order Status
Endpoint:https://api.chainrewardz.net/hotelBookingMng/customer/v3/hotelBooking/{{orderId}}
After payment, this endpoint should be used to check the status of the hotel booking.
Example Request
Example Response
The status will update to reflect the status of the booking. We recommend checking every 10 seconds to get the final response code. A full list of response code is available in our API reference document.
Last updated