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

Headers

Request Body

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

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:

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

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.

Last updated