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

# Examples

> The two integrations you can copy: an agent that signs a voucher, and a merchant that captures it.

## Agent

Connect hosted MCP using setup-staging (`https://agents.sohopay.ai/skills/v1/setup-staging.md`). On `VOUCHER_ISSUED`, sign with [`@sohopay/agent-signer`](/sdks/agent-signer) and return `PAYMENT-SIGNATURE` to the merchant. The sequence, including which failures reuse the same idempotency key, is [Payment flow](/guides/payment-flow.md).

Reference merchant apps in the SohoPay GitHub organization (`sohopay-merchant-demo`, `x402-merchant-demo`) show the server side on Base Sepolia. Prefer their capture code over any markdown in those repos that still says `POST /settle`.

## Merchant

```bash
curl -X POST https://staging.api.sohopay.ai/api/v1/facilitator/capture \
  -H "Authorization: Bearer $SOHO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{"x402Version":2,"paymentPayload":{}}'
```

Replace `paymentPayload` with the envelope the agent submitted. Then poll `GET /api/v1/facilitator/settle/status/by-payment/$PAYMENT_ID` until `CONFIRMED`.

## Next steps

> [card] [Testing](/guides/testing.md)
>
> The staging checklist.

> [card] [OpenAPI](/sdks/openapi-tools.md)
>
> Generate a merchant client from the facilitator spec.
