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.

Full Refund Example
Refund the complete payment amount
// 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.

Partial Refund Example
Refund only a portion of the payment
// 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

Understanding Refund Status
pending

Refund has been initiated and is being processed

completed

Refund has been successfully processed and funds returned

failed

Refund could not be processed. Check the error message for details.

Refund Workflow

Step-by-Step Process
1

Identify the Payment

Get the payment_id from your transaction records or dashboard

2

Create Refund Request

Use the Refunds API to create a refund with the payment_id and amount

3

Receive Webhook

You'll receive a webhook notification when the refund is completed

4

Update Your System

Update your order management system and notify the customer

Best Practices

Refund Management Tips
  • 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.

Related Resources