Set up your first Rise webhook in under 10 minutes
This guide will walk you through setting up your first Rise webhook in under 10 minutes. By the end, you’ll have a working webhook endpoint that receives real-time notifications from Rise.
Now you can add business logic to handle specific events with full type safety:
Copy
Ask AI
import type { RiseWebhookEvent, PaymentSentV1, PaymentGroupCreatedV1, DepositReceivedV1} from '@riseworks/sdk';function handleEvent(event: RiseWebhookEvent) { switch (event.event_type) { case 'payment.sent': // Send confirmation email with full type safety sendPaymentConfirmation(event as PaymentSentV1); break; case 'payment.group.created': // Update order status with full type safety updateOrderStatus(event as PaymentGroupCreatedV1); break; case 'deposit.received': // Trigger fulfillment with full type safety triggerFulfillment(event as DepositReceivedV1); break; default: console.log('Unhandled event type:', event.event_type); }}async function sendPaymentConfirmation(event: PaymentSentV1) { // Your email logic here with full type safety console.log(`Sending confirmation for payment ${event.payment.nanoid}`); console.log(`Amount: ${event.payment.amount_cents} cents`); console.log(`Recipients: ${event.payment.recipients.length}`);}async function updateOrderStatus(event: PaymentGroupCreatedV1) { // Your database update logic here with full type safety console.log(`Updating payment group ${event.payment_group.nanoid} to processing`); console.log(`Payments count: ${event.payment_group.payments?.length || 0}`);}async function triggerFulfillment(event: DepositReceivedV1) { // Your fulfillment logic here with full type safety console.log(`Triggering fulfillment for deposit ${event.deposit.nanoid}`); console.log(`Amount: ${event.deposit.destination_amount_cents} cents`);}
Copy
Ask AI
// JavaScript version (without TypeScript types)function handleEvent(event) { switch (event.event_type) { case 'payment.sent': // Send confirmation email sendPaymentConfirmation(event); break; case 'payment.group.created': // Update order status updateOrderStatus(event); break; case 'deposit.received': // Trigger fulfillment triggerFulfillment(event); break; default: console.log('Unhandled event type:', event.event_type); }}async function sendPaymentConfirmation(event) { // Your email logic here console.log(`Sending confirmation for payment ${event.payment.nanoid}`);}async function updateOrderStatus(event) { // Your database update logic here console.log(`Updating payment group ${event.payment_group.nanoid} to processing`);}
Congratulations! You now have a working webhook endpoint. Here’s what to explore next:
Explore Event Types
See the complete list of available events and their payloads
Security Best Practices
Learn about advanced security features and best practices
Webhook Management
Learn how to manage multiple webhooks and team configurations
Testing Tools
Testing your webhooks locally and troubleshooting common issues
Pro tip: Start with just one or two event types to keep things simple, then add more as your integration grows. It’s easier to debug and maintain fewer, well-configured webhooks.
SDK recommendation: Use the Rise SDK for webhook validation to get automatic type safety, proper error handling, and protection against common security issues. The SDK handles Buffer payloads, signature verification, and timestamp validation automatically.