This section documents the takeaway offer endpoints of the MiseOS API.
After lunch service, head chefs and sous chefs can publish leftover portions as takeaway offers. Customers can browse available offers and place orders through the order endpoints.
Each offer is linked to a dish from the dish bank and tracks the number of offered and remaining portions. When all portions are sold, the offer is automatically marked as sold out and disabled.
Takeaway offer lifecycle#
stateDiagram-v2
[*] --> ENABLED : offer created (after 12:00)
ENABLED --> DISABLED : manually disabled
DISABLED --> ENABLED : re-enabled
ENABLED --> SOLD_OUT : all portions sold
SOLD_OUT --> [*] : offer closed
One offer per dish per day is allowed. Offers can only be created after 12:00.
Takeaway Offer Endpoints#
| Method | URL | Auth |
|---|---|---|
GET | /takeaway/offers | ANYONE |
GET | /takeaway/offers/{id} | ANYONE |
POST | /takeaway/offers | HEAD_CHEF, SOUS_CHEF |
PUT | /takeaway/offers/{id} | HEAD_CHEF, SOUS_CHEF |
PATCH | /takeaway/offers/{id}/enable | HEAD_CHEF, SOUS_CHEF |
PATCH | /takeaway/offers/{id}/disable | HEAD_CHEF, SOUS_CHEF |
DELETE | /takeaway/offers/{id} | HEAD_CHEF, SOUS_CHEF |
TakeAwayOffer response object#
The take away offer object contains the following fields:
{
"id": 1,
"enabled": true,
"soldOut": false,
"offeredPortions": 20,
"availablePortions": 14,
"price": 65.00,
"dish": {
"id": 3,
"nameDA": "Boller i karry"
},
"createdBy": {
"id": 1,
"firstName": "Gordon",
"lastName": "Ramsay"
},
"createdAt": "2026-04-09",
"updatedAt": "2026-04-09 13:15"
}GET /takeaway/offers#
Returns all offers with optional filters. Available to anyone — no token required.
Query parameters
| Parameter | Type | Description |
|---|---|---|
date | LocalDate | Filter by offer date (yyyy-MM-dd) |
enabled | Boolean | Filter by enabled status |
soldOut | Boolean | Filter by sold out status |
dishId | Long | Filter by specific dish |
Example Request#
curl "https://miseos.corral.dk/api/v1/takeaway/offers?enabled=true&soldOut=false"Response 200 — array of TakeAwayOffer objects:
[
{
"id": 1,
"enabled": true,
"soldOut": false,
"offeredPortions": 20,
"availablePortions": 14,
"price": 65.00,
"dish": {
"id": 3,
"nameDA": "Boller i karry"
},
"createdBy": {
"id": 1,
"firstName": "Gordon",
"lastName": "Ramsay"
},
"createdAt": "2026-04-09",
"updatedAt": "2026-04-09 13:15"
},
{
"id": 2,
"enabled": true,
"soldOut": false,
"offeredPortions": 35,
"availablePortions": 17,
"price": 65.00,
"dish": {
"id": 7,
"nameDA": "Stegt flæsk"
},
"createdBy": {
"id": 2,
"firstName": "Jamie",
"lastName": "Oliver"
},
"createdAt": "2026-04-09",
"updatedAt": "2026-04-09 13:20"
}
]GET /takeaway/offers/{id}#
Returns a single offer by ID. Available to anyone.
Example Request#
curl https://miseos.corral.dk/api/v1/takeaway/offers/1Response 200 — TakeAwayOffer object.
Errors
| Status | Cause |
|---|---|
400 | Invalid ID |
404 | Offer not found |
POST /takeaway/offers#
Creates a new takeaway offer for today’s service.
Domain rules:
- Offers can only be created after 12:00
- Only one offer per dish per day is allowed
- The dish must be active in the dish bank
Request body
{
"dishId": 3,
"offeredPortions": 20,
"price": 65.00
}Example Request#
curl -X POST \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"dishId": 3, "offeredPortions": 20, "price": 65.00}' \
https://miseos.corral.dk/api/v1/takeaway/offersResponse 201 — created TakeAwayOffer object.
Errors
| Status | Cause |
|---|---|
400 | Invalid input — missing or invalid field |
404 | Dish not found |
409 | Offer creation before 12:00 |
409 | An offer for this dish already exists today |
PUT /takeaway/offers/{id}#
Updates an existing offer. Useful to correct portions or price before orders are placed.
Domain rules:
- Portions cannot be set below already sold quantity
Request body
{
"dishId": 3,
"offeredPortions": 25,
"price": 60.00
}Response 200 — updated TakeAwayOffer object.
Errors
| Status | Cause |
|---|---|
400 | Invalid input |
404 | Offer or dish not found |
409 | New portions below already sold quantity |
PATCH /takeaway/offers/{id}/enable#
Re-enables a disabled offer, making it visible and orderable again.
Cannot enable a sold out offer.
Example Request#
curl -X PATCH \
-H "Authorization: Bearer <token>" \
https://miseos.corral.dk/api/v1/takeaway/offers/1/enableResponse 200 — updated TakeAwayOffer object with enabled: true.
Errors
| Status | Cause |
|---|---|
404 | Offer not found |
409 | Offer is sold out and cannot be re-enabled |
PATCH /takeaway/offers/{id}/disable#
Disables an active offer, hiding it from customers without deleting it.
Example Request#
curl -X PATCH \
-H "Authorization: Bearer <token>" \
https://miseos.corral.dk/api/v1/takeaway/offers/1/disableResponse 200 — updated TakeAwayOffer object with enabled: false.
DELETE /takeaway/offers/{id}#
Permanently deletes an offer.
Offers that have active or completed orders cannot be deleted.
Response 204 — no content.
Errors
| Status | Cause |
|---|---|
404 | Offer not found |
409 | Offer has existing orders and cannot be deleted |