PHPackages                             goosfraba/krd-rastin-sdk - 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. goosfraba/krd-rastin-sdk

ActiveLibrary[API Development](/categories/api)

goosfraba/krd-rastin-sdk
========================

The SDK for KRD Rastin 2.0 protocol

1.0.6(2y ago)02.9kMITPHPPHP &gt;=7.4

Since Mar 28Pushed 2y ago1 watchersCompare

[ Source](https://github.com/dbojdo/krd-rastin)[ Packagist](https://packagist.org/packages/goosfraba/krd-rastin-sdk)[ RSS](/packages/goosfraba-krd-rastin-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (8)Used By (0)

KRD RASTIN 2.0 SDK
==================

[](#krd-rastin-20-sdk)

This project provides a high level SDK for the KRD ([Krajowy Rejestr Długów](https://info.krd.pl/Programista/Wprowadzenie-do-KRD-API)) Rastin Protocl 2.0.

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

[](#installation)

Installation via composer. PHP 7.4+ required.

```
composer require goosfraba/krd-rastin
```

Usage
-----

[](#usage)

### SDK Creation

[](#sdk-creation)

Create the SDK instance

```
use Goosfraba\KrdRastin\Soap\KrdRastinSoapApiFactory;
use Goosfraba\KrdRastin\Soap\Authorization;

$factory = KrdRastinSoapApiFactory::getInstance();

$apiDemo = $factory->createDemo(
    Authorization::loginAndPassword("demo-login", "demo-password")
); // creates API for DEMO WSDL

$apiDemo = $factory->createDemo(
    Authorization::loginAndPassword("your-prod-login", "your-prod-password")
); // creates API for PROD WSDL
```

### Verify the consumer's identity number / address (VerifyConsumerIdentityNumber method)

[](#verify-the-consumers-identity-number--address-verifyconsumeridentitynumber-method)

```
use Goosfraba\KrdRastin\VerifyConsumerIdentityNumberRequest;
use Goosfraba\KrdRastin\VerifyConsumerIdentityNumberResponse;
use Goosfraba\KrdRastin\Exception\ValidationException;
use Goosfraba\KrdRastin\Exception\AuthenticationException;
use Goosfraba\KrdRastin\Exception\GenericException;

try {
    /** @var VerifyConsumerIdentityNumberResponse $result */
    $result = $api->verifyConsumerIdentityNumber(
        VerifyConsumerIdentityNumberRequest::create(
            "13300100037",
            "OKTAWIUSZ",
            "DE LORM",
            Address::create(
                "GÓRNICZA",
                "39",
                "20",
                "01203",
                "JÓZEFÓW"
            )
        )
    );
} catch (ValidationException $e) {
    // invalid PESEL (given number is not a valid PESEL number)
} catch (AuthenticationException $e) {
    // invalid login / password
} catch (GenericException $e) {
    // generic API exception, see \SoapFault for details
    $soapFault = $e->soapFault();
}

$result->isPeselValid(); // checks if PESEL is valid (false if given PESEL is not matching the given name)
$addressResult = $result->permanentAddressVerificationResult(); // Address validation result object
```

### Verify the consumer's ID Card (VerifyIDCard method)

[](#verify-the-consumers-id-card-verifyidcard-method)

```
use Goosfraba\KrdRastin\VerifyIDCardRequest;
use Goosfraba\KrdRastin\VerifyIDCardResponse;

try {
    /** @var VerifyIDCardResponse $result */
    $result = $api->verifyIdCard(
        VerifyIDCardRequest::create(
            "51011500014",
            FullName::createWithLastName("ANDRZEJ", "PAWEŁ", "WALCZUK-KOWALSKA"),
            "VCX",
            "959351",
            date_create_immutable("2014-09-24"),
            date_create_immutable("2024-09-24")
        )
    );
} catch (AuthenticationException $e) {
    // invalid login / password
} catch (GenericException $e) {
    // generic API exception, see \SoapFault for details
    $soapFault = $e->soapFault();
}

/**
 * true if the ID Card number details (name, number, dates)
 * matching the PESEL and the ID Card has not been invalidated
 */
$result->isValid();
```

### Check if the consumer's ID Card is canceled (VerifyIsIDCardCanceled method)

[](#check-if-the-consumers-id-card-is-canceled-verifyisidcardcanceled-method)

```
use Goosfraba\KrdRastin\VerifyIsIDCardCanceledRequest;
use Goosfraba\KrdRastin\VerifyIsIDCardCanceledResponse;

try {
    /** @var VerifyIsIDCardCanceledResponse $result */
    $result = $api->verifyIsIdCardCanceled(
        VerifyIsIDCardCanceledRequest::create("VCX", "959351")
    );
} catch (AuthenticationException $e) {
    // invalid login / password
} catch (GenericException $e) {
    // generic API exception, see \SoapFault for details
    $soapFault = $e->soapFault();
}

/**
 * TRUE only if the ID Card number exists and it has been cancelled.
 * Please not it will return FALSE for invalid ID Card so this should be used only along with VerifyIdCard method.
 */
$isCanceled = $result->isCanceled();
```

### Verify the consumer is alive (VerifyConsumerIsAlive method)

[](#verify-the-consumer-is-alive-verifyconsumerisalive-method)

```
use Goosfraba\KrdRastin\VerifyConsumerIsAliveRequest;
use Goosfraba\KrdRastin\VerifyConsumerIsAliveResponse;
use Goosfraba\KrdRastin\VerifyConsumerIsAliveStatus;
try {
    /** @var VerifyConsumerIsAliveResponse $result */
    $result = $api->verifyConsumerIsAlive(
        VerifyConsumerIsAliveRequest::create("14221400248", "DELFFINA", "TONDOSSSS")
    );
} catch (AuthenticationException $e) {
    // invalid login / password
} catch (GenericException $e) {
    // generic API exception, see \SoapFault for details
    $soapFault = $e->soapFault();
}

/**
 * Status is one of:
 * VerifyConsumerIsAliveStatus::alive()
 * VerifyConsumerIsAliveStatus::notAlive()
 * VerifyConsumerIsAliveStatus::incorrectData()
 */
$status = $result->status();
```

Contribution
------------

[](#contribution)

Feel free to contribute into this repository with new features / bugfixes.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~49 days

Recently: every ~73 days

Total

7

Last Release

847d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a6cc50814a7b150c2a02d719d33c6e11040a6d0d010b2f986a24794edce7f52f?d=identicon)[dbojdo](/maintainers/dbojdo)

---

Top Contributors

[![dbojdo](https://avatars.githubusercontent.com/u/1272416?v=4)](https://github.com/dbojdo "dbojdo (1 commits)")

---

Tags

apisdkkrdrastinrastin 2.0

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/goosfraba-krd-rastin-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/goosfraba-krd-rastin-sdk/health.svg)](https://phpackages.com/packages/goosfraba-krd-rastin-sdk)
```

###  Alternatives

[deepseek-php/deepseek-php-client

deepseek PHP client is a robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities.

47073.9k5](/packages/deepseek-php-deepseek-php-client)[webit/w-firma-api

wFirma.pl API

1820.2k](/packages/webit-w-firma-api)

PHPackages © 2026

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