Update Webhook
curl --request PUT \
--url https://sandbox.api.paylias.xyz/gateway/api/v1/csp/webhook/{webhook_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--header 'x-partner-id: <x-partner-id>' \
--data '
{
"name": "Payment Webhook",
"endpoint": "https://example.com/webhook",
"events": [
{
"record_type": "RT_PaymentSubmissions",
"event_type": "EK_Created"
},
{
"record_type": "RT_PaymentSubmissions",
"event_type": "EK_Updated"
}
],
"enabled": true,
"secret": "ASDLKJASDFLKJ121232342"
}
'import requests
url = "https://sandbox.api.paylias.xyz/gateway/api/v1/csp/webhook/{webhook_id}"
payload = {
"name": "Payment Webhook",
"endpoint": "https://example.com/webhook",
"events": [
{
"record_type": "RT_PaymentSubmissions",
"event_type": "EK_Created"
},
{
"record_type": "RT_PaymentSubmissions",
"event_type": "EK_Updated"
}
],
"enabled": True,
"secret": "ASDLKJASDFLKJ121232342"
}
headers = {
"x-partner-id": "<x-partner-id>",
"idempotency-key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-partner-id': '<x-partner-id>',
'idempotency-key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Payment Webhook',
endpoint: 'https://example.com/webhook',
events: [
{record_type: 'RT_PaymentSubmissions', event_type: 'EK_Created'},
{record_type: 'RT_PaymentSubmissions', event_type: 'EK_Updated'}
],
enabled: true,
secret: 'ASDLKJASDFLKJ121232342'
})
};
fetch('https://sandbox.api.paylias.xyz/gateway/api/v1/csp/webhook/{webhook_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://sandbox.api.paylias.xyz/gateway/api/v1/csp/webhook/{webhook_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Payment Webhook',
'endpoint' => 'https://example.com/webhook',
'events' => [
[
'record_type' => 'RT_PaymentSubmissions',
'event_type' => 'EK_Created'
],
[
'record_type' => 'RT_PaymentSubmissions',
'event_type' => 'EK_Updated'
]
],
'enabled' => true,
'secret' => 'ASDLKJASDFLKJ121232342'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"idempotency-key: <idempotency-key>",
"x-partner-id: <x-partner-id>"
],
]);
$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://sandbox.api.paylias.xyz/gateway/api/v1/csp/webhook/{webhook_id}"
payload := strings.NewReader("{\n \"name\": \"Payment Webhook\",\n \"endpoint\": \"https://example.com/webhook\",\n \"events\": [\n {\n \"record_type\": \"RT_PaymentSubmissions\",\n \"event_type\": \"EK_Created\"\n },\n {\n \"record_type\": \"RT_PaymentSubmissions\",\n \"event_type\": \"EK_Updated\"\n }\n ],\n \"enabled\": true,\n \"secret\": \"ASDLKJASDFLKJ121232342\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-partner-id", "<x-partner-id>")
req.Header.Add("idempotency-key", "<idempotency-key>")
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.put("https://sandbox.api.paylias.xyz/gateway/api/v1/csp/webhook/{webhook_id}")
.header("x-partner-id", "<x-partner-id>")
.header("idempotency-key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Payment Webhook\",\n \"endpoint\": \"https://example.com/webhook\",\n \"events\": [\n {\n \"record_type\": \"RT_PaymentSubmissions\",\n \"event_type\": \"EK_Created\"\n },\n {\n \"record_type\": \"RT_PaymentSubmissions\",\n \"event_type\": \"EK_Updated\"\n }\n ],\n \"enabled\": true,\n \"secret\": \"ASDLKJASDFLKJ121232342\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.paylias.xyz/gateway/api/v1/csp/webhook/{webhook_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-partner-id"] = '<x-partner-id>'
request["idempotency-key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Payment Webhook\",\n \"endpoint\": \"https://example.com/webhook\",\n \"events\": [\n {\n \"record_type\": \"RT_PaymentSubmissions\",\n \"event_type\": \"EK_Created\"\n },\n {\n \"record_type\": \"RT_PaymentSubmissions\",\n \"event_type\": \"EK_Updated\"\n }\n ],\n \"enabled\": true,\n \"secret\": \"ASDLKJASDFLKJ121232342\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"description": "Webhook to consume link events",
"endpoint": "https://www.postb.in/1743272420303-9920796800870",
"enabled": false,
"events": [
{
"record_type": "RT_PaymentSubmissions",
"event_type": "EK_Created"
},
{
"record_type": "RT_PaymentSubmissions",
"event_type": "EK_Updated"
}
],
"name": "Link Events",
"secret": "2ff46f215a5bb7da8f7fda9b2b0c9ef86c9e7de6"
},
"ok": true
}{
"code": "error.bad_request",
"message": "Invalid request parameters"
}{
"code": "error.unauthorized",
"message": "Authentication required"
}{
"code": "error.not_found",
"message": "Requested resource not found"
}{
"code": "error.conflict",
"message": "Resource already exists"
}Webhooks
Update Webhook
Webhooks can be updated by provinding the below listed parameters.
Setting a webhook secret allows you to ensure that POST requests sent to the payload URL are from GitHub. When you set a secret, you’ll receive the X-PAYLIAS-SIGNATURE header in the webhook POST request.
The add_events array allows your webhook to subscribe to additional events while the remove_events array will unsubscribe the events from your webhook. Please note that the uniqueness constraint from the section above still applies.
PUT
/
api
/
v1
/
csp
/
webhook
/
{webhook_id}
Update Webhook
curl --request PUT \
--url https://sandbox.api.paylias.xyz/gateway/api/v1/csp/webhook/{webhook_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--header 'x-partner-id: <x-partner-id>' \
--data '
{
"name": "Payment Webhook",
"endpoint": "https://example.com/webhook",
"events": [
{
"record_type": "RT_PaymentSubmissions",
"event_type": "EK_Created"
},
{
"record_type": "RT_PaymentSubmissions",
"event_type": "EK_Updated"
}
],
"enabled": true,
"secret": "ASDLKJASDFLKJ121232342"
}
'import requests
url = "https://sandbox.api.paylias.xyz/gateway/api/v1/csp/webhook/{webhook_id}"
payload = {
"name": "Payment Webhook",
"endpoint": "https://example.com/webhook",
"events": [
{
"record_type": "RT_PaymentSubmissions",
"event_type": "EK_Created"
},
{
"record_type": "RT_PaymentSubmissions",
"event_type": "EK_Updated"
}
],
"enabled": True,
"secret": "ASDLKJASDFLKJ121232342"
}
headers = {
"x-partner-id": "<x-partner-id>",
"idempotency-key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'x-partner-id': '<x-partner-id>',
'idempotency-key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Payment Webhook',
endpoint: 'https://example.com/webhook',
events: [
{record_type: 'RT_PaymentSubmissions', event_type: 'EK_Created'},
{record_type: 'RT_PaymentSubmissions', event_type: 'EK_Updated'}
],
enabled: true,
secret: 'ASDLKJASDFLKJ121232342'
})
};
fetch('https://sandbox.api.paylias.xyz/gateway/api/v1/csp/webhook/{webhook_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://sandbox.api.paylias.xyz/gateway/api/v1/csp/webhook/{webhook_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Payment Webhook',
'endpoint' => 'https://example.com/webhook',
'events' => [
[
'record_type' => 'RT_PaymentSubmissions',
'event_type' => 'EK_Created'
],
[
'record_type' => 'RT_PaymentSubmissions',
'event_type' => 'EK_Updated'
]
],
'enabled' => true,
'secret' => 'ASDLKJASDFLKJ121232342'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"idempotency-key: <idempotency-key>",
"x-partner-id: <x-partner-id>"
],
]);
$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://sandbox.api.paylias.xyz/gateway/api/v1/csp/webhook/{webhook_id}"
payload := strings.NewReader("{\n \"name\": \"Payment Webhook\",\n \"endpoint\": \"https://example.com/webhook\",\n \"events\": [\n {\n \"record_type\": \"RT_PaymentSubmissions\",\n \"event_type\": \"EK_Created\"\n },\n {\n \"record_type\": \"RT_PaymentSubmissions\",\n \"event_type\": \"EK_Updated\"\n }\n ],\n \"enabled\": true,\n \"secret\": \"ASDLKJASDFLKJ121232342\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-partner-id", "<x-partner-id>")
req.Header.Add("idempotency-key", "<idempotency-key>")
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.put("https://sandbox.api.paylias.xyz/gateway/api/v1/csp/webhook/{webhook_id}")
.header("x-partner-id", "<x-partner-id>")
.header("idempotency-key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Payment Webhook\",\n \"endpoint\": \"https://example.com/webhook\",\n \"events\": [\n {\n \"record_type\": \"RT_PaymentSubmissions\",\n \"event_type\": \"EK_Created\"\n },\n {\n \"record_type\": \"RT_PaymentSubmissions\",\n \"event_type\": \"EK_Updated\"\n }\n ],\n \"enabled\": true,\n \"secret\": \"ASDLKJASDFLKJ121232342\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.api.paylias.xyz/gateway/api/v1/csp/webhook/{webhook_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-partner-id"] = '<x-partner-id>'
request["idempotency-key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Payment Webhook\",\n \"endpoint\": \"https://example.com/webhook\",\n \"events\": [\n {\n \"record_type\": \"RT_PaymentSubmissions\",\n \"event_type\": \"EK_Created\"\n },\n {\n \"record_type\": \"RT_PaymentSubmissions\",\n \"event_type\": \"EK_Updated\"\n }\n ],\n \"enabled\": true,\n \"secret\": \"ASDLKJASDFLKJ121232342\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"description": "Webhook to consume link events",
"endpoint": "https://www.postb.in/1743272420303-9920796800870",
"enabled": false,
"events": [
{
"record_type": "RT_PaymentSubmissions",
"event_type": "EK_Created"
},
{
"record_type": "RT_PaymentSubmissions",
"event_type": "EK_Updated"
}
],
"name": "Link Events",
"secret": "2ff46f215a5bb7da8f7fda9b2b0c9ef86c9e7de6"
},
"ok": true
}{
"code": "error.bad_request",
"message": "Invalid request parameters"
}{
"code": "error.unauthorized",
"message": "Authentication required"
}{
"code": "error.not_found",
"message": "Requested resource not found"
}{
"code": "error.conflict",
"message": "Resource already exists"
}Authorizations
Headers
Path Parameters
Body
application/json
Request to update an existing webhook
Was this page helpful?