PHPackages                             lenz/shopware-account-api - 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. lenz/shopware-account-api

ActiveLibrary[API Development](/categories/api)

lenz/shopware-account-api
=========================

Standalone PHP client for the Shopware Account / Store (SBP) API: authentication, plugins, support tickets, provisions and statistics.

111PHPCI passing

Since Jun 28Pushed 1mo agoCompare

[ Source](https://github.com/lenzebusiness/shopware-account-api)[ Packagist](https://packagist.org/packages/lenz/shopware-account-api)[ RSS](/packages/lenz-shopware-account-api/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

lenz/shopware-account-api
=========================

[](#lenzshopware-account-api)

Standalone PHP client for the **Shopware Account / Store (SBP) API**(`api.shopware.com`). Handles the Shopware login flow transparently and exposes the producer-facing endpoints as **request objects**: plugins, support tickets, sales, revenues, in-app features, statistics, store statics and more.

- Framework-agnostic — built on **PSR-18 / PSR-17** (Guzzle, Symfony HttpClient, … auto-discovered).
- Transparent authentication with pluggable **token caching**.
- One **request object per endpoint**; options are configured with fluent setters instead of long method signatures.

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

[](#installation)

```
composer require lenz/shopware-account-api
# plus a PSR-18 client if your project doesn't ship one:
composer require guzzlehttp/guzzle
```

Usage
-----

[](#usage)

```
use Lenz\ShopwareAccountApi\Credentials;
use Lenz\ShopwareAccountApi\ShopwareAccountClient;
use Lenz\ShopwareAccountApi\Request\Plugin\PluginListRequest;
use Lenz\ShopwareAccountApi\Request\Support\SupportTicketListRequest;
use Lenz\ShopwareAccountApi\Request\Support\SupportTicketDetailRequest;

$client = new ShopwareAccountClient(
    new Credentials('your-shopware-id@example.com', 'your-password'),
);

// Configure the request on its own object, then execute it:
$plugins = $client->send(
    (new PluginListRequest(producerId: 245))
        ->limit(100)
        ->orderBy('creationDate', 'desc')
        ->where('generation', 'platform')      // filter=[{"property":"generation","value":"platform"}]
);

$openTickets = $client->send(
    (new SupportTicketListRequest(245))->limit(5)->status('open')
);

$ticket = $client->send(new SupportTicketDetailRequest(245, 331165));
```

`send()` returns the decoded JSON body (associative array). Use `sendRaw()` when you need response headers, e.g. the `sw-meta-total` paging total:

```
use Lenz\ShopwareAccountApi\Request\Revenue\ExtensionPartnerRevenueListRequest;

$response = $client->sendRaw(new ExtensionPartnerRevenueListRequest(245));
$total    = (int) ($response->header('sw-meta-total') ?? -1);
$rows     = $response->json();
```

For list endpoints, `paginate()` iterates every page lazily (managing limit/offset for you):

```
foreach ($client->paginate(new PluginListRequest(245)) as $plugin) {
    // ... handle each plugin across all pages
}
```

> **Design note:** account context such as `producerId` and `companyId` are *not*credentials. They live on the individual request objects, so each request only asks for the ids it actually needs.

Filters
-------

[](#filters)

Endpoints that accept the Shopware `filter` parameter expose a fluent `where()`:

```
use Lenz\ShopwareAccountApi\Request\Plugin\PluginListRequest;
use Lenz\ShopwareAccountApi\Request\Statics\SoftwareVersionsRequest;

$client->send(
    (new PluginListRequest(245))
        ->where('isCompatible', false)
        ->where('shopwareVersion', 5)          // values may be string|int|bool|array
);

$client->send((new SoftwareVersionsRequest())->where('pluginGeneration', 'platform'));
```

Enums
-----

[](#enums)

Closed-set parameters are typed as backed enums under `Lenz\ShopwareAccountApi\Enum`; setters accept the enum **or** a raw string, so values not yet enumerated still work.

EnumUsed by`OrderSequence` (`asc`/`desc`)`orderBy($field, OrderSequence::Asc)` on every list request`TicketStatus` (`open`/`answered`/`closed`)`SupportTicketListRequest::status()``SalesVariantType` (`buy`/`rent`/`free`/`test`/`support`/`abuses`/`producerLicensed`)`SalesRequest::variantType()``PluginGeneration` (`classic`/`platform`/`apps`)`->where('generation', PluginGeneration::Platform)``AbuseStatus` (`open`/`first_reminder`/…/`FUPAbuse`)`PluginAbuseListRequest::status()````
use Lenz\ShopwareAccountApi\Enum\TicketStatus;

$client->send((new SupportTicketListRequest(245))->status(TicketStatus::Open));
$client->send((new SupportTicketListRequest(245))->status('open')); // still works
```

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

[](#authentication)

By default the client authenticates via `POST /accesstokens`(`AccessTokenAuthenticator`). The token expiry is read from the JWT `exp` claim when present, otherwise a fallback lifetime (`tokenTtlMinutes`, default 50) is used.

To use the Ory Kratos login flow (`auth-api.shopware.com`) instead, pass a `KratosAuthenticator`:

```
use Lenz\ShopwareAccountApi\Auth\KratosAuthenticator;
use Lenz\ShopwareAccountApi\Http\HttpTransport;

// any object implementing AuthenticatorInterface works
$client = new ShopwareAccountClient(
    new Credentials($id, $password),
    authenticator: new KratosAuthenticator(
        new HttpTransport($psr18Client, $requestFactory, $streamFactory)
    ),
);
```

Token caching
-------------

[](#token-caching)

By default the token lives in memory for the process. Persist it to avoid re-authenticating on every run:

```
use Lenz\ShopwareAccountApi\Token\FileTokenStorage;

$client = new ShopwareAccountClient(
    new Credentials($id, $password),
    new FileTokenStorage(__DIR__ . '/var/shopware-token.json'),
);
```

Implement `TokenStorageInterface` for your own backend (Doctrine, Redis, PSR-6/PSR-16, …).

Available request objects
-------------------------

[](#available-request-objects)

Grouped under `Lenz\ShopwareAccountApi\Request\{Plugin,Support,InAppFeature,Sales,Revenue,Statics,Partner}`. List requests share `limit() / offset() / orderBy() / search()`.

### Plugins

[](#plugins)

ClassEndpoint`PluginListRequest($producerId)``GET /plugins` (filters, `simpleData()`)`PluginDetailRequest($pluginId)``GET /plugins/{id}``PluginPicturesRequest($pluginId)``GET /plugins/{id}/pictures``PluginReviewsRequest($pluginId)``GET /plugins/{id}/reviews``PluginReleaseRequestsRequest($pluginId)``GET /plugins/{id}/releaserequests``PluginLicenseCountRequest($pluginId)``GET /plugins/{id}/priceadjustment/licensecount``PluginTestingInstancesRequest($pluginId)``GET /plugins/{id}/testinginstances``PluginTestingInstancesConfigRequest()``GET /plugins/testinginstances/config``PluginPreviewRequest($pluginId)``GET /plugins/{id}/preview``PluginBinariesRequest($producerId, $pluginId)``GET /producers/{p}/plugins/{id}/binaries``PluginUsageRequest($pluginId)``GET /statistics/shopwareversiondistribution/{id}`### Reviews &amp; abuses

[](#reviews--abuses)

ClassEndpoint`PluginCommentsRequest($pluginId)``GET /plugins/{id}/comments``PluginCommentListRequest($producerId)``GET /plugincomments``PluginCommentDetailRequest($commentId)``GET /plugincomments/{id}``PluginAbuseListRequest($producerId)``GET /pluginAbuses` (`status(...)`)### Support tickets

[](#support-tickets)

ClassEndpoint`SupportTicketListRequest($producerId)``GET /producers/{p}/supporttickets` (`status()`)`SupportTicketDetailRequest($producerId, $ticketId)``GET /producers/{p}/supporttickets/{id}``TicketAttachmentMetaRequest($companyId, $ticketId, $attId)``GET /companies/{c}/supporttickets/{t}/attachments/{a}`### In-app features

[](#in-app-features)

ClassEndpoint`InAppFeatureListRequest($producerId)``GET /producers/{p}/inappfeatures``InAppFeatureDetailRequest($producerId, $featureId)``GET /producers/{p}/inappfeatures/{id}``InAppFeatureGroupListRequest($producerId)``GET /producers/{p}/inappfeaturegroups``InAppFeatureGroupDetailRequest($producerId, $groupId)``GET /producers/{p}/inappfeaturegroups/{id}``InAppFeatureGroupFeaturesRequest($producerId, $groupId)``GET …/inappfeaturegroups/{id}/features``InAppFeatureGroupAccessGrantsRequest($producerId, $groupId)``GET …/inappfeaturegroups/{id}/accessgrants`### Sales, revenues &amp; payouts

[](#sales-revenues--payouts)

ClassEndpoint`SalesRequest($producerId)``GET /producers/{p}/sales` (`variantType()`, flags)`SalesPriceAdjustmentListRequest($producerId)``GET /producers/{p}/sales/priceadjustments``SalesInAppLicenseListRequest($producerId)``GET /producers/{p}/sales/inapplicenses``PluginWithdrawalRequestListRequest($producerId)``GET /producers/{p}/pluginwithdrawalrequests``ExtensionPartnerRevenueListRequest($producerId)``GET /producers/{p}/extensionpartnerrevenues``ExtensionPartnerRevenueBalanceRequest($producerId)``GET …/extensionpartnerrevenuebalance` (`disbursalStatus()`)`ExtensionPartnerRevenueTaxInfoRequest($producerId)``GET …/extensionpartnerrevenues/taxinformation``KickbackBankDataRequest($companyId)``GET /companies/{c}/kickbackbankdata``PartnerPayoutListRequest($companyId)``GET /companies/{c}/partnerpayouts` (`context()`)`PartnerDetailRequest($partnerId)``GET /partners/{id}`### Store statics &amp; reference data

[](#store-statics--reference-data)

ClassEndpoint`SoftwareVersionsRequest()``GET /pluginstatics/softwareVersions` (filters)`PluginStaticsAllRequest()``GET /pluginstatics/all` (filters)`LocalesRequest()``GET /pluginstatics/locales``StoreAvailabilitiesRequest()``GET /pluginstatics/storeAvailabilities``ProducerSupportLanguagesRequest()``GET /producersupportlanguages``ProducerContractCurrentRequest()``GET /documents/producerContract/versions/current``WikiRequest($path, $locale = 'de')``GET /wiki/account/locale/{locale}/path/{path}`Plus on the client itself: `getToken()`, `invalidateToken()` and `downloadAttachment($signedUrl)`.

Errors
------

[](#errors)

All calls throw `Lenz\ShopwareAccountApi\Exception\ApiException` on non-2xx responses (with `$statusCode` / `$responseBody`) and `AuthenticationException`when login fails. Authenticated requests re-authenticate and retry once on `401`.

Custom requests
---------------

[](#custom-requests)

Any endpoint not covered yet can be added without touching the client — just implement `Lenz\ShopwareAccountApi\Request\AccountRequest` (or extend `AbstractRequest` / `AbstractListRequest`) and pass it to `send()`.

Development
-----------

[](#development)

```
composer install
composer test
```

License
-------

[](#license)

MIT © LENZ eBusiness GmbH

###  Health Score

21

—

LowBetter than 17% of packages

Maintenance60

Regular maintenance activity

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity11

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/cd4bf20ea50bd798533f9d42f03131e8659e895dfa8b937e786d8156ff313df9?d=identicon)[lenzebusiness](/maintainers/lenzebusiness)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/lenz-shopware-account-api/health.svg)

```
[![Health](https://phpackages.com/badges/lenz-shopware-account-api/health.svg)](https://phpackages.com/packages/lenz-shopware-account-api)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.5M7](/packages/exsyst-swagger)[lucasdotvin/laravel-soulbscription

A straightforward interface to handle subscriptions and features consumption.

709209.3k](/packages/lucasdotvin-laravel-soulbscription)

PHPackages © 2026

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