Unlocking UK Taxi Bookings with API Integration

04/09/2024

Rating: 4.49 (9580 votes)

In today's fast-paced digital world, the demand for seamless, on-demand services has never been higher. For businesses and individuals alike, booking transport needs to be as straightforward and efficient as possible. This is where the power of a robust booking API comes into play. Specifically, for anyone looking to integrate reliable taxi services across the United Kingdom, understanding the Taxicode API is paramount. It serves as a sophisticated bridge, connecting your platform directly to a vast network of taxi providers, offering real-time quotes and streamlining the entire booking process from start to finish.

What is booking API & taxicode API?

A Booking API, or Application Programming Interface, is essentially a set of definitions and protocols that allows different software applications to communicate with each other. In the context of transport, a booking API enables a platform (like a travel website, a corporate booking system, or a mobile app) to send requests for taxi services and receive back detailed information, such as available vehicles, prices, and company details, without direct human intervention. This automation significantly enhances operational efficiency and customer experience.

Table

Introducing the Taxicode API: Your Gateway to UK Taxis

The Taxicode API is a specialised booking API meticulously designed for the UK taxi market. Its core function is to allow developers and businesses to embed taxi booking capabilities directly into their own applications or websites. Instead of manually searching for taxi companies or relying on fragmented booking systems, the Taxicode API provides a unified interface to access a wide array of taxi operators across the UK. This means you can request quotes, compare prices, and confirm bookings programmatically, offering a comprehensive and integrated transport solution to your users.

When you make a request to the Taxicode API, typically detailing your journey requirements, you will receive two primary objects back in the response: a Journey object and a Quotes object. The Journey object serves as a confirmation, echoing back the details of the journey you initially entered, ensuring accuracy and providing a reference point. The Quotes object, on the other hand, is where the magic happens. It contains a collection of available quotes from various taxi companies, each keyed with a unique quote ID. These quote IDs are crucial; they are temporarily stored on Taxicode's servers for 24-48 hours, providing a window within which you can proceed to book the quoted journey. This structure allows for dynamic pricing and availability, ensuring that the information you receive is always up-to-date.

Deciphering the API Response Statuses

Understanding the status of your API response is vital for robust error handling and user feedback. The Taxicode API provides clear status indicators:

  • OK: This status signifies that everything is in order, and your request was successfully processed, with valid quotes returned and ready for booking.
  • WARNING: A WARNING status indicates that quotes were indeed returned, but for some reason, they cannot be booked at that specific moment. This often occurs if the booking notice period for a company is too short, or if there are other temporary restrictions. The response will include a `warning` string explaining the specific issue, allowing you to inform the user or adjust your request.
  • ERROR: An ERROR status means that there was a significant issue, and no quotes could be returned at all. This could be due to incorrect parameters in your request, a server-side problem, or no available taxis meeting your criteria. An `error` string will accompany this status, detailing the problem.

Beyond these statuses, the response also includes a `journey_id`, a unique identifier for the journey that can be used for lookup after a booking is made (stored for one month). This is particularly useful for refilling user forms or retrieving booking details if your system hasn't stored them. Additionally, a `payment_url` is provided, which is the URL you can direct your user to if you opt for Taxicode to handle the payment process directly. This URL requires the specific `QUOTE_ID` to be appended, along with any other relevant variables.

Navigating Payment Options and URL Variables

When utilising the `payment_url` provided by the Taxicode API, several optional and required variables can be appended to customise the payment process and user experience:

  • callback: An optional string URL where Taxicode will redirect the customer after they complete the payment process. This URL will include `?edit=JOURNEY_ID` or `?success=BOOKING_REF`, allowing your system to track the outcome. It's important to note that customers might abandon the process, so a return to your domain is not always guaranteed.
  • key: A required string, this is your public API key, essential for identifying your application and authenticating your requests.
  • v: An optional integer representing the ID of the specific vehicle the user wishes to book. This ID corresponds to the array index from the vehicles returned by the booking/quote function, allowing for granular selection.
  • mag: An optional 1 or 0. If the quote included an optional meet and greet service, setting `mag=1` indicates that the customer has opted for this service.
  • onbehalf: An optional 1 or 0. Setting `onbehalf=1` auto-selects that the booking is being made on behalf of someone else on the payment page. This is particularly useful for applications targeting travel agents or personal assistants booking for their clients.
  • currency: An optional 3-letter currency code (ISO 4217). While the price is always charged in Pound Sterling (GBP), this parameter allows you to display an approximation of the GBP price in a different currency. Taxicode currently supports a wide range of currencies, making it globally friendly, though it's crucial to remember the actual transaction currency remains GBP.
  • test: An optional 1 or 0. Setting `test=1` designates the booking as a test. This means it will not be sent to an actual taxi company but will be stored on a special testing company's record once paid for via SagePay's testing servers. This feature is invaluable for development and quality assurance, allowing you to thoroughly test your integration without incurring real costs or generating false bookings.

The range of currencies supported for approximation includes:

Currency CodeCurrency NameSymbol
AUDAustralian Dollar$
BRLBrazilian RealR$
CADCanadian Dollar$
CHFSwiss FrancFr
CLPChilean Peso$
CNYChinese Yuan Renmin¥
CZKCzech Koruna
DKKDanish Kronekr
EUREuro
FJDFiji Dollar$
GBPPound Sterling£
HKDHong Kong Dollar$
HNLHonduran LempiraL
HUFHungarian ForintFt
IDRIndonesian RupiahRp
ILSIsraeli New Shekel
INRIndian Rupee
ISKIceland Kronakr
JPYJapanese Yen¥
KRWKorean Won
MXNMexican Peso$
MYRMalaysian RinggitRM
NGNNigerian Naira
NOKNorwegian Kronekr
NZDNew Zealand Dollar$
PHPPhilippine Peso
PKRPakistan Rupee
PLNPolish Zloty
RUBRussian Ruble
SEKSwedish Kronakr
SGDSingapore Dollar$
THBThai Baht฿
TRYTurkish Lira
TWDTaiwan Dollar$
USDUS Dollar$
ZARSouth African RandR

A Deep Dive into the Journey Object

The Journey object within the API response provides a comprehensive summary of the requested trip, ensuring all details are correctly understood and communicated:

  • pickup: A Location object detailing the starting point of the journey, including its `position` (latitude and longitude array), `postcode`, and a descriptive `string` representation of the location.
  • vias: Similar to `pickup`, this object (or `false` if none) specifies any intermediate stops or waypoints along the journey.
  • destination: A Location object identical in structure to `pickup`, defining the final drop-off point.
  • date: A UNIX Timestamp indicating the precise date and time of the outbound journey.
  • return: A UNIX Timestamp for the return journey, or `false` if it's a one-way trip.
  • people: An integer (ranging from 1 to 30) specifying the number of passengers.
  • distance: An estimated integer representing the journey's length in miles.
  • duration: An estimated integer indicating the journey's duration in seconds.
  • duration_text: A human-readable string version of the duration (e.g., "1 hour 30 minutes").
  • quote_type: A string indicating how the quote is calculated, either "hourly" or "mileage".

These details are crucial for both the taxi company to accurately quote and for the end-user to confirm their booking requirements.

What is booking API & taxicode API?
The Booking API allows you to request a quote for a journey and then pay for that journey. The pickup location. An address string that can be identified by Google Places API. Taxicode API also accepts the use of latitude and longitude as a value but should only be used as a fallback in the case the pickup address string fails to return results.

Understanding the Quotes Object: Your Price and Provider Details

The Quotes object is the heart of the response, providing all the necessary information to choose and book a taxi. It is structured as an object where quote IDs serve as keys, each pointing to a detailed Quote Object. If no quotes are found, this object will simply be `false`.

Key Attributes within a Quote Object:

  • active: A boolean indicating whether the company is currently an active result and can be booked. Companies may be inactive if they require more booking notice than the current request provides.
  • notification: An integer specifying the number of hours' notice the company needs for a booking.
  • cutoff: A string in 'YYYY-MM-DD HH:MM:SS' format, indicating the latest date/time the quote can be booked, taking into account the company's notice period.
  • class: A string categorising the vehicle class offered by the company, such as "standard", "executive", or "minibuses", catering to different comfort and capacity needs.
  • highlight: An optional string that highlights a notable aspect of the company or quote, such as "best price" or "most reliable".
  • company_name, company_id, instance_id: Details identifying the taxi company and its specific operational instance within the Taxicode system.
  • company_location: The geographical base of the company branch providing the quote.
  • company_phone: The contact phone number of the company, or `false` if not listed.
  • price: The standard price of the journey in GBP. This is the base cost before any optional extras.
  • payment_options: An array listing the available payment methods, such as ["CARD", "BALANCE", "CASH"]. For options like "BALANCE" or "CASH", the customer may need to be logged in or have an account balance.
  • performance: A float representing the company's performance score out of 10. Companies scoring below 8 may not be displayed unless no other options are available, ensuring a certain level of service quality. This metric provides transparency regarding provider reliability.

Special Features: Meet & Greet and Company Ratings

The Quote Object also provides details on value-added services and company reputation:

  • meetandgreet: An optional object that details the meet and greet service if available. It includes the `location` where the meet and greet will occur, the `price` for this additional service, the `waiting_time` included, and any `waiting_time_extra` charges for additional 15-minute increments. If no such option is available, this will be `false`.
  • rating: An optional object providing insights into the company's customer ratings. It includes `ratings` (the number of reviews received) and `score` (the average rating out of 5). This crucial information helps users make informed decisions based on past customer experiences. If no ratings exist, this will be `false`.

Vehicle Specifics: Tailoring Your Ride

Within the Quote Object, the `vehicles` array contains detailed Vehicle Objects, allowing for precise vehicle selection based on passenger and luggage needs:

  • class: The specific vehicle class (e.g., "Saloon", "Estate", "MPV").
  • count: The number of vehicles of this type required to accommodate the passenger count.
  • price: The price of the journey specifically with this vehicle type.
  • meetandgreet_price: The price with this vehicle if meet and greet is applied.
  • name: The common name of the vehicle (e.g., "Toyota Prius", "Mercedes E-Class").
  • image: A URL to an image of the vehicle, providing a visual reference.
  • passengers: The maximum number of passengers the vehicle can comfortably accommodate.
  • luggage_big: The number of large luggage items (e.g., suitcases) the vehicle can carry.
  • luggage_small: The number of small luggage items (e.g., hand luggage) the vehicle can carry.

Beyond Standard Rates: Other Quoting Options

Some quotes may include an `other_rates` array, which provides details for non-standard rate types, such as traditional black cabs. Each object within this array details the `count` of vehicles needed, a `lower_price` and optional `upper_price` for estimated costs, and an `about` string providing context for the rate.

Payment Flexibility: Understanding Card Options

The `card` array provides details on supported card types for payment and any associated uplift fees. Each Card Object includes a `code` for the card type, its `name` (e.g., "Visa", "Mastercard"), and the `uplift` percentage that will be charged. This ensures full transparency regarding payment processing fees, allowing customers to see exactly what they will pay if they choose to pay by card.

The Strategic Advantages of Integrating Taxicode API

Integrating the Taxicode API into your platform offers a multitude of benefits, transforming how you manage and offer taxi services:

  • Efficiency and Automation: The API automates the entire quote and booking process. This significantly reduces manual effort, minimises errors, and speeds up response times, leading to greater operational efficiency.
  • Expanded Service Reach: By connecting to Taxicode's extensive network of UK taxi companies, your platform instantly gains access to a broad range of providers, enhancing your service coverage across various locations and catering to diverse customer needs.
  • Enhanced User Experience: Users benefit from real-time quotes, transparent pricing, and a variety of vehicle and payment options. This level of control and clarity fosters trust and improves overall satisfaction.
  • Real-time Data and Pricing: The API provides dynamic, up-to-date information on availability and pricing, ensuring that customers always receive the most current and accurate quotes. This responsiveness is critical in the fast-moving transport industry.
  • Customisation and Flexibility: Developers have the flexibility to integrate the API in a way that best suits their application's design and functionality. From handling payments internally to customising the booking flow, the API supports a wide range of integration strategies.

Who Stands to Gain from Taxicode API Integration?

The Taxicode API is a powerful tool with broad applicability across various sectors:

  • Online Travel Agencies (OTAs) and Tour Operators: Seamlessly integrate ground transport options into holiday packages, flight bookings, or tour itineraries, offering a complete travel solution to customers.
  • Hotel and Accommodation Providers: Offer guests an easy way to book airport transfers, local rides, or excursions directly through the hotel's website or concierge system, enhancing guest services and potentially generating additional revenue.
  • Corporate Travel Managers: Streamline business travel arrangements by integrating taxi booking into internal travel management platforms, ensuring employees have reliable transport while maintaining centralised control over bookings and expenses.
  • Software Developers and App Creators: For developers building travel apps, ride-sharing platforms, or local service directories, the Taxicode API provides a robust backend for incorporating comprehensive taxi booking functionality without having to establish individual relationships with numerous taxi companies.
  • Event Organisers: Facilitate transport for attendees to and from venues, ensuring smooth logistics for conferences, concerts, or sporting events.

Frequently Asked Questions (FAQs)

Q: What is the difference between a `WARNING` and an `ERROR` status in the API response?
A: An `ERROR` status indicates a fundamental issue preventing any quotes from being returned, such as an invalid request or a server problem. A `WARNING` status, however, means that quotes were found, but they cannot currently be booked. This is often due to a short notice period, where the taxi company requires more time before the booking can be confirmed, or other specific company restrictions.
Q: How long are quote IDs valid for?
A: Quote IDs are stored on Taxicode's servers for a period of 24 to 48 hours. It is imperative that you use the quote ID to proceed with a booking within this timeframe, as they are automatically deleted afterwards.
Q: Can I handle the payment for bookings myself, or must I use Taxicode's payment URL?
A: The Taxicode API provides a `payment_url` for convenience if you prefer their system to manage the payment process. However, depending on your agreement and integration level with Taxicode, you may be able to handle payments directly through your own platform. The API response indicates available `payment_options` such as "CARD", "BALANCE", or "CASH", giving you flexibility.
Q: What is the purpose of the `test` parameter when making a booking?
A: Setting the `test=1` parameter allows you to simulate a booking. This means the booking will not be dispatched to an actual taxi company but will be recorded on a special testing company's ledger once payment (using SagePay's testing servers) is simulated. This feature is invaluable for developers to thoroughly test their integration, verify payment flows, and ensure all functionalities work as expected without incurring real costs or creating live, false bookings.
Q: Are all the listed currencies supported for direct payment?
A: No. While the Taxicode API can display prices in various currencies as approximations for user convenience, all actual charges and transactions are processed in Pound Sterling (GBP). The displayed foreign currency prices are estimates based on current exchange rates and are purely for informational purposes.

In conclusion, the Taxicode API offers a powerful, flexible, and comprehensive solution for integrating taxi booking services into any digital platform operating within the UK. Its detailed response structure, robust error handling, and extensive customisation options empower businesses to deliver a superior transport booking experience. By leveraging this API, you can enhance operational efficiency, expand your service offerings, and provide users with instant, transparent access to a wide network of reliable taxi providers across the United Kingdom.

If you want to read more articles similar to Unlocking UK Taxi Bookings with API Integration, you can visit the Taxis category.

Go up