Mock Food Ordering API
  1. Orders
Mock Food Ordering API
  • General
    • API Information
      GET
    • Health Check
      GET
  • Orders
    • List Orders
      GET
    • Create Order
      POST
    • Get Order by ID
      GET
    • Update Order
      PATCH
    • Delete Order
      DELETE
    • Cancel Order (Convenience Endpoint)
      PATCH
  • Schemas
    • Schemas
      • OrderStatus
      • OrderItem
      • Receipt
      • Order
      • CreateOrderRequest
      • UpdateOrderRequest
      • Pagination
      • OrderListData
      • ApiResponse
      • OrderResponse
      • OrderListResponse
      • DeleteResponse
      • HealthResponse
      • ApiInfoResponse
      • ErrorResponse
    • Response
      • BadRequest
      • NotFound
      • ValidationError
      • InternalServerError
  1. Orders

Create Order

POST
/orders
Create a new food order with customer information and items.
The order will be created with 'pending' status and can include burger, fries, or other menu items.

Request

Body Params application/json

Examples

Responses

🟢201Created
application/json
Order created successfully
Body

🟠400Bad Request
🟠422Parameter Error
🔴500Server Error
Request Request Example
Shell
JavaScript
Java
Swift
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
        }
    ]
}'
Response Response Example
201 - Success
{
    "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"
    }
}
Modified at 2025-09-17 13:22:25
Previous
List Orders
Next
Get Order by ID
Built with