Generate a Meal Plan

At any point in time, you can make adjustments to the meal plan settings and schedule, and replace your existing meal plan with a new one.

Note: To use the Whisk Meal Plan API, you must acquire a User Token. For more information, see User Access Tokens.

The Meal Plan API provides you two endpoints that allow you to generate a meal plan. The only difference between the two is that one of them requires a {meal_plan_id} and the other doesn't. This arrangement has been made for a future planned feature of supporting multiple meal plans for every user.

While at the moment, since Whisk only supports a single meal plan per user, the {meal_plan_id} has been kept optional for both endpoints. You can leave it blank and it would be directly derived from the user token being used for API authentication.

Generate a meal plan

PUT https://api.whisk.com/mealplan/v2/generate

This endpoint allows you to regenerate a meal plan using the Body parameter.

Request Body

{
  "meal_plan_id": "5f27a59a9a8641078c7057eeec0a1b90",
  "start_date": 
    ...
  "end_date":
    ...
  "meals": [
    {
      "id": "894f285cd9d543d3b78b374f59b56311",
      "meal_type": "MEAL_TYPE_BREAKFAST",
      "date_time":
        ...
      "content": {
        "recipe": 
          ...
      },
      "generated": true,
      "day_slot": 3,
      "date":
        ...
    },
    {
      "id": "aab8f93131724117836f8cab365518c6",
      "meal_type": "MEAL_TYPE_LUNCH",
      "date_time":
        ...
      "content": {
        "recipe": 
          ...
      },
      "generated": true,
      "day_slot": 4,
      "date":
        ...
    },
    {
      "id": "4b50cf3d2bf24ebe9c4630d2816fea99",
      "meal_type": "MEAL_TYPE_DINNER",
      "date_time":
        ...
      "content": {
        "recipe": 
          ...
      },
      "generated": true,
      "day_slot": 5,
      "date":
        ...
    },
    ...
  ],
  "result_code": "GENERATION_RESULT_CODE_SUCCESS"
}

Note: Whisk provides its APIs on the Swagger interface for you to try it out. You can call this endpoint here.

Generate a specific meal plan

PUT https://api.whisk.com/mealplan/v2/{meal_plan_id}/generate

This endpoint allows you to regenerate a meal plan using the meal_plan_id path parameter (currently optional) and the body parameter.

Path Parameters

Request Body

{
  "meal_plan_id": "5f27a59a9a8641078c7057eeec0a1b90",
  "start_date": 
    ...
  "end_date":
    ...
  "meals": [
    {
      "id": "894f285cd9d543d3b78b374f59b56311",
      "meal_type": "MEAL_TYPE_BREAKFAST",
      "date_time":
        ...
      "content": {
        "recipe": 
          ...
      },
      "generated": true,
      "day_slot": 3,
      "date":
        ...
    },
    {
      "id": "aab8f93131724117836f8cab365518c6",
      "meal_type": "MEAL_TYPE_LUNCH",
      "date_time":
        ...
      "content": {
        "recipe": 
          ...
      },
      "generated": true,
      "day_slot": 4,
      "date":
        ...
    },
    {
      "id": "4b50cf3d2bf24ebe9c4630d2816fea99",
      "meal_type": "MEAL_TYPE_DINNER",
      "date_time":
        ...
      "content": {
        "recipe": 
          ...
      },
      "generated": true,
      "day_slot": 5,
      "date":
        ...
    },
    ...
  ],
  "result_code": "GENERATION_RESULT_CODE_SUCCESS"
}

Note: Whisk provides its APIs on the Swagger interface to try and test. You can call this endpoint here.

{
  "meal_plan_id": "string",
  "settings": {
    ...
  },
  "period": {
    ...
  },
  "fields": [
    ...
  ]
}

The body object contains the following attributes and arrays that can be set to generate a meal plan for you:

Last updated