Setup
curl --request POST \
--url https://api.sandbox.wepayout.com.br/v2/register/companies/webhooks \
--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"
payload = {
"event": "<string>",
"url": "<string>",
"secret": "<string>"
}
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({event: '<string>', url: '<string>', secret: '<string>'})
};
fetch('https://api.sandbox.wepayout.com.br/v2/register/companies/webhooks', 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",
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([
'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"
payload := strings.NewReader("{\n \"event\": \"<string>\",\n \"url\": \"<string>\",\n \"secret\": \"<string>\"\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.sandbox.wepayout.com.br/v2/register/companies/webhooks")
.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")
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 \"event\": \"<string>\",\n \"url\": \"<string>\",\n \"secret\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"event": "payin",
"url": "https://my-url.requestcatcher.com/test",
"secret": "whsec_9f8e7d6c5b4a3210"
}
{
"success": false,
"error": {
"code": "invalid_url",
"message": "Webhook URL must use HTTPS protocol",
"field": "url"
}
}
{
"success": false,
"error": {
"code": "unauthorized",
"message": "Invalid API key provided"
}
}
Webhook
Setup
Register a webhook URL to receive automatic notifications about relevant events
POST
/
v2
/
register
/
companies
/
webhooks
Setup
curl --request POST \
--url https://api.sandbox.wepayout.com.br/v2/register/companies/webhooks \
--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"
payload = {
"event": "<string>",
"url": "<string>",
"secret": "<string>"
}
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({event: '<string>', url: '<string>', secret: '<string>'})
};
fetch('https://api.sandbox.wepayout.com.br/v2/register/companies/webhooks', 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",
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([
'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"
payload := strings.NewReader("{\n \"event\": \"<string>\",\n \"url\": \"<string>\",\n \"secret\": \"<string>\"\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.sandbox.wepayout.com.br/v2/register/companies/webhooks")
.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")
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 \"event\": \"<string>\",\n \"url\": \"<string>\",\n \"secret\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"event": "payin",
"url": "https://my-url.requestcatcher.com/test",
"secret": "whsec_9f8e7d6c5b4a3210"
}
{
"success": false,
"error": {
"code": "invalid_url",
"message": "Webhook URL must use HTTPS protocol",
"field": "url"
}
}
{
"success": false,
"error": {
"code": "unauthorized",
"message": "Invalid API key provided"
}
}
Setup
The system allows the registration of webhook URLs to receive automatic notifications about relevant events. Webhook URL: HTTPS address where the events will be delivered.Supported events: onboarding, payin, payout
Notification format: JSON payload sent via HTTP request
Request method: All notifications will be sent exclusively using the POST method
The registered URL overrides the URL sent in each request. Once a webhook is registered for the
payin or payout event, every webhook of that event is delivered to the registered URL, and the notification_url / callback_url sent when creating a transaction is ignored. The same applies to all Payin and Payout webhooks — status updates, refunds and Data Qualifications. The URL sent in the request is only used when no webhook is registered for the event.Registered deliveries are sent with the x-webhook-wp-type and x-webhook-wp-timestamp headers (plus x-webhook-wp-signature when a secret is set). See Webhook Signature.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.
Request Body
string
required
Type of event that will trigger the webhook.Allowed values:
onboarding, payin, payoutonboarding: notifications about the account onboarding status. Sent without thex-webhook-wp-typeheader.payin: notifications about Payin status changes (Pix — including Pix key credits and Automatic Pix —, Boleto, Credit Card and refunds).x-webhook-wp-typevalues:payin-pix: status update of a Pix Payin (including Automatic Pix and Pix key credits)payin-boleto: status update of a Boleto Payinpayin-credit-card: status update of a Credit Card Payinpayin-refund: refund of a received Pix Payin, requested by the merchant
payout: notifications about Payout status changes, refunds and Data Qualifications.x-webhook-wp-typevalues:payout-pix: status update of a Pix Payoutpayout-ted: status update of a TED Payoutpayout-qrcode: status update of a Pix QR Code Payoutpayout-refund: Pix Payout returned to the merchantpayout-customer-refund: status update of a customer refund (Reembolso) paid out to your customerpayout-data-qualification: status update of a Data Qualification
payinstring
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.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_9f8e7d6c5b4a3210Response
string
Type of event that will trigger the webhook.Allowed values:
onboarding, payin, payoutExample: payinstring
Endpoint URL that was registered to receive webhook notifications.Example:
https://my-url.requestcatcher.com/teststring
Secret used to sign the webhooks for this event, or
null if none is set.Example: whsec_9f8e7d6c5b4a3210Request Example
curl --request POST \
--url https://api.sandbox.wepayout.com.br/v2/register/companies/webhooks \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
"event": "payin",
"url": "https://my-url.requestcatcher.com/test",
"secret": "whsec_9f8e7d6c5b4a3210"
}'
const response = await fetch('https://api.sandbox.wepayout.com.br/v2/register/companies/webhooks', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
event: 'payin',
url: 'https://my-url.requestcatcher.com/test',
secret: 'whsec_9f8e7d6c5b4a3210'
})
});
const data = await response.json();
console.log(data);
import requests
url = 'https://api.sandbox.wepayout.com.br/v2/register/companies/webhooks'
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json'
}
data = {
'event': 'payin',
'url': 'https://my-url.requestcatcher.com/test',
'secret': 'whsec_9f8e7d6c5b4a3210'
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
{
"event": "payin",
"url": "https://my-url.requestcatcher.com/test",
"secret": "whsec_9f8e7d6c5b4a3210"
}
{
"success": false,
"error": {
"code": "invalid_url",
"message": "Webhook URL must use HTTPS protocol",
"field": "url"
}
}
{
"success": false,
"error": {
"code": "unauthorized",
"message": "Invalid API key provided"
}
}
Webhook Payload
When an onboarding event occurs, a POST request will be sent to your webhook URL:{
"id": "1234-5678-90ab-cdef-1234567890ab",
"status": "active",
"updated_at": "2024-01-15T10:30:00Z",
"account_id": 123
}
The account_id is only returned the first time in the webhook when the status is active.
When the new Onboarding Documents Flow is enabled for a merchant, the payload for the
pending_documents status also includes a documents array with the documents the client must send.Your webhook endpoint must return a
200 OK status code to acknowledge receipt. If the endpoint fails or returns an error, delivery is retried up to 3 times, every 15 minutes.Was this page helpful?

