Register a webhook
curl --request POST \
--url https://api.zet.money/v1/webhooks \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"url": "https://yourapp.com/webhooks/zet",
"events": [
"onramp.completed",
"offramp.completed"
],
"description": "Production payment webhook"
}
'import requests
url = "https://api.zet.money/v1/webhooks"
payload = {
"url": "https://yourapp.com/webhooks/zet",
"events": ["onramp.completed", "offramp.completed"],
"description": "Production payment webhook"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://yourapp.com/webhooks/zet',
events: ['onramp.completed', 'offramp.completed'],
description: 'Production payment webhook'
})
};
fetch('https://api.zet.money/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.zet.money/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://yourapp.com/webhooks/zet',
'events' => [
'onramp.completed',
'offramp.completed'
],
'description' => 'Production payment webhook'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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://api.zet.money/v1/webhooks"
payload := strings.NewReader("{\n \"url\": \"https://yourapp.com/webhooks/zet\",\n \"events\": [\n \"onramp.completed\",\n \"offramp.completed\"\n ],\n \"description\": \"Production payment webhook\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-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://api.zet.money/v1/webhooks")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://yourapp.com/webhooks/zet\",\n \"events\": [\n \"onramp.completed\",\n \"offramp.completed\"\n ],\n \"description\": \"Production payment webhook\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zet.money/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://yourapp.com/webhooks/zet\",\n \"events\": [\n \"onramp.completed\",\n \"offramp.completed\"\n ],\n \"description\": \"Production payment webhook\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "wh_01H8X7...",
"url": "https://yourapp.com/webhooks/zet",
"events": [
"onramp.completed",
"offramp.completed"
],
"secret": "whsec_abc123...",
"isActive": true,
"description": "Production payment webhook",
"createdAt": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": {
"code": "INVALID_REQUEST",
"message": "The 'amount' field must be a positive number."
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key."
}
}Webhooks
Register Webhook
Register a URL to receive webhook events. The response includes a secret that you must store securely — it is used to verify webhook signatures.
Zet signs every webhook payload with HMAC-SHA256 using this secret. The signature is sent in the x-zet-signature header.
Verification example:
const crypto = require('crypto');
function verifyWebhook(payload, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(JSON.stringify(payload))
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected)
);
}
POST
/
webhooks
Register a webhook
curl --request POST \
--url https://api.zet.money/v1/webhooks \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"url": "https://yourapp.com/webhooks/zet",
"events": [
"onramp.completed",
"offramp.completed"
],
"description": "Production payment webhook"
}
'import requests
url = "https://api.zet.money/v1/webhooks"
payload = {
"url": "https://yourapp.com/webhooks/zet",
"events": ["onramp.completed", "offramp.completed"],
"description": "Production payment webhook"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://yourapp.com/webhooks/zet',
events: ['onramp.completed', 'offramp.completed'],
description: 'Production payment webhook'
})
};
fetch('https://api.zet.money/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.zet.money/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://yourapp.com/webhooks/zet',
'events' => [
'onramp.completed',
'offramp.completed'
],
'description' => 'Production payment webhook'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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://api.zet.money/v1/webhooks"
payload := strings.NewReader("{\n \"url\": \"https://yourapp.com/webhooks/zet\",\n \"events\": [\n \"onramp.completed\",\n \"offramp.completed\"\n ],\n \"description\": \"Production payment webhook\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-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://api.zet.money/v1/webhooks")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://yourapp.com/webhooks/zet\",\n \"events\": [\n \"onramp.completed\",\n \"offramp.completed\"\n ],\n \"description\": \"Production payment webhook\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zet.money/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://yourapp.com/webhooks/zet\",\n \"events\": [\n \"onramp.completed\",\n \"offramp.completed\"\n ],\n \"description\": \"Production payment webhook\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "wh_01H8X7...",
"url": "https://yourapp.com/webhooks/zet",
"events": [
"onramp.completed",
"offramp.completed"
],
"secret": "whsec_abc123...",
"isActive": true,
"description": "Production payment webhook",
"createdAt": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": {
"code": "INVALID_REQUEST",
"message": "The 'amount' field must be a positive number."
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key."
}
}Authorizations
Your Zet API key. Contact zetdotmoney@gmail.com to obtain your keys.
Body
application/json
HTTPS URL to receive webhook POST requests.
Example:
"https://yourapp.com/webhooks/zet"
List of event types to subscribe to. Use * for all events.
Available options:
onramp.completed, onramp.failed, offramp.completed, offramp.failed, swap.completed, swap.failed, transfer.completed, transfer.failed, * Example:
["onramp.completed", "offramp.completed"]
Optional description for this webhook.
Example:
"Production payment webhook"
