StateSet iCommerce Engine
Infrastructure for autonomous commerce. Embedded engine, verifiable sync, on-chain settlement, x402 payments, and multi-channel messaging.Skill Files
| File | URL |
|---|---|
| SKILL.md (this file) | https://doc.stateset.com/stateset-icommerce-skill.md |
API Base URLs
| Service | Base URL | Purpose |
|---|---|---|
| Commerce Engine | Local (embedded) | Core commerce operations (orders, products, customers) |
| Sequencer | https://api.sequencer.stateset.app/v1 | VES event ordering, proofs, commitments |
| VES (Sequencer) | https://api.sequencer.stateset.app/v1/ves | VES v1.0 protocol endpoints |
| x402 Payments | https://api.sequencer.stateset.app/v1/x402 | Payment intents, batches, settlements |
Architecture Overview
StateSet iCommerce is a five-layer infrastructure stack:| Layer | Component | Function |
|---|---|---|
| Compute | stateset-embedded | In-process commerce engine |
| Coordination | stateset-sequencer | Distributed event ordering |
| Settlement | Set Chain (L2) | On-chain verification |
| Payments | x402 Protocol | HTTP-native stablecoin payments |
| Communication | Messaging Gateway | 9-channel agent interaction |
Install the CLI
~/.config/stateset/config.json:
Initialize the Engine
Create a new commerce database:~/.stateset/commerce.db with:
- SQLite database with 70+ tables
- Demo data (customers, products, inventory)
- Sync outbox ready for VES
Authentication
Commerce operations run locally via the embedded engine. Sequencer API requests require your API key:Agent Registration
AI agents must register with the sequencer to receive an API key for authentication.Register a New Agent
apiKey securely. It is only returned once and cannot be retrieved later.
Registration Options
| Field | Type | Description |
|---|---|---|
name | string | Human-readable agent name (required) |
description | string | Agent purpose description |
tenantId | UUID | Join existing tenant (optional) |
storeIds | UUID[] | Restrict to specific stores |
readOnly | boolean | Read-only permissions (default: false) |
admin | boolean | Admin permissions (default: false) |
rateLimit | number | Requests per minute limit |
Get Agent Details
Create Additional API Keys
List API Keys
Revoke an API Key
Register Signing Key (for VES Events)
After registration, agents should register an Ed25519 signing key for VES event signatures:Core Operations
Customers
Products
Inventory
Orders
Returns
Checkout Flow
Cart Operations
Complete Checkout Flow
x402 Payments
HTTP-native stablecoin micropayments between AI agents.Supported Networks
| Network | Chain ID | Assets | Status |
|---|---|---|---|
| Set Chain | 84532001 | ssUSD, USDC | Production |
| Base | 8453 | USDC | Production |
| Ethereum | 1 | USDC, USDT | Production |
| Arbitrum | 42161 | USDC | Production |
| Optimism | 10 | USDC | Production |
| Solana | — | USDC | Production |
Create Payment Intent
Check Balance
Payment Flow
Verifiable Event Sync (VES)
Multi-agent coordination with cryptographic proofs.Check Sync Status
Push Events
Pull Events
Full Sync
View Outbox
Entity History
Sequencer API Reference
The StateSet Sequencer provides deterministic event ordering with cryptographic proofs for multi-agent coordination. Base URL:https://api.sequencer.stateset.app
Authentication
All sequencer requests require Bearer token authentication:Event Ingestion
Ingest VES Events (Recommended)Events & Head
VES Commitments
VES Validity Proofs (STARK ZK Proofs)
VES Compliance Proofs (Per-Event Encrypted)
Inclusion Proofs
On-Chain Anchoring
Agent Key Management
Schema Registry
x402 Sequencer Payments
Health & Status
Legacy Endpoints
Agent Integration Patterns
Full Sync Flow for Agents
Multi-Agent Coordination
MCP Tool Integration
The CLI exposes 700+ commerce operations via MCP for AI agents.Start MCP Server
Tool Categories
| Domain | Examples |
|---|---|
| Customers | list_customers, get_customer, create_customer |
| Orders | create_order, ship_order, cancel_order |
| Products | list_products, create_product |
| Inventory | get_stock, adjust_inventory, reserve_inventory |
| Returns | create_return, approve_return |
| Carts | create_cart, add_cart_item, checkout |
| Payments | create_payment, process_refund |
| Analytics | get_sales_summary, get_demand_forecast |
| Sync | sync_status, sync_push, sync_pull |
Permission Model
Multi-Channel Messaging
Supported Channels
| Channel | Protocol | Status |
|---|---|---|
| Cloud API | GA | |
| Telegram | Bot API | GA |
| Discord | Gateway + REST | GA |
| Slack | Events + Web API | GA |
| Signal | signal-cli | GA |
| Google Chat | Spaces API | GA |
| WebChat | WebSocket | GA |
| iMessage | AppleScript | Experimental |
| Teams | Bot Framework | Experimental |
Launch Channels
Configuration
Create~/.stateset/channels.json:
Warehouse Operations
Warehouse Management
Fulfillment
Receiving
Financial Operations
General Ledger
Accounts Receivable
Accounts Payable
Vector Search
Hybrid semantic + BM25 search across commerce entities.Heartbeat Monitor
Proactive health checking for commerce operations.Built-in Checkers
| Checker | Trigger | Action |
|---|---|---|
low-stock | Stock below threshold | Alert, auto-reorder |
abandoned-carts | Cart idle > timeout | Recovery notification |
revenue-milestone | Target reached/missed | Dashboard alert |
pending-returns | Return aging > days | Escalation |
overdue-invoices | Invoice past due | Collection notification |
subscription-churn | Cancellation spike | Retention campaign |
CLI
Skills System
38 built-in skills covering the full commerce lifecycle.Install Skills
Skill Categories
Core Commerce:- commerce-engine-setup
- commerce-embedded-sdk
- commerce-customers
- commerce-products
- commerce-orders
- commerce-checkout
- commerce-payments
- commerce-inventory
- commerce-shipments
- commerce-returns
- commerce-backorders
- commerce-fulfillment
- commerce-receiving
- commerce-warehouse
- commerce-lots-and-serials
- commerce-invoices
- commerce-tax
- commerce-currency
- commerce-accounts-payable
- commerce-accounts-receivable
- commerce-cost-accounting
- commerce-credit
- commerce-general-ledger
- commerce-sync
- commerce-autonomous-engine
- commerce-vector-search
- commerce-mcp-tools
Language Bindings
The Rust core compiles to 10 target runtimes:| Runtime | Technology | Use Case |
|---|---|---|
| Native Rust | Direct linking | High-performance backends |
| Node.js | NAPI-RS | JavaScript/TypeScript |
| Python | PyO3 | Data science, ML |
| Browser | wasm-pack | Client-side |
| Ruby | Magnus | Rails |
| PHP | ext-php-rs | Laravel/WordPress |
| Java | JNI | Enterprise JVM |
| Kotlin | JNI | Android, server |
| Swift | C FFI | iOS/macOS |
| .NET/C# | P/Invoke | ASP.NET, Unity |
| Go | cgo | Go microservices |
Node.js Example
Python Example
Response Format
Success:Rate Limits
| Limit | Value |
|---|---|
| API requests | 1000/minute |
| Write operations | 100/minute |
| Sync operations | 10/minute |
| Vector search | 100/minute |
System Statistics
| Component | Metric | Value |
|---|---|---|
| stateset-core | Lines of Code | ~45,000 |
| stateset-db | Lines of Code | ~55,000 |
| stateset-embedded | Lines of Code | ~39,000 |
| stateset-sequencer | Lines of Code | ~33,000 |
| Total Rust | Lines of Code | ~172,000 |
| Domain Modules | Count | 32 |
| Domain Types | Count | 400+ |
| Database Tables | Count | 70+ |
| Commerce API Methods | Count | 700+ |
| Sequencer API Endpoints | Count | 40+ |
| Language Bindings | Count | 10 |
| Commerce Skills | Count | 38 |
| Messaging Channels | Count | 9 |
Everything You Can Do
| Action | What it does |
|---|---|
| Create orders | Process commerce transactions |
| Manage inventory | Track stock, reservations, adjustments |
| Process returns | Handle RMAs and refunds |
| Run fulfillment | Pick, pack, ship workflows |
| Accept payments | x402 stablecoin payments |
| Sync events | VES multi-agent coordination via sequencer |
| Generate proofs | Merkle inclusion + STARK ZK proofs |
| Anchor on-chain | Set Chain L2 commitment anchoring |
| Register schemas | Event type validation |
| Search products | Hybrid semantic + keyword search |
| Message customers | 9-channel omnichannel support |
| Run analytics | Sales reports, forecasts |
| Manage finances | GL, AP, AR, tax |
Quick Reference
CLI Commands
Sequencer API Quick Reference
Ideas to Try
- Register your AI agent with the sequencer to get an API key
- Set up the embedded engine with demo data
- Create a multi-step order flow with cart → checkout → fulfillment
- Configure VES sync between multiple agents using the sequencer
- Enable x402 payments for agent-to-agent commerce
- Ingest events and generate inclusion proofs via sequencer API
- Anchor commitments on-chain and verify with STARK proofs
- Register custom event schemas for domain-specific events
- Set up WhatsApp or Discord for customer support
- Run vector search for product discovery
- Configure heartbeat monitors for low-stock alerts
- Build a storefront with
stateset scaffold
StateSet iCommerce v0.3.2 January 2026