Official Python SDK for the YourTransfer24 REST JSON API Platform
Project description
yt24-sdk-python
Official Python SDK for the YourTransfer24 REST JSON API Platform. Provides clean access to API authentication, profile data, bookings, booking status, vehicles, companies, coverage, availability, quotes, and logs. Fully aligned with the official YourTransfer24 API documentation.
Installation
pip install yt24-sdk-python
Initialization
from yt24_sdk import (
YT24Client,
ProfileAPI,
BookingsAPI,
AvailabilityAPI,
QuoteAPI,
VehiclesAPI,
CompaniesAPI,
CoverageAPI,
LogsAPI
)
client = YT24Client("YOUR_API_KEY", environment="sandbox")
# API Modules
profile = ProfileAPI(client)
bookings = BookingsAPI(client)
availability = AvailabilityAPI(client)
quote = QuoteAPI(client)
vehicles = VehiclesAPI(client)
companies = CompaniesAPI(client)
coverage = CoverageAPI(client)
logs = LogsAPI(client)
API Usage
1. Profile
# Get profile
profile_data = profile.get_profile()
# Update profile
profile.update_profile({
"first_name": "John",
"last_name": "Doe"
})
2. Bookings
List, Get, Create, Confirm, Update Status
This section uses the complete booking payload exactly as defined in the official YourTransfer24 API documentation.
# List bookings
bookings.list()
# With filters
bookings.list({"limit": 20, "page": 2})
# Get booking
bookings.get(123)
# Create booking (FULL REAL PAYLOAD)
booking_data = {
"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": "john@example.com",
"phone": "+18095551234"
}
}
# Create booking
response = bookings.create(booking_data)
# Retrieve booking
booking = bookings.get(response["id"])
# Confirm booking
bookings.confirm(response["id"])
# Update booking status
bookings.update_status(response["id"], { "status": "confirmed" })
3. Availability
availability.check({
"pickup_location": "Airport",
"dropoff_location": "Hotel",
"date": "2025-01-20"
})
4. Quote
quote.get_quote({
"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
# Coverage zones
coverage.list()
8. Logs
# Logs with filters
logs.list({"booking_id": 123})
Error Handling
YourTransfer24 API returns structured error responses:
{
"error": true,
"type": "validation_error",
"message": "Pickup location is required",
"err_key": "YT24_400_01"
}
Capturing Errors
try:
bookings.create({})
except Exception as err:
print(err.status) # HTTP status code
print(err.err_key) # YourTransfer24 error key
print(err.args[0]) # Error message
The SDK returns errors exactly as provided by the YourTransfer24 API. No modifications, wrappers, or internal transformations are applied.
Project Structure
yt24-sdk-python/
│── README.md
│── LICENSE
│── pyproject.toml
└── yt24_sdk/
├── __init__.py
├── client.py
├── profile.py
├── bookings.py
├── availability.py
├── quote.py
├── vehicles.py
├── companies.py
├── coverage.py
├── logs.py
License
MIT License © YourTransfer24
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yt24_sdk_python-1.0.0.tar.gz.
File metadata
- Download URL: yt24_sdk_python-1.0.0.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d3be5d05d05229c0881f025b196204716d695bff0b26212be48a31983eda4b5
|
|
| MD5 |
a6e9c0ddaa32e9f9dd575692b3b70b97
|
|
| BLAKE2b-256 |
11809f682905e854b08a7598d39eea56bb899890bb9372138829ff630a2112bc
|
File details
Details for the file yt24_sdk_python-1.0.0-py3-none-any.whl.
File metadata
- Download URL: yt24_sdk_python-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f942cc8e0bb6d3bfb53a68107a95a0b3cd0801473b724fb16351e3653f606b9f
|
|
| MD5 |
2d030e7b918b25e03c18453db824854e
|
|
| BLAKE2b-256 |
976be7f8c6f2b81e5d0ceeabed611b095848832097546853cdc03910b8e69773
|