Universal Commerce Protocol (UCP) integration for Shopware 6.
This plugin is a reference implementation of the UCP protocol for Shopware 6. For most payment methods there is still work to do before production use:
- PaymentHandlerService — Exposes payment handlers in the discovery profile (e.g.
/.well-known/ucp). Currently returns a single default “business tokenizer” handler; mapping of Shopware payment methods to UCP handlers (e.g. Google Pay) is reserved for future use and not fully implemented. - PaymentProcessingService — Applies UCP payment data to the cart and maps handler IDs to Shopware payment methods. The current implementation is a placeholder: it picks the first available payment method instead of resolving handler IDs from configuration, and payment credentials are stored on the cart for later processing rather than being fully integrated with order creation.
If you integrate additional payment methods or processors, extend these services and wire them to your Shopware payment method configuration and order flow.
- Install via Composer (VCS) from your Shopware root:
composer config repositories.swagucp vcs https://github.com/agentic-commerce-lab/SwagUcp.git composer require shopware/ucp-integration:dev-main
- Install and activate the plugin:
bin/console plugin:refresh bin/console plugin:install --activate SwagUcp
- Clear cache:
bin/console cache:clear
Configure the plugin in Shopware Admin:
- Extensions → My extension → UCP Integration → configure
| Option | Type | Default | Description |
|---|---|---|---|
| UCP Protocol Version | Text | 2026-01-11 |
The UCP protocol version this shop supports. Used in discovery profile and API responses. |
| Option | Type | Default | Description |
|---|---|---|---|
| Enable Agent Whitelist | Boolean | false |
If enabled, only agents from whitelisted domains can use the UCP endpoints. Recommended for production. |
| Whitelisted Agent Domains | Textarea | (empty) | One domain per line. Supports wildcards (e.g., *.openai.com). If empty and whitelist is enabled, known AI platforms are allowed by default. |
| Require Agent Signature | Boolean | false |
If enabled, all requests must include a valid Request-Signature header signed by the agent's private key. Provides cryptographic proof of request origin. |
| Option | Type | Default | Description |
|---|---|---|---|
| Signing Key ID | Text | (auto-generated) | Unique identifier for your signing key. Published in the kid field of JWK. Auto-generated as shopware_ucp_<random> if empty. |
| Signing Public Key (PEM) | Textarea | (auto-generated) | EC P-256 public key in PEM format. Published at /.well-known/ucp for webhook signature verification. Auto-generated if empty. |
| Signing Private Key (PEM) | Password | (auto-generated) | EC P-256 private key in PEM format. Used to sign outgoing webhooks. Keep this secret! Auto-generated if empty. |
| Option | Type | Default | Description |
|---|---|---|---|
| Checkout Session TTL | Integer | 30 |
How long checkout sessions remain valid, in minutes. Expired sessions cannot be completed. |
| Enable Webhooks | Boolean | true |
Send signed webhooks to platforms when order status changes (e.g., payment confirmed, shipped). |
⚠️ No hardcoded keys! Each installation generates unique cryptographic keys.
You don't need to do anything! When the plugin is first accessed:
- The plugin checks if signing keys exist in the configuration
- If no keys are found, it automatically generates:
- A random Key ID:
shopware_ucp_<16-char-hex> - An EC P-256 key pair using PHP's OpenSSL extension
- A random Key ID:
- Keys are stored in Shopware's SystemConfig (database) and persist permanently
To trigger key generation, simply access https://your-shop.com/.well-known/ucp after installation.
If you prefer to generate your own keys (e.g., for key rotation or compliance requirements):
# Generate EC P-256 private key
openssl ecparam -genkey -name prime256v1 -noout -out private.pem
# Extract public key
openssl ec -in private.pem -pubout -out public.pem
# View the keys
cat private.pem # Copy to "Signing Private Key" field
cat public.pem # Copy to "Signing Public Key" fieldThen in Shopware Admin:
- Go to Settings → System → Plugins → SwagUcp
- Paste the private key into Signing Private Key (PEM)
- Paste the public key into Signing Public Key (PEM)
- Set a unique Signing Key ID (e.g.,
myshop_2026_01) - Save and clear cache
To rotate keys without downtime:
- Generate new keys using the commands above
- Update the configuration with new keys and a new Key ID
- The new public key will immediately be published at
/.well-known/ucp - Platforms will fetch the new key on their next request
Check that your keys are published correctly:
curl https://your-shop.com/.well-known/ucp | jq '.signing_keys'Expected output:
[
{
"kid": "shopware_ucp_abc123...",
"kty": "EC",
"crv": "P-256",
"x": "...",
"y": "...",
"use": "sig",
"alg": "ES256"
}
]The plugin provides multiple layers of security:
Enable "Agent Whitelist" and configure allowed domains:
api.openai.com
generativelanguage.googleapis.com
api.anthropic.com
api.cohere.ai
Agents must send a UCP-Agent header with their profile URL:
UCP-Agent: UCP/2026-01-11 profile="https://api.openai.com/.well-known/ucp"
The plugin extracts the domain and checks against the whitelist.
Enable "Require Agent Signature" for cryptographic verification:
- Agent signs the request body with their private key
- Sends signature in
Request-Signatureheader (Detached JWS) - Plugin fetches agent's public keys from their
/.well-known/ucp - Verifies the signature matches the request body
This ensures:
- ✅ Only authorized agents can call the endpoints
- ✅ Requests cannot be tampered with
- ✅ Non-repudiation (agent cannot deny sending request)
If whitelist is enabled but no domains configured, these are automatically allowed:
| Platform | Domain |
|---|---|
| OpenAI | api.openai.com |
| Google Gemini | generativelanguage.googleapis.com |
| Anthropic | api.anthropic.com |
| Cohere | api.cohere.ai |
| Mistral | api.mistral.ai |
| Amazon Bedrock | inference.aws.amazon.com |
| Together AI | api.together.xyz |
| Perplexity | api.perplexity.ai |
Agent Whitelist: ❌ Disabled
Require Signature: ❌ Disabled
Agent Whitelist: ✅ Enabled
Whitelisted Domains: api.openai.com, api.anthropic.com
Require Signature: ❌ Disabled
Agent Whitelist: ✅ Enabled
Whitelisted Domains: api.openai.com
Require Signature: ✅ Enabled
- UCP profile available at
/.well-known/ucp - Automatic capability negotiation
- Payment handler discovery
- JWK signing keys published for webhook verification
POST /ucp/checkout-sessions- Create checkoutGET /ucp/checkout-sessions/{id}- Get checkoutPUT /ucp/checkout-sessions/{id}- Update checkoutPOST /ucp/checkout-sessions/{id}/complete- Complete checkoutPOST /ucp/checkout-sessions/{id}/cancel- Cancel checkout
Outgoing webhooks (order updates) are signed using Request-Signature header:
Request-Signature: eyJhbGciOiJFUzI1NiIsImtpZCI6InNob3B3YXJlX3VjcF8yMDI2In0..MEUCIQDx...
Platforms can verify using the public key from /.well-known/ucp.
vendor/bin/phpunit tests/Unit --testdoxvendor/bin/phpunit tests/Integration --testdox./tests/run_live_flow_test.shSee tests/README.md for detailed test documentation.
curl https://your-shop.com/.well-known/ucpcurl -X POST https://your-shop.com/ucp/checkout-sessions \
-H "Content-Type: application/json" \
-H "X-Requested-With: XMLHttpRequest" \
-H "UCP-Agent: UCP/2026-01-11 profile=\"https://api.openai.com/.well-known/ucp\"" \
-d '{
"line_items": [
{
"item": {
"id": "product-123",
"title": "Test Product",
"price": 1000
},
"quantity": 1
}
]
}'curl -X POST https://your-shop.com/ucp/checkout-sessions \
-H "Content-Type: application/json" \
-H "X-Requested-With: XMLHttpRequest" \
-H "UCP-Agent: UCP/2026-01-11 profile=\"https://agent.example.com/.well-known/ucp\"" \
-H "Request-Signature: eyJhbGciOiJFUzI1NiIsImtpZCI6ImFnZW50X2tleV8xIn0..SIGNATURE" \
-d '{"line_items": [...]}'Before going live:
- Enable Agent Whitelist in plugin settings
- Configure allowed agent domains (or leave empty for known platforms)
- Consider enabling "Require Agent Signature" for high-value transactions
- Verify your signing keys are generated (check
/.well-known/ucp) - Test the integration with your AI agent partner
- Ensure HTTPS is configured
- Review webhook endpoints are secured
- Add the agent's domain to the whitelist
- Or disable whitelist for development
- Agent must send valid
Request-Signatureheader - Public keys must be published at agent's
/.well-known/ucp
- Clear Shopware cache:
bin/console cache:clear - Keys auto-generate on first request
Apache License 2.0