curl --request POST \
--url https://api.zerion.io/v1/tx-subscriptions/ \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"callback_url": "https://webhook.site/fcd606d2-f5bd-4832-9874-ff07c980b5a3",
"addresses": [
"0x42b9df65b219b3dd36ff330a4dd8f327a6ada990"
]
}
'import requests
url = "https://api.zerion.io/v1/tx-subscriptions/"
payload = {
"callback_url": "https://webhook.site/fcd606d2-f5bd-4832-9874-ff07c980b5a3",
"addresses": ["0x42b9df65b219b3dd36ff330a4dd8f327a6ada990"]
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
callback_url: 'https://webhook.site/fcd606d2-f5bd-4832-9874-ff07c980b5a3',
addresses: ['0x42b9df65b219b3dd36ff330a4dd8f327a6ada990']
})
};
fetch('https://api.zerion.io/v1/tx-subscriptions/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zerion.io/v1/tx-subscriptions/"
payload := strings.NewReader("{\n \"callback_url\": \"https://webhook.site/fcd606d2-f5bd-4832-9874-ff07c980b5a3\",\n \"addresses\": [\n \"0x42b9df65b219b3dd36ff330a4dd8f327a6ada990\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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))
}{
"data": {
"type": "transactions_subscription",
"id": "52d994a173d755e99845e861d534a419",
"attributes": {
"callback_url": "https://webhook.site/fcd606d2-f5bd-4832-9874-ff07c980b5a3",
"created_at": "2022-08-15T11:26:31+00:00",
"updated_at": "2022-08-15T11:26:31+00:00",
"filters": {
"exclude": {
"types": [
"send"
],
"is_spam": true,
"protocol_ids": [
"uniswap-v3"
],
"addresses": [
"0x0000000000000000000000000000000000000001"
]
}
}
},
"relationships": {
"chains": [
{
"links": {
"related": "https://api.zerion.io/v1/chains/polygon"
},
"data": {
"type": "chains",
"id": "polygon"
}
}
]
}
}
}{
"errors": [
{
"title": "Parameter is malformed",
"detail": "Some validation errors will be described here"
}
]
}{
"errors": [
{
"title": "Unauthorized Error",
"detail": "The API key is invalid, please, make sure that you are using a valid key"
}
]
}{
"errors": [
{
"title": "Too many requests",
"detail": "Your request had been throttled"
}
]
}Create subscription
Create a webhook subscription that pushes transaction notifications for a set of wallets to your callback URL.
curl --request POST \
--url https://api.zerion.io/v1/tx-subscriptions/ \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"callback_url": "https://webhook.site/fcd606d2-f5bd-4832-9874-ff07c980b5a3",
"addresses": [
"0x42b9df65b219b3dd36ff330a4dd8f327a6ada990"
]
}
'import requests
url = "https://api.zerion.io/v1/tx-subscriptions/"
payload = {
"callback_url": "https://webhook.site/fcd606d2-f5bd-4832-9874-ff07c980b5a3",
"addresses": ["0x42b9df65b219b3dd36ff330a4dd8f327a6ada990"]
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
callback_url: 'https://webhook.site/fcd606d2-f5bd-4832-9874-ff07c980b5a3',
addresses: ['0x42b9df65b219b3dd36ff330a4dd8f327a6ada990']
})
};
fetch('https://api.zerion.io/v1/tx-subscriptions/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zerion.io/v1/tx-subscriptions/"
payload := strings.NewReader("{\n \"callback_url\": \"https://webhook.site/fcd606d2-f5bd-4832-9874-ff07c980b5a3\",\n \"addresses\": [\n \"0x42b9df65b219b3dd36ff330a4dd8f327a6ada990\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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))
}{
"data": {
"type": "transactions_subscription",
"id": "52d994a173d755e99845e861d534a419",
"attributes": {
"callback_url": "https://webhook.site/fcd606d2-f5bd-4832-9874-ff07c980b5a3",
"created_at": "2022-08-15T11:26:31+00:00",
"updated_at": "2022-08-15T11:26:31+00:00",
"filters": {
"exclude": {
"types": [
"send"
],
"is_spam": true,
"protocol_ids": [
"uniswap-v3"
],
"addresses": [
"0x0000000000000000000000000000000000000001"
]
}
}
},
"relationships": {
"chains": [
{
"links": {
"related": "https://api.zerion.io/v1/chains/polygon"
},
"data": {
"type": "chains",
"id": "polygon"
}
}
]
}
}
}{
"errors": [
{
"title": "Parameter is malformed",
"detail": "Some validation errors will be described here"
}
]
}{
"errors": [
{
"title": "Unauthorized Error",
"detail": "The API key is invalid, please, make sure that you are using a valid key"
}
]
}{
"errors": [
{
"title": "Too many requests",
"detail": "Your request had been throttled"
}
]
}Authorizations
Body
Callback URL where updates will be delivered to
"https://webhook.site/fcd606d2-f5bd-4832-9874-ff07c980b5a3"
Addresses of the wallets to create subscription for. Maximum 100 addresses per subscription. Note: Free tier accounts are limited to 5 addresses per subscription.
Address of the wallet.
Subscribe for transactions from specified chains. Leave empty to subscribe for all supported chains. You can find available chain ids in chain endpoints.
Exclusion filters for the subscription. Conditions are combined with OR: an
event matching any one of them is dropped and no webhook is delivered for it.
Omit the field, or send null, to receive every event the subscription
covers. Filters are absent from the response when none are set.
Field paths below refer to the delivered webhook transaction payload, not to
this subscription resource. A condition does not match an event lacking the
value it compares, so an event with no dapp is not excluded by
protocol_ids.
Show child attributes
Show child attributes
Callbacks
Response
Response for requested wallet's transactions subscription
Show child attributes
Show child attributes
Was this page helpful?