Create a Shopping List
POST
/v1/lists
Creates a shopping list
Both Server Token and User Access Token are allowed to be used in this endpoint. In case of Server Token, list will not be linked to any user and it will be only possible to access it by id.
Parameters
ATTRIBUTE | TYPE | DESCRIPTION | ||
---|---|---|---|---|
name | string | Shopping List name | ||
language | string | Language can be provided explicitly which will impact analysis on shopping list items. Default: | ||
recipes | array [ShoppingListRecipePayload] | references to recipes to add to a shopping list | ||
rawItems | array [string] | Ids of recipes. Cart will be generated basing on recipe ingredients. Id can be represented by GraphID or recipe url | ||
items | array [ShoppingListItemPayload] | list of normalised items to add |
ShoppingListRecipePayload
ATTRIBUTE | TYPE | DESCRIPTION | ||
---|---|---|---|---|
id* | string | GraphId or URL of a Recipe | ||
scale | float | Multiplier for default amounts in recipe: 0.5, 2 ... |
ShoppingListItemPayload
ATTRIBUTE | TYPE | DESCRIPTION | ||
---|---|---|---|---|
quantity | double | Item quantity | ||
unit | string | Item unit (e.g. gram, ml) | ||
name* | string | Item name (e.g. potato) | ||
comment | string |
Request (adding raw items)
curl -X POST "https://graph.whisk.com/v1/lists" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <User-Access-Token>" \
-d '{
"name": "My Shopping List",
"rawItems": [
"200g pack smoked salmon",
"2 slices sharp cheddar cheese",
"1 tbsp salt and olive oil to serve"
]
}'
Request (adding items)
curl -X POST "https://graph.whisk.com/v1/lists" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <User-Access-Token>" \
-d '{
"name": "My Shopping List",
"items": [
{
"quantity": 200,
"unit": "g",
"name": "smoked salmon"
},
{
"quantity": 2,
"unit": "slices",
"name": "cheddar cheese",
"comment": "extra mature"
}
]
}'
Request (adding recipes)
curl -X POST "https://graph.whisk.com/v1/lists" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <User-Access-Token>" \
-d '{
"name": "My Shopping List",
"recipes": [
{
"id": "https://www.bbcgoodfood.com/recipes/omelette-pancakes-tomato-pepper-sauce",
"scale": 0.5
},
{
"id": "9773cb7eca5d11e7ae7e42010a9a0035"
}
]
}'
Response
ATTRIBUTE | TYPE | DESCRIPTION | ||
---|---|---|---|---|
id* | string | |||
name* | string | |||
primary | boolean | |||
createdTime* | datetime | The time the Shopping List was created. | ||
updatedTime* | datetime | |||
items | array [ShoppingListItemElement] |
ShoppingListItemElement
ATTRIBUTE | TYPE | DESCRIPTION | ||
---|---|---|---|---|
quantity | double | Item quantity | ||
unit | string | Item unit (e.g. gram, ml) | ||
name* | string | Item name (e.g. potato) | ||
comment | string | |||
brand | string | |||
analysis | SLItemAnalysis | |||
recipe | string | |||
recipeOrdering | integer | |||
createdTime | datetime | |||
combined | array |
SLItemAnalysis
ATTRIBUTE | TYPE | DESCRIPTION | ||
---|---|---|---|---|
canonicalName | string | Unique normalised product name | ||
category | ProductCategory |
ProductCategory
ATTRIBUTE | TYPE | DESCRIPTION | ||
---|---|---|---|---|
name* | string |
Sample Response
{
"id": "ef610b5c0e294ef6a54931738d79f55d",
"name": "My Shopping List",
"primary": true,
"createdTime": "2017-12-07T20:06:14+0000",
"updatedTime": "2017-12-07T20:06:14+0000",
"items": [
{
"id": "c484682c-66b7-4fa9-82b6-9ef34dec9fc7",
"quantity": 200,
"unit": "g",
"name": "smoked salmon",
"analysis": {
"canonicalName": "SMOKED SALMON",
"category": {
"name": "MEATS AND SEAFOOD"
}
},
"recipe": "9773cb7eca5d11e7ae7e42010a9a0035",
"recipeOrdering": 0
},
{
"id": "bb47bf7b-060d-49f0-9091-bada6b695019",
"quantity": 4,
"name": "eggs",
"comment": "large",
"analysis": {
"canonicalName": "EGG",
"category": {
"name": "DAIRY AND EGGS"
}
},
"recipe": "9773cb7eca5d11e7ae7e42010a9a0035",
"recipeOrdering": 1
}
],
"recipes": [
{
"id": "9773cb7eca5d11e7ae7e42010a9a0035",
"name": "Omelette pancakes with tomato & pepper sauce",
"url": "https://www.bbcgoodfood.com/recipes/omelette-pancakes-tomato-pepper-sauce"
}
]
}