Processing Refunds
Learn how to process refunds for your customers. Handle both full and partial refunds through the API or merchant dashboard.
Refund Overview
Refunds allow you to return money to customers for completed payments. You can issue full refunds or partial refunds depending on your business needs.
Important Notes:
- Refunds can only be issued for succeeded payments
- Partial refunds are allowed, but total refunds cannot exceed the original payment
- Refunds typically take 3-5 business days to appear in the customer's account
- Always use idempotency keys to prevent duplicate refunds
Full Refund
Process a full refund to return the entire payment amount to the customer.
// Process a full refund
const response = await fetch('https://api.altafinex.com/v1/refunds', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_SECRET_KEY',
'Content-Type': 'application/json',
'Idempotency-Key': 'refund-' + Date.now(),
},
body: JSON.stringify({
payment_id: 'pay_1234567890abcdef',
amount: 10000, // Full refund amount
reason: 'Customer requested refund',
}),
});
const refund = await response.json();Partial Refund
Issue a partial refund when you only need to return a portion of the payment amount.
// Process a partial refund
const response = await fetch('https://api.altafinex.com/v1/refunds', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_SECRET_KEY',
'Content-Type': 'application/json',
'Idempotency-Key': 'partial-refund-' + Date.now(),
},
body: JSON.stringify({
payment_id: 'pay_1234567890abcdef',
amount: 5000, // Partial refund (50% of original 10000)
reason: 'Partial refund for damaged item',
}),
});Multiple Partial Refunds:
You can issue multiple partial refunds for the same payment, as long as the total refunded amount doesn't exceed the original payment amount.
Refund Status
Refund has been initiated and is being processed
Refund has been successfully processed and funds returned
Refund could not be processed. Check the error message for details.
Refund Workflow
Identify the Payment
Get the payment_id from your transaction records or dashboard
Create Refund Request
Use the Refunds API to create a refund with the payment_id and amount
Receive Webhook
You'll receive a webhook notification when the refund is completed
Update Your System
Update your order management system and notify the customer
Best Practices
- Always Use Idempotency Keys: Prevent duplicate refunds by including a unique idempotency key with each refund request.
- Document Refund Reasons: Always include a reason for the refund for your records and customer service.
- Monitor Refund Status: Set up webhooks to track refund status and update your system automatically.
- Check Refund Limits: Ensure the refund amount doesn't exceed the original payment amount.