> ## Documentation Index
> Fetch the complete documentation index at: https://developer.novacpayment.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Refund a Transaction

> Learn how to use the Refund API to process full or partial refunds seamlessly.

## Overview

The refund API allows you to reverse transactions in part or in full, providing flexibility and control when handling customer requests, errors, or operational reversals.

## How It Works

When a transaction is successfully completed, you can initiate a refund by making a request to the refund API.

To process the refund efficiently, follow these steps:

<Steps>
  <Step title="Authenticate Your Request">
    Include your Secret Key in the `Authorization` header to securely authenticate the refund request.
  </Step>

  <Step title="Provide the Order Reference">
    Use the unique `reference` associated with the transaction you want to refund.
  </Step>

  <Step title="Add Optional Details">
    You may include additional context for the refund using either the `customer_note` or `merchant_note` field.
  </Step>

  <Step title="Process a Full or Partial Refund">
    * **Full Refund**: Refunds the entire transaction amount.
    * **Partial Refund**: Refunds a portion of the total amount, useful when customers return only part of an order or when a service is partially fulfilled.
  </Step>
</Steps>

## Partial Refunds Explained

A partial refund allows you to return only a portion of the original payment instead of the full amount. This is ideal for scenarios like:

* A customer cancels one item in a multi-item order.
* A service was only partially delivered.
* You want to retain a processing or cancellation fee.

## Refunds

### Initiate a Refund

```bash Request theme={null}
curl --request POST \
  --url https://api.novacpayment.com/api/v1/direct-card-charge \
  --header 'Authorization: Bearer YOUR_SECRET_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "reference": "TXN-REF-20240101-001",
    "amount": "1000",
    "customer_note": "",
    "merchant_note": ""
  }'
```

<Note>
  Its important to note that amount cannot be greater than the original transaction amount.
</Note>

| Parameter       | Type   | Required | Description                                                                                     |
| --------------- | ------ | -------- | ----------------------------------------------------------------------------------------------- |
| `reference`     | string | Yes      | Original transaction reference to refund.                                                       |
| `amount`        | string | Yes      | Amount to refund. Cannot exceed the original transaction amount. Partial refunds are supported. |
| `customer_note` | string | No       | Reason shown to the customer.                                                                   |
| `merchant_note` | string | No       | Internal note for your records.                                                                 |

```json Refund Response theme={null}
{
  "status": true,
  "message": "Refund submitted and in progress",
  "data": {
    "id": 19410,
    "refundReference": "BR85288NQFBGU72BHWSQ",
    "amount": "1000",
    "currency": "NGN",
    "domain": "live",
    "initiatedBy": "self",
    "channel": "API",
    "merchantNote": "Customer requested refund",
    "customerNote": "Refund for order ORD-123",
    "status": "pending",
    "createdAt": "2024-03-14T12:04:05.0000000"
  }
}
```

### Check Refund Status

```http theme={null}
GET https://api.novacpayment.com/api/v1/refund/{refundReference}
```

```json Response theme={null}
{
   "Status":true,
   "Message":"Refund submitted and in progress ",
   "Data":{
      "Id":19410,
      "RefundReference":"BX5X88NXXXGU72BHWSQ",
      "Amount":"20.8",
      "Currency":"USD",
      "Domain":"live",
      "InitiatedBy":"self",
      "Channel":"API",
      "MerchantNote":" refund for transaction M0386-A0650-a12hCnGI",
      "CustomerNote":" refund for transaction M0386-A0650-a12hCnGI",
      "Status":"pending",
      "CreatedAt":"2024-03-14T12:04:05.0000000"
   }
}
```

<Note>
  Use the `refundReference` returned when the refund was initiated, not the original transaction reference.
</Note>

## What Next ?

* [Initiate a full refund](/api-reference/refunds/create-refund)
* [Initiate a partial refund](/api-reference/refunds/create-partial-refund)
