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

ActiveLibrary[API Development](/categories/api)

pkge/php-sdk
============

Pkge Business API PHP SDK

1.1.0(4y ago)1291PHPPHP &gt;=5.4

Since Sep 9Pushed 3y ago1 watchersCompare

[ Source](https://github.com/pkge-business/pkge-php-sdk)[ Packagist](https://packagist.org/packages/pkge/php-sdk)[ RSS](/packages/pkge-php-sdk/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

[![logo](logo.svg)](logo.svg)

Order Tracking API - PHP SDK
============================

[](#order-tracking-api---php-sdk)

A single multifunctional API to track packages worldwide from over 850 courier companies and postal services in the desired language.

Library provides convenient access to [business.pkge.net](https://business.pkge.net) api for applications written in PHP language.

Tracking API documentation are available here:

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

[](#requirements)

PHP 5.4.0 and later.

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

[](#installation)

#### Via Composer ()

[](#via-composer-httpsgetcomposerorg)

Run the following command:

```
composer require pkge/php-sdk
```

To use SDK, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading):

```
require_once 'vendor/autoload.php';
```

Getting Started
---------------

[](#getting-started)

First, you need initialize api wrapper class with your api key

```
$api = new \Pkge\API(
    '{API_KEY}', //Your API key
    'en', //API language
    false //Expand related objects
);
```

Responses Metadata
------------------

[](#responses-metadata)

Metadata for last response, such as requests [rate-limiting](src/Common/ResponseRateLimit.php) and [pagination](src/Common/ResponsePagination.php) information for some API endpoints, available in `getLastResponseMetaData()` method:

```
$metadata = $api->getLastResponseMetaData();

//Last response status code
$metadata->responseStatusCode;

//Requests Rate-Limit information.
$metadata->rateLimit;

//Pagination information
$metadata->pagination;
```

Entities
--------

[](#entities)

All entities used in the SDK and descriptions of their properties, see in [/src/Entities](src/Entities)

Delivery services endpoints
---------------------------

[](#delivery-services-endpoints)

Access to all delivery services endpoints via `couriers` property of API object:

```
$api->couriers;
```

All available endpoints methods see in [\\Pkge\\Endpoints\\Couriers::class](src/Endpoints/Couriers.php)

Packages endpoints
------------------

[](#packages-endpoints)

Access to all delivery services endpoints via `packages` property of API object:

```
$api->packages;
```

All available endpoints methods see in [\\Pkge\\Endpoints\\Packages::class](src/Endpoints/Packages.php)

Webhooks
--------

[](#webhooks)

For handle webhook notifications use [`\Pkge\Webhook::class`](src/Webhook.php). Example:

```
$webhook = new \Pkge\Webhook('WEBHOOK_SECRET');

try {
    $event = $webhook->handleEvent(
        file_get_contents("php://input"),
        $_SERVER['HTTP_PKGE_WEBHOOK_SIGNATURE']
    );
} catch (\Pkge\Exceptions\WebhookSignatureException $e) {
    die ($e->getMessage());
}

/** @var \Pkge\Entities\Package $updatedPackage */
$updatedPackage = $event->payload;
```

Exceptions
----------

[](#exceptions)

In some cases, exceptions may occur when making API requests via the SDK. Their description is given below. For more information about what exceptions a particular method can throw, see the PHPDoc comments on this method.

- `\Pkge\Exceptions\ApiBadKeyException` - Invalid API key specified. How to get API key, see [here](https://business.pkge.net/docs/overview/auth).
- `\Pkge\Exceptions\ApiCouriersNotDetectedException` - Failed to automatically identify the delivery service for the given tracking number.
- `\Pkge\Exceptions\ApiMaxPackagesAmountUpdatingNowException` - Failed to update the package. The maximum number of packages allowed is currently being updated. Wait for the next package to complete the update and repeat the request.
- `\Pkge\Exceptions\ApiPackageCannotBeUpdatedException` - Failed to update the package. Not enough time has passed since the last update, or the package has already been delivered. Followed by the date of the next possible update in 'payload' if an update is possible.
- `\Pkge\Exceptions\ApiPackagesLimitExceededException` - You've reached your plan's limit for adding packages for the billing period.
- `\Pkge\Exceptions\ApiRequestRateLimitException` - Limit for requests per second exceeded.
- `\Pkge\Exceptions\ApiTrackNumberExistsException` - Tracking number has already been added.
- `\Pkge\Exceptions\ApiWrongCourierIdException` - Invalid delivery service ID specified.
- `\Pkge\Exceptions\ApiWrongTrackNumberException` - Invalid or unsupported tracking number format.
- `\Pkge\Exceptions\ApiRequestValidationException` - Error validating data sent by POST request. See validation errors descriptions in `getValidationErrors()` method of exception.
- `\Pkge\Exceptions\ApiRequestException` - General or unknown request error. For a description, see the `getMessage()`method.

Example
-------

[](#example)

Example demo code see in [examples/demo.php](examples/demo.php). Run:

```
php ./examples/demo.php
```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

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

Total

2

Last Release

1730d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/31bac7182dbfcc9736a7ab8a39e39ccf8b044f7278a9e9f9665d28b9ded7b564?d=identicon)[pkge-business](/maintainers/pkge-business)

---

Top Contributors

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

---

Tags

apipackage-trackingpkgepkge.netpkge.business

### Embed Badge

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

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[resend/resend-php

Resend PHP library.

617.2M43](/packages/resend-resend-php)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

563.6M13](/packages/checkout-checkout-sdk-php)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

783.8k](/packages/scriptdevelop-whatsapp-manager)

PHPackages © 2026

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