Add Recipes To Cart

Add Recipes to Cart

POST https://graph.whisk.com/v1/:id/recipes

Add all recipe ingredients as items to the cart.

Path Parameters

Request Body

{
  "id": "b35ababeefa0452ebd9bac430417254d",
  "retailer": {
    "id": "898003be304e49b084ac6224adc7ff53",
    "name": "Tesco",
    "displayName": "Tesco",
    "country": "GB",
    "currency": "GBP",
    "logo": {
      "url": "https://res.cloudinary.com/whisk/image/upload/whisk3/supermarket_select_dropdown/tesco-logo.png",
      "width": 134,
      "height": 36
    },
    "urls": {
      "signupUrl": "https://secure.tesco.com/account/en-GB/register",
      "forgotPasswordUrl": "https://secure.tesco.com/account/en-GB/forgotten-password",
      "trolleyUrl": "https://www.tesco.com/groceries/en-GB/slots"
    }
  },
  "items": [
    {
      "id": "28c47e7684704e73bce11b74300dc6b7",
      "sourceList": [
        {
          "name": "1 egg",
          "groupId": "f4e354c79e984fe6bad72a9f8e0e0de9"
        },
        {
          "name": "4 large eggs"
        },
        {
          "name": "4 eggs",
          "groupId": "a0316893c5404d689fe91f9f2adbebc3"
        }
      ],
      "product": {
        "sku": "299626009",
        "name": "Tesco 15 Eggs",
        "quantity": {
          "count": 1
        },
        "price": {
          "list": 1.19
        },
        "images": [
          {
            "url": "https://img.tesco.com/Groceries/pi/043/5057545736043/IDShot_540x540.jpg"
          }
        ],
        "url": "https://www.tesco.com/groceries/en-GB/products/299626009"
      },
      "combined": {
        "name": "9 egg"
      }
    },
    ...
    {
      "id": "0a33e8d087ce4de4a188e2f504a087ea",
      "sourceList": [
        {
          "name": "2 tsp rapeseed oil",
          "groupId": "a0316893c5404d689fe91f9f2adbebc3"
        }
      ],
      "product": {
        "sku": "281921684",
        "name": "Tesco Organic Rapeseed Oil 500Ml",
        "quantity": {
          "count": 1
        },
        "price": {
          "list": 1.5
        },
        "images": [
          {
            "url": "https://img.tesco.com/Groceries/pi/749/0000003243749/IDShot_540x540.jpg"
          }
        ],
        "url": "https://www.tesco.com/groceries/en-GB/products/281921684"
      }
    }
  ],
  "groups": [
    {
      "id": "a0316893c5404d689fe91f9f2adbebc3",
      "type": "Recipe",
      "displayName": "Omelette pancakes with tomato & pepper sauce",
      "recipe": {
        "id": "9773cb7eca5d11e7ae7e42010a9a0035",
        "name": "Omelette pancakes with tomato & pepper sauce",
        "description": "Healthy, low-calorie and gluten-free - these herby egg 'pancakes' will become your go-to favourite for a quick midweek meal",
        "ingredients": [
          {
            "text": "4 large eggs"
          },
          {
            "text": "handful basil leaves"
          },
          {
            "text": "2 tsp rapeseed oil, plus a little extra for the pancakes"
          },
          {
            "text": "1 yellow pepper, quartered, deseeded and thinly sliced"
          },
          {
            "text": "2 garlic cloves, thinly sliced"
          },
          {
            "text": "1 tbsp cider vinegar"
          },
          {
            "text": "400g can chopped tomatoes"
          },
          {
            "text": "wholemeal bread or salad leaves, to serve"
          }
        ],
        "images": [
          {
            "url": "https://www.bbcgoodfood.com/sites/default/files/styles/recipe/public/recipe_images/omelette-pancakes-with-tomato-pepper-sauce.jpg",
            "responsive": {
              "url": "https://whisk-res.cloudinary.com/image/upload/v1523012138/recipe/758058656142eaae402f1781e18c527c.jpg",
              "width": 500,
              "height": 454
            }
          }
        ],
        "videos": [],
        "source": {
          "name": "bbcgoodfood.com",
          "displayName": "BBC Good Food",
          "sourceRecipeUrl": "https://www.bbcgoodfood.com/recipes/omelette-pancakes-tomato-pepper-sauce",
          "license": "Fairuse",
          "image": {
            "url": "http://whisk-res.cloudinary.com/image/upload/v1527610208/publishers/logos/bbcgoodfood-logo.png",
            "responsive": {
              "url": "http://whisk-res.cloudinary.com/image/upload/v1527610208/publishers/logos/bbcgoodfood-logo.png",
              "width": 256,
              "height": 256
            }
          }
        },
        "numberOfServings": 2
      }
    },
    ...
  ],
  "created": 1532503799,
  "expiresIn": 1533108599,
  "labels": {
    "myId": "some value"
  }
}

Sample Request

curl -X POST "https://graph.whisk.com/v1/:id/recipes" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "Authorization: Token Access-Token>" \
  -d '{
    "recipeIds": [
      "9773cb7eca5d11e7ae7e42010a9a0035",
      "https://www.mccormick.com/recipes/breakfast-brunch/quick-and-easy-french-toast"
    ]
  }'

Combined Items

An automatic combination of items is enabled by default. All cart items will be recombined considering the new items. Use combineItems = false to disable it.

More about combined items here.

Parameters

Response

CartItemResponse

CartProductOption

CartGroupResponse

CartItemPrice

CartItemSource

CartProductQuantity

CombinedProductsInfo

Last updated