PHPackages                             schababerle-digital/shopware6-api-client - 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. schababerle-digital/shopware6-api-client

ActiveLibrary[API Development](/categories/api)

schababerle-digital/shopware6-api-client
========================================

Ein PHP-Client für die Shopware 6 Admin API

v1.0.0(1y ago)192MITPHPPHP &gt;=7.4

Since Mar 13Pushed 1y ago2 watchersCompare

[ Source](https://github.com/Schababerle-Digital/shopware6-php-client)[ Packagist](https://packagist.org/packages/schababerle-digital/shopware6-api-client)[ RSS](/packages/schababerle-digital-shopware6-api-client/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

Shopware 6 API Client
=====================

[](#shopware-6-api-client)

A robust PHP client for the Shopware 6 Admin API with automatic authentication and token management.

Features
--------

[](#features)

- Simple authentication via client credentials
- Automatic token management with auto-refresh
- Support for all HTTP methods (GET, POST, PATCH, DELETE)
- Helper methods for common API operations
- Comprehensive error handling
- Fully tested with PHPUnit

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

[](#installation)

```
composer require schababerle-digital/shopware6-api-client
```

Quick Start
-----------

[](#quick-start)

```
use Shopware6Client\Shopware6ApiClient;

// Initialize client
$client = new Shopware6ApiClient(
    'https://your-shop.com',
    'YOUR_CLIENT_ID',
    'YOUR_CLIENT_SECRET'
);

// Authenticate
$client->authenticate();

// Fetch products
$products = $client->getProducts(['limit' => 10]);

// Create a new product
$newProduct = $client->createProduct([
    'name' => 'My Product',
    'productNumber' => 'MP-001',
    'stock' => 100,
    'taxId' => 'YOUR_TAX_ID',
    'price' => [
        [
            'currencyId' => 'YOUR_CURRENCY_ID',
            'gross' => 19.99,
            'net' => 16.80,
            'linked' => true
        ]
    ]
]);

// Update product
$client->updateProduct($newProduct['data']['id'], [
    'stock' => 150,
    'description' => 'This is a product description'
]);

// Delete product
$client->deleteProduct($newProduct['data']['id']);
```

Available Methods
-----------------

[](#available-methods)

### Main Methods

[](#main-methods)

- `authenticate()`: Performs authentication
- `refreshAccessToken()`: Manually refreshes the token
- `request(string $method, string $endpoint, array $data = [], array $query = [], array $headers = [])`: Performs an API request
- `get(string $endpoint, array $query = [])`: Performs a GET request
- `post(string $endpoint, array $data = [])`: Performs a POST request
- `patch(string $endpoint, array $data = [])`: Performs a PATCH request
- `delete(string $endpoint)`: Performs a DELETE request

### Helper Methods

[](#helper-methods)

- `getProducts(array $criteria = [])`: Fetches products
- `getOrder(string $orderId)`: Fetches an order
- `getOrders(array $criteria = [])`: Fetches orders
- `getCustomers(array $criteria = [])`: Fetches customers
- `createProduct(array $productData)`: Creates a product
- `updateProduct(string $productId, array $productData)`: Updates a product
- `deleteProduct(string $productId)`: Deletes a product

Examples for Filter Criteria
----------------------------

[](#examples-for-filter-criteria)

```
// Fetch products with filter
$activeProducts = $client->getProducts([
    'filter' => [
        [
            'type' => 'equals',
            'field' => 'active',
            'value' => true
        ]
    ],
    'sort' => [
        [
            'field' => 'name',
            'order' => 'ASC'
        ]
    ],
    'limit' => 10,
    'page' => 1
]);

// Filter orders by date
$recentOrders = $client->getOrders([
    'filter' => [
        [
            'type' => 'range',
            'field' => 'orderDateTime',
            'parameters' => [
                'gte' => '2023-01-01T00:00:00+00:00'
            ]
        ]
    ],
    'sort' => [
        [
            'field' => 'orderDateTime',
            'order' => 'DESC'
        ]
    ]
]);
```

Error Handling
--------------

[](#error-handling)

The client throws exceptions when an error occurs. It is recommended to wrap your API requests in try-catch blocks:

```
try {
    $client->authenticate();
    $products = $client->getProducts(['limit' => 10]);
} catch (\Exception $e) {
    echo "Error: " . $e->getMessage();
}
```

Automatic Token Refresh
-----------------------

[](#automatic-token-refresh)

The client automatically handles token management:

1. On first use, `authenticate()` is automatically called if no token is present
2. If a token expires (or will expire in less than 30 seconds), it is automatically refreshed
3. If a 401 Unauthorized error occurs, the client attempts to refresh the token and retry the request

Tests
-----

[](#tests)

The package contains comprehensive tests:

```
# Run unit tests
composer test

# With coverage report
composer test-coverage

# Run integration tests (requires .env file)
vendor/bin/phpunit --group integration
```

### Setting Up Integration Tests

[](#setting-up-integration-tests)

For integration tests, copy the `.env.example` file to `.env` and fill in your Shopware API credentials.

License
-------

[](#license)

MIT

Contributing
------------

[](#contributing)

Contributions are welcome! Please ensure all tests pass before submitting a pull request.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance42

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity38

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

Unknown

Total

1

Last Release

471d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/166416599?v=4)[schababerle.digital](/maintainers/schababerle-digital)[@Schababerle-Digital](https://github.com/Schababerle-Digital)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/schababerle-digital-shopware6-api-client/health.svg)

```
[![Health](https://phpackages.com/badges/schababerle-digital-shopware6-api-client/health.svg)](https://phpackages.com/packages/schababerle-digital-shopware6-api-client)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.3M7](/packages/avalara-avataxclient)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2478.1k](/packages/filescom-files-php-sdk)[aimeos/prisma

A powerful PHP package for integrating media related Large Language Models (LLMs) into your applications

1772.4k4](/packages/aimeos-prisma)

PHPackages © 2026

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