> ## Documentation Index
> Fetch the complete documentation index at: https://developers.fd.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> Let AI agents buy from your store and pay with stablecoins, powered by Prism and x402.

Universal Commerce Protocol (UCP) is an open standard that gives AI agents a shared way to discover merchants, browse catalogs, build carts, and pay. Prism handles the payment side: it exposes a ready-to-use handler, generates x402 payment requirements for each order, and settles the signed payment on-chain.

```mermaid theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
sequenceDiagram
    participant P as Platform (Agent)
    participant M as Merchant
    participant Pr as Prism

    P->>M: GET /.well-known/ucp
    M->>Pr: GET /api/v2/merchant/ucp/handlers
    Pr-->>M: xyz.fd.prism_payment handler definition
    M-->>P: UCP profile with payment handler

    P->>M: POST /checkout-sessions
    M->>Pr: POST /api/v2/merchant/ucp/payment-requirements
    Pr-->>M: x402 paymentRequirements (per chain/token)
    M-->>P: Session with handler config

    Note over P: Agent Wallet signs x402 authorization

    P->>M: POST /checkout-sessions/{id}/complete
    M->>Pr: POST /api/v2/payment/settle
    Pr-->>M: { success: true, transaction: "0x..." }
    M-->>P: Order confirmed with txHash
```

## What Prism Does

1. **Advertise**. Prism gives merchants a `xyz.fd.prism_payment` handler to drop into their UCP profile. Chains, tokens, and settlement settings live in the Prism Console.
2. **Prepare**. At checkout, Prism returns the x402 payment requirements for the order, with the correct token amounts and contract addresses already resolved.
3. **Settle**. The merchant forwards the agent's signed credential to Prism. Prism verifies it, executes the on-chain transfer, and returns the transaction hash.

<CardGroup cols={3}>
  <Card title="For Merchants" icon="store" href="/prism/integrations/ucp/merchants">
    Add the Prism handler, prepare checkout sessions, and settle agent payments
  </Card>

  <Card title="For Agents" icon="robot" href="/prism/integrations/ucp/agents">
    Discover UCP merchants, sign x402 payments, and complete checkout cleanly
  </Card>

  <Card title="End-to-End Flow" icon="route" href="/prism/integrations/ucp/flows">
    Follow one complete purchase from discovery to on-chain settlement
  </Card>
</CardGroup>
