---
title: x402 and the Payments SDK
description: How merchants use @0xcurvy/payments-sdk on the exact x402 rail; shoppers use a standard x402 client.
---

# x402 and the Payments SDK

On the exact x402 rail, roles split like this:

| Role | Responsibility | Package |
| --- | --- | --- |
| Shopper (agent) | Answers HTTP 402 with EIP-3009 / `PAYMENT-SIGNATURE` | Standard `@x402/*` client (not Payments SDK) |
| Resource server | Issues challenges, talks to Curvy’s facilitator, confirms shield evidence | `@0xcurvy/payments-sdk` + `@0xcurvy/x402-protocol` |
| Facilitator | Verify, settle, submit shield | Curvy proprietary service |

Copyable merchant reference in this monorepo: `packages/merchant/merchant-x402-exact`. Human-checkout helpers (`signPaymentIntent`, `buildCheckoutUrl`, …) are not part of this rail — see [Human checkout](./human-checkout).

## Tests

- Unit (mocked chain, Payments SDK only): `pnpm --filter @0xcurvy/payments-sdk test` — includes `x402-merchant` cases for challenge note derivation, facilitator-recovery portal prediction, and shield confirmation.
- E2E (Anvil + facilitator + `merchant-x402-exact` + shopper driver): `pnpm demo:payments:x402-merchant-e2e` (documented under `packages/demo/TESTING.md`).

## Related

- [Confirming payments](./confirming-payments) — `verifyPayment` and payment references
- [API surface](./api) — all Payments SDK entry points
- `@0xcurvy/x402-protocol` — x402 wire types (not part of this package)
