Webhooks
Create webhook
Create a new webhook subscription
POST
/
v1
/
webhooks
Create webhook
curl --request POST \
--url https://api.example.com/v1/webhooksimport requests
url = "https://api.example.com/v1/webhooks"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/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.example.com/v1/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/webhooks"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/v1/webhooks")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"key": "uLbBzVvN7ARX",
"name": "Partner Notifications",
"url": "https://yourcompany.com/webhooks/partnero",
"is_active": true,
"signature": "Sjn3sNnmh14yk6zb",
"events": [
"partner.created",
"partner.approved",
"transaction.created"
]
},
"status": 1
}
Endpoint
POST https://api.partnero.com/v1/webhooks
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Name for the webhook |
url | string | Yes | URL where webhook events will be sent |
events | array | Yes | Array of event types to subscribe to |
key | string | No | Custom unique ID (auto-generated if not provided) |
is_active | boolean | No | Whether the webhook is active (default: true) |
Request
cURL
curl --location 'https://api.partnero.com/v1/webhooks' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"name": "Partner Notifications",
"url": "https://yourcompany.com/webhooks/partnero",
"events": [
"partner.created",
"partner.approved",
"transaction.created"
]
}'
Response
{
"data": {
"key": "uLbBzVvN7ARX",
"name": "Partner Notifications",
"url": "https://yourcompany.com/webhooks/partnero",
"is_active": true,
"signature": "Sjn3sNnmh14yk6zb",
"events": [
"partner.created",
"partner.approved",
"transaction.created"
]
},
"status": 1
}
Store the
signature value securely. You’ll need it to verify incoming webhook requests.⌘I
Create webhook
curl --request POST \
--url https://api.example.com/v1/webhooksimport requests
url = "https://api.example.com/v1/webhooks"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/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.example.com/v1/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/webhooks"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/v1/webhooks")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"key": "uLbBzVvN7ARX",
"name": "Partner Notifications",
"url": "https://yourcompany.com/webhooks/partnero",
"is_active": true,
"signature": "Sjn3sNnmh14yk6zb",
"events": [
"partner.created",
"partner.approved",
"transaction.created"
]
},
"status": 1
}
