curl -X PATCH https://api.razorpay.com/v2/accounts/acc_H3kYHQ635sBwXG/webhooks/HK890egfiItP3H \
-u <ACCESS_TOKEN> \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.linkedin.com",
"events": [
"refund.created"
]
}'
RazorpayClient razorpay = new RazorpayClient("[ACCESS_TOKEN]");
String accountId = "acc_GP4lfNA0iIMn5B";
String webhookId = "HK890egfiItP3H";
JSONObject webhookRequest = new JSONObject();
webhookRequest.put("url","https://www.linkedin.com");
ArrayList<String> events = new ArrayList<String>();
events.add("refund.created");
webhookRequest.put("events",events);
Webhook webhook = instance.webhook.edit(accountId, webhookId, webhookRequest);
require "razorpay"
Razorpay.setup('ACCESS_TOKEN')
webhookId = "HK890egfiItP3H"
accountId = "acc_GP4lfNA0iIMn5B"
Razorpay::Webhook.edit({
"url": "https://www.linkedin.com",
"events": [
"refund.created"
]
}, webhookId, accountId)
RazorpayClient client = new RazorpayClient("[ACCESS_TOKEN]");
string accountId = "acc_ua2tBezhcEBvap";
string webhookId = "wxK6n7AmmJyRtq";
Dictionary<string, object> webhookRequest = new Dictionary<string, object>();
webhookRequest.Add("url", "https://www.google.com");
List<string> events = new List<string>();
events.Add("refund.created");
webhookRequest.Add("events", events);
Webhook webhook = client.Webhook.Fetch(webhookId,accountId).Edit(webhookRequest, accountId);
{
"id": "HK890egfiItP3H",
"created_at": 1623060358,
"updated_at": 1623067148,
"service": "beta-api-test",
"owner_id": "H3kYHQ635sBwXG",
"owner_type": "merchant",
"context": [],
"disabled_at": 0,
"url": "https://www.linkedin.com",
"alert_email": "gaurav.kumar@example.com",
"secret_exists": true,
"entity": "webhook",
"active": true,
"events": [
"refund.created"
]
}
Update a Webhook
Update a Webhook using Razorpay Curlec APIs.
PATCH
/
v2
/
accounts
/
:account_id
/
webhooks
/
:webhook_id
curl -X PATCH https://api.razorpay.com/v2/accounts/acc_H3kYHQ635sBwXG/webhooks/HK890egfiItP3H \
-u <ACCESS_TOKEN> \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.linkedin.com",
"events": [
"refund.created"
]
}'
RazorpayClient razorpay = new RazorpayClient("[ACCESS_TOKEN]");
String accountId = "acc_GP4lfNA0iIMn5B";
String webhookId = "HK890egfiItP3H";
JSONObject webhookRequest = new JSONObject();
webhookRequest.put("url","https://www.linkedin.com");
ArrayList<String> events = new ArrayList<String>();
events.add("refund.created");
webhookRequest.put("events",events);
Webhook webhook = instance.webhook.edit(accountId, webhookId, webhookRequest);
require "razorpay"
Razorpay.setup('ACCESS_TOKEN')
webhookId = "HK890egfiItP3H"
accountId = "acc_GP4lfNA0iIMn5B"
Razorpay::Webhook.edit({
"url": "https://www.linkedin.com",
"events": [
"refund.created"
]
}, webhookId, accountId)
RazorpayClient client = new RazorpayClient("[ACCESS_TOKEN]");
string accountId = "acc_ua2tBezhcEBvap";
string webhookId = "wxK6n7AmmJyRtq";
Dictionary<string, object> webhookRequest = new Dictionary<string, object>();
webhookRequest.Add("url", "https://www.google.com");
List<string> events = new List<string>();
events.Add("refund.created");
webhookRequest.Add("events", events);
Webhook webhook = client.Webhook.Fetch(webhookId,accountId).Edit(webhookRequest, accountId);
{
"id": "HK890egfiItP3H",
"created_at": 1623060358,
"updated_at": 1623067148,
"service": "beta-api-test",
"owner_id": "H3kYHQ635sBwXG",
"owner_type": "merchant",
"context": [],
"disabled_at": 0,
"url": "https://www.linkedin.com",
"alert_email": "gaurav.kumar@example.com",
"secret_exists": true,
"entity": "webhook",
"active": true,
"events": [
"refund.created"
]
}
Available in🇮🇳 India🇲🇾 Malaysia🇺🇸 United States
Use this endpoint to update the details of a webhook. Know about the various error responses for this API.
curl -X PATCH https://api.razorpay.com/v2/accounts/acc_H3kYHQ635sBwXG/webhooks/HK890egfiItP3H \
-u <ACCESS_TOKEN> \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.linkedin.com",
"events": [
"refund.created"
]
}'
RazorpayClient razorpay = new RazorpayClient("[ACCESS_TOKEN]");
String accountId = "acc_GP4lfNA0iIMn5B";
String webhookId = "HK890egfiItP3H";
JSONObject webhookRequest = new JSONObject();
webhookRequest.put("url","https://www.linkedin.com");
ArrayList<String> events = new ArrayList<String>();
events.add("refund.created");
webhookRequest.put("events",events);
Webhook webhook = instance.webhook.edit(accountId, webhookId, webhookRequest);
require "razorpay"
Razorpay.setup('ACCESS_TOKEN')
webhookId = "HK890egfiItP3H"
accountId = "acc_GP4lfNA0iIMn5B"
Razorpay::Webhook.edit({
"url": "https://www.linkedin.com",
"events": [
"refund.created"
]
}, webhookId, accountId)
RazorpayClient client = new RazorpayClient("[ACCESS_TOKEN]");
string accountId = "acc_ua2tBezhcEBvap";
string webhookId = "wxK6n7AmmJyRtq";
Dictionary<string, object> webhookRequest = new Dictionary<string, object>();
webhookRequest.Add("url", "https://www.google.com");
List<string> events = new List<string>();
events.Add("refund.created");
webhookRequest.Add("events", events);
Webhook webhook = client.Webhook.Fetch(webhookId,accountId).Edit(webhookRequest, accountId);
{
"id": "HK890egfiItP3H",
"created_at": 1623060358,
"updated_at": 1623067148,
"service": "beta-api-test",
"owner_id": "H3kYHQ635sBwXG",
"owner_type": "merchant",
"context": [],
"disabled_at": 0,
"url": "https://www.linkedin.com",
"alert_email": "gaurav.kumar@example.com",
"secret_exists": true,
"entity": "webhook",
"active": true,
"events": [
"refund.created"
]
}
Path Parameters
The unique identifier of a sub-merchant account generated by Razorpay Curlec. For example,
acc_H3kYHQ635sBwXGThe unique identifier of the webhook whose details are to be updated. For example,
HK890egfiItP3HRequest Parameters
The URL where you receive the webhook payload when an event is triggered. The maximum length is 255 characters.
The required events from the list of Active Events. For example,
payment.authorized, payment.captured, payment.failed, payment.dispute.created, refund.failed, refund.created and so on.Response Parameters
The unique identifier of the created webhook. For example,
HK890egfiItP3H. This id is used to fetch, update or delete a webhook. The maximum length is 14 characters.The unique identifier generated by Razorpay Curlec for the sub-merchant who will receive the webhooks. For example, in this case, it will be
account_id passed in the API URL.The URL where you receive the webhook payload when an event is triggered. The maximum length is 255 characters.
This attribute is set to
true if a secret password has been set for the webhook endpoint. If no secret is sent in the request, this parameter does not appear in the response code.Last modified on November 17, 2026
Was this page helpful?