A standard for open, transparent, and automated refund processing for x402. Built for developers, designed for openness.
Currently in alpha · APIs may change
Pick your arbiter, deploy your escrow contract, mark routes as refundable, and let the protocol handle disputes. Minimal changes required.
TypeScript
import { EscrowServerScheme } from "@x402r/evm/escrow/server";
import { refundable } from "@x402r/helpers";
...
app.use(
paymentMiddleware(
{
"GET /weather": {
accepts: [
refundable({
scheme: "escrow",
price: "$0.01",
network: NETWORK_ID,
payTo: account.address,
}, operatorAddress),
],
description: "Weather data",
},
},
new x402ResourceServer(facilitatorClient)
.register(NETWORK_ID, new EscrowServerScheme()),
),
);TypeScript
import { registerEscrowScheme } from "@x402r/evm/escrow/facilitator";
...
const facilitator = new x402Facilitator();
registerEscrowScheme(facilitator, {
signer: evmSigner,
networks: NETWORK,
});Building the future of refundable payments with innovative partners across the ecosystem.
x402 facilitators
The x402 refund protocol provides a standardized, secure, and customizable way to handle refunds for merchants.
Funds can only go to the merchant or user, nowhere else. No third-party custody or risk
Source-available contracts with on-chain verification and full traceability of all transactions
Choose your own operator for escrow and dispute resolution, maintaining full control over the process
Very little changes to your current code are required to enable refund functionality
Conditions, escrow periods, and dispute resolution are all pluggable and customizable per operator
Arbiters set their own fee structure. Transparent, on-chain, and fully configurable