Integration
Full and partial refunds
Return funds with merchant consent and a verifiable receipt.
Issue a refund from your workspace
Open an order and select Review refunds. Check the available amount, enter the amount to return, then select Review in wallet. Sign with your registered payout wallet. The receipt updates after confirmation. Your wallet must hold enough USDT to cover the refund.
Open orders ↗Reserve the amount
Use a stable refundId for each refund. The server checks confirmed refunds and pending reservations against the original payment. Reusing that ID with another amount returns REFUND_CONFLICT.
const refund = await checkout.refund({
checkoutId,
refundId: 'return-1042-1',
amount: '500000', // 0.5 USDT
});Get the merchant signature
Have the registered payout wallet sign refund.authorization using EIP-712. JSON numeric strings may need conversion to BigInt for the wallet client. The bundled wallet module validates the token, chain, recipient and amount before requesting a signature. Merchant credentials and login do not authorize token movement.
Inspect the wallet signing implementation ↗Submit and confirm
The signature comes from the merchant wallet. A queued response does not mean funds have returned. Wait for the Refunded receipt event or refund.confirmed notification. The merchant needs sufficient USDT; the relayer pays gas.
await checkout.submitRefund(refund.id, signature);
// Poll GET /v1/checkouts/:id for the confirmed refund.Reservations and limits
Unsigned reservations expire after 15 minutes, including while the worker is paused. GET /v1/merchant/orders/:id/refunds reports reservations and available balance. POST /v1/merchant/refunds/:id/cancel releases an unsubmitted reservation; queued refunds cannot be cancelled. Closing a signature prompt does not immediately release a reservation. The contract caps cumulative refunds at the original payment, but it cannot force a merchant to authorize a refund or retain enough funds. Refunds remain possible during the contract payment pause; the application worker pause suspends submission for both.