This application includes a simple refund request flow for customer support and order issues.
- Provides a refund request form at
/refund-request - Accepts refund submissions via
/api/refund/request - Stores each request in the SQLite database
- Generates a prefilled email draft for
papoosedaniels94@gmail.com - Lets staff review submissions via
/api/refund/requests
GET /refund-request
Optional query parameters:
orderIdcustomerEmail
Example:
/refund-request?orderId=12345&customerEmail=customer@example.com
POST /api/refund/request
Request body:
{
"orderId": "12345",
"customerEmail": "customer@example.com",
"reason": "Product not as described",
"message": "Please review this order and confirm the refund status."
}Response:
{
"message": "Refund request received",
"id": 1,
"status": "submitted",
"emailDraft": {
"to": "papoosedaniels94@gmail.com",
"subject": "Refund request for order #12345",
"body": "Hello, ..."
}
}GET /api/refund/requests
Required header:
X-Admin-Token: YOUR_ADMIN_TOKENThe app stores refund records in the refund_requests table.
Fields:
idorder_idcustomer_emailreasonmessagestatuscreated_at
The app generates a mailto: draft that opens the customer’s email app with the refund email prefilled and addressed to:
papoosedaniels94@gmail.com
This is the correct workflow if you are using a browser-based refund interface and are not sending emails directly from the server.
npm install
npm startThen visit:
http://localhost:3000/refund-request