Create a Shopping List

POST
/v1beta/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

ATTRIBUTETYPEDESCRIPTION
namestring

Shopping List name

languagestring

Language can be provided explicitly which wll impact analysis on shopping list items. Default: en

recipesarray [ShoppingListRecipePayload]

references to recipes to add to a shopping list

rawItemsarray [string]

Ids of recipes. Cart will be generated basing on recipe ingredients.

Id can be represented by GraphID or recipe url

itemsarray [ShoppingListItemPayload]

list of normalised items to add

ShoppingListRecipePayload

ATTRIBUTETYPEDESCRIPTION
id*string

GraphId or URL of a Recipe

scaleinteger

Number of recipe servings

ShoppingListItemPayload

ATTRIBUTETYPEDESCRIPTION
quantitydouble

Item quantity

unitstring

Item unit (e.g. gram, ml)

name*string

Item name (e.g. potato)

commentstring

Request (adding raw items)

curl -X POST "https://graph.whisk.com/v1beta/lists" \ -H "Accept: 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/v1beta/lists" \ -H "Accept: 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/v1beta/lists" \ -H "Accept: 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

ATTRIBUTETYPEDESCRIPTION
id*string
name*string
primaryboolean
createdTime*datetime

The time the Shopping List was created.

updatedTime*datetime
itemsarray [ShoppingListItemElement]

ShoppingListItemElement

ATTRIBUTETYPEDESCRIPTION
quantitydouble

Item quantity

unitstring

Item unit (e.g. gram, ml)

name*string

Item name (e.g. potato)

commentstring
brandstring
analysisobject
recipestring
recipeOrderinginteger
createdTimedatetime
combinedarray

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": { "id": "e9df2867-63b7-48f8-aede-c3acab6f597c", "canonicalName": "MEATS AND SEAFOOD" } }, "recipe": "9773cb7eca5d11e7ae7e42010a9a0035", "recipeOrdering": 0 }, { "id": "bb47bf7b-060d-49f0-9091-bada6b695019", "quantity": 4, "name": "eggs", "comment": "large", "analysis": { "canonicalName": "EGG", "category": { "id": "38f0d9f7-d19d-407d-bfc3-17258c57d954", "canonicalName": "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" } ] }