Juniper Commerce Docs
Everything you need to understand the onX standard, build your adapter, integrate with UCP, and validate conformance.
Getting Started
The onX (Order Network eXchange) standard defines a common MCP (Model Context Protocol) interface for commerce fulfillment operations. Any AI platform can connect to any onX-compliant adapter using a single, consistent protocol.
1. Clone and run this reference app
The onX standard is developed by the Commerce Operations Foundation . Source code: mcp-reference-server on GitHub .
git clone https://github.com/commerce-operations-foundation/mcp-reference-server cd mcp-reference-server/juniper-app npm install npm run dev # → http://localhost:3000
2. Run the MCP server
cd ../server npm install && npm run build ADAPTER_TYPE=built-in ADAPTER_NAME=mock node dist/index.js
3. Test conformance
npx onx-conform --endpoint http://localhost:3000 # Runs 17 tests across 5 suites # Outputs pass/fail report to console
src/lib/onx-client.ts.Architecture
The onX standard uses the Model Context Protocol (MCP) over stdio transport. Adapters implement the IFulfillmentAdapter interface and expose 12 operations.
The 12 Operations
get-productsList product catalogget-product-variantsList SKUs & optionsget-inventoryStock levels by SKU/locationget-customersCustomer lookupget-ordersOrder history & filteringcreate-sales-orderPlace a new orderupdate-orderModify an existing ordercancel-orderCancel with reasonfulfill-orderShip with trackingget-fulfillmentsFulfillment statuscreate-returnInitiate return/RMAget-returnsReturn historyThree-Layer Architecture
Protocol Layer (MCP SDK, stdio transport)
↓
Service Layer (ServiceOrchestrator, Validator, ErrorHandler)
↓
Adapter Layer (IFulfillmentAdapter implementations)onx-client.ts shows how to consume these operations from a Next.js application. In a real deployment, replace the in-memory calls with HTTP/stdio calls to a running MCP server.Build Your Adapter
An adapter wraps your fulfillment system (Shopify, NetSuite, custom WMS, etc.) and implements the onX interface. Use the template from adapter-template/ as your starting point.
Step 1: Scaffold
cp -r adapter-template my-adapter cd my-adapter npm install # Edit src/adapter.ts
Step 2: Implement the interface
import { IFulfillmentAdapter } from '@onx/server';
export class MyAdapter implements IFulfillmentAdapter {
async getOrders(params) {
// Fetch from your system
const orders = await myAPI.listOrders(params);
// Return in onX format
return { items: orders.map(toOnXOrder), total: orders.length };
}
async createSalesOrder(input) {
const order = await myAPI.createOrder(input);
return toOnXOrder(order);
}
// ... implement all 12 operations
}Step 3: Configure and test
# Set your adapter as the MCP server adapter ADAPTER_TYPE=local ADAPTER_PATH=./dist/adapter.js node server/dist/index.js # Run conformance to verify npx onx-conform --endpoint http://localhost:3000
Step 4: Publish to npm
npm publish --access public # Consumers can then use: # ADAPTER_TYPE=npm ADAPTER_PACKAGE=@myco/onx-adapter
schemas/. The conformance runner validates your adapter against these schemas automatically.UCP Integration
The Universal Commerce Protocol (UCP) lets AI platforms discover and consume your commerce capabilities via a standardized manifest. This app implements the full UCP bridge.
Discovery Manifest
Expose your capabilities at /.well-known/ucp:
{
"version": "1.0",
"name": "My Store",
"baseUrl": "https://store.example.com",
"capabilities": [
{
"id": "dev.ucp.shopping.catalog",
"type": "catalog",
"endpoint": "/api/ucp/catalog",
"methods": ["GET", "POST"]
},
{
"id": "dev.ucp.shopping.checkout",
"type": "checkout",
"endpoint": "/api/ucp/checkout",
"methods": ["POST"]
}
],
"auth": {
"type": "apiKey",
"apiKeyHeader": "Authorization"
}
}Request/Response Flow
AI Platform → POST /.well-known/ucp discovery
AI Platform → GET /api/ucp/catalog?query=jacket
AI Platform → POST /api/ucp/checkout { items, customer, address }
→ translates to onX create-sales-order
→ returns { orderId, status, total }
AI Platform → GET /api/ucp/fulfillment?orderId=X
→ translates to onX get-fulfillments
→ returns { orderId, status, trackingNumbers }Conformance Testing
The conformance runner validates that any onX endpoint meets the standard. Run it from the web UI or via CLI.
CLI Usage
# Run against any endpoint npx onx-conform --endpoint http://localhost:3000 # With JSON output npx onx-conform --endpoint http://localhost:3000 --json # Run specific suite only npx onx-conform --endpoint http://localhost:3000 --suite catalog