Contents
On this page

Create List from Meal Plan - Plugixa Recipe

POST /plugixa-recipe/v1/shopping-lists/from-meal-plan/{id}

Create a shopping list for the caller from every recipe in a meal plan, with matching ingredients merged.

Needs the plugixa_recipe_edit capability, or WordPress’s edit_posts (Contributor and up). Needs Plugixa Recipe Pro with the Shopping Lists app on.

Note. Ingredients with the same name and unit are merged into one line. Their quantities are added when both are plain numbers (2 and 2 make 4); otherwise the first quantity is kept and the others are dropped, so 1/2 cup and 1 cup of the same ingredient come out as 1/2 cup. Check merged lines.

Request

POST https://your-site.example/wp-json/plugixa-recipe/v1/shopping-lists/from-meal-plan/6

Path parameters

Name Type Description
id integer The id of a collection of type meal_plan

Request body

Content type: application/json. Optional.

Field Type Required Description
name string No The list name. Defaults to Shopping List - followed by the meal plan name.

The name and unit comparison ignores case and surrounding spaces.

{
  "name": "Week 46"
}

Responses

200 OK. data is the new list with its items.

{
  "success": true,
  "message": "",
  "data": {
    "id": "11",
    "user_id": "1",
    "name": "Shopping List - Week 46",
    "status": "active",
    "created_at": "2026-11-12 09:30:00",
    "modified_at": null,
    "items": [
      {
        "id": "60",
        "shopping_list_id": "11",
        "recipe_id": "12",
        "ingredient_name": "flour",
        "quantity": "4",
        "unit": "cups",
        "is_checked": false,
        "sort_order": "0",
        "added_at": "2026-11-12 09:30:00"
      }
    ]
  }
}
Field Type Meaning
data.id string The list’s id
data.user_id string The owner: always the caller
data.status string active unless you set something else; personal marks the list the front end keeps
data.items[] object[] In the order stored
data.items[].ingredient_name, quantity, unit string The line
data.items[].recipe_id string|null The recipe it came from
data.items[].is_checked boolean Ticked off

Errors

Status Code When
404 rest_error No meal plan with that id (a collection of another type counts as none).
400 rest_error The meal plan has no recipes.
500 rest_error The list could not be written.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-recipe/v1/shopping-lists/from-meal-plan/6" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-recipe/v1/shopping-lists/from-meal-plan/6');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const auth = 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`);
const response = await fetch('https://your-site.example/wp-json/plugixa-recipe/v1/shopping-lists/from-meal-plan/6', {
  method: 'POST',
  headers: {
    'Authorization': auth,
  },
});
const { data } = await response.json();

Quick Links

Share