Refunds
Process full and partial refunds for Pelago payments.
Creating a Refund
const refund = await pelago.refunds.create({
paymentId: 'pay_abc123',
amount: 50.00, // Partial refund (omit for full)
reason: 'customer_request'
});
Refund Reasons
| Reason | Description |
|---|---|
customer_request | Customer asked for refund |
duplicate | Duplicate payment |
fraudulent | Suspected fraud |
order_canceled | Order was canceled |
Refund Flow
Checking Refund Status
const refund = await pelago.refunds.retrieve('ref_xyz789');
console.log('Status:', refund.status);
// 'pending' | 'completed' | 'failed'
Webhook Events
{
"type": "refund.completed",
"data": {
"refundId": "ref_xyz789",
"paymentId": "pay_abc123",
"amount": 50.00,
"transactionHash": "abc..."
}
}
Refund Limitations
- Refunds must be initiated within 180 days
- Maximum refund = original payment amount
- Network fees are non-refundable