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

ActiveLibrary[API Development](/categories/api)

shipbg/php-sdk
==============

Portable, dependency-free PHP SDK for the ShipBG multi-carrier shipping API (generated from the OpenAPI spec).

v0.2.0(1mo ago)06↓50%MITPHPPHP &gt;=7.4

Since Jun 12Pushed 1mo agoCompare

[ Source](https://github.com/SK-Software-Ltd/shipbg-php-sdk)[ Packagist](https://packagist.org/packages/shipbg/php-sdk)[ Docs](https://shipbg.com)[ RSS](/packages/shipbg-php-sdk/feed)WikiDiscussions main Synced 1w ago

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

ShipBG PHP SDK
==============

[](#shipbg-php-sdk)

Portable, **dependency-free** PHP client for the [ShipBG](https://shipbg.com) multi-carrier shipping API. Generated from the OpenAPI spec — typed request methods + DTOs, single source of truth, no drift.

- **PHP 7.4+**, zero Composer dependencies (just `ext-curl` + `ext-json`).
- **Pluggable transport** — ships a `CurlTransport` default; inject any `Transport` (e.g. a WordPress `wp_remote_*` adapter, Guzzle, Symfony HttpClient). Same SDK on WooCommerce, Magento, OpenCart, plain PHP.
- Resource-grouped, fully typed: `$client->rates->quote($payload)` returns a `QuoteRatesResult`.

Install
-------

[](#install)

```
composer require shipbg/php-sdk
```

Usage
-----

[](#usage)

```
use ShipBG\Sdk\Client;

$client = new Client('YOUR_API_TOKEN');                 // default CurlTransport
// or inject a platform transport:
// $client = new Client($token, 'https://shipbg.com/api/v1', new MyWpRemoteTransport());

$account = $client->account->show();                    // GET  /account    → AccountResponseData
$rates   = $client->rates->quote([                      // POST /rates:quote → QuoteRatesResult
    'from_address' => [/* ... */],
    'to_address'   => [/* ... */],
    'parcel'       => ['weight' => 1.5],
    'currency'     => 'BGN',
]);

foreach ($rates->rates as $rate) {
    // typed DTO graph
}
```

Errors raise `ShipBG\Sdk\Exception\ApiException` (`getStatus()`, `getType()`, `getBody()`).

Custom transport
----------------

[](#custom-transport)

Implement `ShipBG\Sdk\Transport` to route HTTP through your platform's stack:

```
final class WpRemoteTransport implements \ShipBG\Sdk\Transport
{
    public function send(string $method, string $url, array $headers, ?string $body): array
    {
        $res = wp_remote_request($url, ['method' => $method, 'headers' => $headers, 'body' => $body]);
        return [(int) wp_remote_retrieve_response_code($res), (string) wp_remote_retrieve_body($res)];
    }
}
```

Regenerating
------------

[](#regenerating)

Generated from `backend/docs/api/openapi.snapshot.json` by `tools/sdk-generator/generate-plain.php` in the monorepo. Regenerate, commit, `git tag vX.Y.Z && git push --tags` → Packagist auto-updates.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance90

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity25

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

45d ago

PHP version history (2 changes)v0.1.0PHP ^8.1

v0.2.0PHP &gt;=7.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3624347?v=4)[sksoftware](/maintainers/sksoftware)[@SKsoftware](https://github.com/SKsoftware)

---

Top Contributors

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

---

Tags

sdkshippingcourierspeedyecontshipbgboxnow

### Embed Badge

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

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

###  Alternatives

[saloonphp/laravel-plugin

The official Laravel plugin for Saloon

807.1M211](/packages/saloonphp-laravel-plugin)[octw/aramex

A Library to integrate with Aramex APIs

2927.7k](/packages/octw-aramex)

PHPackages © 2026

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