> For the complete documentation index, see [llms.txt](https://docs.phptravels.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.phptravels.com/modules/tours/viator.md).

# Viator

Viator affiliate API for PHPTRAVELS: add your Viator partner API key, choose sandbox or production and show Viator tours and activities with your markup.

This video guide contains only viator affiliate Integration for any help please contact to our official email at <info@phptravels.com>

{% embed url="<https://www.youtube.com/watch?t=56s&v=jbzMX_433Zc>" %}

### Viator affiliate setup in writing

Viator is a marketplace for tours, activities and attraction tickets. The PHPTRAVELS **Tours** module includes a Viator connector that uses the Viator Partner API: Viator supplies the products, prices, itineraries and reviews, and PHPTRAVELS shows them in your tours search with your markup, next to the tours you create yourself. The video above covers the **affiliate** integration only.

### What you need

* An approved Viator partner account. Viator decides your partner type and booking model, so confirm it before planning a launch.
* Your **Viator API key** from the partner account. Viator gives separate access for its sandbox and production environments.
* Admin access to your PHPTRAVELS website.

Viator accounts on the merchant model use a separate Viator Merchant module that stores a Merchant API key and Merchant ID. Taking payment and confirming Viator bookings inside your own checkout is scoped per project; ask our team if you need it.

### Where to paste the key

1. Log in to the admin panel at `yourdomain.com/admin`.
2. Open **Settings > Modules** and select **Viator**.
3. On **General**, enable the module and choose the **sandbox** environment (Dev mode on development).
4. On **Credentials**, paste your Viator API key and save. The module checks the key and rejects placeholder values.
5. On **Markup**, set the margin added to Viator prices.

### Test it

1. Search a popular destination on your website, for example Rome or Dubai.
2. Check that Viator products show title, from-price, duration, rating and image.
3. Open a product and confirm the inclusions, itinerary and cancellation policy load.
4. Check prices in a second display currency.
5. When results look right, switch to the **production** environment with your live key.

### Common errors

* **Credential check fails** -- the key is a placeholder, mistyped, or belongs to the other environment.
* **No products for a city** -- try the city name Viator uses, or a larger destination.
* **Booking flow not as expected** -- affiliate accounts send travellers to Viator to book; merchant flows need the Merchant module.

Questions? Email <info@phptravels.com> or [submit a ticket](https://docs.phptravels.com/support/submit-ticket).
