PHPackages                             tcgunel/omniship-mng - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. tcgunel/omniship-mng

ActiveLibrary[HTTP &amp; Networking](/categories/http)

tcgunel/omniship-mng
====================

MNG Kargo carrier for Omniship shipping library

v0.0.2(2mo ago)03↓100%MITPHPPHP ^8.2

Since Mar 12Pushed 2mo agoCompare

[ Source](https://github.com/tcgunel/omniship-mng)[ Packagist](https://packagist.org/packages/tcgunel/omniship-mng)[ RSS](/packages/tcgunel-omniship-mng/feed)WikiDiscussions main Synced 1mo ago

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

Omniship MNG Kargo
==================

[](#omniship-mng-kargo)

MNG Kargo (now DHL eCommerce Turkey) carrier driver for the Omniship multi-carrier shipping library.

> **Note:** MNG Kargo was acquired by DHL Group in 2023 and rebranded as DHL eCommerce in Turkey (May 2025). The legacy SOAP API at `service.mngkargo.com.tr` is still operational.

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

[](#installation)

```
composer require tcgunel/omniship-mng
```

Usage
-----

[](#usage)

```
use Omniship\Omniship;
use Omniship\Common\Address;
use Omniship\Common\Package;

$mng = Omniship::create('MNG');
$mng->initialize([
    'username' => '1234567890',     // MNG müşteri numarası
    'password' => 'ABCDEF123',      // MNG anlaşma şifresi
    'testMode' => true,
]);
```

### Create Shipment

[](#create-shipment)

Uses the `SiparisKayit_C2C` SOAP method — the full C2C (Customer to Customer) endpoint for e-commerce platforms.

```
$response = $mng->createShipment([
    'orderNumber' => 'SIP-001',         // pSiparisNo — unique, used for tracking
    'barcodeText' => 'SIP-001',         // pBarkodText — label barcode (defaults to orderNumber)
    'invoiceNumber' => 'IRS-001',       // pIrsaliyeNo (optional)
    'shipFrom' => new Address(
        name: 'Gönderici Müşteri',
        street1: 'Atatürk Cad. No:42',
        city: 'İstanbul',              // Uppercase dönüşümü otomatik
        district: 'Kadıköy',
        phone: '+905551234567',         // +90 ve başındaki 0 otomatik silinir
    ),
    'shipTo' => new Address(
        name: 'Alıcı Müşteri',
        street1: 'Kızılay Mah. 123. Sok. No:5',
        city: 'Ankara',
        district: 'Çankaya',
        phone: '+905559876543',
    ),
    'packages' => [
        new Package(weight: 3.0, desi: 2.0, quantity: 1, description: 'Kitap'),
    ],
    // 'paymentType' => PaymentType::SENDER,     // default
    // 'cashOnDelivery' => false,                 // default
    // 'codAmount' => 0.0,
])->send();

if ($response->isSuccessful()) {
    echo $response->getTrackingNumber();  // "SIP-001" (= orderNumber)
    echo $response->getBarcode();         // "SIP-001" (= barcodeText)
}
```

### Track Shipment

[](#track-shipment)

Uses the `GelecekIadeSiparisKontrol` SOAP method. Returns status codes 0-7.

```
$response = $mng->getTrackingStatus([
    'trackingNumber' => 'SIP-001',      // pCHSiparisNo
])->send();

if ($response->isSuccessful()) {
    $info = $response->getTrackingInfo();
    echo $info->status->value;           // "delivered", "in_transit", etc.
    echo $info->trackingNumber;          // MNG gönderi numarası
    echo $info->signedBy;               // Teslim alan kişi (if delivered)
    echo $response->getTrackingUrl();    // MNG kargo takip linki
}
```

### Cancel Shipment

[](#cancel-shipment)

Uses the `SiparisIptali_C2C` SOAP method.

```
$response = $mng->cancelShipment([
    'orderNumber' => 'SIP-001',
])->send();

if ($response->isCancelled()) {
    echo 'Shipment cancelled';
}
```

Status Mapping
--------------

[](#status-mapping)

MNG CodeDescriptionShipmentStatus0Henüz işlem yapılmadı`PRE_TRANSIT`1Sipariş Kargoya Verildi`PICKED_UP`2Transfer Aşamasında`IN_TRANSIT`3Gönderi Teslim Birimine Ulaştı`IN_TRANSIT`4Gönderi Teslimat Adresine Yönlendirildi`OUT_FOR_DELIVERY`5Teslim Edildi`DELIVERED`6Teslim Edilemedi (nedenli)`FAILURE`7Göndericiye Teslim Edildi`RETURNED`Payment Types
-------------

[](#payment-types)

PaymentTypeMNG Value`SENDER``Gonderici_Odeyecek``RECEIVER``Alici_Odeyecek``THIRD_PARTY``Platform_Odeyecek`API Details
-----------

[](#api-details)

- **Transport**: SOAP-over-HTTP (raw XML via PSR-18, not SoapClient)
- **Create**: `SiparisKayit_C2C` — supports sender + receiver, packages (Kg/Desi/Adet), COD, delivery type
- **Track**: `GelecekIadeSiparisKontrol` — returns .NET DataSet XML with status codes
- **Cancel**: `SiparisIptali_C2C` — returns "1" (success) or "0" (failure)
- **Test endpoint**: `https://service.mngkargo.com.tr/tservis/musterisiparisnew.asmx`
- **Production endpoint**: `https://service.mngkargo.com.tr/musterikargosiparis/musterisiparisnew.asmx`

Testing
-------

[](#testing)

```
# Run tests
docker compose run --rm php bash -c "cd omniship-mng && vendor/bin/pest"
```

License
-------

[](#license)

MIT

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance88

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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

2

Last Release

60d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/36dffe883e88aeef07c26067af3d6a7eda1c2a81f1ae45fdd430b721665131da?d=identicon)[Mobius Studio](/maintainers/Mobius%20Studio)

---

Top Contributors

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

###  Code Quality

TestsPest

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tcgunel-omniship-mng/health.svg)

```
[![Health](https://phpackages.com/badges/tcgunel-omniship-mng/health.svg)](https://phpackages.com/packages/tcgunel-omniship-mng)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

48247.0M384](/packages/php-http-curl-client)

PHPackages © 2026

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