Skip to content

Conversation

@Sagsgit
Copy link
Contributor

@Sagsgit Sagsgit commented Dec 10, 2025

Description 📝

  • Purpose: Adds comprehensive Viator Partner API integration to enable tours and experiences booking functionality within the Autohive platform
  • Approach: Implements a complete integration with 9 actions covering product discovery, availability checking, booking operations, and review management using the Viator Partner API

Type of change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Updates
👉 Added complete Viator integration with custom authentication and 9 comprehensive actions (search products, get product details, check availability, calculate price, create/get/cancel bookings, get destinations, get product reviews)
👉 Implemented robust API client with proper error handling, data transformation, and support for both production and sandbox environments
👉 Created comprehensive test suite with real API integration tests and detailed documentation including setup instructions and use cases

Screenshots 📷

{Image here of before and after - if applicable}

Test plan 🧪

The integration includes a comprehensive test suite in viator/tests/test_viator.py that covers all 9 actions. Tests can be run with real API credentials to verify functionality. Key test scenarios include:

  • Product search and filtering by destination
  • Product detail retrieval with full metadata
  • Real-time availability checking with pricing
  • Price calculation for different traveler configurations
  • Review and rating retrieval
  • Destination catalog browsing
  • Complete booking workflow (commented out for safety)

Author(s) to check 👓

  • Project and all contained modules builds successfully
  • Self-/dev-tested
  • Unit/UI/Automation/Integration tests provided where applicable
  • Code is written to standards
  • Appropriate documentation written (code comments, internal docs)

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +148 to +152
"productCode": product_code,
"productOptionCode": product_option_code,
"travelDate": travel_date,
"currency": currency,
"travelers": traveler_details,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Map booking traveler fields to Viator camelCase payload

The booking request forwards traveler_details and booker_details to the Viator API without converting the snake_case fields defined in the action schema (e.g., first_name, age_band) to the camelCase keys the Viator endpoints expect (firstName, ageBand, etc.). As a result, any create_booking call built from the provided schema will send mismatched field names and the API will reject the request for missing required traveler data, preventing bookings from succeeding.

Useful? React with 👍 / 👎.

@Autohive-AI Autohive-AI deleted a comment from chatgpt-codex-connector bot Dec 10, 2025
"help_text": "Your Viator Partner API Key. You can obtain this from the Viator Partner API portal at https://www.viator.com/partner"
}
},
"required": ["api_key"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed required as SDK errors on all calls when you put required fields in the custom auth definition

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed it, thanks

@@ -0,0 +1 @@
autohive-integrations-sdk
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix to v1.0.2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed it to 1.0.2

- Document Viator integration in README
- Implement config loading, API key management, and sandbox URL
- Migrate action handlers to return ActionResult
- Enhance product search transformation (duration, image, rating)
- Update tests with real API key and import fix
@Sagsgit Sagsgit force-pushed the sj/viator-integration branch from 4ecdf95 to d9b99bd Compare December 10, 2025 20:57
Sagsgit and others added 3 commits December 11, 2025 09:58
- Remove 'required' field from custom auth definition to prevent SDK errors
- Pin autohive-integrations-sdk to version 1.0.2

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@Sagsgit Sagsgit requested a review from ProRedCat December 10, 2025 21:57
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to our recent discussion/decision, we want to change this to ~= - see https://raygun.slack.com/archives/C08KMNRAX8R/p1765943429616509 for more info. Sorry for the extra hassle.

@sumitramanga
Copy link
Contributor

I believe this PR is also waiting on the Merchant API access to ensure we are accessing relevant data requested by Joe's client. I'm taking care of the registration for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants