Create webhook endpoint
curl --request POST \
--url https://sandbox.payfi.global/v1/webhooks \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <api-key>' \
--header 'X-PayFi-Api-Key: <api-key>' \
--header 'X-PayFi-Nonce: <api-key>' \
--header 'X-PayFi-Signature: <api-key>' \
--data '
{
"name": "Acme endpoint",
"url": "https://acme.example/payfi/webhooks",
"eventTypes": [
"operation.created",
"operation.requirements.ready",
"operation.analysis.completed",
"operation.action_required"
]
}
'import requests
url = "https://sandbox.payfi.global/v1/webhooks"
payload = {
"name": "Acme endpoint",
"url": "https://acme.example/payfi/webhooks",
"eventTypes": ["operation.created", "operation.requirements.ready", "operation.analysis.completed", "operation.action_required"]
}
headers = {
"X-PayFi-Api-Key": "<api-key>",
"X-PayFi-Nonce": "<api-key>",
"X-PayFi-Signature": "<api-key>",
"Idempotency-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-PayFi-Api-Key': '<api-key>',
'X-PayFi-Nonce': '<api-key>',
'X-PayFi-Signature': '<api-key>',
'Idempotency-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Acme endpoint',
url: 'https://acme.example/payfi/webhooks',
eventTypes: [
'operation.created',
'operation.requirements.ready',
'operation.analysis.completed',
'operation.action_required'
]
})
};
fetch('https://sandbox.payfi.global/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://sandbox.payfi.global/v1/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([
'name' => 'Acme endpoint',
'url' => 'https://acme.example/payfi/webhooks',
'eventTypes' => [
'operation.created',
'operation.requirements.ready',
'operation.analysis.completed',
'operation.action_required'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <api-key>",
"X-PayFi-Api-Key: <api-key>",
"X-PayFi-Nonce: <api-key>",
"X-PayFi-Signature: <api-key>"
],
]);
$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.payfi.global/v1/webhooks"
payload := strings.NewReader("{\n \"name\": \"Acme endpoint\",\n \"url\": \"https://acme.example/payfi/webhooks\",\n \"eventTypes\": [\n \"operation.created\",\n \"operation.requirements.ready\",\n \"operation.analysis.completed\",\n \"operation.action_required\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-PayFi-Api-Key", "<api-key>")
req.Header.Add("X-PayFi-Nonce", "<api-key>")
req.Header.Add("X-PayFi-Signature", "<api-key>")
req.Header.Add("Idempotency-Key", "<api-key>")
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://sandbox.payfi.global/v1/webhooks")
.header("X-PayFi-Api-Key", "<api-key>")
.header("X-PayFi-Nonce", "<api-key>")
.header("X-PayFi-Signature", "<api-key>")
.header("Idempotency-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme endpoint\",\n \"url\": \"https://acme.example/payfi/webhooks\",\n \"eventTypes\": [\n \"operation.created\",\n \"operation.requirements.ready\",\n \"operation.analysis.completed\",\n \"operation.action_required\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.payfi.global/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-PayFi-Api-Key"] = '<api-key>'
request["X-PayFi-Nonce"] = '<api-key>'
request["X-PayFi-Signature"] = '<api-key>'
request["Idempotency-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Acme endpoint\",\n \"url\": \"https://acme.example/payfi/webhooks\",\n \"eventTypes\": [\n \"operation.created\",\n \"operation.requirements.ready\",\n \"operation.analysis.completed\",\n \"operation.action_required\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"webhookId": "whe_example",
"name": "Acme endpoint",
"url": "https://acme.example/payfi/webhooks",
"status": "ACTIVE",
"eventTypes": [
"operation.created",
"operation.requirements.ready",
"operation.analysis.completed",
"operation.action_required"
],
"secretPreview": "whsec_te...abcd",
"secret": "whsec_test_returned_once",
"createdAt": "2026-05-20T12:00:00.000Z",
"updatedAt": "2026-05-20T12:00:00.000Z"
}{
"error": {
"code": "INVALID_REQUEST",
"message": "The request payload is invalid."
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication failed."
}
}Webhooks
Create webhook endpoint
Creates a signed webhook endpoint and returns the webhook signing secret once.
POST
/
v1
/
webhooks
Create webhook endpoint
curl --request POST \
--url https://sandbox.payfi.global/v1/webhooks \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <api-key>' \
--header 'X-PayFi-Api-Key: <api-key>' \
--header 'X-PayFi-Nonce: <api-key>' \
--header 'X-PayFi-Signature: <api-key>' \
--data '
{
"name": "Acme endpoint",
"url": "https://acme.example/payfi/webhooks",
"eventTypes": [
"operation.created",
"operation.requirements.ready",
"operation.analysis.completed",
"operation.action_required"
]
}
'import requests
url = "https://sandbox.payfi.global/v1/webhooks"
payload = {
"name": "Acme endpoint",
"url": "https://acme.example/payfi/webhooks",
"eventTypes": ["operation.created", "operation.requirements.ready", "operation.analysis.completed", "operation.action_required"]
}
headers = {
"X-PayFi-Api-Key": "<api-key>",
"X-PayFi-Nonce": "<api-key>",
"X-PayFi-Signature": "<api-key>",
"Idempotency-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-PayFi-Api-Key': '<api-key>',
'X-PayFi-Nonce': '<api-key>',
'X-PayFi-Signature': '<api-key>',
'Idempotency-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Acme endpoint',
url: 'https://acme.example/payfi/webhooks',
eventTypes: [
'operation.created',
'operation.requirements.ready',
'operation.analysis.completed',
'operation.action_required'
]
})
};
fetch('https://sandbox.payfi.global/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://sandbox.payfi.global/v1/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([
'name' => 'Acme endpoint',
'url' => 'https://acme.example/payfi/webhooks',
'eventTypes' => [
'operation.created',
'operation.requirements.ready',
'operation.analysis.completed',
'operation.action_required'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Idempotency-Key: <api-key>",
"X-PayFi-Api-Key: <api-key>",
"X-PayFi-Nonce: <api-key>",
"X-PayFi-Signature: <api-key>"
],
]);
$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.payfi.global/v1/webhooks"
payload := strings.NewReader("{\n \"name\": \"Acme endpoint\",\n \"url\": \"https://acme.example/payfi/webhooks\",\n \"eventTypes\": [\n \"operation.created\",\n \"operation.requirements.ready\",\n \"operation.analysis.completed\",\n \"operation.action_required\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-PayFi-Api-Key", "<api-key>")
req.Header.Add("X-PayFi-Nonce", "<api-key>")
req.Header.Add("X-PayFi-Signature", "<api-key>")
req.Header.Add("Idempotency-Key", "<api-key>")
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://sandbox.payfi.global/v1/webhooks")
.header("X-PayFi-Api-Key", "<api-key>")
.header("X-PayFi-Nonce", "<api-key>")
.header("X-PayFi-Signature", "<api-key>")
.header("Idempotency-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme endpoint\",\n \"url\": \"https://acme.example/payfi/webhooks\",\n \"eventTypes\": [\n \"operation.created\",\n \"operation.requirements.ready\",\n \"operation.analysis.completed\",\n \"operation.action_required\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.payfi.global/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-PayFi-Api-Key"] = '<api-key>'
request["X-PayFi-Nonce"] = '<api-key>'
request["X-PayFi-Signature"] = '<api-key>'
request["Idempotency-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Acme endpoint\",\n \"url\": \"https://acme.example/payfi/webhooks\",\n \"eventTypes\": [\n \"operation.created\",\n \"operation.requirements.ready\",\n \"operation.analysis.completed\",\n \"operation.action_required\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"webhookId": "whe_example",
"name": "Acme endpoint",
"url": "https://acme.example/payfi/webhooks",
"status": "ACTIVE",
"eventTypes": [
"operation.created",
"operation.requirements.ready",
"operation.analysis.completed",
"operation.action_required"
],
"secretPreview": "whsec_te...abcd",
"secret": "whsec_test_returned_once",
"createdAt": "2026-05-20T12:00:00.000Z",
"updatedAt": "2026-05-20T12:00:00.000Z"
}{
"error": {
"code": "INVALID_REQUEST",
"message": "The request payload is invalid."
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication failed."
}
}Authorizations
Body
application/json
Webhook endpoint payload.
Response
Webhook endpoint created. The secret is returned only in this response.
Example:
"whe_example"
Example:
"Acme endpoint"
Example:
"https://acme.example/payfi/webhooks"
Example:
"ACTIVE"
Example:
["operation.analysis.completed"]
Example:
"whsec_te...abcd"
Example:
"whsec_test_returned_once"
Example:
"2026-05-20T12:00:00.000Z"
Example:
"2026-05-20T12:00:00.000Z"
⌘I