Skip to main content
The merchant client exposes a read-heavy slice of refund actions plus freeze.isFrozen. Writes that change refund-request status (deny, refuse) and writes that lift a freeze (unfreeze) live on createArbiterClient or on the full createX402r() client. Use createMerchantClient for queries below; for executing a refund, see Capture vs refund decision flow. The merchant client’s payment.voidPayment() flips the request to Approved through the VOID_POST_ACTION_HOOK.

Refund request queries

refund.has

Check whether a refund request exists for a payment.
Parameters Returns Promise<boolean>.

refund.getStatus

Retrieve the current status of a refund request.
Parameters Returns Promise<RefundRequestStatus>, Pending | Approved | Denied | Cancelled | Refused.

refund.get

Retrieve the complete refund request data.
Parameters Returns Promise<RefundRequestData>:

refund.getByKey

Look up a refund request directly by its payment info hash.
Parameters Returns Promise<RefundRequestData>.

Paginated refund request listing

refund.getReceiverRequests

Retrieve paginated refund request keys for this merchant (the receiver).
Parameters Returns Promise<{ keys: readonly Hex[]; total: bigint }>. To hydrate each entry, call refund.getByKey(hash) per key.
getOperatorRequests (paginated across all payments under an operator) lives on createArbiterClient, not on the merchant client.

Refund request actions

Approving or denying a request through the operator hook is what the merchant does. Terminal deny and refuse calls on the RefundRequest contract belong to the arbiter role; from a merchant, execute the refund through payment.voidPayment() (which flips the request to Approved) or signal a refusal off-chain and let the arbiter terminalize it.

payment.voidPayment

To approve and execute a refund, call payment.voidPayment(). The operator’s VOID_POST_ACTION_HOOK (RefundRequest) flips the request status to Approved.
Parameters Returns Promise<Hash>.
voidPayment() flips the pending RefundRequest to Approved. This action cannot be undone.

Freeze management

freeze.isFrozen

Check whether a freeze currently holds a payment. The escrow blocks capture on a frozen payment until the arbiter unfreezes it.
Parameters Returns Promise<boolean>.
The merchant client exposes freeze.isFrozen only. Lifting a freeze (unfreeze) is an arbiter-role action; use createArbiterClient or createX402r().

Complete refund workflow

A full workflow that detects a refund request, reviews it, makes a decision, and executes the refund when approved.

Refund request lifecycle

Method reference

Next steps

Merchant SDK

Capture funds, charge, and query escrow state.

RefundRequest

RefundRequest contract details and state machine.