Skip to main content

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 PaymentSettledV2 receipt 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

PackagePurpose
packages/sdk-tsCore TypeScript SDK (@bnbpay/sdk, re-exported as @pepaylabs/bnbpay)
packages/x402flexHTTP 402 helpers (@bnbpay/x402flex, re-exported as @pepaylabs/x402flex)
bnbpay-apiIndexer + REST API + relay endpoints
contracts/paymentsRouter + X402FlexRegistry
contracts/subscriptionsSubscriptionManager contract
mcp-serverAgent-facing tools (Claude/Codex)
bnbpay-wp-woocommerce-extensionWooCommerce payment gateway

Next steps

  1. Quickstart – run a full invoice → payment → confirmation loop.
  2. Payments – understand router-only settlement and scheme coverage.
  3. API + SDK – choose whether to call the REST API directly or via createApiClient.
  4. x402Flex – ship HTTP 402 flows for API monetization.