curl
curl -X PATCH https://api.paybridgenp.com/v1/webhooks/we_01j9x2k3m4n5p6q7r8s9t0u1v2 \
-H "Authorization: Bearer sk_test_your_key" \
-H "Content-Type: application/json" \
-d '{"events": ["payment.succeeded", "payment.failed", "payment.cancelled", "payment.refunded"]}'import requests
url = "https://api.paybridgenp.com/v1/webhooks/{id}"
payload = {
"url": "https://yourapp.com/webhooks/paybridgenp",
"events": ["payment.succeeded", "payment.failed", "payment.cancelled", "payment.refunded"],
"enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://yourapp.com/webhooks/paybridgenp',
events: ['payment.succeeded', 'payment.failed', 'payment.cancelled', 'payment.refunded'],
enabled: true
})
};
fetch('https://api.paybridgenp.com/v1/webhooks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.paybridgenp.com/v1/webhooks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://yourapp.com/webhooks/paybridgenp',
'events' => [
'payment.succeeded',
'payment.failed',
'payment.cancelled',
'payment.refunded'
],
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.paybridgenp.com/v1/webhooks/{id}"
payload := strings.NewReader("{\n \"url\": \"https://yourapp.com/webhooks/paybridgenp\",\n \"events\": [\n \"payment.succeeded\",\n \"payment.failed\",\n \"payment.cancelled\",\n \"payment.refunded\"\n ],\n \"enabled\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.paybridgenp.com/v1/webhooks/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://yourapp.com/webhooks/paybridgenp\",\n \"events\": [\n \"payment.succeeded\",\n \"payment.failed\",\n \"payment.cancelled\",\n \"payment.refunded\"\n ],\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paybridgenp.com/v1/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://yourapp.com/webhooks/paybridgenp\",\n \"events\": [\n \"payment.succeeded\",\n \"payment.failed\",\n \"payment.cancelled\",\n \"payment.refunded\"\n ],\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"url": "<string>",
"events": [
"<string>"
],
"enabled": true
}{
"error": {
"message": "<string>",
"type": "authentication_error",
"code": "<string>",
"request_id": "req_2Je91NlWKuXkdXUJOK9gaHNW",
"suspension": {
"suspended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
},
"pause": {
"paused_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
}
}{
"error": {
"message": "<string>",
"type": "authentication_error",
"code": "<string>",
"request_id": "req_2Je91NlWKuXkdXUJOK9gaHNW",
"suspension": {
"suspended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
},
"pause": {
"paused_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
}
}{
"error": {
"message": "<string>",
"type": "authentication_error",
"code": "<string>",
"request_id": "req_2Je91NlWKuXkdXUJOK9gaHNW",
"suspension": {
"suspended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
},
"pause": {
"paused_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
}
}Webhooks
Update a webhook endpoint
Updates the URL, subscribed events, or enabled state of an existing webhook endpoint. Only the fields you include in the request body are changed - omitted fields keep their current value.
PATCH
/
v1
/
webhooks
/
{id}
curl
curl -X PATCH https://api.paybridgenp.com/v1/webhooks/we_01j9x2k3m4n5p6q7r8s9t0u1v2 \
-H "Authorization: Bearer sk_test_your_key" \
-H "Content-Type: application/json" \
-d '{"events": ["payment.succeeded", "payment.failed", "payment.cancelled", "payment.refunded"]}'import requests
url = "https://api.paybridgenp.com/v1/webhooks/{id}"
payload = {
"url": "https://yourapp.com/webhooks/paybridgenp",
"events": ["payment.succeeded", "payment.failed", "payment.cancelled", "payment.refunded"],
"enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://yourapp.com/webhooks/paybridgenp',
events: ['payment.succeeded', 'payment.failed', 'payment.cancelled', 'payment.refunded'],
enabled: true
})
};
fetch('https://api.paybridgenp.com/v1/webhooks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.paybridgenp.com/v1/webhooks/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://yourapp.com/webhooks/paybridgenp',
'events' => [
'payment.succeeded',
'payment.failed',
'payment.cancelled',
'payment.refunded'
],
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.paybridgenp.com/v1/webhooks/{id}"
payload := strings.NewReader("{\n \"url\": \"https://yourapp.com/webhooks/paybridgenp\",\n \"events\": [\n \"payment.succeeded\",\n \"payment.failed\",\n \"payment.cancelled\",\n \"payment.refunded\"\n ],\n \"enabled\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.paybridgenp.com/v1/webhooks/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://yourapp.com/webhooks/paybridgenp\",\n \"events\": [\n \"payment.succeeded\",\n \"payment.failed\",\n \"payment.cancelled\",\n \"payment.refunded\"\n ],\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paybridgenp.com/v1/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://yourapp.com/webhooks/paybridgenp\",\n \"events\": [\n \"payment.succeeded\",\n \"payment.failed\",\n \"payment.cancelled\",\n \"payment.refunded\"\n ],\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"url": "<string>",
"events": [
"<string>"
],
"enabled": true
}{
"error": {
"message": "<string>",
"type": "authentication_error",
"code": "<string>",
"request_id": "req_2Je91NlWKuXkdXUJOK9gaHNW",
"suspension": {
"suspended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
},
"pause": {
"paused_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
}
}{
"error": {
"message": "<string>",
"type": "authentication_error",
"code": "<string>",
"request_id": "req_2Je91NlWKuXkdXUJOK9gaHNW",
"suspension": {
"suspended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
},
"pause": {
"paused_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
}
}{
"error": {
"message": "<string>",
"type": "authentication_error",
"code": "<string>",
"request_id": "req_2Je91NlWKuXkdXUJOK9gaHNW",
"suspension": {
"suspended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
},
"pause": {
"paused_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
}
}Authorizations
Your PayBridgeNP API key. Obtain one from the dashboard under Settings → API Keys. Prefix: sk_test_ for testing, sk_live_ for production.
Path Parameters
Webhook endpoint ID (prefix: we_).
Body
application/json
New delivery URL. Must be https://. Internal/private IP ranges are rejected.
Example:
"https://yourapp.com/webhooks/paybridgenp"
Replace the subscribed event list. Pass an empty array to receive all events.
Example:
[
"payment.succeeded",
"payment.failed",
"payment.cancelled",
"payment.refunded"
]
Set false to temporarily pause deliveries without deleting the endpoint.
Example:
true
Was this page helpful?
⌘I