PHPackages                             zaman-ua/justin - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. zaman-ua/justin

ActiveLibrary[API Development](/categories/api)

zaman-ua/justin
===============

Library Justin API

1.5.6(3y ago)023MITPHPPHP &gt;=5.6

Since Oct 25Pushed 3y agoCompare

[ Source](https://github.com/zaman-ua/justin)[ Packagist](https://packagist.org/packages/zaman-ua/justin)[ Docs](https://github.com/martinjack/justin)[ Fund](https://buymeacoffee.com/martinjack)[ GitHub Sponsors](https://github.com/martinjack)[ RSS](/packages/zaman-ua-justin/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

[![header](https://github.com/martinjack/justin/raw/master/doc/header.png?raw=true)](https://github.com/martinjack/justin/blob/master/doc/header.png?raw=true)

Описание
========

[](#описание)

[![Latest Stable Version](https://camo.githubusercontent.com/2430f103a0647102741ebb5b7fc28bc2fb74e575d9b886d7020904d9b47ac34d/68747470733a2f2f706f7365722e707567782e6f72672f6a61636b6d617274696e2f6a757374696e2f762f737461626c65)](https://packagist.org/packages/jackmartin/justin) [![Total Downloads](https://camo.githubusercontent.com/90b07a1040d4ba60316a27d45c1ce6c9235b063bc17f8ae8619524b506604e14/68747470733a2f2f706f7365722e707567782e6f72672f6a61636b6d617274696e2f6a757374696e2f646f776e6c6f616473)](https://packagist.org/packages/jackmartin/justin) [![License](https://camo.githubusercontent.com/1d2b3c7af76ff577c8fad7bc13cf07adb65c5aa2add032f67b61a052e0af8427/68747470733a2f2f706f7365722e707567782e6f72672f6a61636b6d617274696e2f6a757374696e2f6c6963656e7365)](https://packagist.org/packages/jackmartin/justin)

PHP класс для работы с API [Justin](https://justin.ua)

> Read this in other language: [English](README.en.md), [Русский](README.md), [Український](README.ua.md)

> [Wiki - Описание работы библиотеки](https://github.com/martinjack/justin/wiki)

> [Тестирование](https://github.com/martinjack/justin/wiki/Tests)

Документация
============

[](#документация)

[API documentation](https://justin.ua/api/api_justin_documentation.pdf "PDF")

[Telegram Поддержка API](https://t.me/justin_support_api)

Требования
==========

[](#требования)

- PHP 5.6 или выше
- Composer

Composer
========

[](#composer)

```
composer require jackmartin/justin
```

Библиотеки
==========

[](#библиотеки)

[Guzzle](https://github.com/guzzle/guzzle)

Основные методы API
===================

[](#основные-методы-api)

1. Настройка подключения
    - [\_\_construct](https://github.com/martinjack/justin#__construct)
2. Получить текущий статус заказа:
    - [currentStatus](https://github.com/martinjack/justin#currentStatus)
3. Получить список областей
    - [listRegions](https://github.com/martinjack/justin#listregions)
4. Получить список областных районов
    - [listAreasRegion](https://github.com/martinjack/justin#listareasregion)
5. Получить список населенных пунктов
    - [listCities](https://github.com/martinjack/justin#listcities)
6. Получить список районов населенных пунктов
    - [listCityRegion](https://github.com/martinjack/justin#listcityregion)
7. Получить список улиц города
    - [listStreetsCity](https://github.com/martinjack/justin#liststreetscity)
8. Получить список типов отделений
    - [branchTypes](https://github.com/martinjack/justin#branchtypes)
9. Получить список отделений.
    - [listDepartmentsLang](https://github.com/martinjack/justin#listdepartmentslang)
10. Получить расписание работы отделения. (Старый метод)
    - [branchSchedule](https://github.com/martinjack/justin#branchschedule)
11. Создать новый заказ(Отправление)
    - [createOrder](https://github.com/martinjack/justin#createOrder)
12. Отмена заказа
    - [cancelOrder](https://github.com/martinjack/justin#cancelorder)
13. Получить список статусов заказа
    - [listStatuses](https://github.com/martinjack/justin#liststatuses)
14. Получить ключ торговца(senderID)
    - [keySeller](https://github.com/martinjack/justin#keyseller)
15. Получить историю движения отправления
    - [trackingHistory](https://github.com/martinjack/justin#trackingHistory)
16. Получить историю статусов заказа.
    - [getStatusHistoryF](https://github.com/martinjack/justin#getstatushistoryf)
17. Получить список заказов за указанный период
    - [listOrders](https://github.com/martinjack/justin#listorders)
18. Получить информацию о заказе
    - [orderInfo](https://github.com/martinjack/justin#orderinfo)
19. Создать стикер заказа
    - [createSticker](https://github.com/martinjack/justin#createsticker)
20. Калькулятор стоимости услуг
    - [calculatePriceService](https://github.com/martinjack/justin#calculatepriceservice)

Примеры
=======

[](#примеры)

### \_\_construct()

[](#__construct)

```
use Justin\Justin;

include_once 'vendor/autoload.php';

$justin = new Justin('RU', true, 'v2', 30, 30, 'Europe/Kiev');
```

### currentStatus()

[](#currentstatus)

```
include_once 'vendor/autoload.php';

use Justin\Justin;

$justin = new Justin('RU', true);

$justin->setLogin('Ваш логин')->setPassword('Ваш пароль');

print_r(

    $justin->currentStatus('201971185')->getData()

);
```

### listRegions()

[](#listregions)

```
use Justin\Justin;

include_once 'vendor/autoload.php';

$justin = new Justin('RU', true);

$justin->setLogin('Ваш логин')->setPassword('Ваш пароль');

print_r(

    $justin->listRegions()->getData()

);
```

### listAreasRegion()

[](#listareasregion)

```
use Justin\Justin;

include_once 'vendor/autoload.php';

$justin = new Justin('RU', true);

$justin->setLogin('Ваш логин')->setPassword('Ваш пароль');

print_r(

    $justin->listAreasRegion()

);
```

### listCities()

[](#listcities)

```
use Justin\Justin;

include_once 'vendor/autoload.php';

$justin = new Justin('RU', true);

$justin->setLogin('Ваш логин')->setPassword('Ваш пароль');

print_r(

    $justin->listCities()

);
```

### listCityRegion()

[](#listcityregion)

```
use Justin\Justin;

include_once 'vendor/autoload.php';

$justin = new Justin('RU', true);

$justin->setLogin('Ваш логин')->setPassword('Ваш пароль');

print_r(

    $justin->listCityRegion()

);
```

### listStreetsCity()

[](#liststreetscity)

```
use Justin\Justin;

include_once 'vendor/autoload.php';

$justin = new Justin('RU', true);

$justin->setLogin('Ваш логин')->setPassword('Ваш пароль');

print_r(

    $justin->listStreetsCity(

        [

            [

                'name'       => 'objectOwner',

                'comparison' => 'equal',

                'leftValue'  => '32b69b95-9018-11e8-80c1-525400fb7782',

            ]

        ]

    )

    // $justin->name('objectOwner')->leftValue('32b69b95-9018-11e8-80c1-525400fb7782')->equal()->listStreetsCity()
    // $justin->name('objectOwner')->equal('32b69b95-9018-11e8-80c1-525400fb7782')->listStreetsCity()

);
```

### branchTypes()

[](#branchtypes)

```
use Justin\Justin;

include_once 'vendor/autoload.php';

$justin = new Justin('RU', true);

$justin->setLogin('Ваш логин')->setPassword('Ваш пароль');

print_r(

    $justin->branchTypes()->getData()

);
```

### listDepartments()

[](#listdepartments)

```
use Justin\Justin;

include_once 'vendor/autoload.php';

$justin = new Justin('RU', true);

$justin->setLogin('Ваш логин')->setPassword('Ваш пароль');

print_r(

    $justin->listDepartments()

);
```

### listDepartmentsLang()

[](#listdepartmentslang)

```
use Justin\Justin;

include_once 'vendor/autoload.php';

$justin = new Justin('RU', true);

$justin->setLogin('Ваш логин')->setPassword('Ваш пароль');

print_r(

    $justin->listDepartmentsLang()

);
```

### branchSchedule()

[](#branchschedule)

```
use Justin\Justin;

include_once 'vendor/autoload.php';

$justin = new Justin('RU', true);

$justin->setLogin('Ваш логин')->setPassword('Ваш пароль');

print_r(

    $justin
    ->name('Depart')
    ->equal('1a4df005-5d8d-11e8-80be-525400fb7782')
    ->branchSchedule()
    ->getData()

);
```

### cancelOrder()

[](#cancelorder)

```
include_once 'vendor/autoload.php';

use Justin\Justin;

$justin = new Justin('RU', false);

$justin->setKey('Ваш ключ API');

print_r(

    $justin->cancelOrder('Код заказа')->getData()

);
```

### listStatuses()

[](#liststatuses)

```
use Justin\Justin;

include_once 'vendor/autoload.php';

$justin = new Justin('RU', true);

$justin->setLogin('Ваш логин')->setPassword('Ваш пароль');

print_r(

    $justin->listStatuses()

);
```

### keySeller()

[](#keyseller)

```
use Justin\Justin;

include_once 'vendor/autoload.php';

$justin = new Justin('RU', true);

$justin->setLogin('Ваш логин')->setPassword('Ваш пароль');

print_r(

    $justin->keySeller(

        [

            [

                'name'       => 'login',

                'comparison' => 'equal',

                'leftValue'  => 'test',

            ],

        ]

    )

    // $justin->name('login')->leftValue('test')->equal()->keySeller()
    // $justin->name('login')->equal('test')->keySeller()

);
```

### trackingHistory()

[](#trackinghistory)

```
include_once 'vendor/autoload.php';

use Justin\Justin;

$justin = new Justin('RU', true);

print_r(

    $justin->trackingHistory('201810165')->getData()
    // $justin->trackingHistory('201810165')->fields()->orderNumber()
    // $justin->trackingHistory('201810165')->fields()->orderDescr()
    // $justin->trackingHistory('201810165')->fields()->status()
    // $justin->trackingHistory('201810165')->fields()->date()
    // $justin->trackingHistory('201810165')->fields()->time()
    // $justin->trackingHistory('201810165')->fields()->dateAdded()
    // $justin->trackingHistory('201810165')->fields()->deparNumber()
    // $justin->trackingHistory('201810165')->fields()->deparAddress()

);
```

### getStatusHistoryF()

[](#getstatushistoryf)

```
use Justin\Justin;

include_once 'vendor/autoload.php';

$justin = new Justin('RU', true);

$justin->setLogin('Ваш логин')->setPassword('Ваш пароль');

$justin->setKey('Ваш ключ API');

print_r(

    $justin->getStatusHistoryF(

        [

            'name'       => 'orderNumber',

            'comparison' => 'equal',

            'leftValue'  => '000000004',

        ]

    )

    // $justin->name('orderNumber')->leftValue('000000004')->equal()->getStatusHistory()
    // $justin->name('orderNumber')->equal('000000004')->getStatusHistory()

);
```

### createOrder()

[](#createorder)

#### Пример 1

[](#пример-1)

```
include_once 'vendor/autoload.php';

use Justin\Justin;

$order = new Justin('RU', true);

$order->setKey('Ваш ключ');

$newOrder = $order
    ->setNumber('52525')
    ->setDate()
    ->senderCityID(

        '32b69b95-9018-11e8-80c1-525400fb7782'

    )
    ->sender('ТОП ПРОДАЦЕЦ')
    ->senderContact('Иванов Иван')
    ->senderPhone('380524152299')
    ->addressPickup('ул. Груша. 7')
    ->requirePickup(true)
    ->senderBranchID(

        '2100102032'

    )
    ->receiver('ТОВ Укрпочта')
    ->receiverContact('Петр 1')
    ->receiverPhone('380425831259')
    ->countPlace(1)
    ->receiverBranchID(

        '2100108028'

    )
    ->volume('0.02')
    ->weight('10')
    ->costDeclared(1500)
    ->deliveryAmount(0)
    ->redeliveryAmount(1500)
    ->orderAmount(1500)
    ->redeliveryPay(true)
    ->redeliveryPayer(1)
    ->deliveryPay(true)
    ->deliveryPayer(1)
    ->requireDelivery(false)
    ->orderPay(true)
    ->comment('Тест заказ')
    ->createOrder();

print_r(

    $newOrder->fields()->number()
    // $newOrder->fields()->ttn()
    // $newOrder->getData()
    // $newOrder->getResult()
    // $newOrder->getRaw()

);
```

#### Пример 2

[](#пример-2)

```
include_once 'vendor/autoload.php';

use Justin\Justin;

$order = new Justin('RU', true);

$order->setKey('Ваш ключ');

$newOrder = $order->createOrder(

    [
        'number'                         => '123456',

        'date'                           => '20171221',

        'sender_city_id'                 => '32b69b95-9018-11e8-80c1-525400fb7782',

        'sender_company'                 => 'УА ТОВ',

        'sender_contact'                 => 'Петрова Ирина',

        'sender_phone'                   => '+380991112233',

        'sender_pick_up_address'         => 'Степана Бандери, No 6',

        'pick_up_is_required'            => true,

        'sender_branch'                  => '2100102032',

        'receiver'                       => 'Петров Сергей',

        'receiver_contact'               => '',

        'receiver_phone'                 => 'Петров Сергей',

        'count_cargo_places'             => 2,

        'branch'                         => '2100108028',

        'weight'                         => 0.1,

        'volume'                         => 0.02,

        'declared_cost'                  => 1500,

        'delivery_amount'                => 0,

        'redelivery_amount'              => 1500,

        'order_amount'                   => 1500,

        'redelivery_payment_is_required' => true,

        'redelivery_payment_payer'       => 1,

        'delivery_payment_is_required'   => true,

        'delivery_payment_payer'         => 1,

        'delivery_is_required'           => false,

        'order_payment_is_required'      => true,

        'add_description'                => 'Тест API'
    ]

);

print_r(

    $newOrder->fields()->number()
    // $newOrder->fields()->ttn()
    // $newOrder->getData()
    // $newOrder->getResult()
    // $newOrder->getRaw()

);
```

### listOrders()

[](#listorders)

```
use Justin\Justin;

include_once 'vendor/autoload.php';

$justin = new Justin('RU', true);

$justin->setKey('Ваш ключ');

print_r(

    $justin->listOrders('20190505')->getData()

);
```

### orderInfo()

[](#orderinfo)

```
use Justin\Justin;

include_once 'vendor/autoload.php';

$justin = new Justin('RU', true);

$justin->setKey('Ваш ключ');

print_r(

    $justin->orderInfo('Ваш номер заказа')->getData()

);
```

### createSticker()

[](#createsticker)

```
use Justin\Justin;

include_once 'vendor/autoload.php';

$justin = new Justin('RU', true);

$justin->setKey('Ваш ключ');

print_r(

    $justin->createSticker(

        null, '400144837', __DIR__ . '/' . time() . '.pdf', null, false

    )

    // $justin->createSticker(

    //     [400144837, 400144837], null, __DIR__ . '/t.pdf', null, false

    // )

);
```

### Стикер пример

[](#стикер-пример)

[![Sticker](https://github.com/martinjack/justin/raw/master/doc/sticker.png?raw=true "Стикер пример")](https://github.com/martinjack/justin/blob/master/doc/sticker.png?raw=true)

### calculatePriceService()

[](#calculatepriceservice)

```
use Justin\Justin;

include_once 'vendor/autoload.php';

$justin = new Justin('RU', true);

$justin->setLogin('Ваш логин')->setPassword('Ваш пароль')->setKey('Ваш ключ');

print_r(

    $justin->calculatePriceService([

        'point_a_locality_uuid' => 'e7ebcef9-dbfb-11e7-80c6-00155dfbfb00',
        'point_b_locality_uuid' => 'e7ebcef9-dbfb-11e7-80c6-00155dfbfb00',
        'weight'                => 35.0,
        'cargo_details'         => [
            [
                'cargo_description' => 'fdd20d8b-1375-11eb-a2e5-0050569bda1b',
                'amount'            => 0,
            ],

            [
                'cargo_description' => 'bed96769-1386-11eb-a2e5-0050569bda1b',
                'amount'            => 1,
            ],

        ],
        'cargo_places_array'    => [

            [
                'weight' => 10,
                'width'  => 2,
                'height' => 1,
                'depth'  => 1,
            ],

            [
                'weight' => 5,
                'width'  => 1,
                'height' => 1,
                'depth'  => 1,
            ],

      ],

    ])->getData()

);
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1295d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e4e6085c9ca41ae26d271f4a8f12c6a3ffe104f99ae72b5ba66abb7e4f16735f?d=identicon)[zaman-ua](/maintainers/zaman-ua)

---

Top Contributors

[![martinjack](https://avatars.githubusercontent.com/u/11950689?v=4)](https://github.com/martinjack "martinjack (69 commits)")[![zaman-ua](https://avatars.githubusercontent.com/u/100148616?v=4)](https://github.com/zaman-ua "zaman-ua (2 commits)")[![sankam-nikolya](https://avatars.githubusercontent.com/u/8527050?v=4)](https://github.com/sankam-nikolya "sankam-nikolya (1 commits)")

---

Tags

apilibrarydeliveryjustinjustin api

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zaman-ua-justin/health.svg)

```
[![Health](https://phpackages.com/badges/zaman-ua-justin/health.svg)](https://phpackages.com/packages/zaman-ua-justin)
```

###  Alternatives

[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
