Overview
X402Flex standardize x402 payments across EVM chains supporting multiple payments, agentic sessions, and subscriptions so humans and agents share one canonical payment playbook.
What you get
- Router-only settlement with a single
PaymentSettledV2receipt schema. - SDK-first integration via
@pepaylabs/bnbpay(compat:@bnbpay/sdk). - x402Flex middleware via
@pepaylabs/x402flex(compat:@bnbpay/x402flex). - API + relay services for invoices, sessions, and gift cards.
- Agent readiness (MCP server + x402 reference tooling).
Core primitives
- PaymentIntent – typed struct executed by the router (
paymentId, merchant, token, amount, deadline, payer,resourceId,referenceHash,nonce). - FlexWitness – witness that binds scheme + payer to the intent hash.
- ResourceId – deterministic hash of
chainId + merchant + token + amount + referenceId + salt. - SchemeId – keccak of scheme string (
exact:evm:permit2,push:evm:direct, ...). - Reference tags – session and resource tags appended to reference strings for SessionGuard accounting.
Docs focus
These docs are SDK- and API-centric (payment + x402 patterns), not UI component guidance.
Docs navigation
Repo map
| Package | Purpose |
|---|---|
packages/sdk-ts | Core TypeScript SDK (@bnbpay/sdk, re-exported as @pepaylabs/bnbpay) |
packages/x402flex | HTTP 402 helpers (@bnbpay/x402flex, re-exported as @pepaylabs/x402flex) |
bnbpay-api | Indexer + REST API + relay endpoints |
contracts/payments | Router + X402FlexRegistry |
contracts/subscriptions | SubscriptionManager contract |
mcp-server | Agent-facing tools (Claude/Codex) |
bnbpay-wp-woocommerce-extension | WooCommerce payment gateway |
Next steps
- Quickstart – run a full invoice → payment → confirmation loop.
- Payments – understand router-only settlement and scheme coverage.
- API + SDK – choose whether to call the REST API directly or via
createApiClient. - x402Flex – ship HTTP 402 flows for API monetization.