Partner API Documentation

1. Authentication

Every API request must include a valid API key x-api-key and the associated user email x-email in the request headers. The API key must be active (i.e. status = true) and the company must have access to the corresponding modules.

x-api-key: YOUR_API_KEY
x-email: user@example.com

2. Endpoints

2.1 Locations

GET /api/v1/location

Description: Returns a list of locations that have at least one active activity. Each location includes the country, city, and an image.

Example Request:

GET /api/v1/location
x-api-key: YOUR_API_KEY
x-email: user@example.com

Example Response:

{
  "locations": [
    {
      "location_id": 1,
      "country": "UAE",
      "city": "Dubai",
      "img": "https://example.com/location.jpg"
    },
    {
      "location_id": 2,
      "country": "UAE",
      "city": "Abu Dhabi",
      "img": "https://example.com/london.jpg"
    }
  ]
}

2.2 Activities by Location

GET /api/v1/location/{locationId}

Description: Retrieves all activities for a specific location. The response includes basic details such as name, description, image, video, location, creation date, and pricing (adult base price and discounted price).

Example Request:

GET /api/v1/location/1
x-api-key: YOUR_API_KEY
x-email: user@example.com

Example Response:

{
  "activities": [
    {
      "activity_id": 101,
      "name": "City Tour",
      "description": "A guided tour around the city.",
      "image_url": "https://example.com/activity.jpg",
      "video_url": "https://example.com/video.mp4",
      "city": "Dubai",
      "country": "USA",
      "created_at": "2025-03-01T12:34:56Z",
      "min_adult_base_price": 100.00,
      "min_discounted_price": 90.00
    },
    {
      "activity_id": 102,
      "name": "Museum Visit",
      "description": "Explore the famous museum.",
      "image_url": "https://example.com/museum.jpg",
      "video_url": null,
      "city": "Dubai",
      "country": "USA",
      "created_at": "2025-03-05T10:20:30Z",
      "min_adult_base_price": 80.00,
      "min_discounted_price": null
    }
  ]
}

2.3 Activity Details

GET /api/v1/activity/{activityId}

Description: Returns complete details for a specific activity. The response includes activity details, description blocks, and tour options (with pricing, transfer options, time slots, and blocked dates). An optional date parameter can be provided (in YYYY-MM-DD format) to fetch pricing for a specific day, and an optional companyId for B2B pricing.

Query Parameters:

  • date (optional): Booking date in YYYY-MM-DD format.
  • companyId (optional): For applying B2B pricing logic.

Example Request:

GET /api/v1/activity/123
x-api-key: YOUR_API_KEY
x-email: user@example.com

Example Response:

{
  "activity": {
    "activity_id": 123,
    "module_id": 1,
    "location_id": 5,
    "name": "City Tour",
    "description": "Enjoy a city tour...",
    "image_url": "https://example.com/image.jpg",
    "created_at": "2025-03-01T12:34:56Z",
    "video_url": "https://example.com/video.mp4",
    "country": "UAE",
    "city": "Dubai",
    "module_status": true,
    "module_name": "Tour Module",
    "activity_blocked_dates": ["2025-03-20", "2025-03-25"]
  },
  "descriptionBlocks": [
    {
      "description_id": 1,
      "content": "Detailed description block content..."
    }
  ],
  "tourOptions": [
    {
      "option_id": 101,
      "name": "Standard Tour",
      "description": "Basic tour option",
      "discount_value": 10,
      "discount_type": "fixed",
      "availability_start_date": "2025-03-01",
      "availability_end_date": "2025-12-31",
      "created_at": "2025-03-01T12:00:00Z",
      "adult_base_price": 100.00,
      "child_base_price": 50.00,
      "infant_base_price": 0,
      "min_discounted_price": 90.00,
      "allow_child": true,
      "allow_infant": false,
      "transfer_options": [],
      "time_slots": [],
      "blocked_dates": []
    }
  ]
}

2.4 Yachts

GET /api/v1/c/yacht

Description: Retrieves a list of yachts, including availabilities, services, and images.

Example Request:

GET /api/v1/c/yacht
x-api-key: YOUR_API_KEY
x-email: user@example.com

2.5 Shared Yachts

GET /api/v1/c/yacht/shared

Description: Retrieves a list of shared yacht trips along with their detailed schedules.

Example Request:

GET /api/v1/c/yacht/shared
x-api-key: YOUR_API_KEY
x-email: user@example.com

2.6 Bookings (Example)

POST /api/v1/c/booking

Description: Creates a new booking for an activity or yacht.

Request Headers:

x-api-key: YOUR_API_KEY
Content-Type: application/json

Request Body Example:

{
  "activity_id": 123,
  "booking_date": "2025-04-15",
  "adult_count": 2,
  "child_count": 1,
  "infant_count": 0,
  "time_slot_id": 45
}

Example Response:

{
  "booking_id": 1001,
  "status": "pending",
  "total_price": 300.00,
  "created_at": "2025-04-01T12:00:00Z",
  "message": "Booking created successfully"
}

3. General Error Responses

  • 401 Unauthorized: Missing or invalid API key and/or email.
  • 403 Forbidden: API key inactive or insufficient module access.
  • 400 Bad Request: Invalid or missing parameters.
  • 500 Internal Server Error: An unexpected server error occurred.