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

# Examples

> Runnable examples for every SDK operation.

The [x402r-sdk repository](https://github.com/BackTrackCo/x402r-sdk/tree/main/examples) ships runnable example scripts organized by role plus end-to-end scenarios.

## Examples

<CardGroup cols={2}>
  <Card title="payer" icon="user" href="https://github.com/BackTrackCo/x402r-sdk/tree/main/examples/payer">
    Request a refund, freeze a payment, submit on-chain evidence (a placeholder CID; the integrator owns IPFS pinning). Three TypeScript scripts.
  </Card>

  <Card title="merchant" icon="store" href="https://github.com/BackTrackCo/x402r-sdk/tree/main/examples/merchant">
    Capture from escrow and charge directly. TypeScript scripts plus README.
  </Card>

  <Card title="arbiter" icon="gavel" href="https://github.com/BackTrackCo/x402r-sdk/tree/main/examples/arbiter">
    Approve a refund, review on-chain evidence, distribute protocol fees.
  </Card>

  <Card title="scenarios" icon="route" href="https://github.com/BackTrackCo/x402r-sdk/tree/main/examples/scenarios">
    End-to-end runners: happy-path capture, dispute resolution, atomic charge, partial refund flow. Wires payer + merchant + arbiter together against a local Anvil fork.
  </Card>

  <Card title="shared" icon="share-nodes" href="https://github.com/BackTrackCo/x402r-sdk/tree/main/examples/shared">
    Shared setup utilities: Anvil-fork bootstrap, constants, common types.
  </Card>
</CardGroup>

## Running examples

<Info>
  All examples run against a local Anvil fork seeded by `shared/anvil-setup.ts`. You do not need a mainnet wallet or funding.
</Info>

<CodeGroup>
  ```bash pnpm theme={null}
  git clone https://github.com/BackTrackCo/x402r-sdk.git
  cd x402r-sdk
  pnpm install && pnpm build
  ```

  ```bash bun theme={null}
  git clone https://github.com/BackTrackCo/x402r-sdk.git
  cd x402r-sdk
  bun install && bun run build
  ```
</CodeGroup>

The SDK uses pnpm workspaces (`pnpm@10.23.0`). The `npm` runtime is fine for application code that consumes published `@x402r/*` packages, but the workspace clone above expects pnpm or a workspace-aware install.

See each example directory's README on GitHub for the exact run command for that script.

## Next steps

<CardGroup cols={2}>
  <Card title="Deploy an operator" icon="rocket" href="/sdk/deploy-operator">
    Walk through `deployMarketplaceOperator()` and `deployDeliveryProtectionOperator()`.
  </Card>

  <Card title="forwardToArbiter()" icon="wrench" href="/sdk/helpers/forward-to-arbiter">
    Forward `auth-capture` settlements to an arbiter service.
  </Card>

  <Card title="GitHub" icon="github" href="https://github.com/BackTrackCo/x402r-sdk/tree/main/examples">
    Browse every example.
  </Card>
</CardGroup>
