PHPackages                             vin-sw/shopware-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. vin-sw/shopware-sdk

ActiveLibrary[API Development](/categories/api)

vin-sw/shopware-sdk
===================

A PHP SDK for Shopware 6 Platform

2.4.0(4mo ago)122523.9k↓51.7%49[5 issues](https://github.com/vienthuong/shopware-php-sdk/issues)[1 PRs](https://github.com/vienthuong/shopware-php-sdk/pulls)6MITPHPPHP ^8.0 || ^8.1 || ^8.2 || ^8.3CI failing

Since Jul 16Pushed 1mo ago8 watchersCompare

[ Source](https://github.com/vienthuong/shopware-php-sdk)[ Packagist](https://packagist.org/packages/vin-sw/shopware-sdk)[ RSS](/packages/vin-sw-shopware-sdk/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (18)Versions (37)Used By (6)

Shopware 6 PHP SDK
==================

[](#shopware-6-php-sdk)

[![php](https://camo.githubusercontent.com/d282cc3193faee11ee32307d0c4c9d809e8fafa4b3a8c12c6afbf35d4f7ec617/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d3737374242343f7374796c653d666f722d7468652d6261646765266c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://camo.githubusercontent.com/d282cc3193faee11ee32307d0c4c9d809e8fafa4b3a8c12c6afbf35d4f7ec617/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d3737374242343f7374796c653d666f722d7468652d6261646765266c6f676f3d706870266c6f676f436f6c6f723d7768697465)

![GitHub Release](https://camo.githubusercontent.com/4481fadfedea3e385c5fd46231e340acc5e1f722a6f645f6e562562b50ca3665/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f7669656e7468756f6e672f73686f70776172652d7068702d73646b2e7376673f7374796c653d666c6174)[![Latest Version on Packagist](https://camo.githubusercontent.com/50c8ec6627639f40ffc91d17b8edb0268a08adcf50fe1e3c6b863804b6bcce16/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f76696e2d73772f73686f70776172652d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vin-sw/shopware-sdk)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

Shopware PHP SDK is a simple SDK implementation of Shopware 6 APIs. It helps to access the API in an object-oriented way.

If you're familiar with Shopware 6 DAL syntax and how to retrieve it you might see this example is predictable and straightforward

[![image](https://camo.githubusercontent.com/38bb5829bfa24cc33a93729caea4badf68b62cb4529dc86e39d88158f115e8a0/68747470733a2f2f692e696d6775722e636f6d2f4e7958793264622e706e67)](https://camo.githubusercontent.com/38bb5829bfa24cc33a93729caea4badf68b62cb4529dc86e39d88158f115e8a0/68747470733a2f2f692e696d6775722e636f6d2f4e7958793264622e706e67)

Or sending notification from external server [![image](https://camo.githubusercontent.com/3b4ed2e1669dd1c764af1403671697f09651f26560cd9a49b8b91921b7791f26/68747470733a2f2f692e696d6775722e636f6d2f32364c645461622e706e67)](https://camo.githubusercontent.com/3b4ed2e1669dd1c764af1403671697f09651f26560cd9a49b8b91921b7791f26/68747470733a2f2f692e696d6775722e636f6d2f32364c645461622e706e67)

SDK versionSW schema2.x&gt;=6.51.x6.4You can use 1.x to connect to a sw 6.5 but for up-to-date schema and new 6.5 features, you should use 2.x version instead.

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

[](#installation)

Install with Composer

```
composer require vin-sw/shopware-sdk
```

The SDK main features:
======================

[](#the-sdk-main-features)

- Admin API

    - CRUD API
    - Sync Api
    - User Config API
    - Notification API
    - Admin Search API
    - Other services
    - ... (TODO)
- Webhook helper

    - Webhook registration
    - Webhook authentication
    - Webhook receiver
- If you're using Laravel 8, consider check this out [Laravel Shopware SDK Adapter](https://github.com/Shape-and-Shift/shopware-laravel-sdk)

Usage
-----

[](#usage)

More in the examples folder, for integrating the sdk in an App, have a look at this [repository](https://github.com/vienthuong/AppExample)

Admin Authentication
--------------------

[](#admin-authentication)

- Supported 3 grant types, you can create one of these 3 grant type for authentication:

Using Password grant type

```
$grantType = new PasswordGrantType($username, $password);
```

Using Client credential grant type

```
$grantType = new ClientCredentialsGrantType($clientId, $clientSecret);
```

Using Refresh token grant type

```
$grantType = new RefreshTokenGrantType($refreshToken);
```

Or dynamically via

```
$grantType = GrantType::createFromConfig($config);
```

Check the [authentication](examples/authentication.php) example for the reference.

After having a GrantType object, you can fetch the admin's access token using the AdminAuthenticator

```
$adminClient = new AdminAuthenticator($grantType, $shopUrl);
$accessToken = $adminClient->fetchAccessToken();
$context = new Context($shopUrl, $accessToken);
```

**Notice:** You might want to store the access token object into the database so you can create the object without request for another access token for every Admin API request.

Working with Criteria and Repositories
--------------------------------------

[](#working-with-criteria-and-repositories)

It's pretty identical to what you expected when working with Shopware's core or repositories in the SW administration.

This is an example to retrieve a product that have free shipping

```
// Create the repository for the entity
$productRepository = RepositoryFactory::create(ProductDefinition::ENTITY_NAME);

// Create the criteria
$criteria = new Criteria();
$criteria->addFilter(new EqualsFilter('shippingFree', true));

// Using this criteria and the context object that you create from authentication step, you can retrieving the result
$products = $productRepository->search($criteria, $context);
```

Each shopware's entity is mapped into Entity and Collection Classes which can be found in [Data/Entity](/src/Data/Entity) so you can easily access their properties when retrieving data from Admin API.

Support methods `get`, `search`, `searchIds`, `create`, `update`, `delete`, `syncDeleted`, `createVersion`, `mergeVersion`, `deleteVersion`, `clone`, `schema`. Each method requires a [Context](src/Data/Context.php) object

Check [examples/entity-repository.php](/examples/entity-repository.php) for some useful references.

Working with App
----------------

[](#working-with-app)

### AppRegistration examples:

[](#appregistration-examples)

The example took from a Laravel route action, but it can be the same in other frameworks

```
public function register(ShopRepository $repository): RegistrationResponse
{
    $authenticator = new WebhookAuthenticator();

    $app = new App(config('sas_app.app_name'), config('sas_app.app_secret'));

    $response = $authenticator->register($app);

    // Save the response the database...
    $repository->createShop($response->getShop());

    $confirmationUrl = route('sas.app.auth.confirmation');

    return new RegistrationResponse($response, $confirmationUrl);
}

public function confirm(Request $request, ShopRepository $shopRepository): Response
{
    $shopId = $request->request->get('shopId');

    $shopSecret = $shopRepository->getSecretByShopId($shopId);

    if (!WebhookAuthenticator::authenticatePostRequest($shopSecret)) {
        return new Response(null, 401);
    }

    $shopRepository->updateAccessKeysForShop(
        $shopId,
        $request->request->get('apiKey'),
        $request->request->get('secretKey')
    );

    return new Response();
}
```

### Action Button Response examples:

[](#action-button-response-examples)

When receive a POST request from an action button, you can return one of these ActionResponse (PSR-7 Response) classes ported from Shopware's core

```
namespace Vin\ShopwareSdk\Data\Response;
/**
* @see Shopware\Core\Framework\App\ActionButton
 */
new EmptyResponse();
new ReloadDataResponse($shopSecret);
new OpenNewTabResponse($shopSecret, 'http://shopware.test');
new NotificationResponse($shopSecret, 'Success!', NotificationResponse::SUCCESS);
new NotificationResponse($shopSecret, 'Error!', NotificationResponse::ERROR);
new OpenModalResponse($shopSecret, $iframeUrl, OpenModalResponse::LARGE_SIZE, true);
```

Working with Admin API Services
-------------------------------

[](#working-with-admin-api-services)

- Current supported services:
    - [InfoService](/src/Service/InfoService.php)
    - [MediaService](/src/Service/MediaService.php)
    - [UserService](/src/Service/UserService.php)
    - [StateMachineService](/src/Service/StateMachineService.php)
    - [SyncService](/src/Service/SyncService.php)
    - [NotificationService](/src/Service/NotificationService.php)
    - [UserConfigService](/src/Service/UserConfigService.php)
    - [AdminSearchService](/src/Service/AdminSearchService.php)
    - For other services that does not have a concrete class, use: [AdminActionService](/src/Service/AdminActionService.php)

An ApiService requires a [Context](src/Data/Context.php) object as its first argument. Check [examples/sync-service.php](/examples/sync-service.php) or [examples/info-service.php](/examples/info-service.php) for some references.

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Working with Webhook
--------------------

[](#working-with-webhook)

- Check the integration on our [AppExample](https://github.com/vienthuong/AppExample)

Contribution
------------

[](#contribution)

Feels free to create an issue on Github issues page or contact me directly at

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

### Requirements

[](#requirements)

- ext-curl
- PHP &gt;=7.4
- SW &gt;= 6.4

This SDK is mainly dedicated to Shopware 6.4 and onwards, earlier SW application may still be usable without test

Credits
-------

[](#credits)

- [vienthuong](https://github.com/vienthuong)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

66

—

FairBetter than 99% of packages

Maintenance83

Actively maintained with recent releases

Popularity55

Moderate usage in the ecosystem

Community34

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 71.2% 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 ~58 days

Recently: every ~291 days

Total

30

Last Release

124d ago

Major Versions

1.7.3 → 2.0.02023-05-30

PHP version history (4 changes)1.0.0PHP ^7.4

1.3.0PHP ^7.4 || ^8.0

1.7.1PHP ^7.4 || ^8.0 || ^8.1

2.2.0PHP ^8.0 || ^8.1 || ^8.2 || ^8.3

### Community

Maintainers

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

---

Top Contributors

[![vienthuong](https://avatars.githubusercontent.com/u/22548423?v=4)](https://github.com/vienthuong "vienthuong (74 commits)")[![silverDuy](https://avatars.githubusercontent.com/u/22496269?v=4)](https://github.com/silverDuy "silverDuy (4 commits)")[![raphael-homann](https://avatars.githubusercontent.com/u/7700663?v=4)](https://github.com/raphael-homann "raphael-homann (3 commits)")[![fschmtt](https://avatars.githubusercontent.com/u/5806324?v=4)](https://github.com/fschmtt "fschmtt (2 commits)")[![dag-inbase](https://avatars.githubusercontent.com/u/103109181?v=4)](https://github.com/dag-inbase "dag-inbase (2 commits)")[![radsto](https://avatars.githubusercontent.com/u/94012491?v=4)](https://github.com/radsto "radsto (2 commits)")[![feibeck](https://avatars.githubusercontent.com/u/265396?v=4)](https://github.com/feibeck "feibeck (2 commits)")[![C0DE8](https://avatars.githubusercontent.com/u/20956699?v=4)](https://github.com/C0DE8 "C0DE8 (2 commits)")[![Scornexon](https://avatars.githubusercontent.com/u/7467760?v=4)](https://github.com/Scornexon "Scornexon (1 commits)")[![solverat](https://avatars.githubusercontent.com/u/700119?v=4)](https://github.com/solverat "solverat (1 commits)")[![vekkon](https://avatars.githubusercontent.com/u/26244609?v=4)](https://github.com/vekkon "vekkon (1 commits)")[![zFl4wless](https://avatars.githubusercontent.com/u/70114451?v=4)](https://github.com/zFl4wless "zFl4wless (1 commits)")[![adrianles](https://avatars.githubusercontent.com/u/14124160?v=4)](https://github.com/adrianles "adrianles (1 commits)")[![zrja](https://avatars.githubusercontent.com/u/58917672?v=4)](https://github.com/zrja "zrja (1 commits)")[![canvural](https://avatars.githubusercontent.com/u/1574232?v=4)](https://github.com/canvural "canvural (1 commits)")[![fkwakkenbos](https://avatars.githubusercontent.com/u/1029218?v=4)](https://github.com/fkwakkenbos "fkwakkenbos (1 commits)")[![gabriel-efrogg](https://avatars.githubusercontent.com/u/175226866?v=4)](https://github.com/gabriel-efrogg "gabriel-efrogg (1 commits)")[![iNem0o](https://avatars.githubusercontent.com/u/1144755?v=4)](https://github.com/iNem0o "iNem0o (1 commits)")[![IronSean](https://avatars.githubusercontent.com/u/1960190?v=4)](https://github.com/IronSean "IronSean (1 commits)")[![malganis93](https://avatars.githubusercontent.com/u/1519805?v=4)](https://github.com/malganis93 "malganis93 (1 commits)")

---

Tags

php-sdkshopwareshopware-6shopware-6-sdkshopware-php-sdkshopware-sdk

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/vin-sw-shopware-sdk/health.svg)

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

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M738](/packages/sylius-sylius)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M421](/packages/drupal-core-recommended)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)

PHPackages © 2026

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