What’s Changing?
- API Import Review, Manual Approval: Intolerance Values
- Alternate Ingredient: Mandatory Fields
-
API changes:
- GET /ingredients: Return property ‘CostPrice’ when 0 or null
- GET /recipe/{guid}/nutrition: Nutrient ‘salt’ property added to response
- GET /recipeidentifiers: New endpoint
- GET /menus: Menu CourseID property added to response
- POST /ingredients: ‘Parent Ingredient Product Name’ property added
Release date: 29th and 30th September 2020
Reason for the Change
General system enhancements.
Customers Affected
All RME customers using the related functionality.
Release Notes
API Import Review, Manual Approval: Intolerance Values
For customers using Import API to update ingredient intolerance values.
Ingredient intolerance values can be reviewed and manually approved onscreen before they are updated in the database.
Fig.1 - Batch list screen: New Type – Ingredient Intolerances
Fig.2 - Intolerance Data – submitted via import API – for Manual Approval
Alternate Ingredient Validation, Mandatory Ingredient Fields (Same as Parent)
If the fields below are 'mandatory' for parent ingredients, this validation will also be applied to alternate ingredients.
- Supplier Order UoM
- Date 1st delivery to warehouse
- Distributor Name
- Distributor Code
Please note: Mandatory field validation is applied when the field is mandatory for the user's current user group.
Changes to APIs
Please note: Access to the endpoints mentioned below requires a username and password. These credentials can be supplied by Fourth on request – please fill in the Submit a Request form.
GET /ingredients > Response Will Include ‘CostPrice’ Property for ‘Zero Cost’ Ingredient
For ingredients with a ‘zero’ or ‘null’ cost, the response will now include the ‘CostPrice’ property. Previously this property was not included in the response if it was ‘null’ or ‘zero’.
[
{
"IngredientGuid": "d0cc662e-88fa-4cea-ba11-367faae1620d",
"Name": "Absolut Cerise",
"ProductType": "Food",
"Sellable": false,
"ScheduledExportDate": "2015-01-09T00:00:00Z",
"ShortName": "Cherry Vodka",
"Description": "",
"InternalCode": "",
"ExternalCode": "",
"Wastage": 0.0,
"UnitSize": {
"Quantity": "70",
"UoMGuid": "7fdf28d3-1130-4578-946a-fa8c7a749ae7",
"UoM": "cup (UK)",
"PackDescriber": "Bottle"
},
"SuppliedPackSizes": [
{
"StarChefKey": "0053721",
"InternalCode": "",
"ExternalCode": "",
"SupplierGuid": "1e60955a-e675-4e5a-ba39-5c61e7ef39c2",
"SupplierName": "Spirits Wholesale Ltd",
"SuppliedProductName": "Cherry Vodka",
"PreferredSupplier": "true",
"SupplierRef": "",
"SupplierCode": "9988",
"DistributorGuid": "1e60955a-e675-4e5a-ba39-5c61e7ef39c2",
"DistributorName": "Spirits Wholesale Ltd",
"DistributorRef": "",
"DistributorCode": "",
"CostPrice": "0.00",
"PendingCostPrice": "",
"PendingCostPriceEffectiveDate": "",
"SupplyQty": {
"Number": "1",
"Quantity": "70",
"UoMGuid": "0fc125e2-9a2e-4de1-8398-709f7f4a5ddb",
"UoM": "centilitre",
"PackDescriber": "",
"PackageTypeGuid": "eefd120b-8e26-4d87-96cb-e0b1d2fdbbe8"
},
"SupplyQtyConversions": [
{
"Number": "1",
"Quantity": "1",
"UoMGuid": "dff78164-254a-4170-9875-d85188835700",
"UoM": "kilogram"
}
],
"RankOrder": 1,
"Categories": [
{
"CategoryTypeName": "Beverage",
"SmartType": "Cost Centre",
"CategoryTypeGuid": "994d9bb9-411e-486c-ab88-cf8f8efccb29",
"CategoriesList": [
{
"CategoryGuid": "26b84f1b-9805-4d86-9335-370e51d1034e",
"CategoryName": "Vodka",
"IsDefault": true,
"CategoryCode": ""
}
]
}
],
GET /recipeidentifiers
New endpoint to retrieve minimal recipe identification information. This is of particular interest to customers who retrieve large data sets via the API.
Filters available for the new endpoint are:
lastModifiedAfter=YYYY-MM-DD
lastModifiedNutrientsAfter=YYYY-MM-DD
lastModifiedIntolerancesAfter=YYYY-MM-DD
Sample response:
{
"RecipeName": "Seasoning Salt & Pepper",
"StarChefKey": 358,
"RecipeGuid": "F4F29170-2344-4B20-A0AE-534EB34C4FB7",
"DateLastUpdated": "2020-09-16T09:18:49"
}
GET /menus > Add Menu CourseID to Response
A new property has been added to the response for this endpoint. This is the menu CourseID property.
Sample response (partial):
[
{
"MenuGuid": "8957a906-ef93-41bc-82d6-8834ff937d19",
"Type": "A La Carte",
"Name": "Brasserie Dinner Menu",
"IncludeSalesTax": false,
"Description": "Description Description Description Description Description Description Description Description Description Description Description ",
"FlagType": "Yellow",
"FlagExpiry": "2013-02-20T00:00:00Z",
"FlagSetOn": "",
"DateCreated": "2010-07-14T13:36:54Z",
"DateLastUpdated": "2012-08-16T15:31:48Z",
"MenuCourses": [
{
"CourseName": "Starters",
"CourseID": 2554,
"CourseOrder": 1,
"BuffetSellingPrice": "0.00",
"BuffetSales": "0.00",
"BuffetRevenue": "0.00",
"BuffetProfit": "0.00",
"BuffetGP%": "0.00",
"MenuItems": [
{
"RecipeGuid": "7988c039-e5b4-490f-97d7-6fd38f7f54a2",
"RecipeName": "Caesar Salad With Bacon , And Garlic Croutons",
"MenuItemOrder": 1,
"COS%": "58.63",
"Cost+Waste": "2.64",
"GP%": "41.37",
"ItemCode": "",
"ItemCost": "2.64",
"MenuMix%": "4.2",
"ProfitContrib%": "-1.41",
"Quantity": "0.00",
"Revenue": "22.55",
"RevenueContrib%": "3.33",
"Sales": "5.00",
"SalesMix": "0.00",
"SellPrice": "4.51",
"TotalCost": "13.22",
"TotalProfit": "9.33",
"Waste%": "0.00"
},
{
"RecipeGuid": "1a5f5b68-470b-452f-9c34-bef95a2a9c2c",
"RecipeName": "Chilled Gazpacho Soup With Seared Scallops",
"MenuItemOrder": 3,
"COS%": "0.14",
"Cost+Waste": "0.01",
"GP%": "99.86",
"ItemCode": "",
"ItemCost": "0.01",
"MenuMix%": "18.6",
"ProfitContrib%": "-25.80",
"Quantity": "0.00",
"Revenue": "171.38",
"RevenueContrib%": "25.33",
"Sales": "22.00",
"SalesMix": "0.00",
"SellPrice": "7.79",
"TotalCost": "0.25",
"TotalProfit": "171.13",
"Waste%": "0.00"
},
]
},
{
"CourseName": "Mains",
"CourseID": 2555,
"CourseOrder": 2,
"BuffetSellingPrice": "0.00",
"BuffetSales": "0.00",
"BuffetRevenue": "0.00",
"BuffetProfit": "0.00",
"BuffetGP%": "0.00",
"MenuItems": [
{
"RecipeGuid": "dfed0a3a-9d5b-4e19-a1d8-6a0b98bfb294",
"RecipeName": "Braised Shank Of Lamb With Rosemary Roasted Peppers 2011",
GET /recipes/{guid}/nutrition > ‘Salt’ property added to response.
The nutrient ‘salt’ property has been added to the response for the above endpoint.
Sample response:
[
{
"RecipeGuid": "a672fd1e-85b5-476c-9337-833d4c76a270",
"PLU": "0000495",
"Name": "Caesar Salad",
"CalculationMethod": "Auto-calculate",
"SelectedStandard": "Reference Intake (RI) of an average adult, Adults, Adults (general)",
"Nutrients": [
{
"NutrientName": "Energy_kCal",
"NutrientDescription": "Energy (kcal)",
"PerServingGram": "338.592",
"Per100g": "218.446",
"PercentageOfGDA": "16.93",
"NutrientGuid": "99260bc8-c623-4c07-8fc2-674e1cb588b3"
},
{
"NutrientName": "Energy_KJ",
"NutrientDescription": "Energy (kJ)",
"PerServingGram": "1411.377",
"Per100g": "910.566",
"PercentageOfGDA": "16.802",
"NutrientGuid": "642cc016-c0b7-4e7f-ae4e-0aab7df6d613"
},
{
"NutrientName": "Fat",
"NutrientDescription": "Total Fat (g)",
"PerServingGram": "25.625",
"Per100g": "16.532",
"PercentageOfGDA": "36.607",
"NutrientGuid": "5e1dd7f0-3b6a-4a9e-a144-3b7333bec7d5"
},
{
"NutrientName": "Fat_Sat",
"NutrientDescription": "saturates (SFA)",
"PerServingGram": "9.094",
"Per100g": "5.867",
"PercentageOfGDA": "45.472",
"NutrientGuid": "7d566f1c-643a-49ff-a256-703176288d5e"
},
{
"NutrientName": "Fat_Mono",
"NutrientDescription": "mono-unsaturates (MUFA)",
"PerServingGram": "7.365",
"Per100g": "4.752",
"PercentageOfGDA": "",
"NutrientGuid": "ce8f91b0-6c89-409f-af95-da93e9b1dd3c"
},
{
"NutrientName": "Fat_Poly",
"NutrientDescription": "poly-unsaturates (PUFA)",
"PerServingGram": "7.324",
"Per100g": "4.725",
"PercentageOfGDA": "",
"NutrientGuid": "e4c96cfa-1e75-49d8-a1e4-4b800e44d09e"
},
{
"NutrientName": "Carb",
"NutrientDescription": "Carbohydrate (g)",
"PerServingGram": "14.349",
"Per100g": "9.257",
"PercentageOfGDA": "5.519",
"NutrientGuid": "16bbb275-cee4-48b1-875d-8f9b861880dd"
},
{
"NutrientName": "Carb_Starch",
"NutrientDescription": "starch",
"PerServingGram": "",
"Per100g": "",
"PercentageOfGDA": "",
"NutrientGuid": "648294d9-4e3e-4543-a66a-35e75baa2a44"
},
{
"NutrientName": "Carb_Sugars",
"NutrientDescription": "total sugars",
"PerServingGram": "1.626",
"Per100g": "1.049",
"PercentageOfGDA": "1.807",
"NutrientGuid": "72b18874-630f-4c92-801a-b12180920606"
},
{
"NutrientName": "Protein",
"NutrientDescription": "Protein (g)",
"PerServingGram": "13.677",
"Per100g": "8.824",
"PercentageOfGDA": "27.353",
"NutrientGuid": "9d57b6b6-dda7-4bc3-b8e0-d36358406fb7"
},
{
"NutrientName": "Fibre_NSP",
"NutrientDescription": "Fibre",
"PerServingGram": "",
"Per100g": "",
"PercentageOfGDA": "",
"NutrientGuid": "2c706cc1-35e3-4689-b151-0d083edf8664"
},
{
"NutrientName": "Sodium",
"NutrientDescription": "Sodium (g)",
"PerServingGram": "0.549",
"Per100g": "0.354",
"PercentageOfGDA": "22.879",
"NutrientGuid": "887d699b-4c2e-4f2d-90df-6afdf801e5bc"
},
{
"NutrientName": "Salt(g)",
"NutrientDescription": "Salt(g)",
"PerServingGram": "1.373",
"Per100g": "0.886",
"PercentageOfGDA": "22.879",
"NutrientGuid": "887d699b-4c2e-4f2d-90df-6afdf801e5bc"
}
]
}
]
Sample response (partial)Sodium value in API will always be the ‘gram’ value
When sodium was displayed as milligrams in UI (customers can choose mg or g for sodium), the sodium value returned in the API response was the milligram value. Because the label in the API is called ‘PerServingGram’, the sodium value in milligrams could be interpreted as sodium in grams (per serving). The result would be an exaggerated sodium value.
The sodium numeric value in the API has been changed to ensure that it will always be converted to grams whether the UI uses milligrams or grams.
POST /ingredients > 'Parent Ingredient Product Name' property added
‘Parent Ingredient Product Name' property has been added to the import API. This is an optional value.
Reminder:
The logic of the /ingredients endpoint is this:
- If a property is not included in the payload, the value will be cleared, i.e. changed to blank
- So if a user wants the value to remain the same, the value must be included in the payload
Therefore, if making a POST request to this endpoint and any existing 'Parent Ingredient Product Name' values are to be maintained, be sure to populate this property in the payload.
Comments
0 comments
Please sign in to leave a comment.