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
| Status | Description |
|---|---|
REQUESTED | Refund has been requested |
APPROVED | Refund approved for processing |
EXECUTED | Refund transaction completed |
REJECTED | Refund was rejected |
Refund Types
| Type | Use Case |
|---|---|
CANCELLATION | Order was cancelled before fulfillment |
RETURN | Customer returned the item |
OTHER | Other 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
- Code Examples — curl and SDK examples
- API Reference — Full REST API documentation