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
  • Update Item
  • Request Body Object Example
  • Sample Request and Response

Was this helpful?

  1. Whisk API Reference 2.0
  2. Shopping List

Update an Item in a Shopping List

This endpoint allows you update an item in a shopping list.

Update Item

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

You can use the following path parameters and a body parameter to update an item in a shopping list:

Path Parameters

Name
Type
Description

list_id

string

The unique identifier of the list that contains the item to be updated.

item_id

string

The unique identifier of the item to be updated.

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 the item's attributes that can be updated. 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

{
  "fields": {
    "name": "strawberry ice cream",
    "brand": "magnum",
    "comment": "frozen",
    "quantity": 10,
    "unit": "scoop",
    "checked": true
  },
  "mask": {
    "paths": [
      "name", "brand", "comment", "quantity", "unit", "checked"
    ]
  }
}

fields

The fields object allows you to specify new values for following attributes of an item:

Attribute

Type

Description

name

string

The item's name.

brand

array

The brand name if the item is of a specific brand.

comment

boolean

Additional information attached with the item.

quantity

number

The item's volume or count.

unit

array

The measurement unit of the item's quantity.

checked

boolean

Check or uncheck the item in the list.

mask

The mask object allows you to specify the attributes that you want to update specifically. It is essential to use this object because you need to specify values for all the attributes that the fields object contains regardless of whether you want to update all or only a few of them in each update request. Hence, the mask object determines which attributes are to be updated exactly.

The mask object contains the path array that allows you to add a comma-separated list of attributes to update.

Sample Request and Response

curl -X PUT "https://api.whisk.com/list/v2/106c5fa85ddbba343099347c57e54632500/item/611b542e-4d9f-4a1a-afab-be960c88a3c2"
    -H "Accept: application/json"
    -H "Authorization: Bearer <YOUR-API-ACCESS-KEY>"
    -d "{ \"fields\": { \"name\": \"strawberry ice cream\", \"brand\": \"magnum\", \"comment\": \"frozen\", \"quantity\": 10, \"unit\": \"scoop\", \"checked\": true }, \"mask\": { \"paths\": [ \"name\", \"brand\", \"comment\", \"quantity\", \"unit\", \"checked\" ] }}"
{
  "list": {
    "id": "106c5fa85ddbba343099347c57e54632500",
    "name": "My New Shopping List"
  },
  "content": {
    "items": [
      {
        "id": "611b542e-4d9f-4a1a-afab-be960c88a3c2",
        "item": {
          "name": "strawberry ice cream",
          "brand": "magnum",
          "comment": "frozen",
          "quantity": 10,
          "unit": "scoop"
        },
        "checked": true,
        "image_url": "https://whisk-res.cloudinary.com/image/upload/v1579874533/custom_upload/05b8a428286fb4177ae5d82a4d00bc03.jpg",
        "analysis": {
          "product": {
            "canonical_name": "STRAWBERRY ICE CREAM"
          },
          "category": {
            "canonical_name": "FROZEN"
          },
          "brand": {
            "canonical_name": "MAGNUM"
          }
        },
        "created_time": "1614714958",
        "updated_at": "1614715075",
        "matching_properties": {
          "gtin": "00000034411207"
        }
      }
    ]
  }
}

PreviousDelete an Item from a Shopping ListNextClear Items 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