Gate2hotelsAPI_VERSION: v1.0.3 (Iraq Distribution Engine)
GATEWAY_PINGING|LATENCY: --ms|REGION: ME-CENTRAL (BAGHDAD EDGE)

Iraq B2B Hotel Distribution Platform API

Integrate real-time room availability, rate calendars, and atomic reservation execution across approved Iraqi hotels in Baghdad, Erbil, Karbala, Najaf, and Basra.

LAUNCH_SANDBOX →DOWNLOAD_OPENAPI.YAML
QUICKSTART_PIPELINE // 3 STEPS TO INTEGRATION
STEP 01CREDENTIALS
Obtain Sandbox API Keys

Generate instant sandbox credentials (`g2h_test_...`) to access simulated Iraqi hotel allotments without affecting live production booking ledgers.

STEP 02ZERO-TRUST
Inspect Whitelisted Hotels

Call `GET /api/v1/hotels` to inspect the explicit manifest of Iraqi properties authorized for your client contract along with your agreed commission tier.

STEP 03ATOMIC BOOKING
Search & Commit Reservations

Execute the standard lifecycle (`search` → `price-check` → `prebook` → `bookings`). Use `Idempotency-Key` headers to ensure network-safe atomic commits.

SYSTEM_ARCHITECTURE // EDGE_DISTRIBUTION_PIPELINEMUTEX_LOCKING: FIFO_STRICT
+-----------------------+     HTTPS / TLS 1.3     +-----------------------------------------------+
|  B2B Client / Engine  | ======================> |  Gate2hotels Edge API Gateway (/api/v1)        |
|  (OTA / Metasearch)   |  Headers:               |  - Key Hash Verification (g2h_live / g2h_test)|
|  libcurl, Python, JS  |  X-Api-Key, X-Client-Id |  - 120 req/min Sliding Window Rate Limiter    |
+-----------------------+                         |  - Super Admin Zero-Trust Hotel Whitelisting  |
                                                  +-----------------------------------------------+
                                                                          |
                                                                          v
+-------------------------------------------------------------------------------------------------+
|  Channel Manager Core Engine                                                                    |
|  - Real-Time Iraq Availability Matrix (Formula: Available = max(0, Total - Booked - Blocked))   |
|  - Strict FIFO Booking Mutex (Zero Overselling Guarantee on last room)                          |
|  - Idempotency-Key Deduplication Registry                                                       |
+-------------------------------------------------------------------------------------------------+
           |                                     |                                     |
           v                                     v                                     v
+-----------------------+             +-----------------------+             +-----------------------+
|  Baghdad Properties   |             |  Erbil Properties     |             |  Basra / Holy Shrines |
|  - Babylon Rotana     |             |  - Erbil Rotana       |             |  - Basra Int'l Hotel  |
|  - Palestine Hotel    |             |  - Grand Millennium   |             |  - Baron Karbala      |
+-----------------------+             +-----------------------+             +-----------------------+
VERIFIED_SAMPLE // GET /api/v1/hotelsOUTPUT: JSON (Array of Authorized Iraqi Hotels)
cURL (POSIX Shell)
curl -X GET "http://localhost:3000/api/v1/hotels" \
  -H "X-Api-Key: g2h_test_itn_sandbox_994a11" \
  -H "X-Client-Id: api-partner-01"
Modern C++20 (libcurl)
#include <iostream>
#include <curl/curl.h>

int main() {
    CURL* curl = curl_easy_init();
    if (curl) {
        struct curl_slist* headers = NULL;
        headers = curl_slist_append(headers, "X-Api-Key: g2h_test_itn_sandbox_994a11");
        headers = curl_slist_append(headers, "X-Client-Id: api-partner-01");

        curl_easy_setopt(curl, CURLOPT_URL, "http://localhost:3000/api/v1/hotels");
        curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);

        CURLcode res = curl_easy_perform(curl);
        curl_easy_cleanup(curl);
    }
    return 0;
}
API_CAPABILITIES // PRODUCTION SCOPES
Zero Overselling Mutex
Atomic FIFO locking protects single remaining rooms from race-condition double bookings.
Price Lock & Re-quotes
Automated price-change detection triggers clean PRICE_CHANGED alerts if rates shift by > 1%.
Dual Currency Settlement
Native pricing in Iraqi Dinars (IQD) and US Dollars (USD) with configurable taxes & fees.
IHC Vouchers & QR
Official human-readable voucher IDs (IHC-YYYY-XXXXXX) for seamless Iraqi hotel reception check-in.