Skip to main content

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

ReasonDescription
customer_requestCustomer asked for refund
duplicateDuplicate payment
fraudulentSuspected fraud
order_canceledOrder 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