PHPackages                             wiensa/n11-sp-api - 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. wiensa/n11-sp-api

ActiveLibrary[API Development](/categories/api)

wiensa/n11-sp-api
=================

N11 Seller Partner API integration for Laravel

v1.0.1(1y ago)1217↓61.5%MITPHPPHP ^8.3

Since Apr 18Pushed 1y ago1 watchersCompare

[ Source](https://github.com/wiensa/n11-sp-api)[ Packagist](https://packagist.org/packages/wiensa/n11-sp-api)[ RSS](/packages/wiensa-n11-sp-api/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (2)Dependencies (8)Versions (3)Used By (0)

N11 Seller Partner API for Laravel
==================================

[](#n11-seller-partner-api-for-laravel)

Laravel için N11 Seller Partner API entegrasyonu.

N11 platformu ile entegrasyon sağlayarak, ürün yönetimi, sipariş takibi, kategori listeleme ve daha fazla işlemi programatik olarak gerçekleştirmenize olanak tanıyan bir Laravel paketidir.

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

[](#özellikler)

- N11 API ile kolay entegrasyon
- Kategorileri listeleme ve yönetme
- Ürünleri sorgulama, ekleme, güncelleme ve silme
- Siparişleri listeleme ve yönetme
- Şehir ve ilçe bilgilerini sorgulama
- Kargo şirketleri ve şablonlarını yönetme
- Ürün stok ve satış durumlarını yönetme

Kurulum
-------

[](#kurulum)

Composer aracılığıyla paketi projenize ekleyin:

```
composer require wiensa/n11-sp-api
```

Paketi yükledikten sonra, N11 API yapılandırma dosyasını yayınlayın:

```
php artisan vendor:publish --provider="N11Api\N11SpApi\N11SpApiServiceProvider" --tag="config"
```

Bu komut, `config/n11-sp-api.php` yapılandırma dosyasını projenize ekleyecektir.

Yapılandırma
------------

[](#yapılandırma)

`.env` dosyanıza N11 API anahtarlarınızı ekleyin:

```
N11_APP_KEY=your-app-key
N11_APP_SECRET=your-app-secret

```

Bu anahtarları N11 Seller Partner API panelinden alabilirsiniz.

Kullanım
--------

[](#kullanım)

### Facade ile Kullanım

[](#facade-ile-kullanım)

```
use N11Api\N11SpApi\Facades\N11;

// Kategorileri listele
$categories = N11::categories()->getCategories();

// Ürün bilgilerini getir
$product = N11::products()->getProductById(123456);

// Siparişleri listele
$orders = N11::orders()->getOrders([
    'status' => 'New',
    'period' => [
        'startDate' => '01/01/2023',
        'endDate' => '31/12/2023'
    ]
]);
```

### Dependency Injection ile Kullanım

[](#dependency-injection-ile-kullanım)

```
use N11Api\N11SpApi\N11Api;

class ProductController extends Controller
{
    protected N11Api $n11;

    public function __construct(N11Api $n11)
    {
        $this->n11 = $n11;
    }

    public function getProducts()
    {
        $products = $this->n11->products()->getProducts([
            'currentPage' => 0,
            'pageSize' => 20
        ]);

        return $products;
    }
}
```

Servisler
---------

[](#servisler)

Paket, N11 API'sine erişmek için aşağıdaki servisleri içerir:

- **CategoryService**: Kategori işlemleri (`$n11->categories()`)
- **CityService**: Şehir ve ilçe işlemleri (`$n11->cities()`)
- **OrderService**: Sipariş işlemleri (`$n11->orders()`)
- **ProductService**: Ürün işlemleri (`$n11->products()`)
- **ShipmentService**: Teslimat şablonu işlemleri (`$n11->shipments()`)
- **ShipmentCompanyService**: Kargo şirketi işlemleri (`$n11->shipmentCompanies()`)
- **ProductSellingService**: Ürün satış durumu işlemleri (`$n11->productSellings()`)
- **ProductStockService**: Ürün stok işlemleri (`$n11->productStocks()`)

Her servis, ilgili N11 API metodlarını içerir ve belgeli metodlarla kolay kullanım sağlar.

Örnek Uygulamalar
-----------------

[](#örnek-uygulamalar)

### Kategori Listeleme

[](#kategori-listeleme)

```
// Tüm kategorileri getir
$categories = N11::categories()->getCategories();

// Kategori detaylarını döngü ile işle
foreach ($categories as $category) {
    echo "Kategori ID: " . $category->id . "\n";
    echo "Kategori Adı: " . $category->name . "\n";

    // Alt kategorileri getir
    $subCategories = N11::categories()->getSubCategories($category->id);

    // Alt kategorileri işle
    foreach ($subCategories as $subCategory) {
        echo "  Alt Kategori ID: " . $subCategory->id . "\n";
        echo "  Alt Kategori Adı: " . $subCategory->name . "\n";
    }
}
```

### Ürün Ekleme

[](#ürün-ekleme)

```
$product = [
    'productSellerCode' => 'PRD-123456',
    'title' => 'Örnek Ürün',
    'subtitle' => 'Örnek Alt Başlık',
    'description' => 'Ürün açıklama metni',
    'category' => [
        'id' => 1000123
    ],
    'price' => 99.90,
    'currencyType' => 'TL',
    'images' => [
        'image' => [
            [
                'url' => 'https://example.com/image1.jpg',
                'order' => 1
            ],
            [
                'url' => 'https://example.com/image2.jpg',
                'order' => 2
            ]
        ]
    ],
    'stockItems' => [
        'stockItem' => [
            [
                'quantity' => 10,
                'sellerStockCode' => 'STK-123456'
            ]
        ]
    ],
    'shipmentTemplate' => 'Standart Teslimat'
];

$result = N11::products()->createProduct($product);
```

### Siparişleri Listeleme

[](#siparişleri-listeleme)

```
$orders = N11::orders()->getOrders([
    'status' => 'New', // New, Approved, Rejected, Shipped, Delivered, Completed
    'period' => [
        'startDate' => '01/01/2023',
        'endDate' => '31/12/2023'
    ],
    'pagingData' => [
        'currentPage' => 0,
        'pageSize' => 20
    ]
]);

// Siparişleri işle
foreach ($orders->orderList->order as $order) {
    echo "Sipariş ID: " . $order->id . "\n";
    echo "Sipariş Numarası: " . $order->orderNumber . "\n";
    echo "Alıcı: " . $order->buyer->fullName . "\n";

    // Sipariş detayını getir
    $orderDetail = N11::orders()->getOrderDetail($order->id);

    // Sipariş kalemlerini işle
    foreach ($orderDetail->orderItems as $item) {
        echo "  Ürün: " . $item->productName . "\n";
        echo "  Adet: " . $item->quantity . "\n";
        echo "  Fiyat: " . $item->price . "\n";
    }
}
```

### Ürün Stok Yönetimi

[](#ürün-stok-yönetimi)

```
// Ürün stoğunu sorgula
$stockInfo = N11::productStocks()->getProductStockByProductId(123456);

// Stok güncelle
$stockParams = [
    'items' => [
        [
            'productId' => 123456,
            'quantity' => 100,
            'version' => $stockInfo->version
        ]
    ]
];

$result = N11::productStocks()->updateProductStock($stockParams);
```

### Ürün Satış Durum Yönetimi

[](#ürün-satış-durum-yönetimi)

```
// Ürünü satışa kapat
$result = N11::productSellings()->stopSellingProductByProductId(123456);

// Ürünü satışa aç
$result = N11::productSellings()->startSellingProductByProductId(123456);
```

Sürüm Değişiklikleri
--------------------

[](#sürüm-değişiklikleri)

### 1.x

[](#1x)

- N11Api sınıfı ve namespace güncellemeleri
- Servis metot adları güncellendi (çoğul yapıldı: categories(), cities(), vb.)
- Daha tutarlı bir API arayüzü eklendi
- PHP 8.3 desteği eklendi

Lisans
------

[](#lisans)

Bu paket MIT lisansı altında lisanslanmıştır.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance44

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

2

Last Release

440d ago

### Community

Maintainers

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

---

Top Contributors

[![wiensa](https://avatars.githubusercontent.com/u/155260864?v=4)](https://github.com/wiensa "wiensa (2 commits)")

---

Tags

apilaravelintegratione-commercemarketplaceN11seller-partner

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/wiensa-n11-sp-api/health.svg)

```
[![Health](https://phpackages.com/badges/wiensa-n11-sp-api/health.svg)](https://phpackages.com/packages/wiensa-n11-sp-api)
```

###  Alternatives

[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[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)[smodav/mpesa

M-Pesa API implementation

16467.9k1](/packages/smodav-mpesa)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)

PHPackages © 2026

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