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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

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


All versions of yt24-sdk-php with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-json Version *
guzzlehttp/guzzle Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package yourtransfer24/yt24-sdk-php contains the following files

Loading the files please wait ...