Full round trip
1
Probe the endpoint
Make a normal request. A
402 response means payment is required; the body is an X402Challenge listing accepted PaymentRequirements.2
Pick a requirement your agent can pay
Filter
challenge.accepts for a scheme/network/assetId you support. XentFi’s facilitator currently supports the eip3009 scheme.3
Sign, don't call the facilitator directly
signEip3009Authorization() is pure local cryptography — it never touches the network. Your agent’s private key (or wallet adapter) never leaves the client.4
Attach and retry
Base64-encode the signed payload and send it as
X-PAYMENT. The resource server calls verify()/settle() on your behalf using its own facilitator credentials — your agent doesn’t need a XentFi API key at all to pay.Only the resource server needs a WAAS
apiKey/orgId (to verify and settle). A pure payer only needs a viem-compatible account capable of signTypedData — no XentFi credentials required.Getting the token domain right
signEip3009Authorization needs the token’s real EIP-712 domain — it must match the deployed contract exactly, or both the facilitator and the token contract itself will reject the signature.
Pull these from the merchant’s
PaymentRequirement/getSupported() response rather than hardcoding them — different tokens on different chains have different version strings, and getting it wrong produces a signature the contract silently rejects.
Next steps
Signing Reference
Full parameter reference for
signEip3009Authorization.Resource Server Guide
See the other side of this flow.

