PHPackages                             mimicak/shipway-php-sdk - 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. mimicak/shipway-php-sdk

ActiveLibrary[API Development](/categories/api)

mimicak/shipway-php-sdk
=======================

PHP client for Shipway API

v1.0.2(2w ago)212MITPHP

Since Jan 30Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/MimicAk/shipway-php-sdk)[ Packagist](https://packagist.org/packages/mimicak/shipway-php-sdk)[ RSS](/packages/mimicak-shipway-php-sdk/feed)WikiDiscussions main Synced today

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

Shipway PHP SDK
===============

[](#shipway-php-sdk)

A production-ready PHP client for the [Shipway](https://shipway.com) shipping API.

Requirements
------------

[](#requirements)

- PHP 8.1+
- Composer

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

[](#installation)

```
composer require mimicak/shipway-php-sdk
```

Authentication
--------------

[](#authentication)

Shipway uses **HTTP Basic Auth**. Your credentials are:

FieldWhere to find`user_email`Your Shipway registered email`api_key`Shipway dashboard → Profile → Manage Profile → License KeyQuick Start
-----------

[](#quick-start)

```
use MimicAk\ShipwayPhpSdk\Shipway;

$shipway = Shipway::create('you@example.com', 'your-license-key');
```

### Using environment variables

[](#using-environment-variables)

```
SHIPWAY_USER_EMAIL=you@example.com
SHIPWAY_API_KEY=your-license-key
```

```
$shipway = Shipway::createFromEnv();
```

---

Orders
------

[](#orders)

### Create an order (auto-assign carrier)

[](#create-an-order-auto-assign-carrier)

```
use MimicAk\ShipwayPhpSdk\Models\Order;
use MimicAk\ShipwayPhpSdk\Models\Product;

$product = new Product();
$product->product          = 'Blue T-Shirt';
$product->price            = '499.00';
$product->product_quantity = '2';
$product->product_code     = 'SKU-001';

$order = new Order();
$order->order_id = 'ORD-20240501-001';
$order->products = [$product];

// Billing address
$order->billing_firstname = 'Ravi';
$order->billing_lastname  = 'Kumar';
$order->billing_address   = '12, MG Road';
$order->billing_city      = 'Bangalore';
$order->billing_state     = 'Karnataka';
$order->billing_country   = 'India';
$order->billing_zipcode   = '560001';
$order->billing_phone     = '9876543210';

// Shipping address
$order->shipping_firstname = 'Ravi';
$order->shipping_lastname  = 'Kumar';
$order->shipping_address   = '12, MG Road';
$order->shipping_city      = 'Bangalore';
$order->shipping_state     = 'Karnataka';
$order->shipping_country   = 'India';
$order->shipping_zipcode   = '560001';
$order->shipping_phone     = '9876543210';

$order->payment_type  = 'P';   // P = Prepaid, C = COD
$order->order_total   = '998.00';
$order->email         = 'ravi@example.com';

// Optional dimensions
$order->order_weight  = '0.5';  // kg
$order->box_length    = '20';   // cm
$order->box_breadth   = '15';
$order->box_height    = '10';

$response = $shipway->orders()->create($order);

if ($response->success) {
    echo 'Order created. AWB: ' . $response->getAwbNumber();
    echo 'Label URL: '          . $response->getShippingLabelUrl();
}
```

### Create an order with specific carrier and warehouse

[](#create-an-order-with-specific-carrier-and-warehouse)

```
$order->carrier_id          = 3411;  // from courier()->list()
$order->warehouse_id        = 101;   // from warehouse dashboard
$order->return_warehouse_id = 101;

$response = $shipway->orders()->createWithLabel($order);
```

### Fetch orders

[](#fetch-orders)

```
use MimicAk\ShipwayPhpSdk\Models\Request\ShipmentBooking\GetOrdersRequest;
use MimicAk\ShipwayPhpSdk\Models\Request\ShipmentBooking\ShipmentStatus;

$request = new GetOrdersRequest();
$request->date_from       = '2024-05-01';
$request->date_to         = '2024-05-31';
$request->shipment_status = ShipmentStatus::STATUS_IN_TRANSIT;
$request->page            = 1;

$response = $shipway->orders()->getOrders($request);

foreach ($response->getOrders() as $order) {
    echo $order->order_id . ' — ' . $order->tracking_number . PHP_EOL;
}
```

### Track a shipment

[](#track-a-shipment)

```
// By AWB number
$tracking = $shipway->orders()->track('1333110020164');

// By your order ID
$tracking = $shipway->orders()->trackByOrderId('ORD-20240501-001');

// With full scan history
$tracking = $shipway->orders()->track('1333110020164', trackingHistory: 1);

foreach ($tracking->shipments as $shipment) {
    echo $shipment->tracking_details->shipment_status . PHP_EOL;
    echo $shipment->tracking_details->track_url       . PHP_EOL;

    foreach ($shipment->tracking_details->shipment_details as $detail) {
        echo $detail->courier_name   . PHP_EOL;
        echo $detail->current_status . PHP_EOL;
    }
}
```

### Create a manifest

[](#create-a-manifest)

```
use MimicAk\ShipwayPhpSdk\Models\Request\ShipmentBooking\ManifestRequest;

$request  = new ManifestRequest(['ORD-001', 'ORD-002', 'ORD-003']);
$response = $shipway->orders()->createManifest($request);

echo $response->manifest_ids;
```

### Cancel orders (before booking)

[](#cancel-orders-before-booking)

```
$request  = new ManifestRequest(['ORD-001', 'ORD-002']);
$response = $shipway->orders()->cancelOrders($request);

echo 'Cancelled: ' . $response->success_count . PHP_EOL;
echo 'Failed: '    . $response->failure_count . PHP_EOL;
```

### Put orders on hold

[](#put-orders-on-hold)

```
$request  = new ManifestRequest(['ORD-001']);
$response = $shipway->orders()->onHoldOrders($request);
```

### Cancel a booked shipment

[](#cancel-a-booked-shipment)

```
// Single AWB
$response = $shipway->orders()->cancelShipment('1333110020164');

// Multiple AWBs
$response = $shipway->orders()->cancelShipment(['1333110020164', '1333110020165']);

echo $response->shipment_success_tracking_numbers;
echo $response->shipment_failed_tracking_numbers;
```

---

Couriers
--------

[](#couriers)

### List available couriers

[](#list-available-couriers)

```
$response = $shipway->courier()->list();

foreach ($response->carriers as $carrier) {
    echo $carrier->id    . ' — ' . $carrier->carrier_title . PHP_EOL;
    echo 'Supports RTO: ' . ($carrier->reverse_status ? 'yes' : 'no') . PHP_EOL;
}
```

### Check pincode serviceability

[](#check-pincode-serviceability)

```
// All payment types
$response = $shipway->courier()->getPincodeAvailability('560001');

// COD only
$response = $shipway->courier()->getPincodeAvailability('560001', 'C');

foreach ($response->carriers as $carrier) {
    echo $carrier->name . ' (' . $carrier->payment_type . ')' . PHP_EOL;
}
```

### Get carrier rate cards

[](#get-carrier-rate-cards)

```
use MimicAk\ShipwayPhpSdk\Models\Request\Carriers\GetCarrierRates;

$rateRequest = new GetCarrierRates();
$rateRequest->fromPincode      = 110001;
$rateRequest->toPincode        = 560001;
$rateRequest->paymentType      = 'prepaid';
$rateRequest->weight           = 0.5;   // kg
$rateRequest->length           = 20;    // cm
$rateRequest->breadth          = 15;
$rateRequest->height           = 10;
$rateRequest->cummulativePrice = 999;   // required for COD

$response = $shipway->courier()->getCarrierRates($rateRequest);

foreach ($response->carriers as $carrier) {
    echo $carrier->carrier_title  . PHP_EOL;
    echo 'Delivery: Rs. '         . $carrier->delivery_charge . PHP_EOL;
    echo 'RTO: Rs. '              . $carrier->rto_charge      . PHP_EOL;
    echo 'Zone: '                 . $carrier->zone            . PHP_EOL;
}
```

---

Warehouses
----------

[](#warehouses)

### Create a warehouse / pickup address

[](#create-a-warehouse--pickup-address)

```
use MimicAk\ShipwayPhpSdk\Models\Request\Warehouses\CreateWarehouse;

$warehouse          = new CreateWarehouse();
$warehouse->name    = 'Main Fulfilment Centre';
$warehouse->phone   = '9876543210';
$warehouse->address = '15, Industrial Area, Phase 1';
$warehouse->city    = 'Delhi';
$warehouse->state   = 'Delhi';
$warehouse->country = 'India';
$warehouse->pincode = '110020';
$warehouse->email   = 'warehouse@example.com';
$warehouse->gstin   = '07AAACB2894L1ZX';

$response = $shipway->warehouse()->create($warehouse);

echo 'Warehouse ID: ' . $response->warehouseId;
```

---

Error handling
--------------

[](#error-handling)

All SDK methods throw typed exceptions. Catch the most specific type you need:

```
use MimicAk\ShipwayPhpSdk\Exceptions\ValidationException;
use MimicAk\ShipwayPhpSdk\Exceptions\AuthenticationException;
use MimicAk\ShipwayPhpSdk\Exceptions\RateLimitException;
use MimicAk\ShipwayPhpSdk\Exceptions\ApiException;
use MimicAk\ShipwayPhpSdk\Exceptions\ShipwayException;

try {
    $response = $shipway->orders()->create($order);
} catch (ValidationException $e) {
    // Missing/invalid request fields (HTTP 422)
    foreach ($e->getErrors() as $field => $message) {
        echo "{$field}: {$message}" . PHP_EOL;
    }
} catch (AuthenticationException $e) {
    // Bad credentials (HTTP 401/403)
    echo $e->getSuggestedAction();
} catch (RateLimitException $e) {
    // Throttled (HTTP 429)
    sleep($e->getRetryAfter() ?? 60);
} catch (ApiException $e) {
    // Any other HTTP error
    echo 'HTTP ' . $e->getStatusCode() . ': ' . $e->getMessage();
} catch (ShipwayException $e) {
    // Network/config errors
    echo $e->getMessage();
}
```

### Exception hierarchy

[](#exception-hierarchy)

```
ShipwayException
└── ApiException
    ├── AuthenticationException  (401, 403)
    ├── ValidationException      (422)
    ├── RateLimitException       (429)
    ├── ResourceException        (404, 409)
    └── NetworkException         (connection errors)

```

---

Configuration reference
-----------------------

[](#configuration-reference)

```
$shipway = Shipway::create('email', 'key', [
    'base_url'       => 'https://app.shipway.com/', // default
    'timeout'        => 30,     // seconds, default 30
    'retry_attempts' => 3,      // default 3 (exponential back-off)
    'debug'          => false,  // default false; true enables Guzzle debug output
    'partner_code'   => null,   // optional X-Partner-Code header
    'webhook_secret' => null,   // for webhook signature verification
]);
```

---

Order status codes
------------------

[](#order-status-codes)

CodeDescription`O`New order`A`Processing`E`Manifested`G`DispatchedShipment status codes
---------------------

[](#shipment-status-codes)

CodeDescription`DEL`Delivered`INT`In Transit`UND`Undelivered`RTO`RTO In Transit`RTD`RTO Delivered`CAN`Cancelled`SCH`Shipment Booked`ONH`On Hold`OOD`Out for Delivery`NFI`Status Pending`RSCH`Pickup Scheduled`ROOP`Out for Pickup`RPKP`Shipment Picked Up`RDEL`Return Delivered`RINT`Return In Transit`PCAN`Pickup Cancelled`RPF`Pickup Failed---

Running tests
-------------

[](#running-tests)

```
composer test
```

Coverage report:

```
composer test-coverage
```

---

License
-------

[](#license)

MIT

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance92

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

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

Total

4

Last Release

18d ago

Major Versions

v0.0.1\_beta → v1.0.02026-02-04

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/91793533?v=4)[Ashok kumar](/maintainers/MimicAk)[@MimicAk](https://github.com/MimicAk)

---

Top Contributors

[![MimicAk](https://avatars.githubusercontent.com/u/91793533?v=4)](https://github.com/MimicAk "MimicAk (14 commits)")

---

Tags

apisdkshippinglogisticsshipway

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mimicak-shipway-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/mimicak-shipway-php-sdk/health.svg)](https://phpackages.com/packages/mimicak-shipway-php-sdk)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M421](/packages/drupal-core-recommended)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M739](/packages/sylius-sylius)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)

PHPackages © 2026

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