Supplies
Supplies represent orders delivered by specific suppliers in the supply chain. They contain a list of ingredients — the same ingredient object as in recipes — and can serve as the data pool for Eaternity Reports, as well as provide feedback on individual purchases.
For a complete request and response, see the use case Supplies for supply-based reports.
Overview
Use the Supply API to:
- Track ingredient purchases from suppliers
- Calculate CO₂ footprint of supply chain deliveries
- Generate data for Eaternity Reports on procurement sustainability
- Analyze environmental impact per supplier
Query Parameters
All supply endpoints take the query parameters full-resource, indicators, return-uids, transient and ingredients-declaration. Values and defaults: Query Parameters.
Supply Properties
Each delivered article is an ingredient object. Fields, allowed values and matching: Ingredients.
Request Properties
| Property | Type | Required | Description |
|---|---|---|---|
id | String | No | Supply identifier. Either generated by Eaternity or supplied by the client through a PUT. |
kitchen-id | String | Batch only | The kitchen the supply belongs to. Required in POST /supplies/batch; on kitchen-scoped routes the kitchen comes from the URL. |
supplier | String | No | Name of the specific supplier in the supply chain |
supplier-id | String | No | Your identifier for the supplier |
invoice-id | String | No | Invoice number (if different from the supply ID) |
order-date | Date | No | The date the supply was ordered. Format: YYYY-MM-DD |
supply-date | Date | Best practice | The delivery date of the supply. Reports count the supply on this date. Format: YYYY-MM-DD |
ingredients | Array | Yes | The delivered articles, as ingredient objects. See Ingredients. |
Request Example
[
{
"request-id": 1,
"supply": {
"id": "d1ed2263",
"kitchen-id": "kitchen-restaurant-a",
"supplier": "Vegetable Supplies Ltd.",
"supplier-id": "el3i5y-2in5y-2hbllll01",
"supply-date": "2013-06-01",
"ingredients": [
{
"id": "100100191",
"type": "conceptual-ingredients",
"names": [
{
"language": "de",
"value": "Tomaten"
}
],
"amount": 150,
"unit": "gram",
"origin": "spain",
"transport": "air",
"production": "greenhouse",
"processing": "raw",
"conservation": "fresh",
"packaging": "plastic"
}
]
}
}
]
Response Properties (with full-resource=true)
| Property | Type | Description |
|---|---|---|
id | String | Supply identifier |
kitchen-id | String | The kitchen this supply belongs to |
co2-value | Float | Total CO₂ value of the supply in grams CO₂e |
info-text | String | Notes on the calculation (e.g., "Two ingredient origins have been estimated.") |
supplier | String | Supplier name |
supplier-id | String | Supplier identifier |
supply-date | String | Delivery date |
ingredients | Array | Ingredients with individual ratings and CO₂ values |
indicators | Object | Environmental indicators (when indicators=true is set) |
Response Example (GET with full-resource=true)
The batch answers with one status entry per supply, [{"statuscode": 200, "message": "", "supply-id": "d1ed2263", "request-id": 1}]. The values come with GET /kitchens/kitchen-restaurant-a/supplies/d1ed2263?full-resource=true:
{
"statuscode": 200,
"message": "",
"supply-id": "d1ed2263",
"supply": {
"food-unit": 0.12,
"final-weight-per-portion": 150.0,
"co2-value": 169,
"rating": "C",
"co2-value-improvement-percentage": -82,
"co2-value-reduction-value": -76,
"kitchen-id": "kitchen-restaurant-a",
"supplier": "Vegetable Supplies Ltd.",
"supplier-id": "el3i5y-2in5y-2hbllll01",
"supply-date": "2013-06-01",
"ingredients": [
{
"foodUnit": 0.12,
"co2-value": 169,
"rating": "C",
"co2-value-improvement-percentage": -82,
"co2-value-reduction-value": -76,
"bar-chart": 100,
"id": "100100191",
"type": "conceptual-ingredients",
"names": [{"language": "de", "value": "Tomaten"}],
"amount": 150.0,
"unit": "gram",
"origin": "spain",
"transport": "air",
"production": "greenhouse",
"processing": "raw",
"conservation": "fresh",
"packaging": "plastic"
}
],
"id": "d1ed2263"
}
}
Batch Operations
Supplies support batch creation via POST /supplies/batch. Multiple supplies can be created or updated in a single request; each supply names its kitchen-id.
Each supply in the batch can include a request-id to track individual items in the response. Either a request-id or a supply id is required per entry.
Kitchen-Scoped Endpoints
Supplies are managed under a specific kitchen:
| Method | Endpoint | Description |
|---|---|---|
POST | /kitchens/{kitchen_id}/supplies/ | Create a single supply (ID generated by Eaternity) |
GET | /kitchens/{kitchen_id}/supplies/ | List all supply IDs in this kitchen |
GET | /kitchens/{kitchen_id}/supplies/{supply_id} | Get a specific supply |
PUT | /kitchens/{kitchen_id}/supplies/{supply_id} | Update or create a supply with a specific ID |
DELETE | /kitchens/{kitchen_id}/supplies/{supply_id} | Delete a supply |
Endpoints
📄️ Create supplies
Create a single supply in this kitchen. The ID is generated by Eaternity.
📄️ Get all supplies in a kitchen
Returns a list of supply IDs in this kitchen.
📄️ Get a supply
Retrieve a specific supply with calculated CO₂ values.
📄️ Update or create a supply
Update or create this supply with the specific ID.
📄️ Delete a supply
Delete a specific supply.
📄️ Create or update a batch of supplies
Batch operations for supplies allow you to create or update multiple supplies at once.
📄️ Create a supply (standalone)
Create a new supply without specifying the kitchen in the URL path.
📄️ Get a supply (standalone)
Retrieve a supply by its ID without specifying the kitchen.
📄️ Update or create a supply (standalone)
Update an existing supply or create a new one with the specified ID.
📄️ Delete a supply (standalone)
Delete a supply by its ID without specifying the kitchen.