> For the complete documentation index, see [llms.txt](https://chainrewardz.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chainrewardz.gitbook.io/documentation/quickstart-guide/hotel.md).

# 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` with `membershipId`

```
curl --location 'https://api.chainrewardz.net/hotel/guest/v3/serp' \
--header 'Authorization: access_token' \
--data '{
    "checkin": "2023-10-27",
    "checkout": "2023-10-28",
    "guests": [
        {
            "adults": 2,
            "children": []
        }
    ],
    "regionId": 2114,
    "residency": "gb",
    "smartContractAddress": "paras-token-v2.testnet"
}'
```

#### 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.

{% code overflow="wrap" %}

```
"totalPages": 66,
  "session": "4ef38e84-1a39-470d-8424-833025869154",
  "maxItemOfPage": 10,
  "hotels": [
    {
      "id": "the_westbridge_hotel",
      "rates": null,
      "price": 250,
      "isDiscount": false,
      "discountAmount": null,
      "discountPercent": null,
      "isCashback": true,
      "cashbackAmount": 250,
      "cashbackPercent": "5",
      "partnerMarginAmount": 250,
      "membershipPrice": 250,
      ..........
```

{% endcode %}

{% hint style="danger" %}
This API has a low rate limit. To ensure the best user experience, we recommend caching your results.  &#x20;
{% endhint %}

***

## 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` with `membershipId`

```
// curl --location 'https://api.chainrewardz.net/hotelBookingMng/customer/v3/hotelBooking/hotelpage' \
--header 'Authorization: access_token' \
--data '{
    "id": "test_hotel",
    "checkin": "2023-10-16",
    "checkout": "2023-10-17",
    "guests": [
        {
            "adults": 2,
            "children": []
        }
    ],
    "residency": "gb"
    "smartContractAddress": "paras-token-v2.testnet"
}'
```

#### Example Response

{% code overflow="wrap" %}

```
{
  "id": "test_hotel",
  "rates": [
    {
      "allotment": 6,
      "bookHash": "h-b0017e2e-0d52-533c-974b-71a5ba451c83",
      "matchHash": "m-cfe04400-727b-5498-8728-11d686ad1c70",
      "dailyPrices": [
        10
      ],
      "meal": "nomeal",
      "paymentOptions": {
        "paymentTypes": [
          {
            "amount": 11.4,
            "isDiscount": false,
            "discountAmount": null,
            "discountPercent": null,
            "partnerDiscountPercent": null,
            "isCashback": false,
            "cashbackAmount": null,
            "cashbackPercent": null,
            "partnerCashbackPercent": null,
            "membershipPrice": 11.4,
            "currencyCode": "USD",
            "isNeedCreditCardData": false,
            "isNeedCvc": false,
............
```

{% endcode %}

***

## 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**

```
curl --location 'https://api.chainrewardz.net/hotelBookingMng/customer/v3/hotelBooking/create' \
--header 'Authorization: access_token' \
--data '{
    "bookHash":"h-b0017e2e-0d52-533c-974b-71a5ba451c83"
}'
```

#### Example Response

The `id`447 in the response is used in Step 5 to pay for the order.

```
  "id": 447,
  "created": "2023-09-27T14:56:51.01834032",
  "updated": "2023-09-27T14:56:51.01835257",
  "billingInfo": {
    "quantityTotal": null,
    "grossTotal": 11.4,
    "taxTotal": 0,
    "serviceTotal": null,
    "discountTotal": 0,
    "refundTotal": null,
    "tipPrice": null,
    "netTotal": 11.4,
    "baseCurrencyCode": "GBP"
  },
  "expireTime": "2023-09-27T19:56:29",
  "status": "NEW",
  "rate": {
    "bookHash": "h-b0017e2e-0d52-533c-974b-71a5ba451c83",
    "paymentOptions": {
      "paymentTypes": [
        {
          "id": 6475,
          "amount": 11.4,
          "amountForCheckout": 11.4,
          "currencyCode": "GBP",
          "isNeedCreditCardData": true,
          "isNeedCvc": false,
          "type": "deposit",
          "vatData": {
            "included": false,
            "value": "0.00"
```

***

## 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

```
curl --location 'https://api.chainrewardz.net/hotelBookingMng/customer/v3/hotelBooking/finish' \
--header 'Authorization: access_token' \
--data-raw '{
    "orderId": 15,
    "user": {
        "email": "john.smith@chainreward.net",
        "phone": "+44123456789",
        "firstName": "John",
        "lastName": "Smith",
        "comment": ""
    }
}'
```

***

## 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.&#x20;

#### Example Request

In this request, the partner must specify the `orderId` and payment `coin`.&#x20;

> For a list of payment method IDs, please visit [here](/documentation/additional-resources/payment-methods-in-progress.md).

```
curl --location 'https://sandbox.chainrewardz.net/crypto/v3/payment/hotel/pay' \
--header 'Authorization: access_token' \
--data '{
    "coin": "near",
    "orderId": 242
}'
```

#### 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.

```
{
  "expirationEstimateDate": "2023-10-05T17:07:56.097Z",
  "payAddress": "6f2409bbfce137c880f914e3fdaa6298f338435f4379a7a138bdd7d4a2e10dc3",
  "payAmount": 11.34921,
  "payCurrency": "near",
  "priceAmount": "12.30",
  "priceCurrency": "usd"
}
```

***

## 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.&#x20;

#### Example Request

```
curl --location 'https://api.chainrewardz.net/hotelBookingMng/customer/v3/hotelBooking/15' \
--header 'Authorization: access_token'
```

#### 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.

```
{
  "id": 15,
  "created": "2024-05-26T14:58:04",
  "updated": "2024-05-26T14:58:15",
  "billingInfo": {
    "quantityTotal": null,
    "grossTotal": 2.28,
    "taxTotal": 0,
    "serviceTotal": null,
    "discountTotal": 0,
    "refundTotal": null,
    "tipPrice": null,
    "netTotal": 2.28,
    "baseCurrencyCode": "USD",
    "paymentType": null,
    "paymentCurrency": null
  },
  "expireTime": "2024-05-26T15:13:15",
  "status": "PENDING",
  "rate": {
    "bookHash": "h-cef2d0c0-12dd-5ed8-bf45-f57f7e9734c7",
    "paymentOptions": {
      "paymentTypes": [
        {
          "id": 865,
          "amount": 2.28,
          "amountForCheckout": 2.28,
          "currencyCode": "USD",
          "isNeedCreditCardData": true,
          "isNeedCvc": false,
          "type": "deposit",
          "vatData": {
            "included": false,
            "value": "0.00"
          },

```
