๐Ÿข Magento / Adobe Commerce UCP Guide

Implement UCP on your enterprise Magento or Adobe Commerce store. Enable AI agents to discover and transact with your catalog.

๐Ÿค– AI Agent Ready ๐Ÿข Enterprise Grade ๐Ÿ”ง Module Available ๐Ÿ“Š GraphQL Support

Why Add UCP to Magento?

Magento (Adobe Commerce) powers some of the world's largest online stores. Adding UCP support positions your enterprise for AI-driven commerce, allowing AI agents to discover products, check inventory, and complete transactions.

  • Enterprise Scale: UCP works with Magento's multi-store, multi-language setup
  • GraphQL Ready: Magento's GraphQL API integrates seamlessly with UCP
  • B2B Support: Expose B2B catalogs and pricing to AI agents
  • Headless Compatible: Works with PWA Studio and headless setups
๐Ÿข Adobe Commerce Cloud This guide works for both Magento Open Source and Adobe Commerce Cloud. Cloud users should deploy via the standard module deployment process.

Prerequisites

  • Magento 2.4+ or Adobe Commerce
  • SSH/CLI access to your Magento installation
  • Composer installed
  • Basic understanding of Magento module structure

Implementation

1Generate Your UCP Profile

Generate Your UCP Profile

Create a customized UCP profile for your Magento store.

Open Generator โ†’
2Create the Module Structure

Create a new module to serve the UCP profile:

# Create module directories
mkdir -p app/code/Vendor/Ucp/Controller/WellKnown
mkdir -p app/code/Vendor/Ucp/etc
3Create Module Registration

Create app/code/Vendor/Ucp/registration.php:

<?php
use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(
    ComponentRegistrar::MODULE,
    'Vendor_Ucp',
    __DIR__
);
4Create module.xml

Create app/code/Vendor/Ucp/etc/module.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Vendor_Ucp" setup_version="1.0.0">
        <sequence>
            <module name="Magento_Store"/>
        </sequence>
    </module>
</config>
5Create Routes Configuration

Create app/code/Vendor/Ucp/etc/frontend/routes.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="wellknown" frontName=".well-known">
            <module name="Vendor_Ucp"/>
        </route>
    </router>
</config>
6Create the Controller

Create app/code/Vendor/Ucp/Controller/WellKnown/Ucp.php:

<?php
namespace Vendor\Ucp\Controller\WellKnown;

use Magento\Framework\App\Action\HttpGetActionInterface;
use Magento\Framework\Controller\Result\JsonFactory;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Framework\App\Config\ScopeConfigInterface;

class Ucp implements HttpGetActionInterface
{
    private JsonFactory $jsonFactory;
    private StoreManagerInterface $storeManager;
    private ScopeConfigInterface $scopeConfig;

    public function __construct(
        JsonFactory $jsonFactory,
        StoreManagerInterface $storeManager,
        ScopeConfigInterface $scopeConfig
    ) {
        $this->jsonFactory = $jsonFactory;
        $this->storeManager = $storeManager;
        $this->scopeConfig = $scopeConfig;
    }

    public function execute()
    {
        $store = $this->storeManager->getStore();
        $baseUrl = $store->getBaseUrl();
        
        $profile = [
            'profile_version' => '1.0',
            'merchant' => [
                'name' => $this->scopeConfig->getValue('general/store_information/name'),
                'url' => $baseUrl,
                'contact' => [
                    'email' => $this->scopeConfig->getValue('trans_email/ident_general/email')
                ]
            ],
            'capabilities' => ['browse', 'search'],
            'policies' => [
                'returns_url' => $baseUrl . 'returns',
                'shipping_url' => $baseUrl . 'shipping-policy',
                'privacy_url' => $baseUrl . 'privacy-policy'
            ],
            'service_bindings' => [
                [
                    'type' => 'REST',
                    'base_url' => $baseUrl . 'rest/V1'
                ],
                [
                    'type' => 'GraphQL',
                    'base_url' => $baseUrl . 'graphql'
                ]
            ]
        ];

        $result = $this->jsonFactory->create();
        $result->setHeader('Access-Control-Allow-Origin', '*');
        $result->setData($profile);
        
        return $result;
    }
}
7Enable the Module
# Enable the module
bin/magento module:enable Vendor_Ucp

# Run setup upgrade
bin/magento setup:upgrade

# Clear cache
bin/magento cache:clean
โš ๏ธ Production Deployment For Adobe Commerce Cloud, commit the module to your repository and deploy through the standard pipeline.

GraphQL Integration

Magento's GraphQL API is ideal for AI agents. Expose your GraphQL endpoint in the UCP profile for efficient product queries.

Sample GraphQL Query for AI Agents

{
  products(search: "laptop", pageSize: 10) {
    items {
      name
      sku
      price_range {
        minimum_price {
          final_price {
            value
            currency
          }
        }
      }
      image {
        url
      }
      stock_status
    }
  }
}
๐Ÿ’ก Pro Tip Consider creating a dedicated GraphQL schema for AI agents with optimized queries for product discovery.

Multi-Store Configuration

For multi-store setups, each store view can have its own UCP profile. The module automatically uses the current store context.

Store View UCP Endpoint
Default https://store.com/.well-known/ucp
French https://store.com/fr/.well-known/ucp
German https://store.com/de/.well-known/ucp

Validate Your Implementation

Validate Your Magento Store

Check your UCP implementation and AI commerce readiness.

Run Validation โ†’

Common Issues & Solutions

Issue Solution
404 on /.well-known/ucp Run bin/magento cache:clean and check routes.xml
Module not loading Run bin/magento setup:upgrade
Empty store name Configure store name in Stores โ†’ Configuration โ†’ General
Varnish caching issues Add /.well-known/ucp to cache bypass rules

๐Ÿค– Test with AI Agents

Run AI Agent Simulation

Test how AI shopping agents will interact with your Magento store.

Open Simulator โ†’

Resources