PHPackages                             kejubayer/pathao-api-integration - 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. kejubayer/pathao-api-integration

ActiveLibrary[API Development](/categories/api)

kejubayer/pathao-api-integration
================================

Laravel Pathao Courier API integration package for creating orders, delivery price calculation, parcel tracking, merchant stores, and webhook status updates.

1.0.5(4w ago)09↓100%MITPHPPHP &gt;=7.4

Since May 12Pushed 4w agoCompare

[ Source](https://github.com/kejubayer/pathao-api-integration)[ Packagist](https://packagist.org/packages/kejubayer/pathao-api-integration)[ RSS](/packages/kejubayer-pathao-api-integration/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (2)Versions (7)Used By (0)

Pathao Courier API Integration for Laravel
==========================================

[](#pathao-courier-api-integration-for-laravel)

A Laravel package for Pathao Courier API integration in Bangladesh. Create Pathao courier orders, calculate delivery price, get stores, cities, zones, and areas, track parcels, cancel orders, and receive parcel status updates through a webhook.

`kejubayer/pathao-api-integration` provides a Laravel service, facade, config file, route, migration, and model for common Pathao Courier merchant API workflows.

Features
--------

[](#features)

- Pathao Courier order creation from Laravel
- Pathao delivery price calculation
- Pathao merchant store list
- City, zone, and area lookup
- Parcel tracking by consignment ID
- Order cancellation
- Parcel status webhook route
- Webhook event storage in database
- Laravel facade and dependency injection support
- Laravel package auto-discovery

Keywords
--------

[](#keywords)

Pathao Laravel package, Pathao Courier API, Pathao API integration, Laravel courier API, Bangladesh courier API, Pathao parcel tracking, Pathao webhook, Pathao delivery charge, Pathao merchant API.

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

[](#requirements)

- PHP 7.4 or higher
- Laravel 8, 9, 10, or 11
- Guzzle 7

Laravel Pathao API Installation
-------------------------------

[](#laravel-pathao-api-installation)

Install the package with Composer:

```
composer require kejubayer/pathao-api-integration
```

Publish the configuration file:

```
php artisan vendor:publish --tag=pathao-config
```

Add your Pathao credentials to `.env`:

```
PATHAO_BASE_URL=https://api-hermes.pathao.com
PATHAO_CLIENT_ID=your-client-id
PATHAO_CLIENT_SECRET=your-client-secret
PATHAO_USERNAME=your-username (pathao merchant email)
PATHAO_PASSWORD=your-password (pathao merchant password)
PATHAO_WEBHOOK_ROUTE=pathao/webhook/parcel-status
```

Laravel package auto-discovery will register the service provider and facade automatically.

Run the migrations to create the parcel status webhook table:

```
php artisan migrate
```

Pathao API Configuration
------------------------

[](#pathao-api-configuration)

The package configuration is stored in `config/pathao.php`.

KeyEnvironment VariableDescription`base_url``PATHAO_BASE_URL`Pathao API base URL. Defaults to `https://api-hermes.pathao.com`.`client_id``PATHAO_CLIENT_ID`Pathao API client ID.`client_secret``PATHAO_CLIENT_SECRET`Pathao API client secret.`username``PATHAO_USERNAME`Pathao merchant username.`password``PATHAO_PASSWORD`Pathao merchant password.`webhook_route``PATHAO_WEBHOOK_ROUTE`Webhook route path for parcel status callbacks. Defaults to `pathao/webhook/parcel-status`.Pathao Courier API Usage
------------------------

[](#pathao-courier-api-usage)

Import the facade:

```
use Pathao;
```

### Get Access Token

[](#get-access-token)

```
$token = Pathao::getAccessToken();
```

### Create Pathao Courier Order

[](#create-pathao-courier-order)

```
$stores = Pathao::stores();
$storeId = $stores['data']['data'][0]['store_id'];

$order = Pathao::createOrder([
    'store_id' => $storeId,
    'merchant_order_id' => 'ORD-1001',
    'recipient_name' => 'Customer Name',
    'recipient_phone' => '017XXXXXXXX',
    'recipient_address' => 'House 1, Road 2, Dhaka',
    'delivery_type' => 48,
    'item_type' => 2,
    'special_instruction' => 'Handle with care',
    'item_quantity' => 1,
    'item_weight' => 0.5,
    'amount_to_collect' => 1200,
    'item_description' => 'Product description',
]);
```

Pathao requires `store_id` when creating an order. Use `Pathao::stores()` to get your available stores, then pass the selected `store_id` to `Pathao::createOrder()`.

### Pathao Delivery Price Calculation

[](#pathao-delivery-price-calculation)

```
$price = Pathao::priceCalculation([
    'store_id' => 12345,
    'item_type' => 2,
    'delivery_type' => 48,
    'item_weight' => 0.5,
    'recipient_city' => 1,
    'recipient_zone' => 2,
]);
```

### Pathao Store List

[](#pathao-store-list)

```
$stores = Pathao::stores();
```

### Pathao City List

[](#pathao-city-list)

```
$cities = Pathao::cities();
```

### Pathao Zone List

[](#pathao-zone-list)

```
$zones = Pathao::zones($cityId);
```

### Pathao Area List

[](#pathao-area-list)

```
$areas = Pathao::areas($zoneId);
```

### Track Pathao Parcel

[](#track-pathao-parcel)

```
$tracking = Pathao::trackOrder($consignmentId);
```

### Cancel Pathao Order

[](#cancel-pathao-order)

```
$cancelled = Pathao::cancelOrder($consignmentId);
```

Pathao Parcel Status Webhook
----------------------------

[](#pathao-parcel-status-webhook)

The package registers a POST webhook route for Pathao parcel status updates:

```
POST /pathao/webhook/parcel-status

```

Use this URL in your Pathao webhook/callback settings:

```
https://your-domain.com/pathao/webhook/parcel-status

```

When Pathao sends a parcel status callback, the package stores the event in the `pathao_parcel_statuses` table.

Stored columns:

ColumnDescription`consignment_id`Consignment ID from the webhook payload, when available.`merchant_order_id`Merchant order ID from the webhook payload, when available.`store_id`Pathao store ID from the webhook payload.`event`Pathao webhook event name, such as `order.created`.`delivery_fee`Delivery fee from the webhook payload.`pathao_updated_at`Pathao `updated_at` value from the webhook payload.`pathao_timestamp`Pathao `timestamp` value from the webhook payload.`payload`Full webhook request payload as JSON.`received_at`Time the webhook was received.Example webhook payload:

```
{
    "consignment_id": "12ABC345",
    "merchant_order_id": "ORD-1001",
    "updated_at": "2024-12-27 23:49:43",
    "timestamp": "2024-12-27T17:49:43+00:00",
    "store_id": 130820,
    "event": "order.created",
    "delivery_fee": 83.46
}
```

Read saved parcel statuses:

```
use Kejubayer\PathaoIntegration\Models\PathaoParcelStatus;

$statuses = PathaoParcelStatus::latest()->get();
```

To customize the webhook URL, change `PATHAO_WEBHOOK_ROUTE`:

```
PATHAO_WEBHOOK_ROUTE=api/pathao/parcel-status
```

Pathao API Data Reference
-------------------------

[](#pathao-api-data-reference)

### Pathao Create Order Data

[](#pathao-create-order-data)

FieldTypeRequiredDescription`store_id`integerYesPathao store ID from `Pathao::stores()`.`merchant_order_id`stringNoYour internal order ID.`recipient_name`stringYesCustomer name.`recipient_phone`stringYesCustomer phone number.`recipient_secondary_phone`stringNoAdditional customer phone number.`recipient_address`stringYesFull delivery address.`recipient_city`integerNoCity ID from `Pathao::cities()`.`recipient_zone`integerNoZone ID from `Pathao::zones($cityId)`.`recipient_area`integerNoArea ID from `Pathao::areas($zoneId)`.`delivery_type`integerYesDelivery type ID supported by Pathao.`item_type`integerYesItem type ID supported by Pathao.`special_instruction`stringNoDelivery instruction.`item_quantity`integerYesNumber of items.`item_weight`numberYesParcel weight.`amount_to_collect`numberYesCash collection amount. Use `0` for non-COD orders.`item_description`stringNoParcel or product description.### Pathao Price Calculation Data

[](#pathao-price-calculation-data)

FieldTypeRequiredDescription`store_id`integerYesPathao store ID.`item_type`integerYesItem type ID supported by Pathao.`delivery_type`integerYesDelivery type ID supported by Pathao.`item_weight`numberYesParcel weight.`recipient_city`integerYesDestination city ID.`recipient_zone`integerYesDestination zone ID.### Laravel Method Reference

[](#laravel-method-reference)

MethodDescription`getAccessToken()`Issues an access token using configured Pathao credentials.`createOrder(array $data)`Creates a courier order.`priceCalculation(array $data)`Calculates delivery price.`stores()`Returns available merchant store list.`cities()`Returns available city list.`zones($cityId)`Returns zones for a city.`areas($zoneId)`Returns areas for a zone.`trackOrder($consignmentId)`Returns tracking information for a consignment.`cancelOrder($consignmentId)`Cancels an order by consignment ID.Pathao API Endpoints Used
-------------------------

[](#pathao-api-endpoints-used)

MethodHTTPEndpoint`getAccessToken()`POST`/aladdin/api/v1/issue-token``createOrder()`POST`/aladdin/api/v1/orders``priceCalculation()`POST`/aladdin/api/v1/merchant/price-plan``stores()`GET`/aladdin/api/v1/stores``cities()`GET`/aladdin/api/v1/city-list``zones()`GET`/aladdin/api/v1/cities/{cityId}/zone-list``areas()`GET`/aladdin/api/v1/zones/{zoneId}/area-list``trackOrder()`GET`/aladdin/api/v1/orders/{consignmentId}/info``cancelOrder()`POST`/aladdin/api/v1/orders/{consignmentId}/cancel`Dependency Injection
--------------------

[](#dependency-injection)

You can also inject the contract instead of using the facade:

```
use Kejubayer\PathaoIntegration\Contracts\PathaoInterface;

class OrderController
{
    public function store(PathaoInterface $pathao)
    {
        return $pathao->cities();
    }
}
```

License
-------

[](#license)

This package is open-sourced software licensed under the MIT license.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance94

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community6

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

Total

6

Last Release

28d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6655d8864b90508fae52cbbe858c707383d8e63541ca477ba9d1790e63c729d6?d=identicon)[kejubayer](/maintainers/kejubayer)

---

Top Contributors

[![kejubayer](https://avatars.githubusercontent.com/u/47379243?v=4)](https://github.com/kejubayer "kejubayer (6 commits)")

---

Tags

pathaopathao-courierlaravel-shippingdelivery-apishipping apicourier-apibangladesh-courierpathao apipathao laravellaravel courierlaravel deliverycourier webhookpathao courier apipathao packagepathao integrationpathao merchant apipathao parcel trackingpathao webhookpathao delivery chargebangladesh delivery

### Embed Badge

![Health badge](/badges/kejubayer-pathao-api-integration/health.svg)

```
[![Health](https://phpackages.com/badges/kejubayer-pathao-api-integration/health.svg)](https://phpackages.com/packages/kejubayer-pathao-api-integration)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3751.2M45](/packages/tencentcloud-tencentcloud-sdk-php)[simplestats-io/laravel-client

Analytics for Laravel. Track visitors, registrations, and payments. Discover which channels actually drive revenue, not just traffic. Server-side, GDPR compliant, ad-blocker proof.

5019.3k](/packages/simplestats-io-laravel-client)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1348.1k1](/packages/jasara-php-amzn-selling-partner-api)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

232.5k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

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

PHPackages © 2026

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