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

ActiveLibrary[API Development](/categories/api)

shoper/sdk
==========

Shoper\\Sdk\\Rest PHP Library

0.5.7(1mo ago)019MITPHPPHP ^8.1CI passing

Since Apr 29Pushed 1mo agoCompare

[ Source](https://github.com/dreamcommerce/shoper-sdk-php)[ Packagist](https://packagist.org/packages/shoper/sdk)[ RSS](/packages/shoper-sdk/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (5)Dependencies (24)Versions (5)Used By (0)

Shoper PHP SDK
==============

[](#shoper-php-sdk)

Official PHP SDK for the [Shoper REST API](https://developers.shoper.pl/). Generated from OpenAPI 3.1 (Fern), with hand-written ergonomic helpers (`ShoperClient`, `OAuthManager`, `WebhookVerifier`, `Paginator`, `BulkRequestBuilder`, `RateLimitHandler`).

- PHP 8.1+
- PSR-18 HTTP client (any compliant implementation, e.g. Guzzle 7 — auto-discovered via `php-http/discovery` or injected via constructor)
- 74 typed sub-clients covering the full REST surface

Install
-------

[](#install)

```
composer require shoper/sdk
```

Quick start
-----------

[](#quick-start)

### Authenticate (admin Basic Auth → token)

[](#authenticate-admin-basic-auth--token)

```
use Shoper\Sdk\ShoperClient;

$client = new ShoperClient('https://yourshop.shoparena.pl');
$client->authenticate('admin-user', 'admin-pass');   // fetches and stores the token
```

### Authenticate (OAuth authorization-code, AppStore apps)

[](#authenticate-oauth-authorization-code-appstore-apps)

```
$auth = $client->authenticateOAuth($clientId, $clientSecret, $authorizationCode);
// later, when access_token expires:
$auth = $client->refreshToken($clientId, $clientSecret, $auth['refresh_token']);
```

Both calls store the new access token on the client automatically. An existing token can also be injected directly: `new ShoperClient($url, $accessToken)` or `$client->setToken($accessToken)`.

### List products

[](#list-products)

```
$page = $client->products()->listProducts();   // typed ListProductsResponse, default page
foreach ($page->list as $p) {
    echo $p->productId . ' ' . $p->translations['pl_PL']->name . "\n";
}
```

### Iterate every page

[](#iterate-every-page)

```
use Shoper\Sdk\Paginator;
use Shoper\Sdk\Rest\Products\Requests\ListProductsRequest;

$fetch = fn (array $params) => (array) $client->products()->listProducts(new ListProductsRequest($params));

foreach (new Paginator($fetch, limit: 50) as $product) {
    // streams across all pages, transparent
}
```

### Verify a webhook

[](#verify-a-webhook)

```
use Shoper\Sdk\WebhookVerifier;

$verifier = new WebhookVerifier($appstoreSecret, $webhookSecret);
if (!$verifier->verifyFromGlobals(file_get_contents('php://input'))) {
    http_response_code(401);
    exit;
}
```

`verifyFromGlobals()` reads the `X-Webhook-Id`, `X-Shop-License` and `X-Webhook-SHA1` headers; `verifyFromPsr7($request)` does the same for a PSR-7 request. See `examples/03-webhook-verification.php`.

All 74 sub-clients
------------------

[](#all-74-sub-clients)

Every public REST resource is a typed getter on `ShoperClient`:

```
$client->products();           // \Shoper\Sdk\Rest\Products\ProductsClient
$client->orders();             // \Shoper\Sdk\Rest\Orders\OrdersClient
$client->categories();
// ... 71 more — see scripts/sub-clients.expected.php for the canonical list
```

For brand-new resources Fern adds before this README is regenerated, the magic `__call` fallback still works.

Features
--------

[](#features)

- OAuth 2.0 authorization\_code + refresh\_token flows
- Admin Basic authentication
- Type-safe response DTOs (generated from OpenAPI spec)
- `Paginator` — iterate through all pages
- `BulkRequestBuilder` — batch up to 25 operations in one call
- `RateLimitHandler` — automatic retry on 429 with `Retry-After` honor
- `WebhookVerifier` — HMAC signature verification

Examples
--------

[](#examples)

See `examples/` directory for end-to-end scenarios:

- `01-oauth-flow.php` — full AppStore OAuth flow
- `02-basic-crud.php` — list / create / update / delete
- `03-webhook-verification.php` — receive and verify webhooks
- `04-pagination.php` — iterate all pages
- `05-bulk-requests.php` — batch updates
- `06-rate-limit.php` — retry with backoff
- `07-error-handling.php` — typed exceptions

Reference
---------

[](#reference)

- API docs:
- Issue tracker / source:
- Packagist:

Support
-------

[](#support)

**Bug reports and feature requests:** contact Shoper support. **This repository does not accept public issues or direct PRs to auto-generated code.**

Community PRs are welcome to:

- `src/ShoperClient.php` and other root helpers (`src/*.php`)
- `README.md`, `examples/`, `tests/Helpers/`
- `CHANGELOG.md`, `.github/`

Paths `src/Rest/**` are auto-generated from the OpenAPI spec and cannot be modified directly — PRs touching them will be auto-closed.

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance94

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor2

2 contributors hold 50%+ of commits

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

Total

4

Last Release

33d ago

PHP version history (2 changes)v0.3.0PHP ^8.0

0.5.0PHP ^8.1

### Community

Maintainers

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

---

Top Contributors

[![marcinm-shpr](https://avatars.githubusercontent.com/u/235474073?v=4)](https://github.com/marcinm-shpr "marcinm-shpr (4 commits)")[![shoperdocs](https://avatars.githubusercontent.com/u/276017968?v=4)](https://github.com/shoperdocs "shoperdocs (4 commits)")[![mtrzk](https://avatars.githubusercontent.com/u/3176887?v=4)](https://github.com/mtrzk "mtrzk (3 commits)")

---

Tags

apisdkshoper

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

36789.4k2](/packages/telnyx-telnyx-php)[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k28.0M326](/packages/openai-php-client)[getbrevo/brevo-php

Official Brevo provided RESTFul API V3 php library

1003.9M50](/packages/getbrevo-brevo-php)[deeplcom/deepl-php

Official DeepL API Client Library

2577.3M120](/packages/deeplcom-deepl-php)[n1ebieski/ksef-php-client

PHP API client that allows you to interact with the API Krajowego Systemu e-Faktur

9067.8k](/packages/n1ebieski-ksef-php-client)[trycourier/courier

Courier PHP SDK

15660.9k](/packages/trycourier-courier)

PHPackages © 2026

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