curl --request POST \
--url https://api-dashboard.payra.com/v1/webhook-endpoints/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/payra/webhooks",
"enabled_events": [
"payment.succeeded",
"payment.failed"
],
"description": "Order fulfilment"
}
'import requests
url = "https://api-dashboard.payra.com/v1/webhook-endpoints/{id}"
payload = {
"url": "https://example.com/payra/webhooks",
"enabled_events": ["payment.succeeded", "payment.failed"],
"description": "Order fulfilment"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com/payra/webhooks',
enabled_events: ['payment.succeeded', 'payment.failed'],
description: 'Order fulfilment'
})
};
fetch('https://api-dashboard.payra.com/v1/webhook-endpoints/{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-dashboard.payra.com/v1/webhook-endpoints/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://example.com/payra/webhooks',
'enabled_events' => [
'payment.succeeded',
'payment.failed'
],
'description' => 'Order fulfilment'
]),
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-dashboard.payra.com/v1/webhook-endpoints/{id}"
payload := strings.NewReader("{\n \"url\": \"https://example.com/payra/webhooks\",\n \"enabled_events\": [\n \"payment.succeeded\",\n \"payment.failed\"\n ],\n \"description\": \"Order fulfilment\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api-dashboard.payra.com/v1/webhook-endpoints/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/payra/webhooks\",\n \"enabled_events\": [\n \"payment.succeeded\",\n \"payment.failed\"\n ],\n \"description\": \"Order fulfilment\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dashboard.payra.com/v1/webhook-endpoints/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://example.com/payra/webhooks\",\n \"enabled_events\": [\n \"payment.succeeded\",\n \"payment.failed\"\n ],\n \"description\": \"Order fulfilment\"\n}"
response = http.request(request)
puts response.read_body{
"object": "webhook_endpoint",
"id": "we_test_4kQ2mL7Hs1pXv4cR8tWzAbCdEf",
"url": "https://example.com/payra/webhooks",
"description": "Order fulfilment",
"enabled_events": [
"payment.succeeded",
"payment.failed"
],
"status": "enabled",
"livemode": false,
"created_at": "2026-09-19T21:04:11.000Z",
"secret": "whsec_test_…"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}Update a webhook endpoint
Changes the URL, the events, the description or the status; fields left out are kept.
curl --request POST \
--url https://api-dashboard.payra.com/v1/webhook-endpoints/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/payra/webhooks",
"enabled_events": [
"payment.succeeded",
"payment.failed"
],
"description": "Order fulfilment"
}
'import requests
url = "https://api-dashboard.payra.com/v1/webhook-endpoints/{id}"
payload = {
"url": "https://example.com/payra/webhooks",
"enabled_events": ["payment.succeeded", "payment.failed"],
"description": "Order fulfilment"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com/payra/webhooks',
enabled_events: ['payment.succeeded', 'payment.failed'],
description: 'Order fulfilment'
})
};
fetch('https://api-dashboard.payra.com/v1/webhook-endpoints/{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-dashboard.payra.com/v1/webhook-endpoints/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://example.com/payra/webhooks',
'enabled_events' => [
'payment.succeeded',
'payment.failed'
],
'description' => 'Order fulfilment'
]),
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-dashboard.payra.com/v1/webhook-endpoints/{id}"
payload := strings.NewReader("{\n \"url\": \"https://example.com/payra/webhooks\",\n \"enabled_events\": [\n \"payment.succeeded\",\n \"payment.failed\"\n ],\n \"description\": \"Order fulfilment\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api-dashboard.payra.com/v1/webhook-endpoints/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/payra/webhooks\",\n \"enabled_events\": [\n \"payment.succeeded\",\n \"payment.failed\"\n ],\n \"description\": \"Order fulfilment\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-dashboard.payra.com/v1/webhook-endpoints/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://example.com/payra/webhooks\",\n \"enabled_events\": [\n \"payment.succeeded\",\n \"payment.failed\"\n ],\n \"description\": \"Order fulfilment\"\n}"
response = http.request(request)
puts response.read_body{
"object": "webhook_endpoint",
"id": "we_test_4kQ2mL7Hs1pXv4cR8tWzAbCdEf",
"url": "https://example.com/payra/webhooks",
"description": "Order fulfilment",
"enabled_events": [
"payment.succeeded",
"payment.failed"
],
"status": "enabled",
"livemode": false,
"created_at": "2026-09-19T21:04:11.000Z",
"secret": "whsec_test_…"
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "invalid_request_error",
"code": "<string>",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}Authorizations
A secret key, sk_test_... or sk_live_...; a publishable key (pk_...) on the browser routes only
Path Parameters
1 - 64Body
Where events are posted. https only, on a publicly reachable host.
1 - 2048"https://example.com/payra/webhooks"
The event types to deliver, or * alone for every type, present and future.
1payment.processing, payment.authorized, payment.succeeded, payment.failed, payment.canceled, payment.returned, refund.pending, refund.succeeded, refund.failed, checkout_session.completed, checkout_session.expired, * ["payment.succeeded", "payment.failed"]
500"Order fulfilment"
enabled, disabled Response
The endpoint
webhook_endpoint "we_test_4kQ2mL7Hs1pXv4cR8tWzAbCdEf"
"https://example.com/payra/webhooks"
"Order fulfilment"
The event types to deliver, or * alone for every type, present and future.
1payment.processing, payment.authorized, payment.succeeded, payment.failed, payment.canceled, payment.returned, refund.pending, refund.succeeded, refund.failed, checkout_session.completed, checkout_session.expired, * ["payment.succeeded", "payment.failed"]
A disabled endpoint keeps its configuration and secret but receives nothing.
enabled, disabled "enabled"
false
"2026-09-19T21:04:11.000Z"
The signing secret, present in the create response only; store it, it is never shown again.
"whsec_test_…"