Contents
On this page
Remove Supplier Product - Plugixa POS for WooCommerce
DELETE /plugixa-pos/v1/suppliers/{id}/products/{product_id}
Stop buying a product from this supplier.
Needs a user with the plugixa_pos_purchase capability (signed in with an Application Password, or the login cookie with an X-WP-Nonce header). Unlike the other capabilities, Pro gives this one to administrators and to the WooCommerce Shop manager role.
Request
DELETE https://your-site.example/wp-json/plugixa-pos/v1/suppliers/2/products/3745
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The supplier’s id |
product_id |
integer |
The product |
Responses
200 OK. The answer is the same when the link did not exist.
{
"success": true,
"data": {
"product_id": 3745
}
}
Errors
This endpoint has no errors of its own.
Plus the errors every endpoint can return.
Examples
curl -s -X DELETE "https://your-site.example/wp-json/plugixa-pos/v1/suppliers/2/products/3745" \
-u "$WP_USER:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-pos/v1/suppliers/2/products/3745');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => getenv('WP_USER') . ':' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-pos/v1/suppliers/2/products/3745', {
method: 'DELETE',
headers: {
'Authorization': `Basic ${btoa(`${process.env.WP_USER}:${process.env.WP_APP_PASSWORD}`)}`,
},
});
const { data } = await response.json();
Quick Links
Share