PHP: the botmetria/ucp SDK

WooCommerce and a feed storefront — 15 minutes · SDKs — about an hour · 4 ways · not just WordPress

A custom store or Laravel — agentic commerce plugs in with a Composer package and ~50 lines of adapter. MIT, zero dependencies, PHP ≥ 8.1.

Install

composer require botmetria/ucp

Quick start

Two lines at the very top of your front controller (index.php), before your routing:

use Botmetria\Ucp\Ucp;
use Botmetria\Ucp\ArrayProductProvider;

$ucp = new Ucp([
    'store_name' => 'My Shop',
    'store_url'  => 'https://my-shop.com/',
    'currency'   => 'EUR',
    'products'   => new MyProducts(),  // ProductProviderInterface
    // 'cart'    => new MyCart(),      // CartProviderInterface: agent checkout
]);
$ucp->run(); // serves /.well-known/ucp and /ucp/v1/*

Two levels — one package

Storefront (catalog only)

Implement ProductProviderInterface — agents see your catalog, the manifest honestly reports checkout:false.

Full checkout

Add CartProviderInterface::fill() — the agent builds a cart, the shopper pays in your native checkout.

Frameworks

Laravel — a middleware in the global stack; Slim/Mezzio — a PSR-15 middleware; plain PHP — $ucp->run() in the front controller. Examples live in the package README.

Analytics on PHP

To count AI bots, drop in the PHP collector from your dashboard (section “Connection”). Honest note: on PHP the collector counts traffic but does not block — blocking works in the WooCommerce plugin and the Node collector.

Verify

The manifest on your domain plus the live purchase demo:

curl https://your-store.com/.well-known/ucp

Package and sources: Packagist · GitHub · UCP spec & self-hosting