PHPackages                             argist/laravel-invoice-webhook - 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. argist/laravel-invoice-webhook

ActiveLibrary[API Development](/categories/api)

argist/laravel-invoice-webhook
==============================

Laravel altyapılı sistemlerde oluşturulan fatura ve satış kayıtlarını Argist platformuna güvenli şekilde aktaran, e-Arşiv ve e-Fatura uyumlu webhook entegrasyonu.

v1.0.4(5mo ago)011MITPHPPHP ^8.1

Since Jan 10Pushed 5mo agoCompare

[ Source](https://github.com/ilkaya/laravel-invoice-webhook)[ Packagist](https://packagist.org/packages/argist/laravel-invoice-webhook)[ RSS](/packages/argist-laravel-invoice-webhook/feed)WikiDiscussions main Synced today

READMEChangelog (5)Dependencies (1)Versions (6)Used By (0)

Argist Laravel Invoice Webhook
==============================

[](#argist-laravel-invoice-webhook)

[![License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

Laravel altyapılı sistemlerde oluşturulan fatura ve satış kayıtlarını Argist platformuna güvenli şekilde aktaran, e-Arşiv ve e-Fatura uyumlu webhook entegrasyonu.

Özellikler
----------

[](#özellikler)

- ✅ **JWT Token Management** - Otomatik token yönetimi ve caching
- ✅ **Ayrı Servisler** - JWT token servisi ve fatura gönderimi servisleri ayrı çalışır
- ✅ **Production Ready** - Hata yönetimi, validasyon ve logging
- ✅ **Configuration Management** - Merkezi yapılandırma dosyası
- ✅ **Timeout Protection** - HTTP istek timeout'ları
- ✅ **Error Handling** - Detaylı hata mesajları ve yanıtları

Kurulum
-------

[](#kurulum)

### 1. Composer ile Yükleme

[](#1-composer-ile-yükleme)

```
composer require argist/laravel-invoice-webhook
```

### 2. Konfigürasyon Yayınlama

[](#2-konfigürasyon-yayınlama)

```
php artisan vendor:publish --provider="Argist\InvoiceWebhook\Providers\InvoiceWebhookServiceProvider" --tag=argist-config
```

Bu komut, `config/argist.php` dosyasını projenize kopyalayacaktır.

### 3. Environment Değişkenlerini Ayarlama

[](#3-environment-değişkenlerini-ayarlama)

`.env` dosyasına aşağıdaki değişkenleri ekleyin:

```
# Argist API Konfigürasyonu
ARGIST_PUBLIC_KEY=your-public-key-here
ARGIST_SECRET_KEY=your-secret-key-here
```

Kullanım
--------

[](#kullanım)

### Fatura Gönderme

[](#fatura-gönderme)

#### Option 1: Direct Service Call

[](#option-1-direct-service-call)

```
use Argist\InvoiceWebhook\Services\InvoiceApiService;

$invoiceData = [
    'bill_date' => '03/01/2026',
    'bill_time' => '14:30:00',
    'payment_status' => 1,
    'description' => 'Ürün satışı',
    'amount' => 1000,
    'total_tax' => 200,
    'total_amount' => 1200,
    'currency_id' => 1,
    'customer' => [
        'name' => 'Müşteri Adı',
        'email' => 'musteri@example.com',
        'adress' => 'Adres Bilgisi',
        'tax_office' => 'Vergi Müdürlüğü',
        'tax_number' => '12345678901',
    ],
    'rows' => [
        [
            'title' => 'Ürün Adı',
            'quantity' => 2,
            'amount' => 500,
            'tax_rate' => 20,
            'currency_id' => 1,
            'row_sale_type' => '1',
            'product_id' => null,
            'service_id' => null,
            'quantity_unit_id' => 1,
            'tax_amount' => 200,
            'price_excluding_tax' => 1000,
            'total_amount' => 1200,
            'discount_amount' => 0,
            'discount_rate' => 0,
            'description' => 'Ürün açıklaması',
        ]
    ],
];

$result = InvoiceApiService::sendInvoice($invoiceData);

if ($result['success']) {
    // Fatura başarıyla gönderildi
    $invoiceId = $result['data']['id'] ?? null;
} else {
    // Hata oluştu
    $errorMessage = $result['message'];
    $errors = $result['errors'] ?? [];
}
```

#### Option 2: HTTP Request

[](#option-2-http-request)

```
POST /api/v1/invoice/send HTTP/1.1
Content-Type: application/json

{
  "bill_date": "03/01/2026",
  "bill_time": "14:30:00",
  "payment_status": 1,
  "description": "Ürün satışı",
  "amount": 1000,
  "total_tax": 200,
  "total_amount": 1200,
  "currency_id": 1,
  "customer": {
    "name": "Müşteri Adı",
    "email": "musteri@example.com",
    "adress": "Adres Bilgisi",
    "tax_office": "Vergi Müdürlüğü",
    "tax_number": "12345678901"
  },
  "rows": [
    {
      "title": "Ürün Adı",
      "quantity": 2,
      "amount": 500,
      "tax_rate": 20,
      "currency_id": 1,
      "row_sale_type": "1",
      "product_id": null,
      "service_id": null,
      "quantity_unit_id": 1,
      "tax_amount": 200,
      "price_excluding_tax": 1000,
      "total_amount": 1200,
      "discount_amount": 0,
      "discount_rate": 0,
      "description": "Ürün açıklaması"
    }
  ]
}
```

#### Test Endpoint

[](#test-endpoint)

Sistem kurulumunu test etmek için:

```
GET /api/v1/invoice/test HTTP/1.1
```

### Response Format

[](#response-format)

**Success Response (200):**

```
{
  "success": true,
  "status": 200,
  "data": {
    "id": "bill_123456",
    "status": "created"
  }
}
```

**Validation Error (422):**

```
{
  "success": false,
  "status": 422,
  "message": "Fatura gönderimi başarısız",
  "errors": {
    "bill_date": ["Bill date is required"],
    "customer": ["Customer information is invalid"]
  }
}
```

**Server Error (500):**

```
{
  "success": false,
  "status": 500,
  "message": "Gerekli alan eksik: bill_date",
  "errors": []
}
```

Servis Mimarisi
---------------

[](#servis-mimarisi)

### JwtTokenService

[](#jwttokenservice)

JWT token almandan sorumludur.

**Özellikler:**

- Token caching (50 dakika)
- Otomatik yenileme
- Error handling

**Kullanım:**

```
use Argist\InvoiceWebhook\Services\JwtTokenService;

$tokenService = new JwtTokenService();

// Token al (cache'den ya da API'den)
$token = $tokenService->getToken();

// Cache'i temizle
$tokenService->clearCache();
```

### InvoiceApiService

[](#invoiceapiservice)

Fatura gönderme işleminden sorumludur.

**Özellikler:**

- Veri validasyonu
- JWT token integration
- Response handling
- Error formatting

**Metotlar:**

```
// Fatura gönder
InvoiceApiService::sendInvoice(array $invoiceData): array
```

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

[](#hata-yönetimi)

Paket tüm hataları yapılandırılmış bir array formatında döndürür:

```
[
    'success' => bool,
    'status' => int (HTTP status code),
    'message' => string,
    'errors' => array (validation errors if any)
]
```

### Olası Hatalar

[](#olası-hatalar)

DurumStatusSebepJWT Token Hatası401API anahtarları yanlış ya da yapılandırılmamışValidasyon Hatası422Gerekli alanlar eksik veya yanlış formatServer Hatası500Bağlantı sorunu veya API hatasıGelişmiş Ayarlar
----------------

[](#gelişmiş-ayarlar)

### Timeout Ayarı

[](#timeout-ayarı)

```
ARGIST_API_TIMEOUT=30  # Saniye cinsinden
```

### Custom API Domain

[](#custom-api-domain)

```
ARGIST_API_DOMAIN=https://custom-api.argist.com
```

### Custom Bill Endpoint

[](#custom-bill-endpoint)

```
ARGIST_BILL_ENDPOINT=/api/v1/custom/bill/create
```

Logging
-------

[](#logging)

Paket tüm istekleri Laravel logging sistemi ile kaydeder. `config/logging.php` dosyanızda loglama seviyesini ayarlayabilirsiniz.

Testing
-------

[](#testing)

Test endpointini kullanarak sistem kurulumunu doğrulayın:

```
curl http://localhost:8000/api/v1/invoice/test
```

Security Best Practices
-----------------------

[](#security-best-practices)

1. ✅ Environment değişkenlerinde API anahtarlarını saklayın
2. ✅ Production ortamında HTTPS kullanın
3. ✅ API istieyim rate limiting ile koruyun
4. ✅ İstekleri düzenli olarak izleyin ve logları kontrol edin

Teknik Detaylar
---------------

[](#teknik-detaylar)

### Token Caching

[](#token-caching)

- **Cache Duration:** 50 dakika
- **Cache Driver:** Laravel cache (default)
- **Otomatik Yenileme:** Token süresi dolunca otomatik yenilenir

### Timeout Settings

[](#timeout-settings)

- **JWT Token Request:** 10 saniye
- **Bill Sending Request:** 30 saniye

### Validation

[](#validation)

Tüm gerekli alanlar kontrol edilir:

- bill\_date
- bill\_time
- payment\_status
- amount
- total\_tax
- total\_amount
- currency\_id
- customer (array)
- rows (array)

Troubleshooting
---------------

[](#troubleshooting)

### "Argist API anahtarları yapılandırılmadı"

[](#argist-api-anahtarları-yapılandırılmadı)

**Çözüm:** `.env` dosyasında `ARGIST_PUBLIC_KEY` ve `ARGIST_SECRET_KEY` ayarlandığından emin olun.

### "Token alma işlemi başarısız"

[](#token-alma-işlemi-başarısız)

**Çözüm:**

- API anahtarlarının doğru olduğundan emin olun
- Ağ bağlantısını kontrol edin
- API'nin çalışır durumda olduğundan emin olun

### "Gerekli alan eksik"

[](#gerekli-alan-eksik)

**Çözüm:** Tüm gerekli alanları request'e ekleyin. [Kullanım bölümü](#kullan%C4%B1m) referans alın.

Contributions
-------------

[](#contributions)

Katkılarınız hoşgeldiniz! Lütfen pull request gönderin.

License
-------

[](#license)

MIT License. Detaylar için [LICENSE.md](LICENSE.md) dosyasına bakın.

Support
-------

[](#support)

Sorular veya sorunlar için lütfen GitHub issues açın.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance70

Regular maintenance activity

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

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

Total

5

Last Release

174d ago

### Community

Maintainers

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

---

Top Contributors

[![ilkaya](https://avatars.githubusercontent.com/u/46712017?v=4)](https://github.com/ilkaya "ilkaya (5 commits)")

### Embed Badge

![Health badge](/badges/argist-laravel-invoice-webhook/health.svg)

```
[![Health](https://phpackages.com/badges/argist-laravel-invoice-webhook/health.svg)](https://phpackages.com/packages/argist-laravel-invoice-webhook)
```

###  Alternatives

[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.6k3](/packages/defstudio-telegraph)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)[rapidez/core

Rapidez Core

1823.5k72](/packages/rapidez-core)

PHPackages © 2026

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