@x402r/client package provides payer-side methods for interacting with X402r payments: requesting refunds, freezing payments, and querying escrow state.
Setup
Available Methods
The Client SDK currently supports:requestRefund()— Submit a refund request for a payment in escrowgetRefundStatus()— Check the status of a refund requestfreezePayment()— Freeze a payment to prevent release during a disputeisFrozen()— Check if a payment is frozenisDuringEscrowPeriod()— Check if a payment is still in its escrow windowgetAuthorizationTime()— Get when a payment was authorizedgetPaymentState()— Derive the lifecycle state of a paymentpaymentExists()— Check if a payment has been authorizedisInEscrow()— Check if a payment has capturable fundsgetPaymentDetails()— Retrieve full PaymentInfo from event logsgetPayerPayments()— List all payments for the connected walletsubmitEvidence()— Attach evidence (IPFS CID) to a refund requestgetEvidence()— Retrieve a single evidence entry by indexgetAllEvidence()— Retrieve all evidence for a refund request
Try It Now
The easiest way to try client features is with the client-cli example, which provides a command-line interface for all client operations:client-cli
CLI tool for payers to
pay, preview-fee, request refunds, freeze payments, and check status.Next Steps
Examples
See all working examples including the full payment flow.
Deploy Operator
Deploy a PaymentOperator to test client operations against.
