Refunds
The refunds module allows you to initiate and manage refunds. You can make full or partial refunds for payments that have been paid successfully using the Refund APIs. It has the following parameters:
Download Refunds OpenAPI Document
End Points
Attribute
refund_id
string
The unique identifier created for the refund.
payment_id
string
The Payment ID associated with the refund.
reference_number
string
The reference number for the refund.
amount
string
The amount for which the refund was created.
type
string
The type of refund: By the user:
initiated_by_merchant
, initiated_by_customer
. By Zoho Payments (Internal): initiated_by_system
reason
string
The reason for the refund: By the user:
duplicate
, fraudulent
, requested_by_customer
, others
. By Zoho Payments (Internal): system_initiated
, expired_uncaptured_charge
description
string
A description of the refund.
status
string
Status of the refund:
initiated
, succeeded
, failed
, canceled
, or pending
. network_reference_number
string
Network reference number for the refund.
failure_reason
string
Reason for failure, if applicable:
unknown
, lost_or_stolen_card
, expired_or_canceled_card
, exceeds_payment_amount
, exceeds_balance_amount
, payment_already_refunded
, payment_already_disputed
, payment_not_captured
, expiry_time_exceeded
, amount_too_small
, insufficient_funds
, charge_for_pending_refund_disputed
, or merchant_request
. date
long
The date (milliseconds) on which the refund was initiated.
{
"refund_id": "1987000000724219",
"payment_id": "1987000000724215",
"reference_number": "4113662000000240001",
"amount": "200.00",
"type": "initiated_by_merchant",
"reason": "requested_by_customer",
"description": "Refund for Payment (INV-000008)",
"status": "succeeded",
"network_reference_number": "1724154320460",
"failure_reason": "",
"date": 1724154320
}
Create Refund
This API endpoint allows you to create a refund for a payment.
OAuth Scope : ZohoPay.refunds.CREATE
Arguments
amount
double
(Required)
The amount to be refunded, with support for decimal places.
reason
string
(Required)
The reason for the refund: By the user:
duplicate
, fraudulent
, requested_by_customer
, others
. By Zoho Payments (Internal): system_initiated
, expired_uncaptured_charge
type
string
The type of refund: By the user:
initiated_by_merchant
, initiated_by_customer
. By Zoho Payments (Internal): initiated_by_system
description
string
A description of the refund.
Path Parameters
payment_id
long
(Required)
The Payment ID associated with the refund.
Query Parameters
account_id
long
(Required)
The Zoho Payments account ID.
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}");
Request request = new Request.Builder()
.url("https://payments.zoho.com/api/v1/payments/731000001449003/refunds?account_id=23137556")
.post(body)
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'POST',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
'content-type': 'application/json'
},
body: '{"field1":"value1","field2":"value2"}'
};
fetch('https://payments.zoho.com/api/v1/payments/731000001449003/refunds?account_id=23137556', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("payments.zoho.com")
payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"
headers = {
'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
'content-type': "application/json"
}
conn.request("POST", "/api/v1/payments/731000001449003/refunds?account_id=23137556", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "POST",
"hostname": "payments.zoho.com",
"port": null,
"path": "/api/v1/payments/731000001449003/refunds?account_id=23137556",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
"content-type": "application/json"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({field1: 'value1', field2: 'value2'}));
req.end();
curl --request POST \
--url 'https://payments.zoho.com/api/v1/payments/731000001449003/refunds?account_id=23137556' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"amount": 200,
"reason": "requested_by_customer",
"type": "initiated_by_merchant",
"description": "Refund for Payment (INV-000008)"
}
{
"code": 0,
"message": "Refund initiated",
"refund": {
"refund_id": "1987000000724219",
"payment_id": "1987000000724215",
"reference_number": "4113662000000240001",
"amount": "200.00",
"type": "initiated_by_merchant",
"reason": "requested_by_customer",
"description": "Refund for Payment (INV-000008)",
"status": "succeeded",
"network_reference_number": "1724154320460",
"failure_reason": "",
"date": 1724154320
}
}
Retrieve Refund Details
Used to retrieve details of a specific refund.
OAuth Scope : ZohoPay.refunds.READ
Path Parameters
refund_id
long
(Required)
The unique identifier created for the refund.
Query Parameters
account_id
long
(Required)
The Zoho Payments account ID.
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://payments.zoho.com/api/v1/refunds/731000001449003?account_id=23137556")
.get()
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'GET',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://payments.zoho.com/api/v1/refunds/731000001449003?account_id=23137556', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("payments.zoho.com")
headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }
conn.request("GET", "/api/v1/refunds/731000001449003?account_id=23137556", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "GET",
"hostname": "payments.zoho.com",
"port": null,
"path": "/api/v1/refunds/731000001449003?account_id=23137556",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
curl --request GET \
--url 'https://payments.zoho.com/api/v1/refunds/731000001449003?account_id=23137556' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "success",
"refund": {
"refund_id": "1987000000724219",
"payment_id": "1987000000724215",
"reference_number": "4113662000000240001",
"amount": "200.00",
"type": "initiated_by_merchant",
"reason": "requested_by_customer",
"description": "Refund for Payment (INV-000008)",
"status": "succeeded",
"network_reference_number": "1724154320460",
"failure_reason": "",
"date": 1724154320
}
}