• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
Victoria1234

Victoria1234

creatawebhoodforabusiness

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 milliseconds.
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
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.