Whisk Docs
Whisk HomeHelp CenterDeveloper Tools
v2.0.0
v2.0.0
  • The Whisk Platform
  • Whisk API Overview
    • Introduction
    • Integration
    • Authentication
      • Server Token
      • User Access Token
        • Auth Flow Example
      • Client Token
      • Anonymous Access from Client Apps
    • Whisk Sandbox
    • Getting Started
  • Whisk API Reference 2.0
    • Provisioning
      • Get provisioning
    • Autocomplete
    • Community
      • Get your Communities
      • Get Communities from a Topic
      • Discover Recommended Communities
      • Search Communities
      • Get a Community
      • Get Recipes from a Community
      • Add Recipes to a Community
      • Remove a Recipe from a Community
      • Join a Community
      • Leave a Community
    • Posts and Reviews
      • Get reviews for a recipe
      • Create or edit review
      • Create a Post
      • Get Post by id
      • Delete a Post
      • Edit a Post
      • Report a Post
      • Create a Post Reply
      • Get Post Replies
      • Delete a Post reply
      • Report a Post reply
      • Like a Post or Reply
      • Users who liked a Post or Reply
    • Public profiles
      • Hide recipe in Public profile
      • Get Recipes for Public Profile
      • Get User's public profile by user_id
      • Get User's public profile by username
    • Custom Label
    • Feed
      • Obtain a Recipe Feed
    • Food DB
      • Autocomplete
      • Search
      • Get Food
    • Food List
    • Food Log
    • Foodpairing
    • Healthy meal recommendations
      • Healthy recipe only recommendations for DA
      • Recipe recommendations for SH
      • Tailored Plan API request for Samsung TV
    • Meal Plan
      • Generate a Meal Plan
      • Meal Object
        • Get Meals
        • Delete Meal
        • Add a Meal
      • Meal Plan Settings Object
        • Get Meal Plan Settings
        • Update Meal Plan Settings
      • Meal Plan Batch
    • Recipe
      • Get a Recipe
      • Search a Recipe
      • User Recipes & Collections
        • Add User Recipe
        • Create A Recipe
        • Update External Recipe
        • Get All User Recipes
        • Update User Recipe
        • Remove Recipe from Favorites
        • Create Collection
        • Get All User Collections
        • Get Collection
        • Get Recipes from a Collection
        • Remove Collection
        • Get Smart Collection
        • Get Recipes from a Smart Collection
    • Shopping List
      • Get your Shopping Lists
      • Get a Shopping List
      • Create a Shopping List
      • Delete a Shopping List
      • Update basic details of a Shopping List
      • Move Items between Shopping Lists
      • Add Items to a Shopping List
      • Delete an Item from a Shopping List
      • Update an Item in a Shopping List
      • Clear Items from a Shopping List
    • Media
    • Store Item
    • Unit Conversion
    • Users
      • Get a User
      • Update User Settings using Patch
      • Update User Settings using Post
    • Try it out!
  • Shopping List SDK
    • Overview
    • Examples
      • Shoppable Recipes
      • Shoppable Products
      • Shoppable Media
    • Basic Setup
      • Basic Setup
      • Methods
      • Event Listeners
      • Widget
      • Subscriptions
      • Global Configuration
      • UTM Parameters
      • Using With SPA
  • Shopping List Mobile API
    • Overview
    • Examples
    • Reference
  • API Resources
    • Authentication Scopes
    • Errors and Troubleshooting
    • Cursor Pagination
    • Limits
    • Nutrients
    • Recipe Labels
    • Filtering Recipes using Custom Labels
    • Health Score, Glycemic Index, Glycemic Load
    • Whisk User Data
    • Integrated Retailers
    • Optimizing Image Load
    • Meal Plan
Powered by GitBook
On this page
  • Add Items
  • Request Body Object Example
  • Sample Request and Response

Was this helpful?

  1. Whisk API Reference 2.0
  2. Shopping List

Add Items to a Shopping List

This endpoints allows you to add items to your shopping list.

Add Items

PUT https://api.whisk.com/list/v2/{id}/item

You can use a body parameter to add items to a shopping list:

Path Parameters

Name
Type
Description

id

string

The shopping list identifier.

Headers

Name
Type
Description

Authentication

string

Server Token or a User Access token containing shopping_list:write scope to authorize the API usage. For more information, see Authentication.

Request Body

Name
Type
Description

body

object

The body object contains a list of items to add. See the Body Object Example below.

{
  "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"
        }
      }
    ]
  }
}
{
  "error_code": "REAL_CODES_ARE_IN_ENDPOINT_DESCRIPTION",
  "message": "Additional details about error are not static and can be changed"
}
{
  "code": "auth.tokenNotFound"
}
This is unexpected response, something is wrong on our side, please contact: [email protected]

Request Body Object Example

{
   "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"
      }
   ]
}

The body object contains the following attributes that let you add items to your 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 -X PUT "https://api.whisk.com/list/v2/106c5fa85ddbba343099347c57e54632500/item"
    -H "Accept: application/json"
    -H "Authorization: Bearer <YOUR-API-ACCESS-KEY>"
    -d "{ \"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\" } ]}"
{
  "list": {
    "id": "106c5fa85ddbba343099347c57e54632500",
    "name": "My New Shopping List"
  },
  "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": {}
      },
      {
        "id": "ec162612-e137-4b7a-823e-e9dc6651b261",
        "item": {
          "name": "onion",
          "comment": "medium, diced",
          "quantity": 1
        },
        "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"
          }
        },
        "created_time": "1614618694",
        "updated_at": "1614618694",
        "matching_properties": {}
      },
      {
        "id": "fe9be106-3c5a-4cbd-b51a-37a7ef929416",
        "item": {
          "name": "fresh basil",
          "comment": "chopped",
          "unit": "handful"
        },
        "image_url": "https://whisk-res.cloudinary.com/image/upload/v1550764699/graph/fooddb/fb3922212f4471d2dc6c0d116318c165.jpg",
        "analysis": {
          "product": {
            "canonical_name": "BASIL"
          },
          "category": {
            "canonical_name": "FRUITS AND VEGETABLES"
          }
        },
        "created_time": "1614618694",
        "updated_at": "1614618694",
        "matching_properties": {}
      },
      {
        "id": "827bb416-6ba7-4174-b96a-d413b841e0d4",
        "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": "1614621738",
        "updated_at": "1614621738",
        "matching_properties": {
          "gtin": "00000075259567",
          "custom_product_id": "6037bd956f0187c6c0f56241"
        }
      },
      {
        "id": "da8280f9-096f-4518-a670-e538643f1f5a",
        "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": "1614621738",
        "updated_at": "1614621738",
        "matching_properties": {
          "gtin": "00000034411207"
        }
      }
    ],
    "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"
        }
      }
    ]
  }
}

PreviousMove Items between Shopping ListsNextDelete an Item from a Shopping List

Last updated 4 years ago

Was this helpful?

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 .

A successful response returns the shopping list definition with an updated list of items. To understand the data structure of a shopping list definition, see .

here
Shopping List Object