# Ratehawk

{% embed url="<https://youtu.be/WQTuQEwrHjA>" %}

### 📌 Overview

This guide explains how to integrate the **RateHawk API** into your PHPTRAVELS-based travel booking system.

The integration allows you to:

* Search hotels in real-time
* Display hotel content locally (fast loading)
* Process bookings with live pricing
* Manage bookings with PNR confirmation

***

### ⚙️ 1. API Authentication & Setup

**Steps:**

1. Register with RateHawk and get API access
2. Collect the following credentials:
   * API Key
   * Key ID
   * Key Type
3. Go to your admin panel:

```
Modules > Stays > RateHawk
```

4. Enter your API credentials
5. Click **Test API Connection**

✅ Expected Result:

* Search API working
* Booking API working
* Management API working

***

### 🗄️ 2. Database Configuration

To handle large hotel data, a separate database is required.

**Steps:**

1. Create a new database via:
   * CPanel / CloudPanel / Hosting Panel
2. Save credentials:
   * Database Name
   * Username
   * Password
   * Host
3. Add these details in your system settings

✅ This ensures:

* Secure connection
* Better performance
* Scalable data handling

***

### 📥 3. Database Import & Content Setup

RateHawk provides a **large dataset (30GB+)** for hotel content.

**Steps:**

1. Download the database file from RateHawk
2. Rename file to:

```
db.json
```

3. Upload file to:

```
/modules/stays/ratehawk/content
```

4. Go to Admin Panel → Run **Import Tool**

***

#### ⚠️ Important Notes

* Import process can take **12–24+ hours**
* Depends on server performance
* Keep process running (do not stop)
* Recommended: Use VPS or dedicated server

***

### 🔍 4. Search, Pricing & Booking Flow

Once data is imported:

#### 🔎 Hotel Search

* Uses **local database** for:
  * Hotel names
  * Images
  * Descriptions
  * Locations

👉 Result: **Fast loading search results**

***

#### 💰 Pricing & Availability

* Pulled in real-time from RateHawk API

👉 Result: **Accurate live pricing**

***

#### 🛒 Booking Flow

1. User selects hotel
2. System fetches live rates
3. Payment processed (e.g., Stripe)
4. Booking confirmed

✅ Output:

* Booking status: Confirmed
* PNR generated
* Stored in admin panel

***

### 🚀 Best Practices

* Use **high-performance server (8GB+ RAM recommended)**
* Run import via **CLI or background process**
* Enable caching for better speed
* Monitor logs during import

***

### 💡 Need a Ready Solution?

We provide a complete travel booking system with:

* Hotels (RateHawk, Hotelbeds, Agoda)
* Flights (Amadeus, Travelport, Duffel)
* Tours (Viator, Tiqets)
* Cars & Transfers
* B2B + B2C system

👉 Book a free meeting:\
<https://phptravels.com/meeting>
