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

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

{
   "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.

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.

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

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