> ## Documentation Index
> Fetch the complete documentation index at: https://razorpay-60c89f9a-mintlify-audit-missing-sections-1778528421.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Batch Refunds

> Use Batch refunds to make refunds in bulk using an XLSX or CSV file. Once you upload a file, it is picked up for processing after 70 minutes. You can cancel a batch upload in the 70 minutes before it is picked up for processing.

<Info>
  **Feature Request**

  This is an on-demand feature. Please raise a request with our [Support team](https://razorpay.com/support/#request) to get this feature activated on your Razorpay account.
</Info>

## Batch States

A batch file can be in any of these states:

* `created`: This is the initial state of the file when it is uploaded. Once you upload a file, it stays in the `created` state for 70 minutes. You can cancel the upload during this time.
* `processing`: This state indicates that the batch file is getting processed.
* `processed`: This is the final state of the file. It indicates that all the rows in the batch file were processed, either successfully or unsuccessfully. Download the Batch Refund Report from the Dashboard to check the status of each refund.
* `cancelled`: You can only cancel batch uploads in the `created` state. You cannot cancel batch uploads in the `processing` or `processed` states.

## Refund Fees

Razorpay does not charge any processing fee for Normal refunds. However, the transaction fee and GST levied by Razorpay at the time of payment capture will not be reversed to your account.

Razorpay charges a small transaction fee to process Instant refunds. The fees is deducted directly from your account balance and reflects under the **Refunds** tab on the Dashboard. In cases where the Instant refund fails and the refund takes 5-7 working days, the levied fee is credited back to your balance. The fee break-up is shown in the end-of-the-month invoice generated by Razorpay. View and download the details of fees charged in the **Instant Refunds Reports** from the Dashboard.

For more details about pricing, [raise a Razorpay Support request](https://razorpay.com/support/#request).

## Create a Batch Refund

Follow the steps given below to create refunds in bulk using batch refund.

To create a batch refund:

<Steps>
  <Step title="Step 1">
    Log in to the Dashboard.
  </Step>

  <Step title="Step 2">
    Go to **Transactions** and click **View All** on the **Refunds** tab. Select **Batch Refunds** and click **Click here to upload**.
  </Step>

  <Step title="Step 3">
    Download the sample file.
  </Step>

  <Step title="Step 4">
    Add the required data to the sample file. Know more about [Batch File Fields](#batch-file---fields).
  </Step>

  <Step title="Step 5">
    Upload the file to the Dashboard, check the preview to ensure details are correct, and click **Submit Batch**.
  </Step>
</Steps>

### Batch File - Fields

Download the sample file, add your data and upload it for processing. We support CSV, XLS and XLSX file formats for the batch file. We do not support custom headers.

Shown below is a sample data from a batch file:

The below table lists the various headers in the sample batch file and briefly describes each.

`Payment Id`*mandatory*
: `string` The unique identifier for the payment that is to be refunded. For example, `pay_F1JdjAyjRexm9T`.

`amount`*mandatory*
: `integer` The amount, in subunits, to be refunded. For example, pass `1000` to process a refund of 10.

`speed` *optional*
: `string` The speed at which the refund should be processed. Possible values:

* `normal` : The refund is processed in 5-7 working days.
* `optimum` : Instant Refunds. If it is not possible to process the refund instantly, we will process the refund in 5-7 working days. Know more about [Instant Refunds](/payments/refunds/instant).

If no value is passed, the refund is processed using the default Refund speed set on the Dashboard.

## Cancel a Batch Upload

You can cancel a batch upload from the Dashboard.

<Info>
  **Handy Tips**

  You can only cancel batch uploads in the `created` states. You cannot cancel batch uploads in the `processing` and `processed` states.

  To cancel a batch upload:

  <Steps>
    <Step title="Step 1">
      Log in to the Dashboard.
    </Step>

    <Step title="Step 2">
      Go to **Transactions** and click **View All** on the **Refunds** tab. Select **Batch Refunds**.
    </Step>

    <Step title="Step 3">
      Click **Cancel** for the **Batch Id** that you want to cancel.
    </Step>
  </Steps>
</Info>

## Batch Refund Report

Though a batch file may have acquired `processed` state, all the refunds may not have been successful due to errors. For example, if an incorrect payment id is added to the file, the file might be `processed`, but the refund would have failed.

You can download the Batch Refund report to check the status of each data row.

To download the Batch Refund report:

<Steps>
  <Step title="Step 1">
    Log in to the Dashboard.
  </Step>

  <Step title="Step 2">
    Go to **Transactions** and click **View All** on the **Refunds** tab. Select **Batch Refunds**.
  </Step>

  <Step title="Step 3">
    Click **Download** for the required **Batch Id** to download the Batch Refund Report.

    * If a payment was successfully refunded, the corresponding data row is populated with a `Refund Id`.
    * If a payment was not successfully refunded, the corresponding data row is populated with `Error Code` and `Error Description`.
  </Step>
</Steps>

### Batch Report - Fields

Given below is a sample data from a processed batch file:

The below table describes each of the headers of the processed batch file:

`Payment Id`
: `string` The unique identifier for the payment that is to be refunded. For example, `pay_F1JdjAyjRexm9T`.

`Amount`
: `integer` The amount, in subunits, to be refunded. For example, pass `1000` to process a refund of 10.

`Refund Id`
: `string` The unique identifier of the refund. For example, `rfnd_EqWThTE7dd7utf`.

`Refunded Amount`
: `integer` The amount, in subunits, refunded to the customer. For example, `1000` means 10 was refunded to the customer.

`status`
: `string` The status of the refund. Possible values:

* `processed` : The refund was successfully processed by us.
* `failure` : The refund was not processed. You need to create the refund again.

`speed` *optional*
: `string` The speed at which the refund should be processed. Possible values:

* `normal` : The refund is processed in 5-7 working days.
* `optimum` : Instant Refunds. If it is not possible to process the refund instantly, we will process the refund in 5-7 working days. Know more about [Instant Refunds](/payments/refunds/instant).

`Error Code`
: `string` The error code for the failure. For example, `BAD_REQUEST_ERROR`.

`Error Description`
: `string` The reason for the error. For example, `The refund amount provided is greater than the unrefunded amount`.

### Related Information

* [About Refunds](/payments/refunds)

* [Normal Refunds](/payments/refunds/normal)

* [Instant Refunds](/payments/refunds/instant)

* [Refunds FAQs](/payments/refunds/faqs)
