API Specification

Tour Pricing API

v1.2.0 Active API Key Required

Calculate final pricing for a tour booking

Endpoint

POST /api/b2b/tour/pricing.php

This API calculates the total and final payable amount for a tour based on selected date, number of passengers, discounts, and coupons.

API Key Authentication

Authenticate requests via HTTP Header or Request Parameter
Required for all endpoints

Enjoy Holiday Hub APIs authenticate requests using your unique secret API Key. You can provide your key in either of the following standard formats:

Method 1: Header (Recommended)

Send key in standard HTTP header:

X-API-Key: demo_123456789
Method 2: Body / Query

Send key in JSON payload or query param:

"api_key": "demo_123456789"
Demo Sandbox Key: demo_123456789
Get your production key in Agent Portal

Request Parameters

FieldTypeRequiredDescription
TourIdintegerRequiredUnique tour ID
TourDateIdintegerRequiredSelected travel date ID
AdultsintegerRequiredNumber of adults
ChildrenintegerOptionalNumber of children
InfantsintegerOptionalNumber of infants
CouponCodestringOptionalOptional coupon code

Request Example

JSON Response
{
    "api_key": "YOUR_API_KEY",
    "TourId": 201,
    "TourDateId": 501,
    "Adults": 2,
    "Children": 1,
    "Infants": 0,
    "CouponCode": "SUMMER10"
}

cURL Example

curl -X POST "https://enjoyholidayhub.com/api/b2b/tour/pricing.php" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "X-API-Key: demo_123456789" \
  -d '{
    "TourId": 201,
    "TourDateId": 501,
    "Adults": 2,
    "api_key": "demo_123456789"
}'

Response Example

JSON Response
{
    "status": true,
    "data": {
        "price_breakdown": {
            "adult_price": 8000,
            "child_price": 5000,
            "infant_price": 2000
        },
        "total_amount": 21000,
        "discount": 2000,
        "coupon_discount": 1000,
        "final_amount": 18000
    }
}

Response (Error)

ERROR / NOTICE Pricing calculation failed or invalid input
JSON Response
{
    "status": false,
    "message": "Pricing calculation failed or invalid input"
}

Important Notes

  • 💰 Pricing depends on selected travel date
  • 🎟 Coupon discount is optional
  • 📊 Final amount includes all discounts
  • 🔁 Always verify pricing before blocking or booking
  • ⚠️ Prices may change dynamically