Skip to main content

Refunds

Process refunds for paid checkouts.

Create a Refund

const refund = await volr.createRefund('checkout_id', {
amount: '10000000', // Full or partial refund amount
reason: 'Customer requested refund',
refundType: 'CANCELLATION', // CANCELLATION | RETURN | OTHER
});

Partial Refunds

Refund a portion of the original payment:

// Original checkout was 25 USDC (25000000)
// Refund 10 USDC
const refund = await volr.createRefund('checkout_id', {
amount: '10000000',
reason: 'Item out of stock — partial refund',
refundType: 'RETURN',
});

List Refunds

const refunds = await volr.listRefunds('checkout_id');

for (const refund of refunds) {
console.log(`${refund.id}: ${refund.status}${refund.amount}`);
}

Refund Lifecycle

StatusDescription
REQUESTEDRefund has been requested
APPROVEDRefund approved for processing
EXECUTEDRefund transaction completed
REJECTEDRefund was rejected

Refund Types

TypeUse Case
CANCELLATIONOrder was cancelled before fulfillment
RETURNCustomer returned the item
OTHEROther refund reason

Refund Response

interface Refund {
id: string;
checkoutId: string;
amount: string;
reason: string | null;
refundType: 'CANCELLATION' | 'RETURN' | 'OTHER';
status: 'REQUESTED' | 'APPROVED' | 'EXECUTED' | 'REJECTED';
txHash: string | null;
createdAt: string;
updatedAt: string;
}

Next Steps