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

ActiveLibrary

tcgunel/omniship-aras
=====================

Aras Kargo carrier for Omniship shipping library

v0.0.7(1mo ago)07↓100%MITPHPPHP ^8.2

Since Mar 9Pushed 1mo agoCompare

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

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

Omniship Aras Kargo
===================

[](#omniship-aras-kargo)

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

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

[](#installation)

```
composer require tcgunel/omniship-aras
```

Usage
-----

[](#usage)

### Initialize

[](#initialize)

```
use Omniship\Omniship;

$carrier = Omniship::create('Aras');
$carrier->initialize([
    'username' => 'your-username',
    'password' => 'your-password',
    'testMode' => true, // false for production
    'senderAccountAddressId' => '', // optional
]);
```

### Create Shipment

[](#create-shipment)

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

$response = $carrier->createShipment([
    'shipTo' => new Address(
        name: 'Ahmet Yilmaz',
        street1: 'Ataturk Cad. No:1',
        city: 'Istanbul',
        district: 'Kadikoy',
        phone: '05551234567',
    ),
    'packages' => [
        new Package(
            weight: 1.5,
            length: 30,
            width: 20,
            height: 15,
            description: 'Elektronik urun',
        ),
    ],
    'integrationCode' => 'ORD-001',       // required - your order reference
    'invoiceNumber' => 'INV-001',          // optional
    'tradingWaybillNumber' => 'TWB-001',   // required - irsaliye no
    'barcodes' => ['BARCODE-001'],         // one barcode per piece
    'paymentType' => PaymentType::SENDER,  // or PaymentType::RECEIVER
    'cashOnDelivery' => false,
    'codAmount' => 0.0,
])->send();

if ($response->isSuccessful()) {
    echo $response->getShipmentId();    // InvoiceKey
    echo $response->getBarcode();       // same as InvoiceKey
    echo $response->getTrackingNumber(); // integrationCode
} else {
    echo $response->getMessage();       // error description
    echo $response->getCode();          // Aras result code
}
```

#### Integration Code &amp; Barcodes

[](#integration-code--barcodes)

Per Aras Kargo requirements:

- `integrationCode` must be **unique, minimum 6 characters, numeric only**
- `barcodes` are auto-generated from `integrationCode` + 2-digit piece suffix if not provided
- Single piece: `integrationCode=12345678` → barcode `1234567801`
- Multi piece: `integrationCode=12345678` → barcodes `1234567801`, `1234567802`

You can also provide explicit barcodes (one per piece):

```
'barcodes' => ['1234567801', '1234567802'],
```

If a package has `quantity: 3`, you need 3 barcodes for that package's pieces.

### Generate Labels

[](#generate-labels)

Aras Kargo does not provide labels — they must be designed by the integrator. The built-in label generator creates print-ready HTML labels with barcodes (via Google Fonts Libre Barcode 128).

```
// Generate labels using default template
$html = $carrier->generateLabels([
    'shipFrom' => $shipFrom,
    'shipTo' => $shipTo,
    'packages' => $packages,
    'integrationCode' => '12345678',
    'paymentType' => PaymentType::SENDER,
    'cashOnDelivery' => false,
]);

// Output or save the HTML
file_put_contents('labels.html', $html);
```

Each package piece gets its own label with:

- Carrier name and date
- Sender name
- Receiver name, phone, address
- Payment type or COD info
- Integration code with barcode
- Piece barcode with barcode
- Piece number (e.g. `Paket: 1/3`)

#### Custom Label Template

[](#custom-label-template)

You can provide your own HTML template with placeholders:

```
$customTemplate = '
    {{carrierName}}
    {{receiverName}} - {{receiverPhone}}
    {{receiverAddress}}
    Entegrasyon: {{integrationCode}}
    Barkod: {{barcodeNumber}}
    Paket: {{pieceNumber}} / {{totalPieces}}
';

$html = $carrier->generateLabels($shipmentData, $customTemplate);
```

Available placeholders: `{{carrierName}}`, `{{date}}`, `{{senderName}}`, `{{receiverName}}`, `{{receiverPhone}}`, `{{receiverAddress}}`, `{{paymentTypeText}}`, `{{codLine}}`, `{{codDisplay}}`, `{{paymentDisplay}}`, `{{integrationCode}}`, `{{barcodeNumber}}`, `{{pieceNumber}}`, `{{totalPieces}}`.

#### Raw Label Data

[](#raw-label-data)

For full control over rendering, get `LabelData` objects directly:

```
$labels = $carrier->getLabelData($shipmentData);

foreach ($labels as $label) {
    echo $label->integrationCode;
    echo $label->barcodeNumber;
    echo "{$label->pieceNumber}/{$label->totalPieces}";
}

### Track Shipment

Tracking uses the `GetOrderWithIntegrationCode` SOAP method to look up shipment by integration code.

```php
$response = $carrier->getTrackingStatus([
    'trackingNumber' => 'ORD-001', // your integration code
])->send();

if ($response->isSuccessful()) {
    $info = $response->getTrackingInfo();
    echo $info->trackingNumber;
    echo $info->status->value;  // PRE_TRANSIT, IN_TRANSIT, DELIVERED, etc.
    echo $info->carrier;        // "Aras 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([
    'integrationCode' => 'ORD-001',
])->send();

if ($response->isSuccessful()) {
    echo 'Shipment cancelled';
} else {
    echo $response->getMessage();
}
```

API Endpoints
-------------

[](#api-endpoints)

EnvironmentURLTest`https://customerservicestest.araskargo.com.tr/arascargoservice/arascargoservice.asmx`Production`https://customerservices.araskargo.com.tr/arascargoservice/arascargoservice.asmx`SOAP Methods Used
-----------------

[](#soap-methods-used)

OperationSOAP ActionPurpose`SetOrder`Create shipmentRegisters a new cargo order`GetOrderWithIntegrationCode`Track shipmentLooks up order by integration code`CancelDispatch`Cancel shipmentCancels a pending shipmentError Codes
-----------

[](#error-codes)

CodeDescription0Success935ReceiverPhone1 must be numeric937Integration code is required938Receiver address is required939Receiver name is required940City name is required941District name is required1000Invalid username or password1006Sender dispatch address not found (invalid SenderAccountAddressId)70022Barcode info missing in piece details70027Barcode already used70030Piece barcodes must be uniqueTesting
-------

[](#testing)

```
vendor/bin/pest
```

License
-------

[](#license)

MIT

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance89

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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

Total

7

Last Release

57d 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 (9 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

PHPackages © 2026

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