curl --request POST \
--url https://api.tabby.ai/api/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Merchant-Code: <x-merchant-code>' \
--data '
{
"url": "https://example.com/",
"header": {
"title": "Arbitrary header name to sign the request",
"value": "Random string to sign the request"
}
}
'import requests
url = "https://api.tabby.ai/api/v1/webhooks"
payload = {
"url": "https://example.com/",
"header": {
"title": "Arbitrary header name to sign the request",
"value": "Random string to sign the request"
}
}
headers = {
"X-Merchant-Code": "<x-merchant-code>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Merchant-Code': '<x-merchant-code>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: 'https://example.com/',
header: {
title: 'Arbitrary header name to sign the request',
value: 'Random string to sign the request'
}
})
};
fetch('https://api.tabby.ai/api/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.tabby.ai/api/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([
'url' => 'https://example.com/',
'header' => [
'title' => 'Arbitrary header name to sign the request',
'value' => 'Random string to sign the request'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Merchant-Code: <x-merchant-code>"
],
]);
$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.tabby.ai/api/v1/webhooks"
payload := strings.NewReader("{\n \"url\": \"https://example.com/\",\n \"header\": {\n \"title\": \"Arbitrary header name to sign the request\",\n \"value\": \"Random string to sign the request\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Merchant-Code", "<x-merchant-code>")
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.tabby.ai/api/v1/webhooks")
.header("X-Merchant-Code", "<x-merchant-code>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/\",\n \"header\": {\n \"title\": \"Arbitrary header name to sign the request\",\n \"value\": \"Random string to sign the request\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tabby.ai/api/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Merchant-Code"] = '<x-merchant-code>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://example.com/\",\n \"header\": {\n \"title\": \"Arbitrary header name to sign the request\",\n \"value\": \"Random string to sign the request\"\n }\n}"
response = http.request(request)
puts response.read_body{
"is_test": false,
"url": "https://example.com/",
"header": {
"title": "Arbitrary header name to sign the request",
"value": "Random string to sign the request"
},
"id": "unique webhook id"
}{
"status": "error",
"errorType": "bad_data",
"error": "bad_request"
}{
"status": "error",
"errorType": "not_authorized",
"error": "authorization"
}"404 page not found""Internal Server error"Register a webhook
Creates a new webhook. Webhooks are registered per merchant_code and per environment:
the environment is determined by the secret key you authorize the request with —
a production key (sk_...) registers webhooks for production payments, a test key
(sk_test_...) registers webhooks for test payments. Each merchant_code + key pair
can have up to 4 webhooks.
curl --request POST \
--url https://api.tabby.ai/api/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Merchant-Code: <x-merchant-code>' \
--data '
{
"url": "https://example.com/",
"header": {
"title": "Arbitrary header name to sign the request",
"value": "Random string to sign the request"
}
}
'import requests
url = "https://api.tabby.ai/api/v1/webhooks"
payload = {
"url": "https://example.com/",
"header": {
"title": "Arbitrary header name to sign the request",
"value": "Random string to sign the request"
}
}
headers = {
"X-Merchant-Code": "<x-merchant-code>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Merchant-Code': '<x-merchant-code>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: 'https://example.com/',
header: {
title: 'Arbitrary header name to sign the request',
value: 'Random string to sign the request'
}
})
};
fetch('https://api.tabby.ai/api/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.tabby.ai/api/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([
'url' => 'https://example.com/',
'header' => [
'title' => 'Arbitrary header name to sign the request',
'value' => 'Random string to sign the request'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Merchant-Code: <x-merchant-code>"
],
]);
$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.tabby.ai/api/v1/webhooks"
payload := strings.NewReader("{\n \"url\": \"https://example.com/\",\n \"header\": {\n \"title\": \"Arbitrary header name to sign the request\",\n \"value\": \"Random string to sign the request\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Merchant-Code", "<x-merchant-code>")
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.tabby.ai/api/v1/webhooks")
.header("X-Merchant-Code", "<x-merchant-code>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/\",\n \"header\": {\n \"title\": \"Arbitrary header name to sign the request\",\n \"value\": \"Random string to sign the request\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tabby.ai/api/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Merchant-Code"] = '<x-merchant-code>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://example.com/\",\n \"header\": {\n \"title\": \"Arbitrary header name to sign the request\",\n \"value\": \"Random string to sign the request\"\n }\n}"
response = http.request(request)
puts response.read_body{
"is_test": false,
"url": "https://example.com/",
"header": {
"title": "Arbitrary header name to sign the request",
"value": "Random string to sign the request"
},
"id": "unique webhook id"
}{
"status": "error",
"errorType": "bad_data",
"error": "bad_request"
}{
"status": "error",
"errorType": "not_authorized",
"error": "authorization"
}"404 page not found""Internal Server error"Authorizations
Bearer authentication header of the form Bearer <secret_key>, where <secret_key> is your secret_key.
Headers
Used for multi store/countries setup, please contact your Account manager to recognize that
"code provided to you from Tabby side"
Body
Response
Success. Webhook object is returned.
Deprecated. The webhook environment is determined by the secret key used at registration (production sk_... or test sk_test_...), not by this field.
HTTPS endpoint for notifications. The URL should be valid and accessible (not local).
"https://example.com/"
Show child attributes
Show child attributes
Unique webhook ID, assigned by Tabby.
"unique webhook id"
Was this page helpful?