iC

iChiangrai B2B API Gateway

OCTO v1.0 • Phase 1-3 Live

Tour & Hotel Syndication, Real-time Allotment, Instant Booking & Webhooks

← Back to Main Site Production Live

iChiangrai B2B Tour & Hotel Syndication Gateway

A modern, high-throughput RESTful JSON syndication gateway enabling domestic and international tour operators, OTAs, travel agencies, and tech platforms to query catalogs, check real-time seat/room allotments, issue instant bookings with wallet deduction, and receive automated webhooks.

⚡

Sub-2ms Latency

Direct PDO connection on local NVMe storage delivering ultra-fast responses.

🌐

3 Native Languages

Complete dynamic content in Thai, English, and Simplified Chinese (?lang=zh).

🏷️

Automated Net Rates

Instant wholesale discount calculation per partner tier with guaranteed commission margins.

💳

Wallet & Webhooks

Pre-deposit wallet balance deduction, instant vouchers, and HMAC-SHA256 push hooks.

Base Production Endpoint HTTPS Protocol Only
https://chiangraihotelbooking.com/api/v1/b2b

Authentication & Security

All requests to the iChiangrai B2B Gateway require a valid API Key provided in HTTP request headers.

Supported Authorization Headers:

Option 1 (Recommended Standard):
Authorization: Bearer crb_b2b_live_test_bkk998877
Option 2 (X-API-KEY Header):
X-API-KEY: crb_b2b_live_test_bkk998877
Security Principle: Keep your API keys and Secret keys strictly confidential. Never expose your API keys in frontend browser code or mobile app bundles. All calls must originate from your secure backend server.

Wholesale Partner Net Tiers

The pricing engine automatically applies wholesale net discount tiers to public rack rates for all tours and rooms.

Silver Partner
10% Net Off

Entry-level registered travel agencies and boutique inbound operators.

Popular
Gold Partner
15% Net Off

Established domestic operators and regional wholesalers (e.g. Bangkok Discovery Holidays).

VIP / Crossborder Partner
20% Net Off

High-volume international OTAs and crossborder charter partners (e.g. Yunnan-Lanna Travel).

Phase 2: Allotment & Real-time Quota Engine

Automated seat and vehicle allocation for Chiang Rai day tours, plus seasonal room tariff overrides for hotels.

🚐 VIP Minivan & Seat Allotment

Each tour date is initialized with 18 seats (2 VIP Commuter Minivans). The availability engine deducts seats booked in real time, displays remaining capacity, returns vehicle recommendations (VIP Sedan for 1-2 pax vs Commuter for 3-9 pax), and flags limited (≤ 4 seats) or sold_out.

🏨 Hotel Seasonal Tariff Matrix

The hotel engine identifies seasonal periods: Regular Season, High Season (Nov 1 – Feb 28), and Peak Festival Season (Dec 20 – Jan 5 / Songkran). Nightly rates are calculated, stop-sale status verified, and net total quotes returned instantly.

Phase 3: Instant Booking, Wallet & Webhooks

End-to-end automated two-way syndication workflow with instant voucher issuance, partner credit deduction, and real-time event webhooks.

1. Wallet Deduction

Bookings deduct wholesale net amounts directly from the agency's pre-funded deposit balance (credit_balance). If balance is insufficient, HTTP 400 is returned immediately.

2. Instant Confirmation

Generates a unique Booking Reference (CRHB-YYYYMMDD-XXXX) and digital Voucher (VCH-XXXXXXXX), updates seat/room allotments, and alerts operations team via LINE.

3. Free Auto-Refund

Cancellations made ≥ 48 hours before travel date automatically refund 100% of the wholesale amount back to the agency's credit balance and restore inventory allotment.

🔔 Webhook Signature Verification (HMAC-SHA256)

When events occur (e.g. booking.created, booking.cancelled), iChiangrai Gateway dispatches an HTTP POST to your configured Webhook URL. Each webhook payload includes an X-Signature header generated with your partner's Secret Key:

$computed_signature = hash_hmac('sha256', $raw_payload, $partner_secret_key);
if (hash_equals($computed_signature, $_SERVER['HTTP_X_SIGNATURE'])) {
    // Signature verified! Process webhook event
}

🧪 Interactive API Sandbox & Live Tester

Test real API requests against production with real-time response parsing

Phase 1, 2 & 3 Supported
Demo Accounts: •
Server Response

                

Integration Code Snippet