PHPackages                             artjoker/laravel-ubki - 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. artjoker/laravel-ubki

ActiveLibrary[API Development](/categories/api)

artjoker/laravel-ubki
=====================

Package for integration UBKI

v5.0(2y ago)12.9kMITPHPPHP ^7.2|^8.1CI failing

Since Aug 20Pushed 2y ago3 watchersCompare

[ Source](https://github.com/artjoker/laravel-ubki)[ Packagist](https://packagist.org/packages/artjoker/laravel-ubki)[ Docs](https://github.com/artjoker/laravel-ubki)[ RSS](/packages/artjoker-laravel-ubki/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (5)Versions (28)Used By (0)

Laravel-Ubki
============

[](#laravel-ubki)

[![Latest Version on Packagist](https://camo.githubusercontent.com/97a0d3e5384cb7d5cf8f3a661b8fd987591c15745cc2c6518e1458bcdbe38bad/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6172746a6f6b65722f6c61726176656c2d75626b692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/artjoker/laravel-ubki)[![Total Downloads](https://camo.githubusercontent.com/db0355274e8a647777928ecf35f66940dcf5e08d9491b4efebe5bb1bd6d9af57/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6172746a6f6b65722f6c61726176656c2d75626b692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/artjoker/laravel-ubki)

[Украинское бюро кредитных историй (УБКИ)](https://www.ubki.ua/) занимается сбором, хранением, обработкой и предоставлением кредитных историй. УБКИ получает информацию о заемщиках от банков, страховых компаний, лизинговых компаний, кредитных союзов и других финансовых институтов. Информация передается на добровольной основе и только при наличии письменного согласия заемщика.

Для автоматизации взаимодействия с УБКИ существует [web-сервис](https://sites.google.com/ubki.ua/doc/%D0%BE%D0%B1%D1%89%D0%B8%D0%B5-%D0%BF%D1%80%D0%B8%D0%BD%D1%86%D0%B8%D0%BF%D1%8B-%D0%B2%D0%B7%D0%B0%D0%B8%D0%BC%D0%BE%D0%B4%D0%B5%D0%B9%D1%81%D1%82%D0%B2%D0%B8%D1%8F), который принимает запросы, обрабатывает и выдает ответ в зависимости от типа запроса.

This package allows you to simply and easily work with the web-service UBKI.

Migration to version 3
----------------------

[](#migration-to-version-3)

In this version we added possibility to use two UBKI accounts.

To use this possibility you should update your config file and add new migration.

Before publishing config you should remove previous config file.

```
$ php artisan vendor:publish --tag="laravelubki.config"
$ php artisan vendor:publish --tag="laravelubki.migrations"
```

Next, you need to run migrations:

```
$ php artisan migrate
```

add environment variables (`.env`)

```
UBKI_SECOND_ACCOUNT_LOGIN=
UBKI_SECOND_ACCOUNT_PASSWORD=

```

For switching between accounts you should add to params:

- to select second account

```
$params = [
    'test' => false,
    'use_second_account_login' => true
];
```

- to select main account

```
$params = [
    'test' => false,
    'use_second_account_login' => false
];
```

if you not select what account to use, last used account will be executed.

Installation
------------

[](#installation)

You can install this package via [Composer](http://getcomposer.org/):

```
$ composer require artjoker/laravel-ubki
```

Next, you need to run migrations:

```
$ php artisan migrate
```

Set environment variable (`.env`)

```
UBKI_TEST_MODE=true
UBKI_ACCOUNT_LOGIN=
UBKI_ACCOUNT_PASSWORD=
UBKI_AUTH_URL=https://secure.ubki.ua/b2_api_xml/ubki/auth
UBKI_REQUEST_URL=https://secure.ubki.ua/b2_api_xml/ubki/xml
UBKI_UPLOAD_URL=https://secure.ubki.ua/upload/data/xml
UBKI_TEST_AUTH_URL=https://secure.ubki.ua:4040/b2_api_xml/ubki/auth
UBKI_TEST_REQUEST_URL=https://secure.ubki.ua:4040/b2_api_xml/ubki/xml
UBKI_TEST_UPLOAD_URL=https://secure.ubki.ua:4040/upload/data/xml

```

Usage
-----

[](#usage)

Add `IntegratorUbki`-trait to the model with client data:

```
    use Artjoker\LaravelUbki\Traits\IntegratorUbki;

    class Loan extends Model
    {
        use IntegratorUbki;
        ...
    }

```

Set the necessary the mapping variables in `config/ubki.php`:

```
'model_data' => [
  'okpo'  => 'inn',           // ИНН
  'lname' => 'lastName',      // Фамилия
  'fname' => 'firstName',     // Имя
  'mname' => 'middleName',    // Отчество
  'bdate' => 'birth_date',    // Дата рождения (гггг-мм-дд)
  'dtype' => 'passport_type', // Тип паспорта (см. справочник "Тип документа")
  'dser'  => 'passport_ser',  // Серия паспорта или номер записи ID-карты
  'dnom'  => 'passport_num',  // Номер паспорта или номер ID-карты
  'ctype' => 'contact_type',  // Тип контакта (см. справочник "Тип контакта")
  'cval'  => 'contact_val',   // Значение контакта (например - "+380951111111")
  'foto'  => 'foto',          //
],

```

This map establishes the correspondence between the attributes of your model and the required query fields in UBKI.

Add a new method `ubkiAttributes()` to the class to add the necessary attributes and fill them with data:

```
    use Artjoker\LaravelUbki\Traits\IntegratorUbki;

    class Loan extends Model
    {
        use IntegratorUbki;
        ...

        public function ubkiAttributes($params = [])
        {
            $client_data = json_decode($this->attributes['client_data']);
            $this->attributes['inn']        = trim($client_data->code);
            $this->attributes['lastName']   = trim($client_data->lastName);
            ...
        }
    }

```

You can use other ways to create custom attributes that you specified in `'model_data'` (`config/ubki.php`).

Now, you can get data from UBKI:

```
$loan = Loan::find(1);
$result = $loan->ubki();
```

`$result['response']` - xml response from UBKI (standard report).

You can also pass parameters:

```
$result = $loan->ubki($params);
```

- `$params['report']` - report alias, if you need other reports;
- `$params['request_id']` - your request ID (if necessary);
- `$params['lang']` - search language;
- `$params['delete_all_history']` - set true if you want delete all history;

You can send the loan data to UBKI:

```
$result = $loan->ubki_upload($params);
```

`$params` - will be passed to the ubkiAttributes() method in the model.

Change log
----------

[](#change-log)

Please see the [changelog](changelog.md) for more information on what has changed recently.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 97.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

Every ~67 days

Recently: every ~231 days

Total

25

Last Release

840d ago

Major Versions

v1.0.6 → v2.02019-09-04

v2.1.1 → v3.0.02020-11-10

v3.0.8 → v4.0.12023-02-03

v4.0.4 → v5.02024-01-24

PHP version history (2 changes)v4.0.1PHP ^8.1

v4.0.2PHP ^7.2|^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/4494b41d92c564ee19e52ec8d2cb2805a5b67618b57579427e5cca9a7d2dbacf?d=identicon)[artjoker](/maintainers/artjoker)

---

Top Contributors

[![VT2](https://avatars.githubusercontent.com/u/12473376?v=4)](https://github.com/VT2 "VT2 (44 commits)")[![MihailBah](https://avatars.githubusercontent.com/u/19978328?v=4)](https://github.com/MihailBah "MihailBah (1 commits)")

---

Tags

laravelUbki

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/artjoker-laravel-ubki/health.svg)

```
[![Health](https://phpackages.com/badges/artjoker-laravel-ubki/health.svg)](https://phpackages.com/packages/artjoker-laravel-ubki)
```

###  Alternatives

[andreaselia/laravel-api-to-postman

Generate a Postman collection automatically from your Laravel API

1.0k586.2k3](/packages/andreaselia-laravel-api-to-postman)[mollie/laravel-mollie

Mollie API client wrapper for Laravel &amp; Mollie Connect provider for Laravel Socialite

3624.1M28](/packages/mollie-laravel-mollie)[api-ecosystem-for-laravel/dingo-api

A RESTful API package for the Laravel and Lumen frameworks.

3121.5M10](/packages/api-ecosystem-for-laravel-dingo-api)[essa/api-tool-kit

set of tools to build an api with laravel

52680.5k](/packages/essa-api-tool-kit)[mll-lab/laravel-graphiql

Easily integrate GraphiQL into your Laravel project

683.2M9](/packages/mll-lab-laravel-graphiql)[kirschbaum-development/laravel-openapi-validator

Automatic OpenAPI validation for Laravel HTTP tests

581.1M5](/packages/kirschbaum-development-laravel-openapi-validator)

PHPackages © 2026

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