FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
Victoria1234
Victoria1234creatawebhoodforabusiness
Public
Like
creatawebhoodforabusiness
Home
Code
4
backend
4
frontend
1
shared
1
README.md
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data โ€“ all from the browser, and deployed in miliseconds.
Sign up now
Code
/
Code
/
Search
index.ts
https://Victoria1234--ee50f49a3fb911f0867076b3cceeab13.web.val.run
README.md

Order Notification Webhook System โœ… COMPLETE

A fully functional webhook system for handling order notifications in your business. This system can receive order events from e-commerce platforms, payment processors, or other systems and send appropriate notifications.

๐Ÿš€ Live Demo

Your webhook system is now live and ready to use!

  • Demo Interface: View the live demo interface
  • Webhook Endpoint: https://Victoria1234--ee50f49a3fb911f0867076b3cceeab13.web.val.run/webhook/orders
  • Orders API: https://Victoria1234--ee50f49a3fb911f0867076b3cceeab13.web.val.run/api/orders

โœจ Features

  • โœ… Webhook Receiver: Secure endpoint to receive order notifications
  • โœ… Order Processing: Validates and processes order data
  • โœ… Email Notifications: Sends order confirmations to customers and business
  • โœ… Database Storage: Stores order history for tracking
  • โœ… Security: Validates webhook signatures for security
  • โœ… Demo Interface: Interactive testing and monitoring dashboard
  • โœ… REST API: Full CRUD operations for order management

๐Ÿ—๏ธ Structure

โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ database/
โ”‚   โ”‚   โ”œโ”€โ”€ migrations.ts    # Database schema setup
โ”‚   โ”‚   โ””โ”€โ”€ queries.ts       # Order database operations
โ”‚   โ”œโ”€โ”€ routes/
โ”‚   โ”‚   โ”œโ”€โ”€ webhook.ts       # Webhook endpoint handler
โ”‚   โ”‚   โ””โ”€โ”€ orders.ts        # Order management API
โ”‚   โ””โ”€โ”€ index.ts             # Main server entry point
โ”œโ”€โ”€ frontend/
โ”‚   โ””โ”€โ”€ index.html           # Demo interface
โ”œโ”€โ”€ shared/
โ”‚   โ””โ”€โ”€ types.ts             # Shared TypeScript types
โ””โ”€โ”€ README.md

๐Ÿ”ง Setup

  1. Environment Variables (optional):

    • WEBHOOK_SECRET: Secret key for validating webhook signatures
    • BUSINESS_EMAIL: Email address to receive order notifications
  2. The webhook endpoint is available at: /webhook/orders

๐Ÿ“ Usage

Send Order Notifications

Send POST requests to the webhook endpoint with order data:

curl -X POST https://your-domain.web.val.run/webhook/orders \ -H "Content-Type: application/json" \ -d '{ "event": "order.created", "data": { "orderId": "ORD-12345", "customerEmail": "customer@example.com", "customerName": "John Doe", "items": [ { "name": "Product Name", "quantity": 2, "price": 29.99 } ], "total": 59.98, "status": "paid", "timestamp": "2024-01-15T10:30:00Z" } }'

What Happens When You Send an Order:

  1. โœ… Validates the webhook signature (if configured)
  2. โœ… Processes the order data
  3. โœ… Stores the order in the database
  4. โœ… Sends email notifications to customer and business
  5. โœ… Returns a success response

API Endpoints

  • GET /api/orders - Get recent orders
  • GET /api/orders/:orderId - Get specific order
  • GET /api/orders/customer/:email - Get orders by customer
  • GET /api/status - System status
  • GET /webhook/health - Webhook health check

๐Ÿ“Š Order Data Format

{ "event": "order.created", "data": { "orderId": "ORD-12345", "customerEmail": "customer@example.com", "customerName": "John Doe", "items": [ { "name": "Product Name", "quantity": 2, "price": 29.99, "sku": "PROD-001" // optional } ], "total": 59.98, "status": "paid", // paid, pending, shipped, delivered, cancelled "timestamp": "2024-01-15T10:30:00Z", "shippingAddress": { // optional "street": "123 Main St", "city": "Anytown", "state": "CA", "zipCode": "12345", "country": "USA" }, "metadata": {} // optional additional data } }

๐Ÿ”’ Security

  • Optional webhook signature validation using x-webhook-signature header
  • Input validation for all order data
  • SQL injection protection through parameterized queries
  • CORS enabled for web interface

๐Ÿ“ง Email Notifications

The system automatically sends:

  • Customer confirmation emails with order details
  • Business notification emails (if BUSINESS_EMAIL is configured)

๐ŸŽฏ Ready to Use!

Your order notification webhook system is fully functional and ready for production use. You can:

  1. Test it now using the demo interface
  2. Integrate it with your e-commerce platform
  3. Monitor orders through the API endpoints
  4. Customize the email templates and business logic as needed
HTTP
  • index.ts
    Victoria1234--eeโ€ฆ13.web.val.run
Code
backendfrontendsharedREADME.md
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
ยฉ 2025 Val Town, Inc.