> 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/cars/viatovia.md).

# ViatoVia

ViaToVia API integration for PHPTRAVELS: add your API key, enable the module and sell live ViaToVia airport transfers to your customers (B2C) and agents (B2B) with your own markup.

<figure><img src="https://2551945148-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2GhG5yrSbZqP4S8EzmhR%2Fuploads%2Fh80ecK0OJrGw98GxecTB%2Fimage.png?alt=media&amp;token=8258448e-5879-4834-8c79-02be813f7274" alt=""><figcaption></figcaption></figure>

#### 📌 Overview <a href="#user-content-overview" id="user-content-overview"></a>

This guide explains how to integrate the **ViaToVia API** into your PHPTRAVELS-based travel booking system.

The integration allows you to:

* Search airport transfers in real-time (one-way and round trip)
* Show vehicles with photos, passengers, bags, ride time and cancellation terms
* Collect flight numbers, luggage and paid extras on the booking page
* Book automatically with ViaToVia after payment
* Show driver details on the invoice and voucher
* Cancel bookings from the admin panel

***

#### 🔑 1. Get Your ViaToVia API Key <a href="#user-content-1-get-your-viatovia-api-key" id="user-content-1-get-your-viatovia-api-key"></a>

**Steps:**

1. Apply for a partner account at [https://viatovia.com](https://viatovia.com/)
2. ViaToVia reviews your application and gives you **sandbox** (test) access
3. Log in to your ViaToVia account and open:

{% code overflow="wrap" %}

```
Profile > Developer
```

{% endcode %}

4. Copy your **API Key**

⚠️ **Sandbox and live use different API keys.** Use the sandbox key for testing. ViaToVia gives you the production key after reviewing your test bookings.

***

#### ⚙️ 2. API Authentication & Setup <a href="#user-content-2-api-authentication--setup" id="user-content-2-api-authentication--setup"></a>

**Steps:**

1. Go to your admin panel:

{% code overflow="wrap" %}

```
Settings > Modules > Cars > ViaToVia
```

{% endcode %}

2. Paste your key in the **API Key** field
3. Choose the **Environment**:
   * **Development** = sandbox key
   * **Production** = live key
4. Set **Status** to **Active**
5. Set the module currency to **USD**, **EUR** or **GBP**
6. Click **Save Configuration**
7. Click **Test API Connection**

✅ Expected Result:

* API connection successful
* ViaToVia vehicles appear in airport transfer searches

***

**⚠️ Important Notes**

* One end of the trip must be an **airport** (airport to city, city to airport, or round trip)
* The sandbox only returns results for **Amsterdam Airport Schiphol (AMS) ↔ Amsterdam**
* A saved API key is never shown again. Leave the field empty to keep it, or paste a new key to replace it

***

#### 💰 3. Markup Setup (B2C & B2B) <a href="#user-content-3-markup-setup-b2c--b2b" id="user-content-3-markup-setup-b2c--b2b"></a>

Set your profit on top of the ViaToVia price, separately for customers and agents.

**Steps:**

1. Go to:

{% code overflow="wrap" %}

```
Settings > Modules > Cars > ViaToVia > Markup & Tax
```

{% endcode %}

2. **B2C** (customers): choose **Markup Type** (Percentage or Fixed Amount) and enter the **Markup Value**
3. **B2B** (agents): choose **Markup Type** and enter the **Markup Value**
4. Optional: set **Tax Type** and **Tax Value**
5. Click **Save Configuration**

**Example:**

| User           | ViaToVia price | Markup | Price shown |
| -------------- | -------------- | ------ | ----------- |
| Customer (B2C) | USD 50.00      | 10%    | USD 55.00   |
| Agent (B2B)    | USD 50.00      | 5%     | USD 52.50   |

👉 Keep the B2B markup lower, so your agents can add their own profit.

***

#### 🔍 4. Search, Pricing & Booking Flow <a href="#user-content-4-search-pricing--booking-flow" id="user-content-4-search-pricing--booking-flow"></a>

**🔎 Transfer Search**

* **Customers (B2C)** search from your website without logging in
* **Agents (B2B)** log in to their agent account first, then search from the same search box

**Steps:**

1. Choose **Airport Transfer**
2. Choose **One Way** or **Round Trip**
3. Enter **From** and **To** (e.g. Amsterdam Airport Schiphol → Amsterdam)
4. Choose pick-up date, time, driver's age and travellers
5. Click **Search**

👉 Result: ViaToVia vehicles with photos, specs and prices, plus filters for price, vehicle type, passengers and free cancellation

***

**💰 Pricing & Availability**

* Pulled in real-time from the ViaToVia API
* Each user sees the price with their own markup (B2C or B2B)
* The price is checked again on the server before booking

👉 Result: **Accurate live pricing, never below cost**

***

**🛒 Booking Flow**

1. User selects a vehicle and clicks **Book Now**
2. Enters traveller details and the **flight number with airline code** (e.g. KL1234)
3. Chooses luggage and extras (e.g. child seat)
4. Payment processed:
   * **B2C:** payment gateways (e.g. Stripe, PayPal)
   * **B2B:** payment gateways, agent wallet balance or credit limit
5. Transfer booked with ViaToVia automatically

✅ Output:

* ViaToVia reservation number (starts with `VIA-`)
* Booking status **Pending**, then **Confirmed** when ViaToVia approves it
* Driver name, phone and number plate on the invoice and voucher
* Round trip booked as two reservations (outbound and return)
* Stored in the admin panel

***

#### 🛠️ 5. Booking Management <a href="#user-content-5-booking-management" id="user-content-5-booking-management"></a>

In the admin panel, open the booking:

{% code overflow="wrap" %}

```
Bookings > Cars
```

{% endcode %}

* **Issue Booking:** books with ViaToVia manually if the automatic booking did not finish (it never books twice)
* **Cancel Booking:** choose a cancellation reason; the customer receives the cancellation email
* **Void:** cancels a booking made by mistake
* Status and driver details are updated automatically when the invoice opens

***

#### ⏱️ 6. Automatic Status Check (Cron Job) <a href="#user-content-6-automatic-status-check-cron-job" id="user-content-6-automatic-status-check-cron-job"></a>

ViaToVia approves bookings and assigns drivers after booking. Add this cron job on your server:

{% code overflow="wrap" %}

```
*/5 * * * * curl -s https://yourdomain.com/supplier_status_check > /dev/null
```

{% endcode %}

✅ This ensures:

* Pending bookings are confirmed automatically
* Driver details are added to the invoice and voucher
* Customers are notified if ViaToVia cancels a booking

👉 You can see this job in **Settings > Automation**

***

#### 🚦 7. Go Live <a href="#user-content-7-go-live" id="user-content-7-go-live"></a>

1. Make the test bookings ViaToVia asks for in the sandbox, for example:
   * One airport-to-city booking
   * One city-to-airport booking
   * Cancellation of one of these bookings
2. Send ViaToVia the `VIA-` reservation numbers (found in **Supplier details** on the invoice)
3. Receive your production API key
4. Paste it in **API Key** and set **Environment** to **Production**
5. Click **Test API Connection** and run one live search

***

#### 🚀 Best Practices <a href="#user-content-best-practices" id="user-content-best-practices"></a>

* Always test in the sandbox before going live
* Make sure the cron job is running, so bookings confirm automatically
* Use USD, EUR or GBP as the module currency
* Check the logs in **Settings > Modules > Cars > ViaToVia > Logs** if a search or booking fails (the API key is never written to the logs)

***

#### 💡 Need a Ready Solution? <a href="#user-content-need-a-ready-solution" id="user-content-need-a-ready-solution"></a>

We provide a complete travel booking system with:

* Hotels (RateHawk, Hotelbeds, Agoda)
* Flights (Amadeus, Travelport, Duffel)
* Tours (Viator, Tiqets)
* Cars & Transfers (ViaToVia, Kiwitaxi, Mozio)
* B2B + B2C system

👉 Book a free meeting:\
<https://phptravels.com/meeting>
