YandexFleetLib

0
2 месяца назад
2 месяца назад
2 месяца назад
2 месяца назад
2 месяца назад
2 месяца назад
2 месяца назад
2 месяца назад
2 месяца назад
README.md

Yandex Fleet SDK

License: MIT PHP Version

A PHP library for integrating with the Yandex Fleet API.

Requirements

  • PHP >= 8.1
  • Composer
  • Guzzle HTTP Client >= 7.10 (or any PSR-18 HTTP client)
  • Active Yandex Fleet account with API credentials

Installation

Quick Start

Configuration

Credentials

All three credentials are required. Obtain them from your Yandex Fleet account:

KeyDescription
client_id
Your application's unique identifier
api_key
API authentication key
park_id
Fleet (park) identifier

Options

PSR-18 HTTP client

Inject any PSR-18 compatible HTTP client (e.g. Symfony HttpClient):

Logging

Inject any PSR-3 logger (e.g. Monolog):

Rate limit awareness

API Reference

EndpointClient methodAvailable methods
Contractor Profiles
contractorProfiles()
getList()
,
get()
,
create()
,
update()
,
createContractor()
,
createAutoCourierProfile()
,
createWalkingCourierProfile()
,
createSelfEmployedWalkingCourierProfile()
,
bindVehicle()
,
unbindVehicle()
,
getSupplyHours()
,
getBlockedBalance()
,
listApplications()
Vehicles
vehicles()
getList()
,
get()
,
create()
,
update()
,
updateRentDetails()
,
updateRentTerms()
Orders
orders()
getList()
,
track()
Transactions
transactions()
getList()
,
listDriverTransactions()
,
listOrderTransactions()
,
listCategories()
,
create()
,
getStatus()
Driver Work Rules
driverWorkRules()
getList()

Contractor Profiles

Vehicles

Orders

Transactions

Driver Work Rules

Pagination

All list endpoints return a

ListResponse
with
items
,
cursor
, and
total
. Use
paginate()
to iterate all pages automatically — it yields typed DTOs:

Error Handling

All API errors throw

ApiException
. It extends
\Exception
and adds two methods:

Transient failures (5xx, 429, connection errors) are retried automatically up to the configured

retries
limit before an exception is thrown.

Project Structure

src/ ├── Client.php ├── Endpoints/ │ ├── BaseEndpoint.php │ ├── ContractorProfiles.php │ ├── DriverWorkRules.php │ ├── Orders.php │ ├── Transactions.php │ └── Vehicles.php ├── Exception/ │ └── ApiException.php └── Http/ ├── HttpClientInterface.php └── Request.php

Testing

Changelog

See CHANGELOG.md for release history.

License

MIT — see LICENSE.

Author

Denis Joloudovinfo@inteliada.ru


This SDK is not officially affiliated with Yandex.