PHPackages                             sylius/shop-api-plugin - 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. sylius/shop-api-plugin

Abandoned → [sylius/api-bundle](/?search=sylius%2Fapi-bundle)ArchivedSylius-plugin[API Development](/categories/api)

sylius/shop-api-plugin
======================

Shop API for Sylius E-Commerce.

v1.6.0(3y ago)128309.3k—3.9%91[32 issues](https://github.com/Sylius/ShopApiPlugin/issues)[6 PRs](https://github.com/Sylius/ShopApiPlugin/pulls)1MITPHPPHP ^8.0

Since Apr 11Pushed 1y ago27 watchersCompare

[ Source](https://github.com/Sylius/ShopApiPlugin)[ Packagist](https://packagist.org/packages/sylius/shop-api-plugin)[ RSS](/packages/sylius-shop-api-plugin/feed)WikiDiscussions 1.7 Synced 1mo ago

READMEChangelog (10)Dependencies (16)Versions (47)Used By (1)

Sylius Shop API
================

[](#sylius-shop-api-)

Warning

This plugin is deprecated. The new way of building APIs in Sylius is with [Sylius Api](https://docs.sylius.com/getting-started-with-sylius/using-api).

[![License](https://camo.githubusercontent.com/447a8d603709b8544e6ce38e588fd002a0295a94802e26ae84d915bf6fea5f00/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f73796c6975732f73686f702d6170692d706c7567696e2e737667)](https://packagist.org/packages/sylius/shop-api-plugin) [![Build Status](https://camo.githubusercontent.com/4670ca3b384e5e4ffd60ea4d7ade2e186606c4cbcc250067a260692083da95cf/68747470733a2f2f7472617669732d63692e6f72672f53796c6975732f53686f70417069506c7567696e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Sylius/ShopApiPlugin) [![Scrutinizer Quality Score](https://camo.githubusercontent.com/173570ee2ce1be450a3a62ee231b76cd91b93020c4e2c042fe5d3fe1dc78655a/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f53796c6975732f53796c69757353686f70417069506c7567696e2e737667)](https://scrutinizer-ci.com/g/Sylius/SyliusShopApiPlugin/)

 [![](https://camo.githubusercontent.com/9b437c7f32af7f569d4c0d8e750fd3e94c19a1a7ad491228a34cf567b0ea8af4/68747470733a2f2f73796c6975732e636f6d2f6173736574732f62616467652d6f6666696369616c2d73796c6975732d706c7567696e2e706e67)](https://sylius.com/plugins/)

This repository contains a plugin that extends the [Sylius eCommerce platform](https://github.com/Sylius/Sylius) with an API in JSON that allows performing all standard shop operations from the customer perspective.

Documentation
-------------

[](#documentation)

The latest documentation is available [here](https://app.swaggerhub.com/apis/Sylius/sylius-shop-api/1.0.0). If you are looking for more information how the system works have a look at the [cookbook](doc/Cookbook.md)

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

[](#installation)

#### IMPORTANT NOTE: Before installing SyliusShopApiPlugin, you should disable all SyliusShopBundle's dependencies. You cannot use these packages together.

[](#important-note-before-installing-syliusshopapiplugin-you-should-disable-all-syliusshopbundles-dependencies-you-cannot-use-these-packages-together)

1. Run `composer require sylius/shop-api-plugin` and, when asked if you want to execute the Flex recipe, answer 'Yes'.
2. Extend config files:

    1. Add SyliusShopApi to `config/bundles.php`.

    ```
    // config/bundles.php

        return [
            Sylius\ShopApiPlugin\SyliusShopApiPlugin::class => ['all' => true],
        ];
    ```

    2. Add `- { path: '^/shop-api', priorities: ['json'], fallback_format: json, prefer_extension: true }` to `fos_rest.format_listener.rules`section in `config/packages/fos_rest.yaml` file and import config from Plugin.

    ```
    # config/packages/_sylius_shop_api.yaml

    imports: #  ['all' => true],
        ];
        ```

        2. Add the new configuration file

        ```
        # config/packages/nelmio_cors.yml

        # ...

        nelmio_cors:
            defaults:
                allow_credentials: false
                allow_origin: []
                allow_headers: []
                allow_methods: []
                expose_headers: []
                max_age: 0
                hosts: []
                origin_regex: false
                forced_allow_origin_value: ~
            paths:
                '^/shop-api/':
                    allow_origin: ['*']
                    allow_headers: ['Content-Type', 'authorization']
                    allow_methods: ['POST', 'PUT', 'GET', 'DELETE', 'PATCH', 'OPTIONS']
                    max_age: 3600
        ```
3. Follow

Sample configuration of Shop API can be found here:

Additional features
-------------------

[](#additional-features)

### Attributes

[](#attributes)

If you would like to receive serialized attributes you need to define an array of theirs codes under `sylius_shop_api.included_attributes` key. E.g.

```
# config/packages/sylius_shop_api.yml
sylius_shop_api:
    included_attributes:
        - "MUG_MATERIAL_CODE"
```

This plugin comes with an integration with [LexikJWTAuthenticationBundle](https://github.com/lexik/LexikJWTAuthenticationBundle/). More information about security customizations may be found there.

Testing
-------

[](#testing)

The application can be tested with API Test Case. In order to run test suite execute the following commands:

```
$ cp tests/Application/.env.test.dist tests/Application/.env.test
$ set -a && source tests/Application/.env.test && set +a
$ (cd tests/Application && bin/console doctrine:database:create -e test)
$ (cd tests/Application && bin/console doctrine:schema:create -e test)

$ vendor/bin/phpunit
```

The application can be also tested with PHPSpec:

```
$ vendor/bin/phpspec run
```

Security issues
---------------

[](#security-issues)

If you think that you have found a security issue, please do not use the issue tracker and do not post it publicly. Instead, all security issues must be sent to `security@sylius.com`.

Maintenance
-----------

[](#maintenance)

This library is officially maintained by [Sylius](https://sylius.com) together with the following contributors outside of the organization:

- [Maximilian Pesch](https://github.com/mamazu)

Release cycle
-------------

[](#release-cycle)

This projects follows [Semantic Versioning](https://semver.org/). Shop API release cycle is independent from Sylius release cycle.

Next major releases are not planned yet. Minor and patch releases will be published as needed.

We provide bug fixes only for the most recent minor release. We provide security fixes for one year since the release of subsequent minor release.

#### Supported versions

[](#supported-versions)

VersionRelease dateEnd of support1.023rd Nov 201919th June 20211.119th June 202008th December 20201.208th December 202022th April 20211.2.122th April 202122th April 20211.322th April 202122th April 20211.3.122th April 202130th June 20211.430th June 202106th July 20211.4.106th July 202120th July 20221.520th July 202221th July 20221.5.121th July 202213th January 20231.613th January 2023

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity52

Moderate usage in the ecosystem

Community36

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

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

Recently: every ~250 days

Total

47

Last Release

394d ago

PHP version history (7 changes)v1.0.0-alpha.1PHP ^5.6|^7.0

v1.0.0-beta.2PHP ^7.0

v1.0.0-beta.7PHP ^7.1

v1.0.0-rc.1PHP ^7.2

v1.2.0PHP ^7.3

v1.4.0PHP ^7.4|^8.0

v1.5.0PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/719423?v=4)[Sylius eCommerce](/maintainers/sylius)[@Sylius](https://github.com/Sylius)

![](https://www.gravatar.com/avatar/4b4a5a1a9293502aa8573551fab020963a9050c5cca4524433b6d94214d3b480?d=identicon)[GSadee](/maintainers/GSadee)

---

Top Contributors

[![lchrusciel](https://avatars.githubusercontent.com/u/6213903?v=4)](https://github.com/lchrusciel "lchrusciel (538 commits)")[![mamazu](https://avatars.githubusercontent.com/u/14860264?v=4)](https://github.com/mamazu "mamazu (296 commits)")[![GSadee](https://avatars.githubusercontent.com/u/6140884?v=4)](https://github.com/GSadee "GSadee (82 commits)")[![pamil](https://avatars.githubusercontent.com/u/1897953?v=4)](https://github.com/pamil "pamil (77 commits)")[![Zales0123](https://avatars.githubusercontent.com/u/6212718?v=4)](https://github.com/Zales0123 "Zales0123 (69 commits)")[![pjedrzejewski](https://avatars.githubusercontent.com/u/614970?v=4)](https://github.com/pjedrzejewski "pjedrzejewski (69 commits)")[![Amr3zzat](https://avatars.githubusercontent.com/u/31932378?v=4)](https://github.com/Amr3zzat "Amr3zzat (31 commits)")[![jseparovic1](https://avatars.githubusercontent.com/u/14984987?v=4)](https://github.com/jseparovic1 "jseparovic1 (29 commits)")[![dlobato](https://avatars.githubusercontent.com/u/1379455?v=4)](https://github.com/dlobato "dlobato (25 commits)")[![alexander-schranz](https://avatars.githubusercontent.com/u/1698337?v=4)](https://github.com/alexander-schranz "alexander-schranz (14 commits)")[![TheMilek](https://avatars.githubusercontent.com/u/53942444?v=4)](https://github.com/TheMilek "TheMilek (12 commits)")[![medteck](https://avatars.githubusercontent.com/u/12381774?v=4)](https://github.com/medteck "medteck (11 commits)")[![CSchulz](https://avatars.githubusercontent.com/u/1520593?v=4)](https://github.com/CSchulz "CSchulz (10 commits)")[![bartoszpietrzak1994](https://avatars.githubusercontent.com/u/22262296?v=4)](https://github.com/bartoszpietrzak1994 "bartoszpietrzak1994 (10 commits)")[![Tomanhez](https://avatars.githubusercontent.com/u/39232096?v=4)](https://github.com/Tomanhez "Tomanhez (6 commits)")[![antonioperic](https://avatars.githubusercontent.com/u/2453151?v=4)](https://github.com/antonioperic "antonioperic (6 commits)")[![clem21](https://avatars.githubusercontent.com/u/25388851?v=4)](https://github.com/clem21 "clem21 (5 commits)")[![adrianmarte](https://avatars.githubusercontent.com/u/48241697?v=4)](https://github.com/adrianmarte "adrianmarte (4 commits)")[![cboita](https://avatars.githubusercontent.com/u/60105166?v=4)](https://github.com/cboita "cboita (4 commits)")[![gorkalaucirica](https://avatars.githubusercontent.com/u/1749891?v=4)](https://github.com/gorkalaucirica "gorkalaucirica (3 commits)")

---

Tags

hacktoberfestphpsymfony

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sylius-shop-api-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/sylius-shop-api-plugin/health.svg)](https://phpackages.com/packages/sylius-shop-api-plugin)
```

###  Alternatives

[sylius/sylius

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

8.4k5.6M651](/packages/sylius-sylius)[components-web-app/api-components-bundle

Creates a flexible API for a website's structure, reusable components and common functionality.

322.8k](/packages/components-web-app-api-components-bundle)

PHPackages © 2026

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