PHPackages                             done6666/nilvera-sdk-php - 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. done6666/nilvera-sdk-php

ActiveLibrary[API Development](/categories/api)

done6666/nilvera-sdk-php
========================

Unofficial PHP SDK for the Nilvera e-document API (e-Invoice, e-Archive, e-Waybill and more)

v1.3.0(2w ago)111↑172.7%MITPHPPHP ^8.2

Since May 15Pushed 2w agoCompare

[ Source](https://github.com/done6666/nilvera-sdk-php)[ Packagist](https://packagist.org/packages/done6666/nilvera-sdk-php)[ Docs](https://developer.nilvera.com)[ RSS](/packages/done6666-nilvera-sdk-php/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (6)Versions (6)Used By (0)

Nilvera PHP SDK
===============

[](#nilvera-php-sdk)

[![PHP](https://camo.githubusercontent.com/83dd395020c37276225039739320f6c8e7e99963ab21ee3d09282cb48dad2a60/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d626c7565)](https://www.php.net)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](LICENSE)

[Nilvera](https://www.nilvera.com) e-belge API'si için PHP SDK. E-Fatura, E-Arşiv, E-İrsaliye, E-SMM, E-MM, E-SKGB, E-Adisyon, E-Saklama ve E-Defter servislerini destekler.

İçindekiler
-----------

[](#i̇çindekiler)

- [Gereksinimler](#gereksinimler)
- [Kurulum](#kurulum)
- [Hızlı Başlangıç](#h%C4%B1zl%C4%B1-ba%C5%9Flang%C4%B1%C3%A7)
- [Servisler](#servisler)
- [E-Fatura (eInvoice)](#e-fatura-einvoice)
    - [InvoiceBuilder ile Fluent API](#invoicebuilder-ile-fluent-api)
    - [E-Fatura Gönderme](#e-fatura-g%C3%B6nderme)
    - [Gelen Faturalar](#gelen-faturalar)
    - [Taslak Faturalar](#taslak-faturalar)
    - [XML / Base64 ile Gönderme](#xml--base64-ile-g%C3%B6nderme)
    - [Önizleme ve PDF İndirme](#%C3%B6nizleme-ve-pdf-i%CC%87ndirme)
    - [İletişim Kanalları](#i%CC%87leti%C5%9Fim-kanallar%C4%B1)
    - [Seri &amp; Şablon Yönetimi](#seri--%C5%9Fablon-y%C3%B6netimi)
    - [İstatistikler](#i%CC%87statistikler)
- [E-Arşiv (eArchive)](#e-ar%C5%9Fiv-earchive)
- [E-İrsaliye (eWaybill)](#e-i%CC%87rsaliye-ewaybill)
- [E-SMM (eSelfEmployed)](#e-smm-eselfemployed)
- [E-MM (eProducerReceipt)](#e-mm-eproducerreceipt)
- [Genel (general)](#genel-general)
- [Hata Yönetimi](#hata-y%C3%B6netimi)
- [İstek Sınıfları](#i%CC%87stek-s%C4%B1n%C4%B1flar%C4%B1)
- [Enum Referansı](#enum-referans%C4%B1)
- [Gelişmiş Yapılandırma](#geli%C5%9Fmi%C5%9F-yap%C4%B1land%C4%B1rma)
- [Test](#test)

---

Gereksinimler
-------------

[](#gereksinimler)

- PHP 8.1+
- Guzzle 7.5+

Kurulum
-------

[](#kurulum)

```
composer require done6666/nilvera-sdk-php
```

Hızlı Başlangıç
---------------

[](#hızlı-başlangıç)

```
use Nilvera\NilveraClient;

// Canlı ortam
$client = NilveraClient::live('your-api-key');

// Test / sandbox ortamı
$client = NilveraClient::test('your-test-api-key');
```

---

Servisler
---------

[](#servisler)

ErişimServisKapsam`$client->general()`GenelŞirket, mükellef, müşteri, stok`$client->eInvoice()`E-FaturaGiden/gelen fatura, taslak, seri, şablon`$client->eArchive()`E-ArşivE-arşiv faturası, rapor, seri, şablon`$client->eWaybill()`E-İrsaliyeİrsaliye gönderme, kabul/red`$client->eSelfEmployed()`E-SMMSerbest meslek makbuzu`$client->eProducerReceipt()`E-MMMüstahsil makbuzu`$client->eInsurance()`E-SKGBSigorta komisyon gider belgesi`$client->eReceipt()`E-AdisyonElektronik adisyon`$client->eStorage()`E-SaklamaBelge saklama`$client->eLedger()`E-DefterElektronik defter`$client->report()`RaporRaporlar---

E-Fatura (eInvoice)
-------------------

[](#e-fatura-einvoice)

### InvoiceBuilder ile Fluent API

[](#invoicebuilder-ile-fluent-api)

`InvoiceBuilder` zincirleme (fluent) sözdizimi sunarak fatura oluşturmayı kolaylaştırır. KDV toplamları otomatik hesaplanır.

```
use Nilvera\Builders\InvoiceBuilder;
use Nilvera\Enums\InvoiceProfile;
use Nilvera\Enums\InvoiceType;
use Nilvera\Enums\UnitType;
use Nilvera\Requests\ValueObjects\ReceiverRequest;

$receiver = new ReceiverRequest(
    taxNumber: '1234567890',
    name:      'Müşteri A.Ş.',
    address:   'Atatürk Cad. No:1',
    district:  'Kadıköy',
    city:      'İstanbul',
    taxOffice: 'Kadıköy',
);

$request = InvoiceBuilder::for($receiver)
    ->issueDate(new DateTimeImmutable('2024-06-01'))
    ->profile(InvoiceProfile::Basic)
    ->type(InvoiceType::Sales)
    ->alias('urn:mail:muhasebe@musteri.com.tr')  // GIB'de kayıtlı alıcı alias'ı
    ->addLine('Yazılım Lisansı', 1, UnitType::Piece, 10_000, 20)
    ->addLine('Yıllık Destek',  12, UnitType::Month,   500, 20)
    ->note('Ödeme vadesi: 30 gün')
    ->orderReference('2024-05-15', 'SIP-2024-001')
    ->build();

$response = $client->eInvoice()->send($request);

echo $response->uuid;          // Fatura UUID
echo $response->invoiceNumber; // örn. "GIB2024000000001"
```

### E-Fatura Gönderme

[](#e-fatura-gönderme)

`InvoiceBuilder` yerine `SendInvoiceRequest` doğrudan da kullanılabilir:

```
use Nilvera\Requests\SendInvoiceRequest;
use Nilvera\Requests\ValueObjects\InvoiceLineRequest;

$request = new SendInvoiceRequest(
    customerInfo:   $receiver,
    invoiceLines:   [
        // KDVTotal otomatik hesaplanır
        InvoiceLineRequest::make('Ürün A', 2, UnitType::Piece, 100.00, 20),

        // Yüzdesel iskonto ile
        InvoiceLineRequest::make(
            name:             'Ürün B',
            quantity:         10,
            unitType:         UnitType::Piece,
            price:            500.00,
            kdvPercent:       10,
            allowancePercent: 5,   // %5 iskonto — AllowanceTotal otomatik hesaplanır
        ),

        // Sabit iskonto tutarı ile
        InvoiceLineRequest::make(
            name:           'Ürün C',
            quantity:       1,
            unitType:       UnitType::Piece,
            price:          1000.00,
            kdvPercent:     20,
            allowanceTotal: 50.00,
        ),
    ],
    issueDate:      new DateTimeImmutable('2024-06-01T10:00:00'),
    invoiceProfile: InvoiceProfile::Basic,
    invoiceType:    InvoiceType::Sales,
    // GIB'de kayıtlı alıcılar için alias zorunludur
    // customerAlias: 'urn:mail:muhasebe@musteri.com.tr',
);

$response = $client->eInvoice()->send($request);
```

### Giden Faturaları Listeleme ve Sorgulama

[](#giden-faturaları-listeleme-ve-sorgulama)

```
use Nilvera\Requests\ListInvoicesRequest;

$params = new ListInvoicesRequest(
    startDate: new DateTimeImmutable('2024-01-01'),
    endDate:   new DateTimeImmutable('2024-12-31'),
    page:      1,
    pageSize:  20,
);

$invoices = $client->eInvoice()->listSaleInvoices($params);

// Fatura içeriği
$html  = $client->eInvoice()->getSaleInvoiceHtml($uuid);
$pdf   = $client->eInvoice()->getSaleInvoicePdf($uuid);  // binary
$xml   = $client->eInvoice()->getSaleInvoiceXml($uuid);
$model = $client->eInvoice()->getSaleInvoiceModel($uuid);

// Durum ve zarf bilgisi
$status       = $client->eInvoice()->getSaleInvoiceStatus($uuid);
$envelopeInfo = $client->eInvoice()->getSaleInvoiceEnvelopeInfo($uuid);
$histories    = $client->eInvoice()->getSaleInvoiceHistories($uuid);

// İptal
$client->eInvoice()->cancelSaleInvoice($uuid);
```

### Gelen Faturalar

[](#gelen-faturalar)

```
// Gelen faturaları listele
$incoming = $client->eInvoice()->listPurchaseInvoices($params);

// GIB'den yeni gelen faturaları senkronize et
$client->eInvoice()->syncPurchaseFromGib();

// Okundu işaretle
$client->eInvoice()->markPurchaseInvoiceAsRead($uuid);

// Gelen faturadan iade faturası oluştur
$return = $client->eInvoice()->createReturnFromPurchaseInvoice($uuid);
echo $return['UUID'];
```

### Taslak Faturalar

[](#taslak-faturalar)

```
// Taslak oluştur
$draft = $client->eInvoice()->createDraft([...]);

// Mevcut taslağı gönder
$response = $client->eInvoice()->sendDraft($uuid);

// Düzenle ve gönder
$response = $client->eInvoice()->editAndSendDraft([...]);

// Taslak içeriği
$html = $client->eInvoice()->getDraftHtml($uuid);
$pdf  = $client->eInvoice()->getDraftPdf($uuid);

// Tek taslak sil
$client->eInvoice()->deleteDraft($uuid);
```

### XML / Base64 ile Gönderme

[](#xml--base64-ile-gönderme)

```
// Ham UBL XML gönder
$result = $client->eInvoice()->sendXml($xmlContent);

// Base64 kodlu XML gönder
$result = $client->eInvoice()->sendBase64(base64_encode($xmlContent));

echo $result['UUID'];
echo $result['InvoiceNumber'];

// UBL XML dosyası yükle
$client->eInvoice()->upload([...]);
```

### Önizleme ve PDF İndirme

[](#önizleme-ve-pdf-i̇ndirme)

```
// HTML önizleme — göndermeden faturanın nasıl görüneceğini kontrol et
$html = $client->eInvoice()->preview($request);  // string döner
file_put_contents('fatura_preview.html', $html);

// PDF binary olarak indir (kaydetmeden)
$pdfBinary = $client->eInvoice()->downloadPdf($request);
file_put_contents('fatura.pdf', $pdfBinary);
```

### İletişim Kanalları

[](#i̇letişim-kanalları)

```
use Nilvera\Requests\SendByEmailRequest;
use Nilvera\Requests\SendBySmsRequest;

// E-posta
$client->eInvoice()->sendSaleInvoiceByEmail(
    new SendByEmailRequest($uuid, ['musteri@example.com', 'muhasebe@example.com'])
);

// SMS
$client->eInvoice()->sendSaleInvoiceBySms(
    new SendBySmsRequest($uuid, ['+905001234567'])
);

// WhatsApp
$client->eInvoice()->sendSaleInvoiceByWhatsapp(
    new SendBySmsRequest($uuid, ['+905001234567'])
);

// Gelen fatura için
$client->eInvoice()->sendPurchaseInvoiceByEmail(new SendByEmailRequest($uuid, ['muhasebe@example.com']));
```

### Seri &amp; Şablon Yönetimi

[](#seri--şablon-yönetimi)

```
// Seriler
$series = $client->eInvoice()->listSeries();
$client->eInvoice()->createSeries([...]);

// Şablonlar
$templates = $client->eInvoice()->listTemplates();
$template  = $client->eInvoice()->getTemplate($id);
$client->eInvoice()->updateTemplate([...]);
$preview   = $client->eInvoice()->previewTemplate($uuid);
$client->eInvoice()->deleteTemplate($id);
```

### İstatistikler

[](#i̇statistikler)

```
$saleStats     = $client->eInvoice()->getSaleStatistics(['StartDate' => '2024-01-01', 'EndDate' => '2024-12-31']);
$purchaseStats = $client->eInvoice()->getPurchaseStatistics(['StartDate' => '2024-01-01', 'EndDate' => '2024-12-31']);
```

---

E-Arşiv (eArchive)
------------------

[](#e-arşiv-earchive)

```
use Nilvera\Requests\SendArchiveInvoiceRequest;

$request = new SendArchiveInvoiceRequest(
    customerInfo: new ReceiverRequest(
        taxNumber: '9876543210',
        name:      'Bireysel Müşteri',
        address:   'Bağcılar Cad. No:5',
        district:  'Bağcılar',
        city:      'İstanbul',
    ),
    invoiceLines: [
        InvoiceLineRequest::make('Hizmet', 1, UnitType::Piece, 500.00, 20),
    ],
    issueDate: new DateTimeImmutable('2024-06-01T09:00:00'),
);

// Göndermeden önce HTML önizleme
$preview = $client->eArchive()->previewSend($request);

// Gönder
$response = $client->eArchive()->send($request);

// İptal
$client->eArchive()->cancelInvoice($uuid);

// GIB'e e-arşiv raporu bildir
$client->eArchive()->sendReport();

// Listeleme ve içerik
$invoices = $client->eArchive()->listInvoices($params);
$pdf      = $client->eArchive()->getInvoicePdf($uuid);
$html     = $client->eArchive()->getInvoiceHtml($uuid);
$xml      = $client->eArchive()->getInvoiceXml($uuid);
```

---

E-İrsaliye (eWaybill)
---------------------

[](#e-i̇rsaliye-ewaybill)

```
use Nilvera\Enums\DespatchProfile;
use Nilvera\Enums\DespatchType;
use Nilvera\Enums\UnitType;
use Nilvera\Requests\SendWaybillRequest;
use Nilvera\Requests\ValueObjects\DespatchLineRequest;
use Nilvera\Requests\ValueObjects\ReceiverRequest;

$request = new SendWaybillRequest(
    customerAlias:        'urn:mail:defaultpk@nilvera.com', // GIB'de kayıtlı alıcı alias'ı
    customerInfo:         new ReceiverRequest(
        taxNumber: '1234567890',
        name:      'Alıcı Firma A.Ş.',
        address:   'Sanayi Cad. No:10',
        district:  'Gebze',
        city:      'Kocaeli',
        taxOffice: 'Gebze',
    ),
    despatchLines:        [
        new DespatchLineRequest(
            name:              'Ürün A',
            deliveredUnitType: UnitType::Piece,
            deliveredQuantity: 100,
            sellerCode:        'STK-001',
            quantityPrice:     50.00,
            lineTotal:         5000.00,
        ),
    ],
    issueDate:             new DateTimeImmutable('2024-06-01T08:00:00'),
    despatchSerieOrNumber: 'IRS',   // zorunlu: 3 haneli seri kodu veya 16 haneli numara
    despatchType:          DespatchType::Sevk,
    despatchProfile:       DespatchProfile::TemelIrsaliye,
);

// Göndermeden önce HTML önizleme
$preview = $client->eWaybill()->previewSend($request);

// Gönder
$response = $client->eWaybill()->send($request);
echo $response->uuid;

// Giden irsaliyeler
$waybills = $client->eWaybill()->listSaleWaybills($params);
$html     = $client->eWaybill()->getSaleWaybillHtml($uuid);
$pdf      = $client->eWaybill()->getSaleWaybillPdf($uuid);

// Gelen irsaliye kabul/red
$client->eWaybill()->acceptPurchaseWaybill($uuid);
$client->eWaybill()->rejectPurchaseWaybill($uuid, 'Red gerekçesi');
```

---

E-SMM (eSelfEmployed)
---------------------

[](#e-smm-eselfemployed)

Serbest meslek makbuzu gönderimi için `SendVoucherRequest` ve `VoucherLineRequest` kullanılır.

```
use Nilvera\Requests\SendVoucherRequest;
use Nilvera\Requests\ValueObjects\VoucherLineRequest;
use Nilvera\Requests\ValueObjects\ReceiverRequest;

$request = new SendVoucherRequest(
    customerInfo: new ReceiverRequest(
        taxNumber: '1234567890',
        name:      'İşveren A.Ş.',
        address:   'Meclis-i Mebusan Cad. No:1',
        district:  'Beyoğlu',
        city:      'İstanbul',
        taxOffice: 'Beyoğlu',
    ),
    voucherLines: [
        new VoucherLineRequest(
            name:                 'Danışmanlık Hizmeti',
            grossWage:            10_000.00,
            price:                10_000.00,
            kdvPercent:           20,
            kdvTotal:             2_000.00,
            gvWithholdingPercent: 20,    // GV stopaj yüzdesi
            gvWithholdingTotal:   2_000.00,
        ),
    ],
    issueDate: new DateTimeImmutable('2024-06-01T09:00:00'),
    sendType:  'ELEKTRONIK', // veya 'KAGIT'
);

$response = $client->eSelfEmployed()->send($request);

// Listeleme ve içerik
$vouchers = $client->eSelfEmployed()->listVouchers($params);
$pdf      = $client->eSelfEmployed()->getVoucherPdf($uuid);
```

---

E-MM (eProducerReceipt)
-----------------------

[](#e-mm-eproducerreceipt)

Müstahsil makbuzu gönderimi için `SendProducerReceiptRequest` ve `ProducerLineRequest` kullanılır.

```
use Nilvera\Requests\SendProducerReceiptRequest;
use Nilvera\Requests\ValueObjects\ProducerLineRequest;
use Nilvera\Requests\ValueObjects\ReceiverRequest;

$request = new SendProducerReceiptRequest(
    customerInfo: new ReceiverRequest(
        taxNumber: '12345678901',  // TC kimlik numarası
        name:      'Ahmet Yılmaz',
        address:   'Köy Mah. No:5',
        district:  'Merkez',
        city:      'Antalya',
    ),
    producerLines: [
        new ProducerLineRequest(
            name:                 'Domates',
            quantity:             500,
            unitType:             UnitType::Kilogram,
            price:                8.50,
            gvWithholdingPercent: 4,
            gvWithholdingAmount:  170.00,
        ),
    ],
    issueDate:    new DateTimeImmutable('2024-06-01T00:00:00'),
    deliveryDate: new DateTimeImmutable('2024-06-01T00:00:00'),
);

$response = $client->eProducerReceipt()->send($request);
```

---

Genel (general)
---------------

[](#genel-general)

```
// Şirket bilgileri
$company = $client->general()->getCompany();
$client->general()->updateCompany([...]);
$modules = $client->general()->getCompanyModules();

// Mükellef sorgulama
$info    = $client->general()->checkTaxpayer('1234567890');    // VKN ile
$results = $client->general()->searchTaxpayers('Acme');         // Ad ile arama
$list    = $client->general()->listTaxpayersByType('GB', 'Invoice'); // Alias tipine göre

// Müşteri yönetimi
$customers = $client->general()->listCustomers();
$client->general()->createCustomer([...]);
$client->general()->updateCustomer([...]);
$client->general()->deleteCustomer($id);

// Stok yönetimi
$stocks = $client->general()->listStocks();
$client->general()->createStock([...]);
$client->general()->deleteStock($id);
```

---

Hata Yönetimi
-------------

[](#hata-yönetimi)

```
use Nilvera\Exception\ApiException;
use Nilvera\Exception\AuthenticationException;
use Nilvera\Exception\ConflictException;
use Nilvera\Exception\NotFoundException;
use Nilvera\Exception\ValidationException;

try {
    $response = $client->eInvoice()->send($request);
} catch (ValidationException $e) {
    // HTTP 422 — iş kuralı veya alan doğrulama hatası
    $errors = $e->getErrors(); // ['AlanAdı' => ['hata mesajı']]
    foreach ($errors as $field => $messages) {
        echo "{$field}: " . implode(', ', $messages) . PHP_EOL;
    }
} catch (AuthenticationException $e) {
    // HTTP 401/403 — geçersiz veya süresi dolmuş API anahtarı
} catch (NotFoundException $e) {
    // HTTP 404 — kayıt bulunamadı
} catch (ConflictException $e) {
    // HTTP 409 — yinelenen istek (aynı UUID tekrar gönderildi)
} catch (ApiException $e) {
    // Diğer tüm API veya bağlantı hataları
    $statusCode = $e->getStatusCode();
    $body       = $e->getResponseBody();
}
```

---

İstek Sınıfları
---------------

[](#i̇stek-sınıfları)

SınıfKullanım`SendInvoiceRequest`E-Fatura gönderme (POST /einvoice/Send/Model)`SendArchiveInvoiceRequest`E-Arşiv fatura gönderme (POST /earchive/Send/Model)`SendWaybillRequest`E-İrsaliye gönderme (POST /edespatch/Send/Model)`SendVoucherRequest`E-SMM gönderme (POST /evoucher/Send/Model)`SendProducerReceiptRequest`E-MM gönderme (POST /eproducer/Send/Model)`ListInvoicesRequest`Listeleme endpoint'leri için sayfalama/filtre`SendByEmailRequest`E-posta ile iletim`SendBySmsRequest`SMS / WhatsApp ile iletim`CreateCustomerRequest`Müşteri oluşturma### Value Objects

[](#value-objects)

SınıfKullanım`ReceiverRequest`Fatura alıcı bilgisi`InvoiceLineRequest`E-Fatura / E-Arşiv kalemi (`::make()` KDV'yi otomatik hesaplar)`DespatchLineRequest`E-İrsaliye kalemi`VoucherLineRequest`E-SMM kalemi`ProducerLineRequest`E-MM kalemi`TaxRequest`Ek vergi bilgisi`PaymentMeansRequest`Ödeme yöntemi`PaymentTermsRequest`Ödeme koşulları`ShipmentDetailRequest`İrsaliye sevkiyat detayı`WaybillPartyRequest`İrsaliye taraf bilgisi`AdditionalDocumentReferenceRequest`Ek belge referansı`AttachmentRequest`Ek dosya---

Enum Referansı
--------------

[](#enum-referansı)

### InvoiceProfile

[](#invoiceprofile)

```
use Nilvera\Enums\InvoiceProfile;

InvoiceProfile::Basic               // 'TEMELFATURA'
InvoiceProfile::Commercial          // 'TICARIFATURA'
InvoiceProfile::Export              // 'IHRACAT'
InvoiceProfile::TravellerBag        // 'YOLCUBERABERFATURA'
InvoiceProfile::EArchive            // 'EARSIVFATURA'
InvoiceProfile::Public              // 'KAMU'
InvoiceProfile::HKS                 // 'HKS'
InvoiceProfile::Energy              // 'ENERJI'
InvoiceProfile::Medical             // 'ILAC_TIBBICIHAZ'
InvoiceProfile::Special             // 'OZELFATURA'
InvoiceProfile::InvestmentIncentive // 'YATIRIMTESVIK'
InvoiceProfile::IDIS                // 'IDIS'
```

### InvoiceType

[](#invoicetype)

```
use Nilvera\Enums\InvoiceType;

InvoiceType::Sales               // 'SATIS'
InvoiceType::Return              // 'IADE'
InvoiceType::Exemption           // 'ISTISNA'
InvoiceType::Stoppage            // 'TEVKIFAT'
InvoiceType::ExciseDuty          // 'IHRACKAYITLI'
InvoiceType::Cancel              // 'IPTAL'
InvoiceType::SpecialBase         // 'OZELMATRAH'
InvoiceType::SGK                 // 'SGK'
InvoiceType::StoppageReturn      // 'TEVKIFATIADE'
InvoiceType::Commissioner        // 'KOMISYONCU'
InvoiceType::HKSSales            // 'HKSSATIS'
InvoiceType::HKSCommissioner     // 'HKSKOMISYONCU'
InvoiceType::AccommodationTax    // 'KONAKLAMAVERGISI'
InvoiceType::EVCharging          // 'SARJ'
InvoiceType::EVChargingStation   // 'SARJANLIK'
InvoiceType::TechSupport         // 'TEKNOLOJIDESTEK'
InvoiceType::YTBSales            // 'YTBSATIS'
InvoiceType::YTBExemption        // 'YTBISTISNA'
InvoiceType::YTBReturn           // 'YTBIADE'
InvoiceType::YTBStoppage         // 'YTBTEVKIFAT'
InvoiceType::YTBStoppageReturn   // 'YTBTEVKIFATIADE'
```

### UnitType

[](#unittype)

```
use Nilvera\Enums\UnitType;

UnitType::Piece       // 'C62' — Adet
UnitType::Kilogram    // 'KGM'
UnitType::Gram        // 'GRM'
UnitType::Liter       // 'LTR'
UnitType::Meter       // 'MTR'
UnitType::SquareMeter // 'MTK'
UnitType::CubicMeter  // 'MTQ'
UnitType::Hour        // 'HUR'
UnitType::Day         // 'DAY'
UnitType::Month       // 'MON'
UnitType::Year        // 'ANN'
UnitType::Box         // 'BX'
UnitType::Dozen       // 'DZN'
UnitType::Ton         // 'TNE'
UnitType::Package     // 'PK'
UnitType::Set         // 'SET'
```

### Diğer Enum'lar

[](#diğer-enumlar)

```
use Nilvera\Enums\DespatchProfile;
use Nilvera\Enums\DespatchType;
use Nilvera\Enums\SendType;
use Nilvera\Enums\SalesPlatform;
use Nilvera\Enums\ProductType;

DespatchProfile::TemelIrsaliye  // 'TEMELIRSALIYE'
DespatchProfile::HKSIrsaliye    // 'HKSIRSALIYE'

DespatchType::Sevk              // 'SEVK'
DespatchType::Matbudan          // 'MATBUDAN'

SendType::Electronic            // 'ELEKTRONIK'
SendType::Paper                 // 'KAGIT'

SalesPlatform::Normal           // 'NORMAL'
SalesPlatform::Internet         // 'INTERNET'

ProductType::Medicine           // 'MEDICINE'
ProductType::MedicalDevice      // 'MEDICALDEVICE'
ProductType::Other              // 'OTHER'
```

---

Gelişmiş Yapılandırma
---------------------

[](#gelişmiş-yapılandırma)

```
use Nilvera\Config;
use Nilvera\NilveraClient;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;

$logger = new Logger('nilvera');
$logger->pushHandler(new StreamHandler('nilvera.log'));

$config = Config::live('your-api-key')
    ->withTimeout(60)           // saniye
    ->withConnectTimeout(10)    // saniye
    ->withLogger($logger)       // PSR-3 uyumlu logger
    ->withRetry(3, 500);        // 3 deneme, 500ms başlangıç gecikmesi (exponential backoff)

$client = NilveraClient::fromConfig($config);
```

SeçenekVarsayılanAçıklama`withTimeout(int)`30sİstek timeout süresi`withConnectTimeout(int)`10sBağlantı timeout süresi`withLogger(LoggerInterface)`NullLoggerPSR-3 uyumlu logger`withRetry(int, int)`2 deneme, 500msOtomatik yeniden deneme (exponential backoff)---

Test
----

[](#test)

```
composer install
./vendor/bin/phpunit
```

Entegrasyon testleri için `.env` dosyası oluşturun:

```
cp .env.example .env
# NILVERA_TEST_API_KEY değerini .env dosyasına girin
./vendor/bin/phpunit --testsuite integration
```

---

API Dokümantasyonu
------------------

[](#api-dokümantasyonu)

Tam API referansı: [developer.nilvera.com](https://developer.nilvera.com/en)

Lisans
------

[](#lisans)

MIT

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance96

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

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 ~2 days

Total

5

Last Release

18d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/52110406?v=4)[Done](/maintainers/done6666)[@done6666](https://github.com/done6666)

---

Top Contributors

[![done6666](https://avatars.githubusercontent.com/u/52110406?v=4)](https://github.com/done6666 "done6666 (18 commits)")

---

Tags

sdkE-Invoiceturkeye faturae arşive-archivenilvera

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/done6666-nilvera-sdk-php/health.svg)

```
[![Health](https://phpackages.com/badges/done6666-nilvera-sdk-php/health.svg)](https://phpackages.com/packages/done6666-nilvera-sdk-php)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k532.1M2.5k](/packages/aws-aws-sdk-php)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.8M710](/packages/sylius-sylius)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21764.8M1.6k](/packages/drupal-core)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

232.5k](/packages/eslazarev-wildberries-sdk)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.7k371.6k5](/packages/theodo-group-llphant)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6941.5M395](/packages/drupal-core-recommended)

PHPackages © 2026

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