Refunds

The following section explains 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 identifier of the refund.

entity
string Indicates type of entity.
amount
integer The amount to be refunded, either partial or full.
If you want to refund only a partial amount to the customer, enter the amount less than the captured amount. Else, the entire captured amount is refunded fully to the customer.

currency :string The currency of amount associated with the refund.

payment_id :string Unique identifier of the payment for which the refund is requested.

created_at :integer 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.

/payments/: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
dictionary 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
integer The timestamp, in seconds, at which the refunds were created.
to
integer The timestamp, in seconds, till which the refunds were created.
count
integer The number of refunds to be fetched.
skip
integer The number of records of the refunds to be skipped.

Fetch a Refund#

The following endpoint is used for retrieving a specific refund of a specific payment entity:

/payments/:payment_id/refunds/:refund_id

Request Parameters#

payment_id
string Unique identifier of the payment that should be refunded.
refund_id
string Unique identifier of the refund that should be fetched.

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
integer The timestamp in seconds after which the refunds were created
to
integer The timestamp in seconds after which the refunds were created.
count
integer The number of refunds to fetch. Maximum: 100
skip
integer 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 Unique identifier of the refund.

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