curl --location --request POST '/orders' \
--header 'Content-Type: application/json' \
--data-raw '{
"customerName": "John Doe",
"customerEmail": "john@example.com",
"items": [
{
"name": "Burger",
"quantity": 1,
"price": 8.99
},
{
"name": "Fries",
"quantity": 1,
"price": 3.99
}
]
}'
{
"success": true,
"data": {
"id": "ORD-1705312200000-001",
"customerName": "John Doe",
"customerEmail": "john@example.com",
"status": "pending",
"items": [
{
"id": "item-1",
"orderId": "ORD-1705312200000-001",
"name": "Burger",
"quantity": 1,
"price": 8.99,
"subtotal": 8.99
},
{
"id": "item-2",
"orderId": "ORD-1705312200000-001",
"name": "Fries",
"quantity": 1,
"price": 3.99,
"subtotal": 3.99
}
],
"total": 12.98,
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
}
}