cURL
curl --request PATCH \
--url https://api.sandbox.finsei.com/v2/webhook \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://api.site.com/webhook",
"enable": true,
"rateLimit": 300,
"events": [
"v1.payment.create"
]
}
'import requests
url = "https://api.sandbox.finsei.com/v2/webhook"
payload = {
"url": "https://api.site.com/webhook",
"enable": True,
"rateLimit": 300,
"events": ["v1.payment.create"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://api.site.com/webhook',
enable: true,
rateLimit: 300,
events: ['v1.payment.create']
})
};
fetch('https://api.sandbox.finsei.com/v2/webhook', 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.finsei.com/v2/webhook",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://api.site.com/webhook',
'enable' => true,
'rateLimit' => 300,
'events' => [
'v1.payment.create'
]
]),
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.finsei.com/v2/webhook"
payload := strings.NewReader("{\n \"url\": \"https://api.site.com/webhook\",\n \"enable\": true,\n \"rateLimit\": 300,\n \"events\": [\n \"v1.payment.create\"\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.sandbox.finsei.com/v2/webhook")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://api.site.com/webhook\",\n \"enable\": true,\n \"rateLimit\": 300,\n \"events\": [\n \"v1.payment.create\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.finsei.com/v2/webhook")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://api.site.com/webhook\",\n \"enable\": true,\n \"rateLimit\": 300,\n \"events\": [\n \"v1.payment.create\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"name": "Bad Request",
"message": "<string>",
"status": 400
}{
"name": "Unauthorized",
"message": "Your request was made with invalid credentials.",
"status": 401
}{
"name": "Forbidden",
"message": "String",
"status": 403
}{
"message": "The entity already exists",
"status": 409
}{
"status": "ERROR",
"errors": {
"email": "Email cannot be blank."
}
}{
"name": "Too Many Requests",
"message": "string",
"status": 429
}Endpoints
PATCH /v2/webhook
PATCH
/
v2
/
webhook
cURL
curl --request PATCH \
--url https://api.sandbox.finsei.com/v2/webhook \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://api.site.com/webhook",
"enable": true,
"rateLimit": 300,
"events": [
"v1.payment.create"
]
}
'import requests
url = "https://api.sandbox.finsei.com/v2/webhook"
payload = {
"url": "https://api.site.com/webhook",
"enable": True,
"rateLimit": 300,
"events": ["v1.payment.create"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://api.site.com/webhook',
enable: true,
rateLimit: 300,
events: ['v1.payment.create']
})
};
fetch('https://api.sandbox.finsei.com/v2/webhook', 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.finsei.com/v2/webhook",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://api.site.com/webhook',
'enable' => true,
'rateLimit' => 300,
'events' => [
'v1.payment.create'
]
]),
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.finsei.com/v2/webhook"
payload := strings.NewReader("{\n \"url\": \"https://api.site.com/webhook\",\n \"enable\": true,\n \"rateLimit\": 300,\n \"events\": [\n \"v1.payment.create\"\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.sandbox.finsei.com/v2/webhook")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://api.site.com/webhook\",\n \"enable\": true,\n \"rateLimit\": 300,\n \"events\": [\n \"v1.payment.create\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.finsei.com/v2/webhook")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://api.site.com/webhook\",\n \"enable\": true,\n \"rateLimit\": 300,\n \"events\": [\n \"v1.payment.create\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"name": "Bad Request",
"message": "<string>",
"status": 400
}{
"name": "Unauthorized",
"message": "Your request was made with invalid credentials.",
"status": 401
}{
"name": "Forbidden",
"message": "String",
"status": 403
}{
"message": "The entity already exists",
"status": 409
}{
"status": "ERROR",
"errors": {
"email": "Email cannot be blank."
}
}{
"name": "Too Many Requests",
"message": "string",
"status": 429
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
OK
⌘I