PHPackages                             tcgunel/omniship-ptt - 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-ptt

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

tcgunel/omniship-ptt
====================

PTT Kargo carrier for Omniship

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

Since Mar 12Pushed 2mo agoCompare

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

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

Omniship PTT Kargo
==================

[](#omniship-ptt-kargo)

PTT Kargo carrier driver for the [Omniship](https://github.com/tcgunel/omniship) shipping library.

Uses the PTT SOAP web services with customer ID/password authentication.

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

[](#installation)

```
composer require tcgunel/omniship-ptt
```

Usage
-----

[](#usage)

### Initialize

[](#initialize)

```
use Omniship\Omniship;

$carrier = Omniship::create('PTT');
$carrier->initialize([
    'musteriId' => 'your-customer-id',
    'sifre' => 'your-password',
    'testMode' => true, // false for production
]);
```

### Create Shipment

[](#create-shipment)

PTT requires a **pre-allocated barcode** for each shipment.

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

$response = $carrier->createShipment([
    'shipFrom' => new Address(
        name: 'Ahmet Yilmaz',
        street1: 'Ataturk Cad. No:42',
        city: 'Istanbul',
        district: 'Kadikoy',
        postalCode: '34710',
        country: 'TR',
        phone: '05551234567',
        email: 'sender@example.com',
    ),
    'shipTo' => new Address(
        name: 'Mehmet Demir',
        street1: 'Kizilirmak Cad. No:5',
        city: 'Ankara',
        district: 'Cankaya',
        postalCode: '06420',
        country: 'TR',
        phone: '05559876543',
    ),
    'packages' => [
        new Package(weight: 2.5, length: 30, width: 20, height: 15),
    ],
    'barcode' => 'PTT0000012345678',  // required - pre-allocated barcode
    'paymentType' => PaymentType::SENDER,
    'cashOnDelivery' => false,
    'codAmount' => 0.0,
    'referenceNumber' => 'ORDER-001', // optional
    'insuredValue' => 0.0,            // optional - declared value
])->send();

if ($response->isSuccessful()) {
    echo $response->getTrackingNumber(); // barcode number
    echo $response->getBarcode();        // same as tracking number
    echo $response->getShipmentId();     // PTT shipment ID
} else {
    echo $response->getMessage(); // error description
    echo $response->getCode();    // PTT error code
}
```

### Track Shipment

[](#track-shipment)

```
$response = $carrier->getTrackingStatus([
    'trackingNumber' => 'PTT0000012345678',
])->send();

if ($response->isSuccessful()) {
    $info = $response->getTrackingInfo();
    echo $info->trackingNumber;
    echo $info->status->value;  // "delivered", "in_transit", etc.
    echo $info->carrier;        // "PTT Kargo"

    foreach ($info->events as $event) {
        echo $event->description;
        echo $event->occurredAt->format('Y-m-d H:i');
        echo $event->location;
    }
}
```

### Cancel Shipment

[](#cancel-shipment)

```
$response = $carrier->cancelShipment([
    'trackingNumber' => 'PTT0000012345678',
])->send();

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

Payment Types
-------------

[](#payment-types)

PTT CodeDescriptionOmniship Enum`MH`Mahsup (sender pays)`PaymentType::SENDER``UA`Ucreti Alicidan (receiver pays)`PaymentType::RECEIVER``N`Nakit (third party)`PaymentType::THIRD_PARTY`Extra Services
--------------

[](#extra-services)

PTT supports extra service codes appended as a string:

CodeDescription`OS`Cash on delivery (Odeme Sartli)`DK`Declared value (Deger Konulmus)API Details
-----------

[](#api-details)

- **Transport**: SOAP/XML via PHP SoapClient
- **Auth**: `musteriId` + `sifre` in request body
- **Create/Cancel Service**: `https://pttws.ptt.gov.tr/PttVeriYukleme/services/Sorgu?wsdl`
- **Tracking Service**: `https://pttws.ptt.gov.tr/GonderiHareketV2/services/Sorgu?wsdl`
- **Test WSDLs**: Append `Test` to service name (e.g. `PttVeriYuklemeTest`)

### SOAP Methods

[](#soap-methods)

OperationServiceSOAP MethodCreatePttVeriYukleme`kabulEkle2`TrackGonderiHareketV2`gonderiDurum`CancelPttVeriYukleme`gonderiIptal`Testing
-------

[](#testing)

```
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 (3 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  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)
