Skip to main content

new X402FacilitatorClient(options)

The facilitator URL (https://api.xentfi.com/v1/x402) and relayer wallet are fixed on the backend — they are not configurable in the client. Every request sends apiKey/orgId as the apikey/orgid headers.

Methods

getSupported()

Lists all (chain, asset) pairs and schemes this facilitator supports. No authentication required — safe to call before you have apiKey/orgId configured, e.g. to build a merchant’s accepts list dynamically.

verify(paymentPayload, paymentRequirements)

Verifies a payment payload against a requirement — checks the EIP-712 signature, amount, recipient, and validity window. Returns { isValid: true } on success; throws on failure (see Error Handling).

settle(paymentPayload, paymentRequirements)

Settles a payment by submitting the TransferWithAuthorization on-chain via your organization’s WAAS relayer wallet, which pays gas. Returns { success: true, txHash, network } on success; throws on failure.

Types

PaymentRequirement

What a resource server demands to be paid, expressed to the client in the 402 challenge.

X402Challenge

The full 402 response body.

PaymentPayload / Eip3009SchemePayload

What the payer sends back (base64-encoded) as the X-PAYMENT header. Currently the only supported scheme is eip3009; PaymentPayload is an alias for Eip3009SchemePayload.

VerifyResult / SettleResult

Both are the success shape only — failures throw instead of returning a falsy result (see Error Handling).

SupportedResponse

Eip3009TokenDomain

Needed if you use the signing helpers — see EIP-3009 Signing Reference for full detail.

All exports

Next steps

Resource Server Guide

See verify/settle used end-to-end.

Error Handling

Error classes and HTTP status mapping.