# Boson Protocol Documentation — full text > The entire docs site, concatenated. For the structured index, see /llms.txt. --- # What Boson is URL: https://www.bosonprotocol.io/docs/ > Boson Protocol is a tokenized-commitment / escrow protocol for selling physical and digital goods, with first-class support for AI agents. # What Boson is Boson is a **tokenized-commitment and escrow protocol for commerce**. A seller publishes an _offer_; a buyer _commits_ to it; the protocol holds both parties' deposits in escrow until the buyer _redeems_ and the seller _delivers_. If something goes wrong, a third-party _dispute resolver_ adjudicates. What makes Boson different from a traditional payment processor: - **Non-custodial.** Funds are held by an on-chain Diamond contract, not by Boson. - **One protocol, many surfaces.** TypeScript SDK, hosted MCP server with ~56 tools, embeddable widgets, an x402 escrow stack, a WooCommerce plugin, and a hosted dApp. Pick whichever fits your stack. - **Agent-native.** Every protocol action is exposed as an MCP tool with a stable schema. Buyer and seller agents can transact autonomously. - **Multi-chain.** Deployed on Polygon, Mainnet, Base, Optimism, Arbitrum, plus matching testnets. ## Who this is for These docs are written for **two audiences in parallel**: - **Developers building human-facing apps.** Marketplaces, e-commerce sites, drop-launches, Shopify-style storefronts. Reach for the [TypeScript SDK](/tooling/core-sdk), [React Kit](/tooling/react-kit), or [embeddable widgets](/tooling/widgets). - **Developers building AI-agent apps.** Autonomous buyer or seller agents, agent-to-agent commerce, x402 payment rails. Reach for the [MCP server](/tooling/mcp) or the [x402 stack](/tooling/x402). Anything that's the same for both (offers, exchanges, disputes, networks, signing) lives once in [Protocol concepts](/concepts/model). Everything else is split by *role* (Sellers, Buyers, Dispute Resolvers, Marketplace operators) and shows you the snippet in whichever stack you're using. ## Where to go next - **Just want to ship something fast?** Pick a [Quickstart](/quickstart/ai-agent-buyer) — each one is 5–15 minutes and ends with a working prototype. - **Not sure which stack to use?** Read [Pick your integration](/pick-your-integration). - **Coming from the v2 dApp or WooCommerce plugin?** Those are still supported — see [Sell via the Boson dApp](/build/sellers/dapp) and [Sell via WooCommerce](/build/sellers/woocommerce). - **Building an agent?** Start with [Build for AI agents → Overview](/agents). - **Want the API reference?** Jump to [Reference](/reference). ## A note on terminology Boson uses a handful of jargon terms (rNFT, dACP, voucher, exchange, offer, agent-the-protocol-role vs agent-the-AI). Every term is defined once in the [Glossary](/glossary). If you see a word that's not obvious, hover the inline link or jump there directly. --- # Buy with an AI agent in 5 minutes URL: https://www.bosonprotocol.io/docs/quickstart/ai-agent-buyer > A copy-paste Vercel AI script that connects to Boson's hosted MCP server and buys a test offer on Base Sepolia. # Buy with an AI agent in 5 minutes What you'll build: a Node.js script that uses Vercel AI's SDK + the Boson GOAT plugin to autonomously buy a test offer on Base Sepolia. **Time**: 5 minutes. **Stack**: Node.js 20+, Vercel AI SDK, GOAT, viem. **Network**: Base Sepolia testnet (`configId: "staging-84532-0"`). ## 1. Get a funded testnet wallet ```bash # Generate a new private key, or use an existing one. node -e "console.log(require('viem/accounts').generatePrivateKey())" ``` Fund it with Base Sepolia ETH from any public faucet (e.g. [coinbase.com/faucets](https://www.coinbase.com/faucets/base-ethereum-sepolia-faucet)). ## 2. Set up the project ```bash mkdir boson-agent-buyer && cd boson-agent-buyer pnpm init pnpm add ai @ai-sdk/anthropic \ @bosonprotocol/agentic-commerce \ @goat-sdk/adapter-vercel-ai \ @goat-sdk/wallet-viem \ viem ``` Set two env vars: ```bash export ANTHROPIC_API_KEY="sk-ant-..." export PRIVATE_KEY="0x..." ``` ## 3. The script ```ts twoslash // @noErrors // agent.ts import { generateText } from "ai" import { anthropic } from "@ai-sdk/anthropic" import { bosonProtocolPlugin } from "@bosonprotocol/agentic-commerce" import { getOnChainTools } from "@goat-sdk/adapter-vercel-ai" import { viem } from "@goat-sdk/wallet-viem" import { createWalletClient, http } from "viem" import { baseSepolia } from "viem/chains" import { privateKeyToAccount } from "viem/accounts" const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`) const walletClient = createWalletClient({ account, chain: baseSepolia, transport: http(), }) const tools = await getOnChainTools({ wallet: viem(walletClient), plugins: [ bosonProtocolPlugin({ url: "https://mcp-staging.bosonprotocol.io/mcp", }), ], }) const result = await generateText({ model: anthropic("claude-sonnet-4-6"), tools, maxSteps: 12, system: ` You are a Boson Protocol buyer agent on Base Sepolia (configId staging-84532-0). Find an available test offer with a low price, commit to it, and report the exchangeId. Do not redeem; just commit. `, prompt: "Find and commit to one test offer.", }) console.log(result.text) ``` Run it: ```bash pnpm tsx agent.ts ``` ## What you should see The agent will: 1. Call `get_offers` to find available offers. 2. Pick one, call `get_supported_tokens` to confirm the payment token. 3. If it's an ERC-20 offer, call `approve_exchange_token`. 4. Call `commit_to_offer`, receive the unsigned tx, sign locally, broadcast. 5. Report the new `exchangeId`. Expected output: ``` Found offer 123 at 0.001 USDC. Approving USDC… approved. Committing… committed. Your new exchange: 456. ``` ## What just happened - The GOAT plugin pulled all 56 MCP tools from the hosted server and registered them with the model. - Every state-changing tool returned an _unsigned_ transaction; the wallet you passed in signed and broadcast each one. - The model orchestrated the calls — choosing the offer, approving the token, committing — without you writing flow logic. ## Common gotchas - **No offers found.** The staging environment may be empty. Create your own with [Quickstart → Build a marketplace](/quickstart/marketplace) first. - **`InvalidExchangeState` on commit.** The offer was voided or sold out between query and commit. Retry; see [Build for AI agents → Idempotency & retry](/agents/idempotency). - **Subgraph lag.** If you immediately try to read the new exchange you may get nothing for 1–3 blocks. See [Concepts → Eventing & indexing](/concepts/eventing). ## Next - [Build for AI agents → Overview](/agents) — patterns for production agents. - [Build for AI agents → The 3-step signing pattern](/agents/signing) — what's happening under the hood. - [Reference → MCP tools](/reference/mcp-tools) — every tool's schema. --- # Embed a commit button in 5 minutes URL: https://www.bosonprotocol.io/docs/quickstart/commit-button > Drop a working Boson Commit Widget into any web page with a script tag. # Embed a commit button in 5 minutes What you'll build: a working "Buy now" button on an existing webpage that triggers the Boson commit flow. No SDK, no React, no build step. **Time**: 5 minutes. **Stack**: any HTML page. **Network**: staging (Base Sepolia) by default. ## 1. Find your seller ID and product UUID If you already have a seller account, look up your `sellerId` and the `productUuid` of the offer you want to sell — for example via the Boson dApp or via: ```ts const offers = await sdk.getOffers({ where: { seller: yourAddress } }) ``` If you don't yet have a seller account, do [Quickstart → Build a marketplace](/quickstart/marketplace) first, or use a public test seller / product (see staging seed data in the [agent-builder repo](https://github.com/bosonprotocol/agent-builder)). ## 2. Drop in the HTML ```html