PHPackages                             mahesh-rajawat/module-agentic-ucp-checkout - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. mahesh-rajawat/module-agentic-ucp-checkout

ActiveMagento2-module[Payment Processing](/categories/payments)

mahesh-rajawat/module-agentic-ucp-checkout
==========================================

Universal Commerce Protocol (UCP) checkout module for Magento 2 — catalog, cart, shipping, billing, order, and tracking endpoints

1.0.0(3mo ago)021MITPHPPHP &gt;=8.1.0

Since Apr 19Pushed 3mo agoCompare

[ Source](https://github.com/mahesh-rajawat/magento-module-agentic-commerce-checkout)[ Packagist](https://packagist.org/packages/mahesh-rajawat/module-agentic-ucp-checkout)[ Docs](https://github.com/mahesh-rajawat/magento2-ucp-agentic)[ RSS](/packages/mahesh-rajawat-module-agentic-ucp-checkout/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

MSR\_AgenticUcpCheckout
=======================

[](#msr_agenticucpcheckout)

Companion module to **MSR\_AgenticUcp** that gives AI agents a complete REST API for e-commerce: browse the catalog, manage a guest cart, go through checkout, place orders, and track shipments — all over a single UCP-authenticated session.

---

Requirements
------------

[](#requirements)

DependencyVersionMagento Open Source / Adobe Commerce2.4.6+PHP8.1+MSR\_AgenticUcp1.0.0+---

Installation
------------

[](#installation)

```
php bin/magento module:enable MSR_AgenticUcpCheckout
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:flush
```

---

How it works
------------

[](#how-it-works)

Every request must carry a Bearer token obtained from `POST /rest/V1/ucp/auth` (provided by MSR\_AgenticUcp). The token encodes the agent's DID, which is used to maintain an isolated guest cart for each agent identity across requests.

```
Agent  →  POST /V1/ucp/auth          →  Bearer token
Agent  →  GET  /V1/ucp/catalog       →  browse products
Agent  →  POST /V1/ucp/cart          →  add item
Agent  →  POST /V1/ucp/checkout/shipping  →  set address + method
Agent  →  POST /V1/ucp/order         →  place order (requires human confirmation header)
Agent  →  GET  /V1/ucp/order/:id     →  track order

```

---

REST API
--------

[](#rest-api)

All routes are under `/rest/V1/ucp/`.

### Catalog

[](#catalog)

MethodEndpointDescriptionGET`/V1/ucp/catalog`Browse products. Optional `pageSize` param (default 10). Returns name, SKU, price, special price, tier prices, stock status.GET`/V1/ucp/search`Full-text product search. Required `q` param.### Cart

[](#cart)

MethodEndpointDescriptionGET`/V1/ucp/cart`View cart contents, item list, subtotal, grand total.POST`/V1/ucp/cart`Add item. Body: `{ "sku": "SKU-001", "qty": 2 }`. Creates cart automatically.DELETE`/V1/ucp/cart/:itemId`Remove one line item by cart item ID.DELETE`/V1/ucp/cart`Clear the entire cart.### Checkout

[](#checkout)

MethodEndpointDescriptionPOST`/V1/ucp/checkout/shipping`Set shipping address and method. Pass `billing_same_as_shipping: true` (default) to copy to billing.POST`/V1/ucp/checkout/billing`Set a separate billing address (only when different from shipping).GET`/V1/ucp/checkout/shipping-methods`List available shipping methods with carrier, code, label, and cost.GET`/V1/ucp/checkout/payment-methods`List available payment methods with code and title.GET`/V1/ucp/checkout/totals`Full totals: subtotal, shipping, tax, discount, grand total, currency.### Order

[](#order)

MethodEndpointDescriptionPOST`/V1/ucp/order`Place the order. Requires `X-UCP-Human-Confirmation` header. Body: `{ "payment_method_code": "checkmo", "email": "customer@example.com" }`.GET`/V1/ucp/order/:orderId`Track by increment ID (e.g. `000000001`) or numeric order ID. Returns status, shipping address, tracking numbers, items.### Inventory

[](#inventory)

MethodEndpointDescriptionGET`/V1/ucp/inventory`Check stock. `?sku=SKU-001` or `?sku=SKU-001,SKU-002`. Returns in-stock flag and qty per SKU.---

Example: full checkout flow
---------------------------

[](#example-full-checkout-flow)

```
TOKEN="Bearer "

# Browse
curl -s "$STORE/rest/V1/ucp/catalog" -H "Authorization: $TOKEN"

# Add to cart
curl -s -X POST "$STORE/rest/V1/ucp/cart" \
  -H "Authorization: $TOKEN" -H "Content-Type: application/json" \
  -d '{"sku":"24-MB01","qty":1}'

# Set shipping (billing copied automatically)
curl -s -X POST "$STORE/rest/V1/ucp/checkout/shipping" \
  -H "Authorization: $TOKEN" -H "Content-Type: application/json" \
  -d '{"firstname":"Jane","lastname":"Doe","street":"123 Main St",
       "city":"Austin","region_code":"TX","postcode":"78701",
       "country_id":"US","telephone":"5125550100",
       "shipping_method_code":"flatrate_flatrate",
       "billing_same_as_shipping":true}'

# Place order (human confirmation required)
CONFIRM=$(echo -n "confirm-$(date +%s)" | base64)
curl -s -X POST "$STORE/rest/V1/ucp/order" \
  -H "Authorization: $TOKEN" -H "Content-Type: application/json" \
  -H "X-UCP-Human-Confirmation: $CONFIRM" \
  -d '{"payment_method_code":"checkmo","email":"jane@example.com"}'

# Track
curl -s "$STORE/rest/V1/ucp/order/000000001" -H "Authorization: $TOKEN"
```

---

Session management
------------------

[](#session-management)

`Model/Cart/SessionManager` maintains an isolated guest cart per agent identity. The agent DID is extracted from the Bearer token's `sub`claim and hashed with SHA-256 to form a cache key with a 24-hour TTL. This means each registered agent always resumes its own cart, even across separate HTTP requests.

---

Module structure
----------------

[](#module-structure)

```
MSR/AgenticUcpCheckout/
├── Api/
│   ├── Data/                  # Data transfer object interfaces
│   │   ├── CartItemInterface.php
│   │   ├── CartSummaryInterface.php
│   │   ├── OrderResultInterface.php
│   │   └── ShippingAddressInterface.php
│   ├── UcpCatalogInterface.php
│   ├── UcpCartInterface.php
│   ├── UcpCheckoutInterface.php
│   ├── UcpOrderInterface.php
│   └── UcpInventoryInterface.php
├── Model/
│   ├── Cart/
│   │   └── SessionManager.php  # Per-agent cart isolation
│   ├── Data/                   # DTO implementations
│   ├── UcpCatalog.php
│   ├── UcpCart.php
│   ├── UcpCheckout.php
│   ├── UcpOrder.php
│   └── UcpInventory.php
├── Plugin/
│   └── AgentPolicyGuardCheckout.php
├── etc/
│   ├── di.xml
│   ├── module.xml
│   └── webapi.xml
├── CHANGELOG.md
└── README.md

```

---

See also
--------

[](#see-also)

- `MSR_AgenticUcp` — core module: authentication, policy engine, admin UI, audit log
- `UCP_Testing_Guide.md` — step-by-step setup and live chat testing instructions
- `local_testing_ollama/` — terminal chat clients (`ucp_chat.py`, `ucp_chat.js`)

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance82

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

96d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/32479280?v=4)[Mahesh Singh](/maintainers/mahesh-rajawat)[@mahesh-rajawat](https://github.com/mahesh-rajawat)

---

Top Contributors

[![mahesh-singh-pinja](https://avatars.githubusercontent.com/u/136575595?v=4)](https://github.com/mahesh-singh-pinja "mahesh-singh-pinja (8 commits)")[![mahesh-rajawat](https://avatars.githubusercontent.com/u/32479280?v=4)](https://github.com/mahesh-rajawat "mahesh-rajawat (1 commits)")

---

Tags

magentoecommercecheckoutmagento2ai-agentsagentic commerceucp

### Embed Badge

![Health badge](/badges/mahesh-rajawat-module-agentic-ucp-checkout/health.svg)

```
[![Health](https://phpackages.com/badges/mahesh-rajawat-module-agentic-ucp-checkout/health.svg)](https://phpackages.com/packages/mahesh-rajawat-module-agentic-ucp-checkout)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
