Skip to navigation

Webhooks

Receive real-time notifications for booking events, payments, and voice calls

Overview

ETERA uses webhooks to notify your application of asynchronous events — payment confirmations, booking status changes, and voice call outcomes.

Payment Webhooks

Stripe payment lifecycle events

Voice AI Webhooks

Automated reservation call outcomes

Async Queue

AI Supervisor processing status


Webhook Types

The Payment service receives Stripe webhook events for payment lifecycle updates.

EndpointMethodDescription
/payment/webhookPOSTStripe event receiver

Stripe events include payment intent confirmations, refund updates, subscription changes, and invoice payments. See the Payment API reference for the full schema.

Verifying Stripe Signatures

import Stripe from "stripe";
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);
const endpointSecret = process.env.STRIPE_WEBHOOK_SECRET;
async function handleWebhook(req: Request) {
const body = await req.text();
const sig = req.headers.get("stripe-signature")!;
const event = stripe.webhooks.constructEvent(
body, sig, endpointSecret
);
switch (event.type) {
case "payment_intent.succeeded":
// Handle successful payment
break;
case "payment_intent.payment_failed":
// Handle failed payment
break;
}
}

Webhook Security

Always verify webhook signatures before processing events. For Stripe webhooks, use the Stripe-Signature header with your webhook signing secret.


Best Practices

1

Return 200 quickly

Acknowledge the webhook before processing. Use a queue for heavy work to avoid timeouts.

2

Handle duplicates

Webhooks may be sent more than once. Use event IDs for idempotency to prevent duplicate processing.

3

Implement retry logic

If your endpoint returns a non-2xx status, the event will be retried with exponential backoff.

4

Log everything

Store raw webhook payloads for debugging and auditing. This is essential for troubleshooting payment issues.


Next Steps