Update
curl --request PUT \
--url https://api.sandbox.wepayout.com.br/v2/register/companies/webhooks/{event} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"event": "<string>",
"url": "<string>",
"secret": "<string>"
}
'import requests
url = "https://api.sandbox.wepayout.com.br/v2/register/companies/webhooks/{event}"
payload = {
"event": "<string>",
"url": "<string>",
"secret": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({event: '<string>', url: '<string>', secret: '<string>'})
};
fetch('https://api.sandbox.wepayout.com.br/v2/register/companies/webhooks/{event}', 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.sandbox.wepayout.com.br/v2/register/companies/webhooks/{event}",
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([
'event' => '<string>',
'url' => '<string>',
'secret' => '<string>'
]),
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.sandbox.wepayout.com.br/v2/register/companies/webhooks/{event}"
payload := strings.NewReader("{\n \"event\": \"<string>\",\n \"url\": \"<string>\",\n \"secret\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.sandbox.wepayout.com.br/v2/register/companies/webhooks/{event}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"event\": \"<string>\",\n \"url\": \"<string>\",\n \"secret\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.wepayout.com.br/v2/register/companies/webhooks/{event}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"event\": \"<string>\",\n \"url\": \"<string>\",\n \"secret\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"event": "onboarding",
"url": "https://my-url.requestcatcher.com/test",
"secret": "whsec_9f8e7d6c5b4a3210"
}
Webhook
Update
Update an existing webhook configuration
PUT
/
v2
/
register
/
companies
/
webhooks
/
{event}
Update
curl --request PUT \
--url https://api.sandbox.wepayout.com.br/v2/register/companies/webhooks/{event} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"event": "<string>",
"url": "<string>",
"secret": "<string>"
}
'import requests
url = "https://api.sandbox.wepayout.com.br/v2/register/companies/webhooks/{event}"
payload = {
"event": "<string>",
"url": "<string>",
"secret": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({event: '<string>', url: '<string>', secret: '<string>'})
};
fetch('https://api.sandbox.wepayout.com.br/v2/register/companies/webhooks/{event}', 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.sandbox.wepayout.com.br/v2/register/companies/webhooks/{event}",
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([
'event' => '<string>',
'url' => '<string>',
'secret' => '<string>'
]),
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.sandbox.wepayout.com.br/v2/register/companies/webhooks/{event}"
payload := strings.NewReader("{\n \"event\": \"<string>\",\n \"url\": \"<string>\",\n \"secret\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.sandbox.wepayout.com.br/v2/register/companies/webhooks/{event}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"event\": \"<string>\",\n \"url\": \"<string>\",\n \"secret\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.wepayout.com.br/v2/register/companies/webhooks/{event}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"event\": \"<string>\",\n \"url\": \"<string>\",\n \"secret\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"event": "onboarding",
"url": "https://my-url.requestcatcher.com/test",
"secret": "whsec_9f8e7d6c5b4a3210"
}
Update Webhook URL
This endpoint allows updating the webhook URL and signing secret associated with a specific event.- The event parameter must be provided in the path
- The request body should include the new configuration values for the specified event’s webhook URL
Registering, updating or removing a webhook may take up to 5 minutes to take effect. Until then, webhooks keep being delivered to the previous destination.
Path Parameters
string
required
The event type for which to update the webhook URLAllowed values:
onboarding, payin, payoutExample: onboardingRequest Body
string
required
Type of event of the webhook. Must match the
event path parameter.Allowed values: onboarding, payin, payoutstring
required
Endpoint URL that will receive the webhook notifications for the selected event.URL characters:
a-z, A-Z charactersMaximum length: 120 charactersExample: https://my-url.requestcatcher.com/teststring
Secret used to sign the
payin and payout webhooks with HMAC-SHA256. When provided, every webhook for this event includes the x-webhook-wp-signature header.Maximum length: 255 characters. Use a long, randomly generated value.Example: whsec_9f8e7d6c5b4a3210The update replaces the whole configuration. If
secret is omitted or null, the current secret is removed and the webhooks are no longer signed. Always send the secret you want to keep.To rotate the secret, send the new value in
secret. Changes may take up to 5 minutes to take effect, so accept signatures computed with either the old or the new secret during this period.Response
string
Type of event that was registered for the webhookAllowed values:
onboarding, payin, payoutstring
Endpoint URL that was registered to receive webhook notificationsExample:
https://my-url.com/teststring
Secret used to sign the webhooks for this event, or
null if none is set.Example: whsec_9f8e7d6c5b4a3210Request Example
curl --request PUT \
--url https://api.sandbox.wepayout.com.br/v2/register/companies/webhooks/onboarding \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
"event": "onboarding",
"url": "https://my-url.requestcatcher.com/test",
"secret": "whsec_9f8e7d6c5b4a3210"
}'
const event = 'onboarding';
const response = await fetch(`https://api.sandbox.wepayout.com.br/v2/register/companies/webhooks/${event}`, {
method: 'PUT',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
event,
url: 'https://my-url.requestcatcher.com/test',
secret: 'whsec_9f8e7d6c5b4a3210'
})
});
const data = await response.json();
console.log(data);
import requests
event = 'onboarding'
url = f'https://api.sandbox.wepayout.com.br/v2/register/companies/webhooks/{event}'
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
}
data = {
'event': event,
'url': 'https://my-url.requestcatcher.com/test',
'secret': 'whsec_9f8e7d6c5b4a3210'
}
response = requests.put(url, json=data, headers=headers)
print(response.json())
{
"event": "onboarding",
"url": "https://my-url.requestcatcher.com/test",
"secret": "whsec_9f8e7d6c5b4a3210"
}
Was this page helpful?

