Pro Plan10 minutesintermediate

Webhooks

Understanding webhooks in Zenovay - how inbound payment webhooks work and how to build custom integrations.

webhooksapiintegrationpayments
Last updated: January 15, 2025
Pro Plan

Learn about how Zenovay uses webhooks for payment processing and how you can build integrations using the External API.

How Zenovay Uses Webhooks

Zenovay processes inbound webhooks from payment providers to manage subscriptions and billing. These are internal system webhooks -- not user-configurable outbound webhooks.

Inbound Webhook Sources

SourcePurpose
StripeSubscription management, payment processing, checkout completion
Uptime MonitoringHealth check triggers from external monitoring services

These webhooks are handled internally by the Zenovay API and do not require any configuration from users.

Building Custom Integrations

While Zenovay does not currently offer a user-configurable outbound webhook system, you can build real-time integrations using the External API.

Polling with the External API

Use the External API to periodically check for new data:

const API_KEY = process.env.ZENOVAY_API_KEY;
const WEBSITE_ID = process.env.ZENOVAY_WEBSITE_ID;

async function checkAnalytics() {
  const response = await fetch(
    `https://api.zenovay.com/api/external/v1/analytics/${WEBSITE_ID}?timeRange=24h`,
    {
      headers: { 'X-API-Key': API_KEY }
    }
  );

  const data = await response.json();

  // Check for significant changes
  if (data.totalVisitors > threshold) {
    await sendSlackNotification(data);
  }
}

// Poll every 5 minutes
setInterval(checkAnalytics, 5 * 60 * 1000);

Live Visitor Count

Use the public live endpoint to check current visitor count without an API key:

async function getLiveVisitors(trackingCode) {
  const response = await fetch(
    `https://api.zenovay.com/live/${trackingCode}`
  );
  return await response.json();
}

Slack Integration Example

Build a scheduled report that posts to Slack:

async function sendDailyReport() {
  const response = await fetch(
    `https://api.zenovay.com/api/external/v1/analytics/${WEBSITE_ID}?timeRange=24h`,
    {
      headers: { 'X-API-Key': API_KEY }
    }
  );

  const data = await response.json();

  await fetch(SLACK_WEBHOOK_URL, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      text: `Daily Analytics Report:\n` +
            `Visitors: ${data.totalVisitors}\n` +
            `Page Views: ${data.totalPageViews}\n` +
            `Bounce Rate: ${data.bounceRate}%`
    })
  });
}

CRM Integration Example

Sync analytics data to your CRM on a schedule:

async function syncToCRM() {
  // Get visitor data from Zenovay
  const response = await fetch(
    `https://api.zenovay.com/api/external/v1/analytics/${WEBSITE_ID}/visitors`,
    {
      headers: { 'X-API-Key': API_KEY }
    }
  );

  const visitors = await response.json();

  // Push to your CRM
  for (const visitor of visitors.data) {
    await crm.contacts.update({
      country: visitor.country,
      last_seen: visitor.last_seen,
      page_count: visitor.pageviews
    });
  }
}

Rate Limits for Polling

When building polling integrations, respect the External API rate limits:

PlanRequests/MinuteMonthly Limit
Free101,000
Pro3010,000
Scale60100,000
Enterprise1201,000,000

Best Practices

  • Cache API responses locally to reduce request frequency
  • Use appropriate polling intervals (5 minutes minimum recommended)
  • Monitor the X-RateLimit-Remaining header to avoid hitting limits
  • Implement exponential backoff if you receive 429 responses

Next Steps

Was this article helpful?