Contents
On this page

Delete Shopping List Item - Plugixa Recipe

DELETE /plugixa-recipe/v1/shopping-lists/{id}/items/{item_id}

Remove one line from a list.

Needs the plugixa_recipe_delete capability, or WordPress’s delete_published_posts (Author 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.

Note. Removing a line from your own list asks for the delete capability, not the edit one: a Contributor can add lines but not remove them.

Request

DELETE https://your-site.example/wp-json/plugixa-recipe/v1/shopping-lists/9/items/55

Path parameters

Name Type Description
id integer The shopping list’s id
item_id integer The line’s id

Responses

200 OK. The line is gone.

{
  "success": true,
  "message": "Item deleted.",
  "data": null
}

Errors

Status Code When
404 rest_error No such line on a list belonging to the caller.

Plus the errors every endpoint can return.

Examples

curl -s -X DELETE "https://your-site.example/wp-json/plugixa-recipe/v1/shopping-lists/9/items/55" \
  -u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-recipe/v1/shopping-lists/9/items/55');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'DELETE',
    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/9/items/55', {
  method: 'DELETE',
  headers: {
    'Authorization': auth,
  },
});
const { success } = await response.json();

Quick Links

Share