Download OpenAPI specification:
Production-ready REST API for purchasing cinema tickets. This implementation extends beyond the basic DWP coding exercise requirements by providing a complete HTTP server with comprehensive endpoints, error handling, and Docker deployment.
Validates request, enforces business rules, processes payment, and reserves seats.
accountId required | integer >= 1 |
required | Array of objects (TicketItem) [ 1 .. 25 ] items |
{- "accountId": 12345,
- "tickets": [
- {
- "type": "ADULT",
- "quantity": 2
}, - {
- "type": "CHILD",
- "quantity": 1
}
]
}
{- "success": true,
- "data": {
- "accountId": 12345,
- "totalAmount": 65,
- "totalSeats": 3,
- "tickets": [
- {
- "type": "ADULT",
- "quantity": 2,
- "price": 50
}, - {
- "type": "CHILD",
- "quantity": 1,
- "price": 15
}
], - "timestamp": "2025-09-14T12:00:00.000Z"
}
}