In samples we are using CreateWebhook.php sample to get the created instance of webhook. However, in real case scenario, we could use just the ID from database or use an already existing webhook.
Updating the webhook as per given request
[
{
"op":"replace",
"path":"/url",
"value":"https://requestb.in/10ujt3c1"
},
{
"op":"replace",
"path":"/event_types",
"value":[
{
"name":"PAYMENT.SALE.REFUNDED"
}
]
}
]
Update Webhook Sample
This sample code demonstrate how to use this call to update a webhook; supports the replace operation only, as documented here at: https://developer.paypal.com/webapps/developer/docs/api/#update-a-webhook API used: PATCH v1/notifications/webhooks/