Integrating your Shopware storefront with external ERP, CRM, PIM, and marketing systems is no longer just a luxury; it's a business requirement. In Shopware 6.7, the webhook architecture has been refined to provide developers and store owners with a more reliable, secure, and developer-friendly way to decouple core commerce operations from third-party services.

This post explores how to leverage webhooks in Shopware 6.7, covering setup methods, powerful use cases, and the enhancements that make version 6.7 a leap forward for integrations.

What Are Webhooks in Shopware 6.7?

Webhooks are HTTP callbacks triggered by specific events within your Shopware store. Unlike polling, where systems repeatedly check for data changes, webhooks push real-time notifications to a predefined destination URL when an event occurs. This event-driven approach reduces server load and ensures instant synchronization across your tech stack.

In Shopware 6.7, webhooks are treated as first-class citizens within the API. They support advanced authorization headers, custom fields for metadata, and granular event filtering. The system also includes improved retry mechanisms and logging, making integrations more robust against network failures.

Shopware 6.7 Improvements for Webhooks

Shopware 6.7 brings several under-the-hood enhancements to the webhook engine:

  1. Enhanced Delivery Guarantees: The webhook dispatcher in 6.7 handles transient errors more gracefully, with optimized retry logic that prevents overwhelming destination servers while ensuring data integrity.
  2. Security Upgrades: You can now easily configure custom authorization headers, including token-based authentication (Bearer tokens) and basic auth, directly via the UI or API. This reduces the need for hardcoded secrets in configuration files.
  3. Developer Experience: The Admin panel offers a streamlined interface for managing webhooks, with better validation for URLs and event types. Additionally, webhook logs are now more detailed, aiding in debugging integration issues.
  4. Event Granularity: While Shopware has long supported core events, 6.7 ensures consistent payload structures for complex entities like orders and products, reducing parsing errors on the receiver side.

Setup: Admin Panel vs. API

You can set up webhooks via the Shopware Admin UI or programmatically via the Store API or plugin code. The method depends on your workflow.

Method 1: Via Admin Panel (Quick Setup)

For store managers or non-technical users, the Admin panel is the easiest route.

  1. Navigate to Settings > Technical Settings > Webhooks.
  2. Click Create and fill in the details:
    • Active: Toggle to enable the webhook.
    • Event: Select from the dropdown (e.g., order.created, product.approved).
    • URL: Enter your endpoint destination. Shopware validates the URL format.
    • Headers: Add custom headers for authentication or metadata.
  3. Click Save. The webhook is now live and will fire immediately when the event occurs.

Method 2: Via API (For Plugins & Automations)

For developers creating plugins or bulk-managing webhooks, the API provides full control. Below is a code example demonstrating how to create a webhook via the Store API context within a migration or service.

<?php declare(strict_types=1);

namespace MyVendor\MyPlugin\Migration;

use Doctrine\DBAL\Connection;
use Shopware\Core\Framework\Api\Context\AdminApiContext;
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
use Shopware\Core\Framework\Migration\MigrationStep;
use Shopware\Core\Framework\Uuid\Uuid;

class Migration1690000002CreateProductWebhook extends MigrationStep
{
    public function getCollisionResolution(): array
    {
        return ['new'];
    }

    public function update(Connection $connection): void
    {
        // Webhooks should ideally be created via the DAL/Context in production code,
        // but for migration examples, we show the payload structure.
        
        $webhookId = Uuid::randomBytes();
        $targetUrl = 'https://your-external-system.com/api/shopware/webhook';

        // In a real plugin, you would use:
        // $context->create('webhook', [$payload]);
        
        // Example payload structure for the API or Service creation:
        $webhookPayload = [
            'id' => $webhookId,
            'active' => true,
            'event' => 'product.approved', // Triggers when a product is approved in store
            'url' => $targetUrl,
            'customFields' => [
                'integration_version' => '1.0.5'
            ],
            // Optional: Authorization headers for security
            'headers' => [
                [
                    'key' => 'Authorization',
                    'value' => 'Bearer YOUR_SECURE_TOKEN_HERE'
                ],
                [
                    'key' => 'X-Shopware-Source',
                    'value' => 'MyPluginWebhook'
                ]
            ]
        ];

        // Save logic would follow here using EntityManager or API client.
    }
}

Top Use Cases for Webhooks in Shopware 6.7

1. Real-Time Order Synchronization to ERP

Event: order.created, order.updated

When a customer completes checkout, push the order data immediately to your ERP system for fulfillment. This eliminates delays caused by batch processing.

  • Payload Includes: Customer details, line items, shipping methods, prices, and tax information.
  • Shopware 6.7 Tip: Use order.updated to sync status changes (e.g., when the ERP marks an order as shipped, update Shopware automatically via a matching webhook).

2. Product Approval Flow to PIM

Event: product.approved

If you use a Product Information Management (PIM) system for centralizing data, trigger a webhook only when a product is marked "approved" in Shopware. This ensures your public storefront reflects data that has been reviewed and validated.

  • Use Case: Keep draft products hidden from external systems until they are fully prepared.
  • Configuration: Filter the webhook to specific channels or groups if you have multi-channel setups.

3. Inventory Management with External Warehouses

Event: stock.updated, sales-channel-api:stock-updated

Sync stock levels in real-time with external warehouse management systems or marketplaces like Amazon/eBay. This prevents overselling and maintains accurate availability across all channels.

  • Best Practice: Combine this with the product.approved event to ensure stock data is only sent for products that are live.

4. Marketing Automation Triggers

Event: customer.registered, order.placed

Connect your store to marketing tools like Mailchimp, HubSpot, or Salesforce. When a new customer registers or places an order, instantly push their profile and purchase history to trigger automated email flows or lead scoring.

  • Data Privacy: Shopware 6.7 allows you to include customFields in the webhook payload, which can be used to map GDPR-compliant flags or consent statuses.

Best Practices for Webhook Integrations

  1. Idempotency: Destination systems must handle duplicate webhooks gracefully. Use unique IDs from the payload (e.g., order.id) and check if records already exist before processing.
  2. Response Validation: Shopware expects a 2xx HTTP status code. If your endpoint fails, the webhook will be retried based on system configuration. Ensure your endpoint responds quickly and reliably.
  3. Security: Always use custom headers to pass secrets or tokens. Avoid relying on IP whitelisting alone; combine header authentication with strict validation in your receiving script.
  4. Monitoring: Regularly check the webhook logs in the Admin panel under Technical Settings > Webhooks. Monitor success rates and latency to detect integration drift early.
  5. Event Selection: Choose specific events to minimize payload volume. Instead of order.updated, use order.created if you only need new order data.

Conclusion

Shopware 6.7 empowers you to build seamless, real-time integrations through its robust webhook system. Whether you are syncing orders to an ERP, managing inventory across marketplaces, or automating customer marketing flows, webhooks provide the reliability and flexibility needed for modern commerce operations.

By leveraging the improved setup tools, security features, and developer experience in Shopware 6.7, you can future-proof your integrations and focus on delivering exceptional customer experiences.

Ready to integrate? Explore the webhook configuration in your Admin panel or dive into the API documentation to start building powerful connections today.