Contents
On this page
Add Shopping List Item - Plugixa Recipe
POST /plugixa-recipe/v1/shopping-lists/{id}/items
Add one line at the end of a list.
Needs the plugixa_recipe_edit capability, or WordPress’s edit_posts (Contributor and up). Needs Plugixa Recipe Pro with the Shopping Lists app on. Each user only ever sees and changes their own lists: another user’s list answers 404.
Request
POST https://your-site.example/wp-json/plugixa-recipe/v1/shopping-lists/9/items
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The shopping list’s id |
Request body
Content type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
ingredient_name |
string |
Yes | Must not be blank. |
quantity, unit |
string |
No | As they should read. |
recipe_id |
integer |
No | The recipe it belongs to. |
{
"ingredient_name": "lemons",
"quantity": "2"
}
Responses
200 OK. data is the new line.
{
"success": true,
"message": "Item added.",
"data": {
"id": "57",
"shopping_list_id": "9",
"recipe_id": null,
"ingredient_name": "lemons",
"quantity": "2",
"unit": "",
"is_checked": "0",
"sort_order": "2",
"added_at": "2026-11-12 09:30:00"
}
}
| Field | Type | Meaning |
|---|---|---|
data.id |
string |
The line’s id |
data.is_checked |
string |
0: here it comes back as the stored text, not a boolean |
data.sort_order |
string |
One after the last line |
Errors
| Status | Code | When |
|---|---|---|
404 |
rest_error |
No shopping list with that id belonging to the caller. |
400 |
rest_error |
ingredient_name is missing or blank. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/plugixa-recipe/v1/shopping-lists/9/items" \
-u "admin:$WP_APP_PASSWORD" \
-H "Content-Type: application/json" \
-d '{"ingredient_name":"lemons","quantity":"2"}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-recipe/v1/shopping-lists/9/items');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => 'admin:' . getenv('WP_APP_PASSWORD'),
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'ingredient_name' => 'lemons',
'quantity' => '2',
]),
]);
$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/9/items', {
method: 'POST',
headers: {
'Authorization': auth,
'Content-Type': 'application/json',
},
body: JSON.stringify({"ingredient_name": "lemons", "quantity": "2"}),
});
const { data } = await response.json();
Quick Links
Share