Download the PHP package yourtransfer24/yt24-sdk-php without Composer
On this page you can find all versions of the php package yourtransfer24/yt24-sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yourtransfer24/yt24-sdk-php
More information about yourtransfer24/yt24-sdk-php
Files in yourtransfer24/yt24-sdk-php
Package yt24-sdk-php
Short Description Official PHP SDK for the YourTransfer24 REST JSON API Platform.
License MIT
Homepage https://yourtransfer24.com
Informations about the package yt24-sdk-php
yt24-sdk-php
Official PHP SDK for the YourTransfer24 REST JSON API Platform. Provides clean access to authentication, profile data, bookings, booking confirmation, booking status, availability checks, quotes, vehicles, companies, coverage, and logs. Fully aligned with the official YourTransfer24 API documentation.
Installation
composer require yourtransfer24/yt24-sdk-php
Initialization
use YT24SDK\YT24Client;
use YT24SDK\ProfileAPI;
use YT24SDK\BookingsAPI;
use YT24SDK\AvailabilityAPI;
use YT24SDK\QuoteAPI;
use YT24SDK\VehiclesAPI;
use YT24SDK\CompaniesAPI;
use YT24SDK\CoverageAPI;
use YT24SDK\LogsAPI;
$client = new YT24Client("YOUR_API_KEY", "sandbox");
// Instantiate endpoints
$profile = new ProfileAPI($client);
$bookings = new BookingsAPI($client);
$availability = new AvailabilityAPI($client);
$quote = new QuoteAPI($client);
$vehicles = new VehiclesAPI($client);
$companies = new CompaniesAPI($client);
$coverage = new CoverageAPI($client);
$logs = new LogsAPI($client);
API Usage
1. Profile
// Get profile
$data = $profile->getProfile();
// Update profile
$profile->updateProfile([
"first_name" => "John",
"last_name" => "Doe"
]);
2. Bookings
Create, Retrieve, List, Confirm, Update Status
// List bookings
$bookings->list();
// With filters
$bookings->list(["limit" => 20, "page" => 2]);
// Retrieve a booking
$bookings->get(123);
// Create booking (Full Real Payload Example)
$bookings->create([
"pickup_location" => "Airport",
"dropoff_location" => "Hotel",
"date" => "2025-01-20",
"passengers" => 3,
"luggage" => 2,
"vehicle_type" => "Sedan",
"flight_number" => "AA123",
"arrival_time" => "14:30",
"child_seats" => 1,
"notes" => "Customer prefers front seat",
"customer" => [
"first_name" => "John",
"last_name" => "Doe",
"email" => "[email protected]",
"phone" => "+18095551234"
]
]);
// Confirm a booking
$bookings->confirm(123);
// Update booking status
$bookings->updateStatus(123, ["status" => "confirmed"]);
3. Availability
$availability->check([
"pickup_location" => "Airport",
"dropoff_location" => "Hotel",
"date" => "2025-01-20"
]);
4. Quote
$quote->getQuote([
"pickup_location" => "Airport",
"dropoff_location" => "Hotel",
"passengers" => 2
]);
5. Vehicles
// List vehicles
$vehicles->list();
// Vehicle details
$vehicles->get(5);
6. Companies
// Company list
$companies->list();
// Company details
$companies->get(12);
7. Coverage
// Get operating zones and coverage areas
$coverage->list();
8. Logs
// Logs filtering example
$logs->list(["booking_id" => 123]);
Error Handling
YourTransfer24 API returns strict structured JSON errors:
{
"error": true,
"type": "validation_error",
"message": "Pickup location is required",
"err_key": "YT24_400_01"
}
Capturing Errors
try {
$bookings->create([]);
} catch (Exception $err) {
echo $err->status; // HTTP status code
echo $err->err_key; // API error code
echo $err->getMessage(); // Error message
}
The SDK does not modify, alter, wrap, or transform errors — they are returned exactly as provided by the YourTransfer24 API.
Project Structure
yt24-sdk-php/
│── README.md
│── LICENSE
│── composer.json
└── src/
├── YT24Client.php
├── ProfileAPI.php
├── BookingsAPI.php
├── AvailabilityAPI.php
├── QuoteAPI.php
├── VehiclesAPI.php
├── CompaniesAPI.php
├── CoverageAPI.php
├── LogsAPI.php
License
MIT License © YourTransfer24