Create a Shopping List

This endpoint allows you create a new shopping list.

post
Create Shopping List

https://api.whisk.com/list/v2
You can use a body parameter to create a shopping list:
Request
Response
Request
Headers
Authentication
required
string
Server Token or a User Access token containing shopping_list:write scope to authorize the API usage. For more information, see Authentication. Note: While using a Server Token for authentication, the new shopping list is not linked to any user and can only be accessed using its identifier (id).
Body Parameters
body
required
object
The body object contains your shopping list definition. See the Body Object Example below.
Response
200: OK
This is how a successful response looks.
{
"list": {
"id": "string",
"name": "string",
"primary": true
},
"content": {
"items": [
{
"id": "string",
"item": {
"name": "string",
"brand": "string",
"comment": "string",
"quantity": 0,
"unit": "string"
},
"checked": true,
"image_url": "string",
"analysis": {
"product": {
"canonical_name": "string",
"original_name": "string"
},
"category": {
"canonical_name": "string"
},
"brand": {
"canonical_name": "string"
}
},
"recipe": {
"recipe_id": "string",
"position": 0
},
"combined": {
"combined_item_id": "string",
"quantity": 0
},
"created_time": "string",
"updated_at": "string",
"matching_properties": {
"gtin": "string",
"custom_product_id": "string"
}
}
],
"combined_items": [
{
"id": "string",
"item": {
"name": "string",
"brand": "string",
"comment": "string",
"quantity": 0,
"unit": "string"
},
"checked": true,
"image_url": "string",
"analysis": {
"product": {
"canonical_name": "string",
"original_name": "string"
},
"category": {
"canonical_name": "string"
},
"brand": {
"canonical_name": "string"
}
},
"created_time": "string",
"updated_at": "string"
}
],
"recipes": [
{
"id": "string",
"name": "string",
"images": [
{
"responsive": {
"url": "string",
"width": 0,
"height": 0,
"selection": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
}
},
"url": "string"
}
],
"source": {
"name": "string",
"display_name": "string",
"source_recipe_url": "string",
"image": {
"responsive": {
"url": "string",
"width": 0,
"height": 0,
"selection": {
"x": 0,
"y": 0,
"width": 0,
"height": 0
}
},
"url": "string"
},
"license": "LICENCE_INVALID"
}
}
]
}
}
400: Bad Request
This failed response appears when error codes are found in the endpoint query.
{
"error_code": "REAL_CODES_ARE_IN_ENDPOINT_DESCRIPTION",
"message": "Additional details about error are not static and can be changed"
}
401: Unauthorized
This failed response appears due to API authentication failure. The possible error codes that may appear are: auth.tokenNotFound , auth.tokenExpired, auth.tokenInvalid, auth.tokenRequired.
{
"code": "auth.tokenNotFound"
}
500: Internal Server Error
This failed response appears when something is not right on Whisk's end. Please send a message to [email protected], and be sure to include both the Request and Response data. We’ll get back to you soon.
This is unexpected response, something is wrong on our side, please contact: [email protected]

Request Body Object Example

{
"name":"My New Shopping List",
"primary":true,
"items":[
{
"normalized":{
"name":"bacon",
"brand":"Oscar mayer",
"comment":"cooked, crumbled",
"quantity":8,
"unit":"slices"
},
"gtin":"00000034411207"
},
{
"raw":{
"text":"2 garlic cloves"
},
"custom_product_id":"6037bd956f0187c6c0f56241"
}
],
"recipes":[
{
"recipe_id":"1011f5a116db3c3e56e57bea0a52ffbfca5fc96f6b1",
"scale":{
"scale":2
},
"ingredients":{
"ids":[
"f83e58370ebc70b01798c575f5132a76d8dba890:1:0"
]
}
},
{
"recipe_id":"10745889d4a1c0f4b8dbfab66bffa433524"
}
],
"language":"en"
}

The body object contains the following core attributes that let you define your shopping list:

Attribute

Type

Description

Example

name

string

The shopping list name.

"name":"My New Shopping List"

primary

boolean

This attribute allows you to set the shopping list as your default list. You can skip this attribute or set it to False when you don't to want to make it your primary list.

"primary":true

language

string

This attribute allows you to set the shopping list language as per ISO 639 standards.

The language you set plays a vital role in analyzing the items you add to your list, and it must match the language of the items you plan to add to the list, or you must add the items in English. Any mismatch could result in problems with identifying the related image, category, and store item. For example, if you set the shopping list language as German and use the French language to add items, the items' analysis would fail. On the contrary, if you add items in German or English language, the corresponding data will be easily matched and found.

You can also skip this attribute if you want to use the language set in your User Preferences, and if you don't have any language set there, it gets set to English by default.

"language":"en"

The body object also contains items and recipes arrays that allow you to add items to the shopping list.

items

The items array allows you to add individual items in a normalized or raw format based on your preference.

Attribute

Type

Description

Example

normalized

object

This object allows you to add items in a normalized format by specifying each information element of the item separately.

Optionally, you can also link an item to a custom product using gtin or custom_product_id if needed.

{

"normalized":{

"name":"bacon",

"brand":"Oscar mayer",

"comment":"cooked, crumbled",

"quantity":8,

"unit":"slices"

},

"gtin":"00000034411207"

}

raw

object

This object allows you to add the item details like a raw string and leave it for automatic normalization. Optionally, you can also link an item to a custom product using gtin or custom_product_id if needed.

{

"raw":{

"text":"2 garlic cloves"

},

"custom_product_id":"6037bd956f0187c6c0f56241"

}

recipes

The recipes array allows add a list of recipes to move their ingredients as items in your shopping list. You can either specify the exact ingredients of a particular recipe or move all recipe ingredients to the shopping list, depending on the need.

Attribute

Type

Description

Example

recipe_id

string

This attribute allows you to identify the recipe for moving its ingredients as items to your shopping list.

recipe_id": "1011f5a116db3c3e56e57bea0a52ffbfca5fc96f6b1"

scale

object

This object allows you to mention the scale to determine and set the ingredient's quantity while adding it to the shopping list. For example, if you set it to 2, the ingredient/item's count or volume gets doubled in the shopping list. If you want to add the exact quantity specified in the recipe, you can skip it or set it to 1.

"scale":

{

"scale":2

}

ingredients

object

This array allows you individually specify each recipe ingredient that you want to add as an item to the shopping list. If you are looking to move all recipe ingredients to your shopping list, you can skip it.

"ingredients":{

"ids":[

"f83e58370ebc70b01798c575f5132a76d8dba890:1:0"

]

}

}

Sample Request and Response

Curl Request
Response
Curl Request
curl -X POST "https://api.whisk.com/list/v2"
-H "Accept: application/json"
-H "Authorization: Bearer <YOUR-API-ACCESS-KEY>"
-d "{ \"name\":\"My New Shopping List\", \"primary\":true, \"items\":[ { \"normalized\":{ \"name\":\"bacon\", \"brand\":\"Oscar mayer\", \"comment\":\"cooked, crumbled\", \"quantity\":8, \"unit\":\"slices\" }, \"gtin\":\"00000034411207\" }, { \"raw\":{ \"text\":\"2 garlic cloves\" }, \"custom_product_id\":\"6037bd956f0187c6c0f56241\" } ], \"recipes\":[ { \"recipe_id\":\"1011f5a116db3c3e56e57bea0a52ffbfca5fc96f6b1\", \"scale\":{ \"scale\":2 }, \"ingredients\":{ \"ids\":[ \"f83e58370ebc70b01798c575f5132a76d8dba890:1:0\" ] } }, { \"recipe_id\":\"10745889d4a1c0f4b8dbfab66bffa433524\" } ], \"language\":\"en\"}"

Whisk allows you to discover and understand its API capabilities on the Swagger interface with the ability to try out the API calls directly in your browser. You can call this endpoint here.

Response
{
"list": {
"id": "106c5fa85ddbba343099347c57e54632500",
"name": "My New Shopping List",
"primary": true
},
"content": {
"items": [
{
"id": "0c76dbb5-c626-4a49-8f5e-87829fea0cbe",
"item": {
"name": "bacon",
"brand": "Oscar mayer",
"comment": "cooked, crumbled",
"quantity": 8,
"unit": "slices"
},
"image_url": "https://whisk-res.cloudinary.com/image/upload/v1550764646/graph/fooddb/0919f5d46996479ba5575bcdc19dc0ba.jpg",
"analysis": {
"product": {
"canonical_name": "BACON"
},
"category": {
"canonical_name": "MEATS AND SEAFOOD"
},
"brand": {
"canonical_name": "OSCAR MAYER"
}
},
"created_time": "1614333362",
"updated_at": "1614333362",
"matching_properties": {
"gtin": "00000034411207"
}
},
{
"id": "23c0bff5-c910-4b06-97d9-4137f8c6a657",
"item": {
"name": "semi-skimmed milk",
"quantity": 750,
"unit": "ml"
},
"image_url": "https://whisk-res.cloudinary.com/image/upload/v1550764818/graph/fooddb/48b648475f551475af2148db6c709031.jpg",
"analysis": {
"product": {
"canonical_name": "SEMI SKIMMED MILK"
},
"category": {
"canonical_name": "DAIRY AND EGGS"
}
},
"recipe": {
"recipe_id": "10745889d4a1c0f4b8dbfab66bffa433524",
"position": 5
},
"created_time": "1614333362",
"updated_at": "1614333362",
"matching_properties": {}
},
{
"id": "26d30eb1-64a8-481e-99ad-d2914cd56c1d",
"item": {
"name": "onion",
"comment": "chopped",
"quantity": 2
},
"image_url": "https://whisk-res.cloudinary.com/image/upload/v1550764494/graph/fooddb/d5bd477463b289845a984f7792ed6d70.jpg",
"analysis": {
"product": {
"canonical_name": "ONION"
},
"category": {
"canonical_name": "FRUITS AND VEGETABLES"
}
},
"recipe": {
"recipe_id": "1011f5a116db3c3e56e57bea0a52ffbfca5fc96f6b1",
"position": 1
},
"created_time": "1614333362",
"updated_at": "1614333362",
"matching_properties": {}
},
{
"id": "611b542e-4d9f-4a1a-afab-be960c88a3c2",
"item": {
"name": "vanilla ice cream",
"quantity": 2,
"unit": "scoops"
},
"image_url": "https://whisk-res.cloudinary.com/image/upload/v1552312265/custom_upload/a4b1ba7ea9533d0079424413ee9a92e8.jpg",
"analysis": {
"product": {
"canonical_name": "VANILLA ICE CREAM"
},
"category": {
"canonical_name": "FROZEN"
}
},
"recipe": {
"recipe_id": "10745889d4a1c0f4b8dbfab66bffa433524",
"position": 1
},
"created_time": "1614333362",
"updated_at": "1614333362",
"matching_properties": {}
},
{
"id": "729d13af-47ec-4675-ac9c-0a47b99e1c42",
"item": {
"name": "dessicated coconut",
"quantity": 3,
"unit": "tbs"
},
"image_url": "https://whisk-res.cloudinary.com/image/upload/v1550764639/graph/fooddb/f1fe2fc9e0919c4d60a8aaa808296684.jpg",
"analysis": {
"product": {
"canonical_name": "DESICCATED COCONUT"
},
"category": {
"canonical_name": "BAKING"
}
},
"recipe": {
"recipe_id": "10745889d4a1c0f4b8dbfab66bffa433524",
"position": 4
},
"created_time": "1614333362",
"updated_at": "1614333362",
"matching_properties": {}
},
{
"id": "83c64f92-336b-40b6-9434-10f3bd9ce7f1",
"item": {
"name": "bananas",
"quantity": 400,
"unit": "g"
},
"image_url": "https://whisk-res.cloudinary.com/image/upload/v1550764678/graph/fooddb/0cc366548b4413cebaaeec7ec862b530.jpg",
"analysis": {
"product": {
"canonical_name": "BANANA"
},
"category": {
"canonical_name": "FRUITS AND VEGETABLES"
}
},
"recipe": {
"recipe_id": "10745889d4a1c0f4b8dbfab66bffa433524"
},
"created_time": "1614333362",
"updated_at": "1614333362",
"matching_properties": {}
},
{
"id": "9a32a754-4f6b-4c4a-947e-7a140c89b438",
"item": {
"name": "garlic cloves",
"quantity": 2
},
"image_url": "https://whisk-res.cloudinary.com/image/upload/v1550764463/graph/fooddb/fb90ea8fbd3e81005fc22ada2c8ddd1f.jpg",
"analysis": {
"product": {
"canonical_name": "GARLIC CLOVE"
},
"category": {
"canonical_name": "FRUITS AND VEGETABLES"
}
},
"created_time": "1614333362",
"updated_at": "1614333362",
"matching_properties": {
"gtin": "00000075259567",
"custom_product_id": "6037bd956f0187c6c0f56241"
}
},
{
"id": "faa50af4-c8dd-4ee9-8250-3eb546e940d5",
"item": {
"name": "vanilla essence",
"quantity": 0.5,
"unit": "tsp"
},
"image_url": "https://whisk-res.cloudinary.com/image/upload/v1550764596/graph/fooddb/e17ca99279ef46921f34ac8b0884134f.jpg",
"analysis": {
"product": {
"canonical_name": "VANILLA ESSENCE"
},
"category": {
"canonical_name": "BAKING"
}
},
"recipe": {
"recipe_id": "10745889d4a1c0f4b8dbfab66bffa433524",
"position": 2
},
"created_time": "1614333362",
"updated_at": "1614333362",
"matching_properties": {}
},
{
"id": "fb496a90-f075-468b-a613-bb685db5263c",
"item": {
"name": "maple syrup",
"comment": "or golden syrup or honey",
"quantity": 1,
"unit": "tbs"
},
"image_url": "https://whisk-res.cloudinary.com/image/upload/v1550764501/graph/fooddb/4b54ff13e2e0d22f60715e45d00ac95f.jpg",
"analysis": {
"product": {
"canonical_name": "MAPLE SYRUP"
},
"category": {
"canonical_name": "BREAKFAST FOODS"
}
},
"recipe": {
"recipe_id": "10745889d4a1c0f4b8dbfab66bffa433524",
"position": 3
},
"created_time": "1614333362",
"updated_at": "1614333362",
"matching_properties": {}
}
],
"recipes": [
{
"id": "10745889d4a1c0f4b8dbfab66bffa433524",
"name": "Banana & coconut smoothie",
"images": [
{
"responsive": {
"url": "https://whisk-res.cloudinary.com/image/upload/v1611680399/recipe/957f8b170c57cfdcad1ea4c598c9ddcb.jpg",
"width": 960,
"height": 1280
},
"url": "https://whisk-res.cloudinary.com/image/upload/v1611680399/recipe/957f8b170c57cfdcad1ea4c598c9ddcb.jpg"
}
],
"source": {
"license": "LICENCE_FAIRUSE"
}
},
{
"id": "1011f5a116db3c3e56e57bea0a52ffbfca5fc96f6b1",
"name": "Bacon Cheeseburger Casserole",
"images": [
{
"responsive": {
"url": "https://whisk-res.cloudinary.com/image/upload/v1536910467/recipe/94f698dfcafefe3223aa66f1b3b21ae7.jpg",
"width": 428,
"height": 640
},
"url": "https://assets.kraftfoods.com/recipe_images/opendeploy/126725_MXM_K59919V0_OR1_CR_640x428.jpg"
}
],
"source": {
"name": "myfoodandfamily.com",
"display_name": "My Food and Family",
"source_recipe_url": "https://www.myfoodandfamily.com/recipe/126725/bacon-cheeseburger-casserole",
"image": {
"responsive": {
"url": "https://whisk-res.cloudinary.com/image/upload/v1565965713/publishers/logos/myfoodandfamily-logo.png",
"width": 256,
"height": 256
},
"url": "https://whisk-res.cloudinary.com/image/upload/v1565965713/publishers/logos/myfoodandfamily-logo.png"
},
"license": "LICENCE_FAIRUSE"
}
}
]
}
}

To understand the data structure of a shopping list definition that is returned in the response, see Shopping List Object.