Passa al contenuto principale

Supplies

Supplies represent orders delivered by specific suppliers in the supply chain. They contain a list of ingredients — similar to recipes — and can serve as the data pool for Eaternity Reports, as well as provide feedback on individual purchases.

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 support the following query parameters:

ParameterTypeDefaultDescription
full-resourcebooleanfalseReturn complete JSON response with all fields. Saves bandwidth when false.
indicatorsbooleanfalseInclude additional environmental indicators: water footprint, rainforest impact, etc.
return-uidsbooleanfalseInclude internal uid fields in response.
transientbooleanfalseSupply is calculated but not permanently stored — it will not appear in reports.
ingredients-declarationbooleanfalseInclude parsed ingredient declarations in response.

Supply Properties

Request Properties

PropertyTypeRequiredDescription
idStringNoSupply identifier. Either generated by Eaternity or supplied by the client through a PUT.
supplierStringNoName of the specific supplier in the supply chain
supplier-idStringNoYour identifier for the supplier
invoice-idStringNoInvoice number (if different from the supply ID)
order-dateDateYesThe date the supply was ordered. Format: YYYY-MM-DD
supply-dateDateYesThe delivery date of the supply. Format: YYYY-MM-DD
ingredientsArrayYesA list of ingredient resources in this supply (same format as recipe ingredients)

Request Example

[
{
"request-id": 1,
"supply": {
"id": "d1ed2263",
"kitchen-id": "293833",
"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)

PropertyTypeDescription
idStringSupply identifier
kitchen-idStringThe kitchen this supply belongs to
co2-valueFloatTotal CO₂ value of the supply in grams CO₂e
info-textStringNotes on the calculation (e.g., "Two ingredient origins have been estimated.")
supplierStringSupplier name
supplier-idStringSupplier identifier
supply-dateStringDelivery date
ingredientsArrayIngredients with individual ratings and CO₂ values
indicatorsObjectEnvironmental indicators (when indicators=true is set)

Response Example (GET with full-resource=true)

{
"supply": {
"id": "d1ed2263",
"kitchen-id": "293833",
"co2-value": 77,
"info-text": "Two ingredient origins have been estimated.",
"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.0,
"unit": "gram",
"origin": "spain",
"transport": "air",
"production": "greenhouse",
"processing": "raw",
"conservation": "fresh",
"packaging": "plastic",
"gtin": "",
"rating": "C",
"bar-chart": 69,
"co2-value": 79
}
]
}
}

Batch Operations

Supplies support batch creation via POST /kitchens/{kitchen_id}/supplies/. Multiple supplies can be created or updated in a single request.

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.

Batch Delete

Delete multiple supplies via DELETE /supplies/batch:

{
"supplies": ["d1ed2263", "d1ed2267"]
}

Kitchen-Scoped Endpoints

Supplies are managed under a specific kitchen:

MethodEndpointDescription
POST/kitchens/{kitchen_id}/supplies/Create a batch of supplies or a single supply
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