priceeio / integration-sylius
Sylius integration with Pricee.io
Package info
github.com/Pricee-io/integration-sylius
Type:sylius-plugin
pkg:composer/priceeio/integration-sylius
Requires
- php: ^8.2
- sylius/sylius: ^2.1
Requires (Dev)
- nyholm/psr7: ^1.8
- phpstan/phpstan: ^1.12
- phpstan/phpstan-doctrine: ^1.3
- phpstan/phpstan-webmozart-assert: ^1.2
- phpunit/phpunit: ^10.5
- sylius-labs/coding-standard: ^4.4
- sylius-labs/suite-tags-extension: ~0.2
- sylius/sylius-rector: ^1.14 || ^2.0
- sylius/test-application: ^1.14.0@alpha || ^2.0.0@alpha || ^2.1.0@alpha || ^2.2.0@alpha
- symfony/browser-kit: ^6.4 || ^7.1
- symfony/debug-bundle: ^6.4 || ^7.1
- symfony/dotenv: ^6.4 || ^7.1
- symfony/http-client: ^6.4 || ^7.1
- symfony/intl: ^6.4 || ^7.1
- symfony/runtime: ^6.4 || ^7.1
- symfony/web-profiler-bundle: ^6.4 || ^7.1
- symfony/webpack-encore-bundle: ^1.15 || ^2.2
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Pricee.io Sylius Plugin allows you to sync your Sylius products to the Pricee.io platform for price monitoring.
Features
- Authenticate with Pricee.io using Client ID & Secret Key (API Key)
- Sync selected product categories from Sylius to Pricee.io
Prerequisites
- PHP 8.2 or higher
- Sylius 2.1 or higher
Installation
- Require the plugin via Composer:
composer require priceeio/integration-sylius
- Enable the bundle in
config/bundles.php:
return [ // ... PriceeIO\SyncPlugin\PriceeIOSyncPlugin::class => ['all' => true], ];
- Import the plugin routes in your application
config/routes.yaml(the sync page and the price webhook):
priceeio_sync: resource: "@PriceeIOSyncPlugin/config/routes.yaml"
The sync page is served under your admin path (SYLIUS_ADMIN_ROUTING_PATH_NAME), behind the admin login.
- Clear cache:
php bin/console cache:clear
- Configure your Pricee.io API key credentials with environment variables. Create the API key from the Integrations page of this shop's website on Pricee.io: each key is tied to one website.
PRICEEIO_CLIENT_ID=your_client_id PRICEEIO_API_KEY=your_api_key
Several channels
Each channel is one website on Pricee.io, with its own API key and webhook secret. Set them per channel code in config/packages/pricee_io_sync.yaml; a channel left out, or a value left empty, uses the PRICEEIO_* environment variables above, so a shop with a single channel needs nothing more.
pricee_io_sync: channels: FASHION_FR: client_id: '%env(PRICEEIO_FR_CLIENT_ID)%' api_key: '%env(PRICEEIO_FR_API_KEY)%' webhook_secret: '%env(PRICEEIO_FR_WEBHOOK_SECRET)%' FASHION_DE: client_id: '%env(PRICEEIO_DE_CLIENT_ID)%' api_key: '%env(PRICEEIO_DE_API_KEY)%' webhook_secret: '%env(PRICEEIO_DE_WEBHOOK_SECRET)%'
Usage
- Go to Admin → Pricee.io → Synchronisation.
- Choose the channel to sync, when the shop has several.
- Select product categories you want to sync.
- Click Synchronise to send products to Pricee.io.
The plugin will automatically:
- Sync to the Pricee.io website the channel's API key is tied to (the sync stops with an error if it is not this channel's website)
- Sync the enabled products of the selected categories sold on the channel, with their page on the channel's hostname and in its default language
- Return a success message with the number of synced products
Webhook (automatic price updates)
The plugin exposes a webhook endpoint that receives the prices Pricee.io computes for your products and applies them to their channel pricing. A price is only written for a product with a single variant, on the channel of its page, when it has no catalog promotion, stays above the channel's minimum price, and was not changed in the shop since Pricee.io last read it.
- Enable the webhook with environment variables (its route comes with the plugin routes imported at installation):
PRICEEIO_WEBHOOK_ENABLED=1 PRICEEIO_WEBHOOK_SECRET=your_webhook_secret
- In Pricee.io, configure the webhook URL to:
https://your-shop.example.com/priceeio/webhook
With several channels, give each one the webhook secret of its Pricee.io website (webhook_secret above): a call only updates the channel whose secret signed it, and PRICEEIO_WEBHOOK_SECRET the channels without their own one.
Each request is signed with HMAC-SHA256 over the raw body (X-Signature header) using the webhook secret, and carries a timestamp and a nonce so stale or replayed payloads are rejected. Received prices are validated before being written; channel pricings are updated for channels whose base currency matches the price currency.
Support
For issues, contact hello@pricee.io or open an issue in this repository.