> ## Documentation Index
> Fetch the complete documentation index at: https://razorpay-881012b3.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Refund Payments

> Refund payments made on a QR Code with this endpoint.

<div style={{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"0.35rem 0.9rem",border:"1px solid rgba(128,128,128,0.28)",borderRadius:"0.5rem",padding:"0.45rem 0.75rem",margin:"0 0 1.25rem",fontSize:"0.875rem"}}>
  <span style={{fontWeight:600}}>Available in</span>
  <span>🇮🇳 India</span>
</div>

Use this endpoint to refund payments made on a QR Code.

<RequestExample>
  ```bash Curl theme={null}
  curl -u <YOUR_KEY_ID>:<YOUR_KEY_SECRET> \
  -X POST https://api.razorpay.com/v1/payments/pay_HKrqmsgBHbaeIM/refund \
  -H "Content-Type: application/json" \
  ```

  ```java Java theme={null}
  RazorpayClient razorpay = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");

  String paymentId = "pay_29QQoUBi66xm2f";

  JSONObject refundRequest = new JSONObject();
  refundRequest.put("amount",100);
  refundRequest.put("speed","normal");
  JSONObject notes = new JSONObject();
  notes.put("notes_key_1","Tea, Earl Grey, Hot");
  notes.put("notes_key_2","Tea, Earl Grey… decaf.");
  refundRequest.put("notes",notes);
  refundRequest.put("receipt","Receipt No. #31");

  Payment payment = razorpay.payments.refund(paymentId,refundRequest);
  ```

  ```php PHP theme={null}
  $api = new Api($key_id, $secret);

  $api->payment->fetch($paymentId)->refund(array("amount"=> "100", "speed"=>"normal", "notes"=>array("notes_key_1"=>"Beam me up Scotty.", "notes_key_2"=>"Engage"), "receipt"=>"Receipt No. 31"));
  ```

  ```python Python theme={null}
  import razorpay
  client = razorpay.Client(auth=("YOUR_ID", "YOUR_SECRET"))

  client.payment.refund(paymentId,{
    "amount": "100",
    "speed": "normal",
    "notes": {
      "notes_key_1": "Beam me up Scotty.",
      "notes_key_2": "Engage"
    },
    "receipt": "Receipt No. 31"
  })
  ```

  ```go Go theme={null}
  import ( razorpay "github.com/razorpay/razorpay-go" )
  client := razorpay.NewClient("YOUR_KEY_ID", "YOUR_SECRET")

  data := map[string]interface{}{
    "speed": "normal",
    "notes": map[string]interface{}{
      "key_1": "value1",
      "key_2": "value2",
    },
  }
  body, err := client.Payment.Refund("<paymentId>",1200, data, nil)
  ```

  ```ruby Ruby theme={null}
  require 'razorpay'

  Razorpay.setup("YOUR_KEY_ID", "YOUR_KEY_SECRET")
  Razorpay::Payment.fetch("pay_29QQoUBi66xm2f").refund()
  ```

  ```javascript Node.js theme={null}
  var instance = new Razorpay({ key_id: 'YOUR_KEY_ID', key_secret: 'YOUR_SECRET' })

  instance.payments.refund(paymentId,{
    "amount": "100",
    "speed": "normal",
    "notes": {
      "notes_key_1": "Beam me up Scotty.",
      "notes_key_2": "Engage"
    },
    "receipt": "Receipt No. 31"
  })
  ```

  ```csharp .NET theme={null}
  //initialize the SDK client
  RazorpayClient client = new RazorpayClient("[YOUR_KEY_ID]", "[YOUR_KEY_SECRET]");

  // payment to be refunded, payment must be a captured payment
  Payment payment = client.Payment.Fetch(paymentId);

  //Full Refund
  Refund refund = payment.Refund();

  //Partial Refund
  Dictionary<string, object> data = new Dictionary<string, object>();
  data.Add("amount", "500100");
  Refund refund = payment.Refund(data);
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "rfnd_HMtH2fBtD60QkX",
    "entity": "refund",
    "amount": 200,
    "currency": "INR",
    "payment_id": "pay_HKrqmsgBHbaeIM",
    "notes": [],
    "receipt": null,
    "acquirer_data": {
      "rrn": null
    },
    "created_at": 1623663010,
    "batch_id": null,
    "status": "processed",
    "speed_processed": "normal",
    "speed_requested": "normal"
  }
  ```
</ResponseExample>

## Path Parameters

<ParamField path="id" type="string" required>
  The unique identifier of the payment to be refunded.
</ParamField>

## Request Parameters

<ParamField body="amount" type="string">
  Amount to be refunded. If no value is passed, a full refund is issued.
</ParamField>

<ParamField body="notes" type="object">
  Key-value pair that can be used to store additional information about the QR Code. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, `"note_key": "Beam me up Scotty”`.
</ParamField>

## Response Parameters

<ResponseField name="id" type="string">
  Unique identifier of the refund.
</ResponseField>

<ResponseField name="entity" type="string">
  Indicates the type of entity. Here, it is `refund`.
</ResponseField>

<ResponseField name="amount" type="integer">
  The amount to be refunded (in the smallest unit of currency). <br /> For example, refund in INR, a value of 100 means 100 paise (equivalent to ₹1).
</ResponseField>

<ResponseField name="currency" type="string">
  The currency of the amount for which refund is initiated.
</ResponseField>

<ResponseField name="payment_id" type="string">
  Unique identifier of the payment for which the refund is initiated.
</ResponseField>

<ResponseField name="created_at" type="integer">
  Timestamp, in Unix format, when the refund was created.
</ResponseField>

<ResponseField name="batch_id" type="string">
  This parameter is populated if the refund was created as part of a batch upload. For example, `batch_00000000000001`.
</ResponseField>

<ResponseField name="notes" type="json object">
  Key-value store for storing your reference data. A maximum of 15 key-value pairs can be included.
</ResponseField>

<ResponseField name="receipt" type="string">
  A unique identifier provided by you for your internal reference.
</ResponseField>

<ResponseField name="acquirer_data" type="array">
  A dynamic array consisting of a unique reference number (either RRN, ARN or UTR) that is provided by the banking partner when a refund is processed. This reference number can be used by the customer to track the status of the refund with the bank.
</ResponseField>

<ResponseField name="status" type="string">
  Indicates the state of the refund. Possible values:

  * `pending`: This state indicates that Razorpay is attempting to process the refund.
  * `processed`: This is the final state of the refund.
  * `failed`: A refund can attain the failed state in the following scenarios:<br />
    * Normal refund is not possible for a payment which is more than 6 months old.<br />
</ResponseField>

<ResponseField name="speed_requested" type="string">
  The processing mode of the refund seen in the refund response. <br /> This attribute is seen in the refund response only if the `speed` parameter is set in the refund request.<br />Possible value is `normal`, which indicates that the refund will be processed via the normal speed. That is, the refund will take 5-7 working days. Know more about [normal refunds](/docs/api/refunds/create-normal).
</ResponseField>

<ResponseField name="speed_processed" type="string">
  This is a parameter in the response which describes the mode used to process a refund. <br /> This attribute is seen in the refund response only if the `speed` parameter is set in the refund request. Possible value is `normal`, which indicates that the refund has been processed by the payment processing partner. The refund will take 5-7 working days.

  Know more about [Refunds API](/docs/api/refunds) to perform other refund-related operations:

  * Fetch a particular refund or a list of refunds for a payment ID.
  * Update a refund to modify the Notes field.
</ResponseField>
