Refunds

The following section will explain the refund entity and their associated API.

Refund Entity#

The refund entity returned by Razorpay is as shown below. It will be returned in JSON form by the API (or in the object form if using language SDKs).

id string
Unique id that identifies the refund on the Razorpay.
entity string
Indicates type of entity.
amount integer
The amount of refund in paisa. e.g. If amount = 100, it means Re 1. Min amount = 100 (Re 1).
currency string
The currency of refund, Currently only INR is supported.
payment_id string
Payment id to for which this refund has been made.
created_at timestamp
Timestamp of refund creation.
notes dictionary
Key-value store for storing your reference data.

Refund a Payment#

The following end-point refunds a payment using the payment ID.

/payment/:id/refund

Request Parameters#

id string
The ID of the payment to refund.
amount string
Amount to be refunded, whole amount is refunded if not specified.
notes array_string([])
Array of notes fields. This is validated the same way as the payment.notes field.

Fetch Multiple Refunds for a Payment#

The following endpoint can be used to retrieve multiple refunds for a payment:

/payments/:id/refunds

This endpoint is used for retrieving list of refunds of a payment based on optional parameters. By default only last 10 are returned. You can use count and skip parameters to change that behavior.

Request Parameters#

id string
The payment id whose refunds are to be fetched
from timestamp
The timestamp in seconds after which the refunds were created
to timestamp
The timestamp in seconds before which the refunds were created.
count int(10)
The number of refunds to fetch
skip int(0)
The number of refunds to be skipped

Fetch a Refund#

The following endpoint is used for retrieving a specific refund of a specific payment entity by its id.:

/payment/:payment_id/refunds/:refund_id

Query Parameters#

payment_id string
The id of the payment whose refund is to be retrieved.
refund_id string
The id of the refund to be retrieved.

Fetch Refunds#

The following endpoint is used for retrieving list of refunds based on optional parameters. By default only last 10 are returned. You can use count and skip parameters to change that behavior:

/refunds/

Request Parameters#

from timestamp
The timestamp in seconds after which the refunds were created
to timestamp
The timestamp in seconds after which the refunds were created.
count int(0)
The number of refunds to fetch. Maximum: 100
skip int(0)
The number of refunds to be skipped.

Fetch Refund by ID#

The following API retrieves the refund using the ID.

/refunds/:id

Query Parameters#

id string
The id of the refunds to be retrieved.

Update the Refund#

You can modify an existing Refund to update the Notes field only. Notes can be used to record additional information about the payment. You can add up to 15 key-value pairs with each value of the key not exceeding 256 characters.

Using the PATCH operation, you can replace the entire notes object for the entity.

Request Parameters#

To modify the Notes field of a Refund, construct the API request as follows:

/refunds/:id/
id required
ID of the refund in which the Notes field should be updated
notes required
Notes of the entity to be modified
Curl
PHP
Python
Ruby
Node
.NET
Java