Skip to main content
This page traces a complete UCP purchase from both perspectives simultaneously — what the agent sends, what the merchant does in the background, and what Prism returns at each step. Scenario: An AI agent buys one “Coldplay World Tour - Floor Standing GA” ticket ($120.00), paying in FDUSD on BSC.

1. Discovery

The agent probes the merchant’s UCP profile. The merchant fetches the current handler definition from Prism and returns it. Agent → Merchant
GET /.well-known/ucp
UCP-Agent: profile="https://platform.example/ucp/profile"
Merchant → Prism (background)
GET https://prism-gw.fd.xyz/api/v2/merchant/payment-profile
X-API-Key: prism_live_...
Agent receives:
{
  "ucp": {
    "version": "2026-01-23",
    "payment_handlers": {
      "xyz.fd.prism_payment": [
        { "id": "prism_default", "version": "2026-01-23" }
      ]
    }
  }
}
The agent confirms xyz.fd.prism_payment is present and proceeds to checkout.

2. Checkout Session

The agent sends their cart. The merchant calls Prism to get x402 payment requirements and returns them in the session. Agent → Merchant
POST /checkout-sessions
Content-Type: application/json
UCP-Agent: profile="https://platform.example/ucp/profile"

{
  "line_items": [
    { "item": { "id": "ticket_floor_ga" }, "quantity": 1 }
  ]
}
Merchant → Prism (background)
POST https://prism-gw.fd.xyz/api/v2/merchant/checkout-prepare
X-API-Key: prism_live_...
Content-Type: application/json

{
  "amount": "12000",
  "currency": "USD",
  "resource": {
    "url": "https://merchant.example/checkout-sessions/sess_abc123",
    "description": "Coldplay World Tour - Floor Standing GA"
  }
}
Agent receives:
{
  "session_id": "sess_abc123",
  "payment_handlers": {
    "xyz.fd.prism_payment": [
      {
        "id": "prism_default",
        "version": "2026-01-23",
        "config": {
          "x402Version": 2,
          "resource": {
            "url": "https://merchant.example/checkout-sessions/sess_abc123",
            "description": "Coldplay World Tour - Floor Standing GA"
          },
          "accepts": [
            {
              "scheme": "exact",
              "network": "eip155:56",
              "amount": "120000000000000000000",
              "asset": "0xaB27f55DB008704Ed8098f0dfBCf5e1aA387b9d9",
              "payTo": "0x40a01003f7543a3a3ee64fFB05504173BDb1C4fD",
              "maxTimeoutSeconds": 300,
              "extra": { "name": "First Digital USD", "version": "1" }
            },
            {
              "scheme": "exact",
              "network": "eip155:8453",
              "amount": "120000000",
              "asset": "0x036cbd53842c5426634e7929541ec2318f3dcf7e",
              "payTo": "0x40a01003f7543a3a3ee64fFB05504173BDb1C4fD",
              "maxTimeoutSeconds": 300,
              "extra": { "name": "USDC", "version": "2" }
            }
          ]
        }
      }
    ]
  }
}
The agent extracts config and passes it to the wallet.

3. Payment Authorization

The agent’s wallet receives the config as paymentRequirements. No HTTP request goes out at this step — everything happens locally inside the TEE.
Wallet receives:  config.accepts — two options (BSC FDUSD, Base USDC)
Wallet selects:   eip155:56 (BSC), FDUSD — sufficient balance available
Wallet signs:     ERC-3009 transferWithAuthorization inside the secure enclave
Wallet returns:   complete signed x402 payment object
The private key never leaves the enclave. Only the signed authorization exits.

4. Complete Checkout

The agent submits the signed wallet output verbatim as the credential. Agent → Merchant
POST /checkout-sessions/sess_abc123/complete
Content-Type: application/json
UCP-Agent: profile="https://platform.example/ucp/profile"

{
  "payment": {
    "instruments": [
      {
        "id": "wallet_bsc_fdusd",
        "handler_id": "prism_default",
        "type": "default",
        "credential": {
          "type": "default",
          "paymentPayload": {
            "signature": "0x...",
            "authorization": {
              "from":        "0xAgentWalletAddress",
              "to":          "0x40a01003f7543a3a3ee64fFB05504173BDb1C4fD",
              "value":       "120000000000000000000",
              "validAfter":  "0",
              "validBefore": "1760000000",
              "nonce":       "0x..."
            }
          },
          "paymentRequirements": { "...": "config from step 2" }
        }
      }
    ]
  }
}
Merchant → Prism (background)
POST https://prism-gw.fd.xyz/api/v2/payment/settle
X-API-Key: prism_live_...
Content-Type: application/json

{ ...credential object verbatim... }
Prism executes the ERC-3009 transferWithAuthorization on BSC, verifies the transfer, and returns:
{
  "success": true,
  "transaction": "0xe80c...674b",
  "network": "eip155:56"
}
Agent receives:
{
  "order": {
    "id": "ord_abc123",
    "status": "confirmed",
    "payment": {
      "handler_id": "prism_default",
      "status": "settled",
      "transaction": "0xe80c...674b",
      "network": "eip155:56"
    }
  }
}
The ticket is reserved. The FDUSD is on-chain. The merchant receives a settlement in local currency — no crypto required on their side.

Testing on Testnet

Use testnet chain IDs in the Prism Console during development. The Prism Gateway URL is the same for both environments. Use the Testnet Faucet to fund the agent wallet.
ChainChain ID
BSC Testneteip155:97
Arbitrum Sepoliaeip155:421614
Ethereum Sepoliaeip155:11155111
Base Sepoliaeip155:84532

Merchant Guide

Step-by-step implementation for the merchant server

Agent Guide

Step-by-step implementation for the agent platform
Last modified on March 23, 2026